Made API return a DBC player object if a player is a DBC player. Deprecated old getDBCPlayer() function.

This commit is contained in:
luisc committed 2024-10-24 17:12:00 -05:00
1 parent ad222657c4
commit d57571ea0d
3 files changed
+54 -34

No files matched your search

@@ -705,17 +705,9 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
return data.getGUIOpen();
}
@Deprecated
public ScriptDBCPlayer<T> getDBCPlayer() {
Set keySet = player.getEntityData().getCompoundTag("PlayerPersisted").func_150296_c();
Iterator iterator = keySet.iterator();
while (iterator.hasNext())
{
String s = (String)iterator.next();
if(s.contains("jrmc"))
return new ScriptDBCPlayer<T>(this.player);
}
return null;
return this instanceof ScriptDBCPlayer ? (ScriptDBCPlayer<T>) this : null;
}
public boolean blocking() {