@@ -21,12 +21,18 @@ public class LeavesBlockMixin {
21
21
// Add the snowiness property to leaf blocks
22
22
@ Inject (method = "appendProperties" , at = @ At ("TAIL" ))
23
23
private void appendPropertiesInject (StateManager .Builder <Block , BlockState > builder , CallbackInfo ci ) {
24
+ if (!this .getClass ().equals (LeavesBlock .class )) {
25
+ return ;
26
+ }
24
27
builder .add (SNOWINESS );
25
28
}
26
29
27
30
// Set the default snowiness to none
28
31
@ Inject (method = "<init>" , at = @ At ("TAIL" ))
29
32
private void initInject (AbstractBlock .Settings settings , CallbackInfo ci ) {
33
+ if (!this .getClass ().equals (LeavesBlock .class )) {
34
+ return ;
35
+ }
30
36
((BlockInvoker ) this )
31
37
.invokeSetDefaultState (
32
38
((LeavesBlock )(Object ) this )
@@ -40,6 +46,9 @@ private void initInject(AbstractBlock.Settings settings, CallbackInfo ci) {
40
46
// Always randomly tick leaf blocks
41
47
@ Inject (method = "hasRandomTicks" , at = @ At ("RETURN" ), cancellable = true )
42
48
private void hasRandomTicksInject (BlockState state , CallbackInfoReturnable <Boolean > cir ) {
49
+ if (!this .getClass ().equals (LeavesBlock .class )) {
50
+ return ;
51
+ }
43
52
cir .setReturnValue (true );
44
53
}
45
54
@@ -51,6 +60,9 @@ private void randomTickInject(
51
60
Random random ,
52
61
CallbackInfo ci
53
62
) {
63
+ if (!this .getClass ().equals (LeavesBlock .class )) {
64
+ return ;
65
+ }
54
66
Snowiness currentSnowiness = state .get (SNOWINESS );
55
67
if (
56
68
// If it's snowing
0 commit comments