Spells should not affect bedrock. Fixes #103

This commit is contained in:
Sollace 2023-03-05 16:37:04 +00:00
parent 0bcf2e7ada
commit 46cfa01a6a
2 changed files with 5 additions and 0 deletions

View file

@ -65,6 +65,10 @@ public interface Caster<E extends Entity> extends
default boolean canModifyAt(BlockPos pos, ModificationType mod) {
if (mod.checkPhysical()) {
if (asWorld().getBlockState(pos).getHardness(asWorld(), pos) < 0) {
return false;
}
if (getMaster() instanceof PlayerEntity player) {
if (!asWorld().canPlayerModifyAt(player, pos)) {
return false;

View file

@ -12,6 +12,7 @@ import com.minelittlepony.unicopia.mixin.MixinFallingBlockEntity;
import com.minelittlepony.unicopia.projectile.MagicProjectileEntity;
import com.minelittlepony.unicopia.projectile.ProjectileDelegate;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.FallingBlockEntity;
import net.minecraft.util.hit.BlockHitResult;