Have chance to yield two sap closes #2014
This commit is contained in:
parent
9ca7b491b0
commit
48bf8ae0f2
2 changed files with 7 additions and 10 deletions
|
@ -27,10 +27,8 @@ package techreborn.blockentity.machine.tier1;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.block.entity.HopperBlockEntity;
|
import net.minecraft.block.entity.HopperBlockEntity;
|
||||||
import net.minecraft.entity.ItemEntity;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.inventory.Inventory;
|
import net.minecraft.inventory.Inventory;
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
@ -85,11 +83,11 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity {
|
||||||
|
|
||||||
// Try and deposit
|
// Try and deposit
|
||||||
if (isFull) {
|
if (isFull) {
|
||||||
// Find a rubber log
|
// Get inventory
|
||||||
Inventory invBelow = getInventoryBelow();
|
Inventory invBelow = getInventoryBelow();
|
||||||
if (invBelow != null) {
|
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);
|
out = HopperBlockEntity.transfer(null, invBelow, out, Direction.UP);
|
||||||
|
|
||||||
if (out.isEmpty()) {
|
if (out.isEmpty()) {
|
||||||
|
@ -137,7 +135,8 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity {
|
||||||
|
|
||||||
// Drop a sap if full
|
// Drop a sap if full
|
||||||
if (this.isFull) {
|
if (this.isFull) {
|
||||||
WorldUtils.dropItem(TRContent.Parts.SAP.asItem(), world, pos);
|
ItemStack out = new ItemStack(TRContent.Parts.SAP, (Math.random() <= 0.6) ? 1 : 2);
|
||||||
|
WorldUtils.dropItem(out, world, pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ package techreborn.blocks.machine.tier1;
|
||||||
|
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.entity.ItemEntity;
|
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
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.BooleanProperty;
|
||||||
import net.minecraft.state.property.DirectionProperty;
|
import net.minecraft.state.property.DirectionProperty;
|
||||||
import net.minecraft.state.property.Properties;
|
import net.minecraft.state.property.Properties;
|
||||||
import net.minecraft.text.LiteralText;
|
|
||||||
import net.minecraft.text.TranslatableText;
|
import net.minecraft.text.TranslatableText;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
import net.minecraft.util.math.Direction;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue