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 1/3] 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... From b9d82c5da5cec0cd5c84539620f6dad571a7be43 Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Wed, 31 Aug 2022 23:32:46 +0800 Subject: [PATCH 2/3] fix oversight in nbt load --- .../github/common/storage/FluidCellInventory.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 e1a5ca8e..32c13194 100644 --- a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java +++ b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java @@ -221,14 +221,15 @@ public class FluidCellInventory implements IFluidCellInventory { for( int x = 0; x < types; x++ ) { final FluidStack t = FluidStack.loadFluidStackFromNBT( this.tagCompound.getCompoundTag( fluidSlots[x] ) ); + final AEFluidStack aet = AEFluidStack.create( t ); - if( t != null ) + if( aet != null ) { - t.amount = this.tagCompound.getInteger( fluidSlotCount[x] ); + aet.setStackSize( this.tagCompound.getLong( fluidSlotCount[x] ) ); - if( t.amount > 0 ) + if( aet.getStackSize() > 0 ) { - this.cellItems.add( AEFluidStack.create( t ) ); + this.cellItems.add( aet ); } } } From 6a69f807f16004e8f3699799ed2785340b90b516 Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Wed, 31 Aug 2022 23:33:11 +0800 Subject: [PATCH 3/3] update ec2 dep --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 078f91a4..7ad17d93 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,7 +4,7 @@ dependencies { compile('com.github.GTNewHorizons:NotEnoughItems:2.2.17-GTNH:dev') compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-92-GTNH:dev') compile('curse.maven:cofh-core-69162:2388751') - compile('com.github.GTNewHorizons:ExtraCells2:2.5.9:dev') {transitive = false} + compile('com.github.GTNewHorizons:ExtraCells2:2.5.20:dev') {transitive = false} compile("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.8.5:dev") compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.7:dev")