diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index acabd70..d38f110 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,7 @@
-
+
@@ -248,7 +248,14 @@
1638722000773
-
+
+ 1638725152334
+
+
+
+ 1638725152334
+
+
@@ -269,6 +276,7 @@
-
+
+
\ No newline at end of file
diff --git a/src/main/java/blackfur/tastytoasters/block/ToasterBlock.java b/src/main/java/blackfur/tastytoasters/block/ToasterBlock.java
index e0289f5..174268a 100644
--- a/src/main/java/blackfur/tastytoasters/block/ToasterBlock.java
+++ b/src/main/java/blackfur/tastytoasters/block/ToasterBlock.java
@@ -114,6 +114,6 @@ public class ToasterBlock extends BlockWithEntity implements BlockEntityProvider
}
@Override
public BlockEntityTicker getTicker(World world, BlockState state, BlockEntityType type) {
- return checkType(type, Tastytoasters.TOASTER_BLOCK_ENTITY, ToasterBlockEntity::tick);
+ return checkType(type, Tastytoasters.TOASTER_BLOCK_ENTITY, (world1, pos, state1, be) -> ToasterBlockEntity.tick(world1, pos, state1, be));
}
}
diff --git a/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java b/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java
index 803a85a..f0107de 100644
--- a/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java
+++ b/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java
@@ -3,15 +3,14 @@ package blackfur.tastytoasters.block;
import blackfur.tastytoasters.Tastytoasters;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.item.ItemStack;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.ItemEntity;
import net.minecraft.nbt.NbtCompound;
-import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class ToasterBlockEntity extends BlockEntity {
- private static int cookTicks;
+ private int cookTicks;
public ToasterBlockEntity(BlockPos pos, BlockState state) {
super(Tastytoasters.TOASTER_BLOCK_ENTITY, pos, state);
@@ -19,15 +18,16 @@ public class ToasterBlockEntity extends BlockEntity {
public static void tick(World world, BlockPos pos, BlockState state, ToasterBlockEntity be) {
if (state.get(ToasterBlock.TOASTING)) {
- if (cookTicks <= 0) {
+ if (be.cookTicks <= 0) {
world.setBlockState(pos, state.with(ToasterBlock.TOASTING, false));
+ world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY() + 0.5, pos.getZ(), Tastytoasters.TOAST_ITEM.getDefaultStack()));
}
- cookTicks--;
+ be.cookTicks--;
}
}
public void handleUse() {
- cookTicks = 10*20;
+ cookTicks = 90*20;
}
@Override