Handle tile entity lookup in 1.20.5

This commit is contained in:
Michael Primm 2024-04-28 14:01:07 -05:00
parent 6fc8090f70
commit 38c9281c7a
18 changed files with 39 additions and 38 deletions

View file

@ -2,35 +2,32 @@
<projectDescription>
<name>Dynmap(Spigot-Common)</name>
<comment>bukkit-helper</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<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/>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments/>
</buildCommand>
</buildSpec>
<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>

View file

@ -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

View file

@ -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

View file

@ -900,7 +900,7 @@ public abstract class AbstractMapChunkCache extends MapChunkCache {
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);

View file

@ -101,7 +101,7 @@ public abstract class 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
*/

View file

@ -24,6 +24,7 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
/**
* Helper for isolation of bukkit version specific issues
*/
@ -456,7 +457,8 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
/**
* 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 {

View file

@ -127,7 +127,7 @@ public class BukkitVersionHelperGlowstone extends BukkitVersionHelper {
}
@Override
public Object readTileEntityNBT(Object te) {
public Object readTileEntityNBT(Object te, org.bukkit.World w) {
// TODO Auto-generated method stub
return null;
}