@Override public void writeToNBT(NBTTagCompound nbttc) { super.writeToNBT(nbttc); nbttc.setBoolean("silktouch", this.silktouch); nbttc.setByte("fortune", this.fortune); nbttc.setByte("efficiency", this.efficiency); nbttc.setByte("unbreaking", this.unbreaking); this.pp.writeToNBT(nbttc); if (this.src1 != null) nbttc.setCompoundTag("src1", this.src1.writeToNBT(new NBTTagCompound())); if (this.src2 != null) nbttc.setCompoundTag("src2", this.src2.writeToNBT(new NBTTagCompound())); if (this.res != null) nbttc.setCompoundTag("res", this.res.writeToNBT(new NBTTagCompound())); nbttc.setFloat("animationSpeed", this.animationSpeed); nbttc.setInteger("animationStage", this.animationStage); }
@Override public void readFromNBT(NBTTagCompound nbttc) { super.readFromNBT(nbttc); this.silktouch = nbttc.getBoolean("silktouch"); this.fortune = nbttc.getByte("fortune"); this.efficiency = nbttc.getByte("efficiency"); this.unbreaking = nbttc.getByte("unbreaking"); this.pp.readFromNBT(nbttc); this.src1 = FluidStack.loadFluidStackFromNBT(nbttc.getCompoundTag("src1")); this.src2 = FluidStack.loadFluidStackFromNBT(nbttc.getCompoundTag("src2")); this.res = FluidStack.loadFluidStackFromNBT(nbttc.getCompoundTag("res")); this.animationSpeed = nbttc.getFloat("animationSpeed"); this.animationStage = nbttc.getInteger("animationStage"); this.buf = (int) (FluidContainerRegistry.BUCKET_VOLUME * 4 * Math.pow(1.3, this.fortune)); PowerManager.configureR(this.pp, this.efficiency, this.unbreaking); }