Tweaks on top of #1775

Make new interface not have default methods, make `Shadow` body throw
and tiny style changes
This commit is contained in:
altrisi committed 2023-08-01 13:39:00 +02:00
1 parent f564a9c491
commit 8416a2f28b
3 files changed
+8 -10

No files matched your search

@@ -19,12 +19,14 @@ import net.minecraft.world.level.block.piston.PistonStructureResolver;
import net.minecraft.world.level.block.state.BlockState;
@Mixin(PistonStructureResolver.class)
public abstract class PistonStructureResolver_customStickyMixin {
public class PistonStructureResolver_customStickyMixin {
@Shadow @Final private Level level;
@Shadow @Final private Direction pushDirection;
@Shadow private static boolean canStickToEachOther(BlockState blockState, BlockState blockState2) { return false; }
@Shadow private static boolean canStickToEachOther(BlockState blockState, BlockState blockState2) {
throw new AssertionError();
}
@Inject(
method = "isSticky",
@@ -34,7 +36,7 @@ public abstract class PistonStructureResolver_customStickyMixin {
)
)
private static void isSticky(BlockState state, CallbackInfoReturnable<Boolean> cir) {
if(state.getBlock() instanceof BlockPistonBehaviourInterface behaviourInterface){
if (state.getBlock() instanceof BlockPistonBehaviourInterface behaviourInterface){
cir.setReturnValue(behaviourInterface.isSticky(state));
}
}