mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 06:26:43 +01:00
Exclude doors from the catapult spell's effects
This commit is contained in:
parent
8c7bb8c700
commit
2bf0cb63db
3 changed files with 15 additions and 0 deletions
|
@ -36,6 +36,7 @@ public interface UTags {
|
||||||
TagKey<Block> GLASS_BLOCKS = block("glass_blocks");
|
TagKey<Block> GLASS_BLOCKS = block("glass_blocks");
|
||||||
TagKey<Block> FRAGILE = block("fragile");
|
TagKey<Block> FRAGILE = block("fragile");
|
||||||
TagKey<Block> INTERESTING = block("interesting");
|
TagKey<Block> INTERESTING = block("interesting");
|
||||||
|
TagKey<Block> CATAPULT_IMMUNE = block("catapult_immune");
|
||||||
|
|
||||||
TagKey<Block> CRYSTAL_HEART_BASE = block("crystal_heart_base");
|
TagKey<Block> CRYSTAL_HEART_BASE = block("crystal_heart_base");
|
||||||
TagKey<Block> CRYSTAL_HEART_ORNAMENT = block("crystal_heart_ornament");
|
TagKey<Block> CRYSTAL_HEART_ORNAMENT = block("crystal_heart_ornament");
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.function.Consumer;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import com.minelittlepony.unicopia.UTags;
|
||||||
import com.minelittlepony.unicopia.ability.magic.Caster;
|
import com.minelittlepony.unicopia.ability.magic.Caster;
|
||||||
import com.minelittlepony.unicopia.ability.magic.spell.Situation;
|
import com.minelittlepony.unicopia.ability.magic.spell.Situation;
|
||||||
import com.minelittlepony.unicopia.ability.magic.spell.trait.SpellTraits;
|
import com.minelittlepony.unicopia.ability.magic.spell.trait.SpellTraits;
|
||||||
|
@ -12,6 +13,7 @@ import com.minelittlepony.unicopia.mixin.MixinFallingBlockEntity;
|
||||||
import com.minelittlepony.unicopia.projectile.MagicProjectileEntity;
|
import com.minelittlepony.unicopia.projectile.MagicProjectileEntity;
|
||||||
import com.minelittlepony.unicopia.projectile.ProjectileDelegate;
|
import com.minelittlepony.unicopia.projectile.ProjectileDelegate;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.FallingBlockEntity;
|
import net.minecraft.entity.FallingBlockEntity;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
|
@ -82,6 +84,11 @@ public class CatapultSpell extends AbstractSpell implements ProjectileDelegate.B
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlockState state = world.getBlockState(bpos);
|
||||||
|
if (state.isIn(UTags.CATAPULT_IMMUNE)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Vec3d pos = Vec3d.ofBottomCenter(bpos);
|
Vec3d pos = Vec3d.ofBottomCenter(bpos);
|
||||||
FallingBlockEntity e = MixinFallingBlockEntity.createInstance(world, pos.x, pos.y, pos.z, world.getBlockState(bpos));
|
FallingBlockEntity e = MixinFallingBlockEntity.createInstance(world, pos.x, pos.y, pos.z, world.getBlockState(bpos));
|
||||||
world.removeBlock(bpos, true);
|
world.removeBlock(bpos, true);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:bedrock",
|
||||||
|
"#minecraft:doors"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue