Skip to content

Commit

Permalink
gt6 handheld fluid containers can now fill thaumcraft crucibles
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoriusT committed Sep 6, 2023
1 parent 0e6c07d commit 7d1a1ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fluids.IFluidContainerItem;
import squeek.applecore.api.food.FoodValues;
import thaumcraft.common.tiles.TileCrucible;

import java.util.List;

Expand Down Expand Up @@ -245,6 +246,7 @@ public boolean onItemUseFirst(MultiTileEntityItemInternal aItem, ItemStack aStac
}

TileEntity tTileEntity = WD.te(aWorld, aX, aY, aZ, F);

try {if (tTileEntity instanceof ICropTile) {
int tHydration = ((ICropTile)tTileEntity).getHydrationStorage();
int tDrained = Math.min((200-tHydration)/10, mFluid.amount);
Expand All @@ -255,6 +257,13 @@ public boolean onItemUseFirst(MultiTileEntityItemInternal aItem, ItemStack aStac
}
return T;
}} catch(Throwable e) {/**/}

try {if (tTileEntity instanceof TileCrucible) {
if (FL.water(mFluid) && FL.nonzero(aItem.drain(aStack, (int)FL.fill((TileCrucible)tTileEntity, SIDE_TOP, FL.Water.make(mFluid.amount), T), T))) {
UT.Sounds.send(aWorld, SFX.MC_LIQUID_WATER, 1.0F, 1.0F, aX, aY, aZ);
}
return T;
}} catch(Throwable e) {/**/}
}
}
return F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public boolean onBlockActivated3(EntityPlayer aPlayer, byte aSide, float aHitX,
OreDictMaterialStack tMaterial = OreDictMaterial.FLUID_MAP.get(aFluid.getFluid().getName());
aFluid = aFluid.copy();
aFluid.amount = Math.min(aFluid.amount, FL.lava(aFluid) ? 1000 : !FL.water(aFluid) && tMaterial != null && tMaterial.mAmount > 0 ? UT.Code.bindInt(tMaterial.mAmount) : 250);
if (((ITileEntityTapAccessible)tDelegator.mTileEntity).tapDrain(tDelegator.mSideOfTileEntity, UT.Code.bindInt(((ITileEntityTapFillable)tDelegator2.mTileEntity).tapFill(tDelegator2.mSideOfTileEntity, aFluid, T)), T) != null) {
if (FL.nonzero(((ITileEntityTapAccessible)tDelegator.mTileEntity).tapDrain(tDelegator.mSideOfTileEntity, UT.Code.bindInt(((ITileEntityTapFillable)tDelegator2.mTileEntity).tapFill(tDelegator2.mSideOfTileEntity, aFluid, T)), T))) {
UT.Sounds.send(SFX.IC_SPRAY, 1.0F, 2.0F, this);
UT.Sounds.send(SFX.MC_LIQUID_WATER, 1.0F, 1.0F, this);
}
Expand Down

0 comments on commit 7d1a1ff

Please sign in to comment.