mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 17:04:24 +00:00
Simplified tank filling code
This commit is contained in:
1 parent
8e686f3fd6
commit
39d0c4ab6d
1 file changed
+1
-9
@@ -151,7 +151,7 @@ public class LavaTankBlock extends BlockContainer {
|
||||
if (amount == liquid.amount) {
|
||||
logic.fill(ForgeDirection.UNKNOWN, liquid, true);
|
||||
if (!entityplayer.capabilities.isCreativeMode) {
|
||||
replaceHeldItem(entityplayer, getEmptyContainer(current));
|
||||
replaceHeldItem(entityplayer, FluidContainerRegistry.drainFluidContainer(current));
|
||||
}
|
||||
|
||||
// update
|
||||
@@ -190,14 +190,6 @@ public class LavaTankBlock extends BlockContainer {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static ItemStack getEmptyContainer(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
if (item != null && item.hasContainerItem(stack)) return item.getContainerItem(stack);
|
||||
else if (FluidContainerRegistry.isFilledContainer(stack))
|
||||
return FluidContainerRegistry.drainFluidContainer(stack);
|
||||
else return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace one currently held item for a given player.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user