Skip to content

Commit

Permalink
Handle tile entity lookup in 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeprimm committed Apr 28, 2024
1 parent e086930 commit 1d6346b
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ allprojects {
apply plugin: 'java'

group = 'us.dynmap'
version = '3.7-SNAPSHOT'
version = '3.7-beta-5'

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = new NBTTagCompound();
tileent.save(nbt); // readNBT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.o();
return nbt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,11 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = new NBTTagCompound(); //TODO tileent.o();
CraftWorld cw = (CraftWorld) w;
//NBTTagCompound nbt = tileent.o(world.registrtAccess());
NBTTagCompound nbt = tileent.e(cw.getHandle().H_());
return nbt;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World world) {
TileEntity tileent = (TileEntity) te;
NBTTagCompound nbt = tileent.n();
return nbt;
Expand Down
25 changes: 11 additions & 14 deletions bukkit-helper/.project
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,32 @@
<projectDescription>
<name>Dynmap(Spigot-Common)</name>
<comment>bukkit-helper</comment>
<projects>
</projects>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
<arguments/>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<linkedResources/>
<filteredResources>
<filter>
<id>1</id>
<name></name>
<type>30</type>
<name/>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
Expand Down
2 changes: 1 addition & 1 deletion bukkit-helper/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.3))
connection.project.dir=../bukkit-helper-120-2
connection.project.dir=../bukkit-helper-120-5
eclipse.preferences.version=1
gradle.user.home=
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home
Expand Down
2 changes: 1 addition & 1 deletion bukkit-helper/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
#Fri Apr 26 17:37:35 CDT 2024
#Sun Apr 28 13:34:57 CDT 2024
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.nonnull=javax.annotation.Nonnull
org.eclipse.jdt.core.compiler.annotation.nullable=javax.annotation.Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ else if(hidestyle == HiddenChunkStyle.FILL_OCEAN)
String[] te_fields = HDBlockModels.getTileEntityFieldsNeeded(ss.getBlockType(cx, te_y, cz));
if(te_fields != null) {
//Object nbtcompound = BukkitVersionHelper.helper.readTileEntityNBT(t);
Object nbtcompound = BukkitVersionHelper.helper.readTileEntityNBT(t);
Object nbtcompound = BukkitVersionHelper.helper.readTileEntityNBT(t, this.w);
vals.clear();
for(String id: te_fields) {
Object val = BukkitVersionHelper.helper.getFieldValue(nbtcompound, id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected BukkitVersionHelper() {
/**
* Read tile entity NBT
*/
public abstract Object readTileEntityNBT(Object te);
public abstract Object readTileEntityNBT(Object te, World world);
/**
* Get field value from NBT compound
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;


/**
* Helper for isolation of bukkit version specific issues
*/
Expand Down Expand Up @@ -456,7 +457,8 @@ public int getTileEntityZ(Object te) {
/**
* Read tile entity NBT
*/
public Object readTileEntityNBT(Object te) {
@Override
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
if(nbttagcompound == null) return null;
Object nbt = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public int getTileEntityZ(Object te) {
}

@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
// TODO Auto-generated method stub
return null;
}
Expand Down

0 comments on commit 1d6346b

Please sign in to comment.