Skip to content

Commit

Permalink
Change HITW fix to meet community consensus on previous fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeltumn committed Oct 24, 2022
1 parent 5bbe5cc commit 0585410
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.noxcrew.noxesium.mixin.client;

import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.piston.MovingPistonBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(BlockBehaviour.BlockStateBase.class)
public abstract class BlockStateBaseMixin {

@Shadow public abstract Block getBlock();

@Inject(method = "isCollisionShapeFullBlock", at = @At(value = "HEAD"), cancellable = true)
private void redirected(BlockGetter blockGetter, BlockPos blockPos, CallbackInfoReturnable<Boolean> cir) {
// Enforce moving piston blocks to not have a full collision shape so
// they don't cast shadows on neighboring blocks
if (getBlock() instanceof MovingPistonBlock) {
cir.setReturnValue(false);
}
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/noxesium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"client.ClientPacketListenerMixin",
"client.LivingEntityMixin",
"client.MinecraftMixin",
"client.PistonRenderingMixin",
"client.BlockStateBaseMixin",
"client.PlayerTabOverlayMixin",
"client.adventure.GameRendererMixin",
"client.adventure.ItemStackMixin",
Expand Down

0 comments on commit 0585410

Please sign in to comment.