Shadow walker

This commit is contained in:
paulevsGitch 2020-11-08 01:32:31 +03:00
parent 60f50767cf
commit 452fbf0497
7 changed files with 45 additions and 4 deletions

View file

@ -9,7 +9,6 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import ru.betterend.blocks.basis.BlockPedestal;
import ru.betterend.blocks.entities.InfusionPedestalEntity;

View file

@ -23,6 +23,7 @@ import net.minecraft.loot.context.LootContextParameters;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.tag.BlockTags;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
@ -128,7 +129,7 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid
BlockPos pos = context.getBlockPos();
BlockState upState = world.getBlockState(pos.up());
BlockState downState = world.getBlockState(pos.down());
boolean upSideSolid = upState.isSideSolidFullSquare(world, pos.up(), Direction.DOWN);
boolean upSideSolid = upState.isSideSolidFullSquare(world, pos.up(), Direction.DOWN) || upState.isIn(BlockTags.WALLS);
boolean hasPedestalOver = upState.getBlock() instanceof BlockPedestal;
boolean hasPedestalUnder = downState.getBlock() instanceof BlockPedestal;
if (!hasPedestalOver && hasPedestalUnder && upSideSolid) {
@ -160,7 +161,7 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid
if (direction != Direction.UP && direction != Direction.DOWN) return state;
BlockState upState = world.getBlockState(pos.up());
BlockState downState = world.getBlockState(pos.down());
boolean upSideSolid = upState.isSideSolidFullSquare(world, pos.up(), Direction.DOWN);
boolean upSideSolid = upState.isSideSolidFullSquare(world, pos.up(), Direction.DOWN) || upState.isIn(BlockTags.WALLS);
boolean hasPedestalOver = upState.getBlock() instanceof BlockPedestal;
boolean hasPedestalUnder = downState.getBlock() instanceof BlockPedestal;
if (direction == Direction.UP) {