mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Save spark transparency properly to NBT
This commit is contained in:
1 parent
994c8821f3
commit
111aa07c9b
2 files changed
+6
No files matched your search
@@ -32,6 +32,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
|
||||
|
||||
private static final String TAG_MASTER = "master";
|
||||
private static final String TAG_NETWORK = "network";
|
||||
private static final String TAG_INVIS = "invis";
|
||||
|
||||
ICorporeaSpark master;
|
||||
List<ICorporeaSpark> connections = new ArrayList();
|
||||
@@ -298,12 +299,14 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
|
||||
protected void readEntityFromNBT(NBTTagCompound cmp) {
|
||||
setMaster(cmp.getBoolean(TAG_MASTER));
|
||||
setNetwork(cmp.getInteger(TAG_NETWORK));
|
||||
dataWatcher.updateObject(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY, cmp.getInteger(TAG_INVIS));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound cmp) {
|
||||
cmp.setBoolean(TAG_MASTER, isMaster());
|
||||
cmp.setInteger(TAG_NETWORK, getNetwork());
|
||||
cmp.setInteger(TAG_INVIS, dataWatcher.getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,6 +42,7 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
|
||||
private static final int TRANSFER_RATE = 1000;
|
||||
private static final String TAG_UPGRADE = "upgrade";
|
||||
private static final String TAG_INVIS = "invis";
|
||||
public static final int INVISIBILITY_DATA_WATCHER_KEY = 27;
|
||||
|
||||
Set<ISparkEntity> transfers = Collections.newSetFromMap(new WeakHashMap());
|
||||
@@ -296,11 +297,13 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound cmp) {
|
||||
setUpgrade(cmp.getInteger(TAG_UPGRADE));
|
||||
dataWatcher.updateObject(INVISIBILITY_DATA_WATCHER_KEY, cmp.getInteger(TAG_INVIS));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound cmp) {
|
||||
cmp.setInteger(TAG_UPGRADE, getUpgrade());
|
||||
cmp.setInteger(TAG_INVIS, dataWatcher.getWatchableObjectInt(INVISIBILITY_DATA_WATCHER_KEY));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user