Skip to content

Commit

Permalink
fix: incompatible with Chrysalis
Browse files Browse the repository at this point in the history
fixes #55
  • Loading branch information
RubixDev committed May 30, 2024
1 parent abb51e1 commit 24e660f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/main/java/de/rubixdev/rug/mixins/EndCrystalItemMixin.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
package de.rubixdev.rug.mixins;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import de.rubixdev.rug.RugSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.EndCrystalItem;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(EndCrystalItem.class)
public class EndCrystalItemMixin {
@Redirect(
@ModifyExpressionValue(
method = "useOnBlock",
at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z"))
private boolean allowPlacement(BlockState blockState, Block block) {
if (!RugSettings.endCrystalPlacementRestriction) {
return true;
}

return blockState.isOf(block);
private boolean allowPlacement(boolean original) {
return original || !RugSettings.endCrystalPlacementRestriction;
}
}

0 comments on commit 24e660f

Please sign in to comment.