Stalactites

This commit is contained in:
paulevsGitch 2021-03-09 07:27:38 +03:00
parent 2ac1ec8f5a
commit 7e73d9a31c
39 changed files with 657 additions and 31 deletions

View file

@ -24,6 +24,7 @@ import net.minecraft.world.WorldAccess;
import ru.betterend.blocks.BlueVineBlock;
import ru.betterend.blocks.basis.DoublePlantBlock;
import ru.betterend.blocks.basis.FurBlock;
import ru.betterend.blocks.basis.StalactiteBlock;
import ru.betterend.blocks.basis.VineBlock;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
@ -207,6 +208,24 @@ public class BlocksHelper {
}
}
}
else if (state.getBlock() instanceof StalactiteBlock) {
if (!state.canPlaceAt(world, POS)) {
if (world.getBlockState(POS.up()).getBlock() instanceof StalactiteBlock) {
while (state.getBlock() instanceof StalactiteBlock) {
setWithoutUpdate(world, POS, AIR);
POS.setY(POS.getY() + 1);
state = world.getBlockState(POS);
}
}
else {
while (state.getBlock() instanceof StalactiteBlock) {
setWithoutUpdate(world, POS, AIR);
POS.setY(POS.getY() - 1);
state = world.getBlockState(POS);
}
}
}
}
else if (!state.canPlaceAt(world, POS)) {
// Chorus
if (state.isOf(Blocks.CHORUS_PLANT)) {