From c88b9a0bd3ade8fbe5bb6f545dbcc80053fada6c Mon Sep 17 00:00:00 2001
From: TheBlackfurGuy <64478051+TheBlackfurGuy@users.noreply.github.com>
Date: Tue, 4 Jan 2022 18:21:40 +0100
Subject: [PATCH] welll it seems there is a fabric api bug
---
.idea/workspace.xml | 87 ++++++++++++++-----
gradle.properties | 8 +-
.../block/ToasterBlockEntity.java | 10 ++-
3 files changed, 78 insertions(+), 27 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 45405d1..602a358 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,9 @@
-
+
-
+
@@ -47,7 +47,18 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -78,18 +89,19 @@
-
-
+
+
+
-
+
-
-
+
+
@@ -100,7 +112,7 @@
@@ -110,7 +122,7 @@
false
-
+
@@ -121,7 +133,7 @@
-
+
@@ -131,18 +143,20 @@
false
-
+
-
+
-
+
+
+
@@ -152,7 +166,7 @@
false
-
+
@@ -173,6 +187,29 @@
false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ false
+
+
@@ -196,11 +233,11 @@
-
-
-
+
+
+
+
-
@@ -262,7 +299,14 @@
1638729298970
-
+
+ 1638808282960
+
+
+
+ 1638808282960
+
+
@@ -285,6 +329,7 @@
-
+
+
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index 05e6b07..632c475 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
-minecraft_version=1.18
-yarn_mappings=1.18+build.1
-loader_version=0.12.8
+minecraft_version=1.18.1
+yarn_mappings=1.18.1+build.17
+loader_version=0.12.12
# Mod Properties
mod_version=1.0-SNAPSHOT
maven_group=blackfur
archives_base_name=tastytoasters
# Dependencies
# check this on https://modmuss50.me/fabric.html
-fabric_version=0.44.0+1.18
+fabric_version=0.45.1+1.18
\ No newline at end of file
diff --git a/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java b/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java
index a3369be..93fd718 100644
--- a/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java
+++ b/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java
@@ -3,14 +3,15 @@ package blackfur.tastytoasters.block;
import blackfur.tastytoasters.Tastytoasters;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
-import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
+import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable;
-public class ToasterBlockEntity extends BlockEntity {
+
+public class ToasterBlockEntity extends BlockEntity implements BlockEntityClientSerializable {
private int cookTicks;
public ToasterBlockEntity(BlockPos pos, BlockState state) {
@@ -19,6 +20,9 @@ public class ToasterBlockEntity extends BlockEntity {
public static void tick(World world, BlockPos pos, BlockState state, ToasterBlockEntity be) {
if (state.get(ToasterBlock.TOASTING)) {
+ if (be.cookTicks % 100 == 0) {
+ world.addParticle(ParticleTypes.SMOKE, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0, 0, 0);
+ }
if (be.cookTicks <= 0) {
world.setBlockState(pos, state.with(ToasterBlock.TOASTING, false));
if ((int) (Math.random() * 10) == 0) {
@@ -28,6 +32,8 @@ public class ToasterBlockEntity extends BlockEntity {
}
}
be.cookTicks--;
+
+ be.markDirty();
}
}