diff --git a/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java index bfc2fc008..68dc98e8d 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java @@ -27,10 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.entity.HopperBlockEntity; -import net.minecraft.entity.ItemEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.Inventory; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundTag; import net.minecraft.sound.SoundCategory; @@ -85,11 +83,11 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity { // Try and deposit if (isFull) { - // Find a rubber log + // Get inventory Inventory invBelow = getInventoryBelow(); if (invBelow != null) { - ItemStack out = new ItemStack(TRContent.Parts.SAP, 1); + ItemStack out = new ItemStack(TRContent.Parts.SAP, (Math.random() <= 0.5) ? 1 : 2); out = HopperBlockEntity.transfer(null, invBelow, out, Direction.UP); if (out.isEmpty()) { @@ -136,8 +134,9 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity { super.onBreak(world, playerEntity, blockPos, blockState); // Drop a sap if full - if(this.isFull){ - WorldUtils.dropItem(TRContent.Parts.SAP.asItem(), world, pos); + if (this.isFull) { + ItemStack out = new ItemStack(TRContent.Parts.SAP, (Math.random() <= 0.6) ? 1 : 2); + WorldUtils.dropItem(out, world, pos); } } diff --git a/src/main/java/techreborn/blocks/machine/tier1/ResinBasinBlock.java b/src/main/java/techreborn/blocks/machine/tier1/ResinBasinBlock.java index ee91d537c..2be3e6fc8 100644 --- a/src/main/java/techreborn/blocks/machine/tier1/ResinBasinBlock.java +++ b/src/main/java/techreborn/blocks/machine/tier1/ResinBasinBlock.java @@ -2,7 +2,6 @@ package techreborn.blocks.machine.tier1; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntity; -import net.minecraft.entity.ItemEntity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; @@ -10,7 +9,6 @@ import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.DirectionProperty; import net.minecraft.state.property.Properties; -import net.minecraft.text.LiteralText; import net.minecraft.text.TranslatableText; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; @@ -74,7 +72,7 @@ public class ResinBasinBlock extends BaseBlockEntityProvider { // Drop item if not next to log and yell at user if (worldIn.getBlockState(pos.offset(facing.getOpposite())).getBlock() != TRContent.RUBBER_LOG) { worldIn.setBlockState(pos, Blocks.AIR.getDefaultState()); - WorldUtils.dropItem(this.asItem(), worldIn,pos); + WorldUtils.dropItem(this.asItem(), worldIn, pos); placer.sendSystemMessage(new TranslatableText("techreborn.tooltip.invalid_basin_placement"), UUID.randomUUID()); } } @@ -90,7 +88,7 @@ public class ResinBasinBlock extends BaseBlockEntityProvider { @Override public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { BlockEntity blockEntity = world.getBlockEntity(pos); - if(blockEntity instanceof MachineBaseBlockEntity){ + if (blockEntity instanceof MachineBaseBlockEntity) { ((MachineBaseBlockEntity) blockEntity).onBreak(world, player, pos, state); }