mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Save the things to nbt...
This commit is contained in:
1 parent
b415f28c43
commit
fc138deb0d
1 file changed
+14
@@ -13,6 +13,7 @@ package vazkii.botania.common.entity;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
@@ -25,6 +26,7 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
public class EntityPoolMinecart extends EntityMinecart {
|
||||
|
||||
private static final int TRANSFER_RATE = 10000;
|
||||
private static final String TAG_MANA = "mana";
|
||||
|
||||
private boolean isBlocked = true;
|
||||
|
||||
@@ -105,6 +107,18 @@ public class EntityPoolMinecart extends EntityMinecart {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
super.writeEntityToNBT(p_70014_1_);
|
||||
p_70014_1_.setInteger(TAG_MANA, getMana());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
super.readEntityFromNBT(p_70037_1_);
|
||||
setMana(p_70037_1_.getInteger(TAG_MANA));
|
||||
}
|
||||
|
||||
public int getMana() {
|
||||
return dataWatcher.getWatchableObjectInt(16);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user