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

@@ -33,7 +33,7 @@ import java.util.*;
public class ScriptEntity<T extends Entity> implements IEntity {
protected T entity;
private Map<String,Object> tempData = new HashMap<String,Object>();
private Map<String,Object> tempData = new HashMap<>();
public ScriptEntity(T entity){
this.entity = entity;
@@ -513,6 +513,12 @@ public class ScriptEntity<T extends Entity> implements IEntity {
return tempData.get(key);
}
public void copyTempData(IEntity<?> scriptEntity) {
if (scriptEntity != null) {
this.tempData = ((ScriptEntity<?>) scriptEntity).tempData;
}
}
/**
* Tempdata gets cleared when the entity gets unloaded or the world restarts
* @param key The key for the data stored