OreDrill state saving

This commit is contained in:
Techlone 2017-06-01 20:58:24 +05:00
parent 75a33be210
commit 7c48590a49

View file

@ -15,6 +15,7 @@ import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.ChunkPosition; import net.minecraft.world.ChunkPosition;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@ -33,14 +34,15 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
private static final Block miningPipeTipBlock = GT_Utility.getBlockFromStack(miningPipeTip); private static final Block miningPipeTipBlock = GT_Utility.getBlockFromStack(miningPipeTip);
private final ArrayList<ChunkPosition> oreBlockPositions = new ArrayList<>(); private final ArrayList<ChunkPosition> oreBlockPositions = new ArrayList<>();
private Block casingBlock;
private Block casingBlock;
private int casingMeta; private int casingMeta;
private int frameMeta; private int frameMeta;
private int casingTextureIndex; private int casingTextureIndex;
private ForgeDirection back; private ForgeDirection back;
private int xDrill, yDrill, zDrill, xCenter, zCenter, yHead; private int xDrill, yDrill, zDrill, xCenter, zCenter, yHead;
private boolean isPickingPipes; private boolean isPickingPipes;
public GT_MetaTileEntity_OreDrillingPlantBase(int aID, String aName, String aNameRegional) { public GT_MetaTileEntity_OreDrillingPlantBase(int aID, String aName, String aNameRegional) {
@ -72,6 +74,18 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OreDrillingPlant.png"); return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OreDrillingPlant.png");
} }
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
aNBT.setBoolean("isPickingPipe", isPickingPipes);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
isPickingPipes = aNBT.getBoolean("isPickingPipes");
}
@Override @Override
public boolean checkRecipe(ItemStack aStack) { public boolean checkRecipe(ItemStack aStack) {
if (isPickingPipes) { if (isPickingPipes) {