Skip to content

Commit

Permalink
fluid display doesnt count towards item-o-meter or stack-o-meter anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoriusT committed Jul 30, 2024
1 parent c00c499 commit 01dcf1b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/java/gregapi/cover/covers/CoverDrain.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023 GregTech-6 Team
* Copyright (c) 2024 GregTech-6 Team
*
* This file is part of GregTech.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2019 Gregorius Techneticies
* Copyright (c) 2024 GregTech-6 Team
*
* This file is part of GregTech.
*
Expand All @@ -19,8 +19,7 @@

package gregtech.tileentity.sensors;

import static gregapi.data.CS.*;

import gregapi.data.IL;
import gregapi.data.LH;
import gregapi.old.Textures;
import gregapi.render.IIconContainer;
Expand All @@ -31,6 +30,8 @@
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;

import static gregapi.data.CS.*;

/**
* @author Gregorius Techneticies
*/
Expand All @@ -48,14 +49,14 @@ public long getCurrentValue(DelegatorTileEntity<TileEntity> aDelegator) {
if (tSlots != null && tSlots.length > 0) {
for (int i : tSlots) {
ItemStack tStack = ((IInventory)aDelegator.mTileEntity).getStackInSlot(i);
if (tStack != null) rAmount += tStack.stackSize;
if (tStack != null && !IL.Display_Fluid.equal(tStack, T, T)) rAmount += tStack.stackSize;
}
return rAmount;
}
}
for (int i = 0, j = ((IInventory)aDelegator.mTileEntity).getSizeInventory(); i < j; i++) {
ItemStack tStack = ((IInventory)aDelegator.mTileEntity).getStackInSlot(i);
if (tStack != null) rAmount += tStack.stackSize;
if (tStack != null && !IL.Display_Fluid.equal(tStack, T, T)) rAmount += tStack.stackSize;
}
return rAmount;
}
Expand All @@ -65,8 +66,8 @@ public long getCurrentValue(DelegatorTileEntity<TileEntity> aDelegator) {
@Override
public long getCurrentMax(DelegatorTileEntity<TileEntity> aDelegator) {
if (aDelegator.mTileEntity instanceof IInventory) {
if (aDelegator.mTileEntity instanceof ISidedInventory) return ((ISidedInventory)aDelegator.mTileEntity).getAccessibleSlotsFromSide(aDelegator.mSideOfTileEntity).length * ((IInventory)aDelegator.mTileEntity).getInventoryStackLimit();
return ((IInventory)aDelegator.mTileEntity).getSizeInventory() * ((IInventory)aDelegator.mTileEntity).getInventoryStackLimit();
if (aDelegator.mTileEntity instanceof ISidedInventory) return (long)((ISidedInventory)aDelegator.mTileEntity).getAccessibleSlotsFromSide(aDelegator.mSideOfTileEntity).length * ((IInventory)aDelegator.mTileEntity).getInventoryStackLimit();
return (long)((IInventory)aDelegator.mTileEntity).getSizeInventory() * ((IInventory)aDelegator.mTileEntity).getInventoryStackLimit();
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2019 Gregorius Techneticies
* Copyright (c) 2024 GregTech-6 Team
*
* This file is part of GregTech.
*
Expand All @@ -19,8 +19,7 @@

package gregtech.tileentity.sensors;

import static gregapi.data.CS.*;

import gregapi.data.IL;
import gregapi.data.LH;
import gregapi.old.Textures;
import gregapi.render.IIconContainer;
Expand All @@ -31,6 +30,8 @@
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;

import static gregapi.data.CS.*;

/**
* @author Gregorius Techneticies
*/
Expand All @@ -48,14 +49,14 @@ public long getCurrentValue(DelegatorTileEntity<TileEntity> aDelegator) {
if (tSlots != null && tSlots.length > 0) {
for (int i : tSlots) {
ItemStack tStack = ((IInventory)aDelegator.mTileEntity).getStackInSlot(i);
if (tStack != null && tStack.stackSize > 0) rAmount++;
if (tStack != null && tStack.stackSize > 0 && !IL.Display_Fluid.equal(tStack, T, T)) rAmount++;
}
return rAmount;
}
}
for (int i = 0, j = ((IInventory)aDelegator.mTileEntity).getSizeInventory(); i < j; i++) {
ItemStack tStack = ((IInventory)aDelegator.mTileEntity).getStackInSlot(i);
if (tStack != null && tStack.stackSize > 0) rAmount++;
if (tStack != null && tStack.stackSize > 0 && !IL.Display_Fluid.equal(tStack, T, T)) rAmount++;
}
return rAmount;
}
Expand Down

0 comments on commit 01dcf1b

Please sign in to comment.