From 72270a3f64c63b6ad5f8aa9bfe124e126748319c Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Wed, 31 Aug 2022 23:06:09 +0800 Subject: [PATCH] use long for data storage --- .../github/common/storage/FluidCellInventory.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java index 0cff2d45..e1a5ca8e 100644 --- a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java +++ b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java @@ -31,7 +31,7 @@ public class FluidCellInventory implements IFluidCellInventory { private final ItemStack cellItem; private final ISaveProvider container; private final static int MAX_TYPE = 1; - private int storedFluidCount; + private long storedFluidCount; private short storedFluids; private IItemList cellItems; private final NBTTagCompound tagCompound; @@ -78,7 +78,7 @@ public class FluidCellInventory implements IFluidCellInventory { this.container = container; this.tagCompound = Platform.openNbtData( o ); this.storedFluids = this.tagCompound.getShort( FLUID_TYPE_TAG ); - this.storedFluidCount = this.tagCompound.getInteger( FLUID_COUNT_TAG ); + this.storedFluidCount = this.tagCompound.getLong( FLUID_COUNT_TAG ); this.cellItems = null; } @@ -247,12 +247,12 @@ public class FluidCellInventory implements IFluidCellInventory { private void updateFluidCount( final long delta ) { this.storedFluidCount += delta; - this.tagCompound.setInteger( FLUID_COUNT_TAG, this.storedFluidCount ); + this.tagCompound.setLong( FLUID_COUNT_TAG, this.storedFluidCount ); } private void saveChanges() { - int itemCount = 0; + long itemCount = 0; int x = 0; @@ -277,7 +277,7 @@ public class FluidCellInventory implements IFluidCellInventory { * NBTBase tagSlotCount = tagCompound.getTag( itemSlotCount[x] ); if ( tagSlotCount instanceof * NBTTagInt ) ((NBTTagInt) tagSlotCount).data = (int) v.getStackSize(); else */ - this.tagCompound.setInteger( fluidSlotCount[x], (int) v.getStackSize() ); + this.tagCompound.setLong( fluidSlotCount[x], v.getStackSize() ); x++; } @@ -312,7 +312,7 @@ public class FluidCellInventory implements IFluidCellInventory { } else { - this.tagCompound.setInteger( FLUID_COUNT_TAG, itemCount ); + this.tagCompound.setLong( FLUID_COUNT_TAG, itemCount ); } // clean any old crusty stuff...