Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed some checks for better sluice placement logic
  • Loading branch information
DisasterMoo committed Aug 13, 2019
1 parent cbc1a7f commit 610efd0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -106,12 +106,12 @@ public ItemStack onItemUseFinish(@Nonnull ItemStack stack, World world, EntityLi
}
});
chunkDataTFC.addWork();
stack.setItemDamage(0);
if (Constants.RNG.nextFloat() < 0.01) // 1/100 chance, same as 1.7.10
{
stack.shrink(1);
world.playSound(null, entityLiving.getPosition(), TFCSounds.CERAMIC_BREAK, SoundCategory.PLAYERS, 1.0f, 1.0f);
}
stack.setItemDamage(0);
}
else
{
Expand Down
Expand Up @@ -59,11 +59,11 @@ else if (facing != EnumFacing.UP)
}
else
{
if (!worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos) || !worldIn.getBlockState(pos.offset(player.getHorizontalFacing())).getBlock().isReplaceable(worldIn, pos))
if (!worldIn.getBlockState(pos).getMaterial().isReplaceable() || !worldIn.getBlockState(pos.offset(player.getHorizontalFacing())).getMaterial().isReplaceable())
{
pos = pos.up(); //try the above
}
if (!worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos) || !worldIn.getBlockState(pos.offset(player.getHorizontalFacing())).getBlock().isReplaceable(worldIn, pos))
if (!worldIn.getBlockState(pos).getMaterial().isReplaceable() || !worldIn.getBlockState(pos.offset(player.getHorizontalFacing())).getMaterial().isReplaceable())
{
return EnumActionResult.FAIL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/dries007/tfc/objects/te/TESluice.java
Expand Up @@ -50,7 +50,7 @@ public class TESluice extends TEBase implements ITickable
public TESluice()
{
super();
ALLOWED_FLUIDS = x -> x == FluidsTFC.FRESH_WATER.get() || x == FluidsTFC.LIMEWATER.get();
ALLOWED_FLUIDS = x -> x == FluidsTFC.FRESH_WATER.get() || x == FluidsTFC.LIMEWATER.get(); //placeholder, missed commit for SALT_WATER
}

@Nullable
Expand Down

0 comments on commit 610efd0

Please sign in to comment.