Skip to content

Commit

Permalink
fix #18
Browse files Browse the repository at this point in the history
  • Loading branch information
LudoCrypt committed Jun 6, 2022
1 parent 1fdfda4 commit 9bae88c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/net/ludocrypt/corners/mixin/SnowBlockMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
import net.minecraft.block.BlockState;
import net.minecraft.block.SnowBlock;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;

@Mixin(SnowBlock.class)
public class SnowBlockMixin {

@Inject(method = "Lnet/minecraft/block/SnowBlock;canReplace(Lnet/minecraft/block/BlockState;Lnet/minecraft/item/ItemPlacementContext;)Z", at = @At("RETURN"), cancellable = true)
private void corners$canReplace(BlockState state, ItemPlacementContext ctx, CallbackInfoReturnable<Boolean> ci) {
ItemStack stack = ctx.getPlayer().getStackInHand(ctx.getHand());
if (stack.getItem().equals(CornerBlocks.DARK_RAILING.asItem())) {
ci.setReturnValue(true);
if (ctx.getStack() != null) {
if (ctx.getStack().getItem().equals(CornerBlocks.DARK_RAILING.asItem())) {
ci.setReturnValue(true);
}
}
}
}

0 comments on commit 9bae88c

Please sign in to comment.