-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change HITW fix to meet community consensus on previous fix
- Loading branch information
Showing
3 changed files
with
28 additions
and
19 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/com/noxcrew/noxesium/mixin/client/BlockStateBaseMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
src/main/java/com/noxcrew/noxesium/mixin/client/PistonRenderingMixin.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters