Skip to content

Commit

Permalink
fix: fix block placement preview render not working for primal & mali…
Browse files Browse the repository at this point in the history
…gnant slabs
  • Loading branch information
Elenterius committed Mar 13, 2024
1 parent e65173f commit 8ae13d8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.github.elenterius.biomancy.BiomancyMod;
import com.github.elenterius.biomancy.block.DirectionalSlabBlock;
import com.github.elenterius.biomancy.block.property.DirectionalSlabType;
import com.github.elenterius.biomancy.item.SimpleBlockItem;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
Expand All @@ -14,6 +13,7 @@
import net.minecraft.core.BlockPos;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -34,7 +34,7 @@ private RenderHighlightHandler() {}
public static void onBlockHighlight(RenderHighlightEvent.Block event) {
if (event.getCamera().getEntity() instanceof Player player) {
ItemStack itemStack = player.getMainHandItem();
if (itemStack.getItem() instanceof SimpleBlockItem blockItem && blockItem.getBlock() instanceof DirectionalSlabBlock slabBlock) {
if (itemStack.getItem() instanceof BlockItem blockItem && blockItem.getBlock() instanceof DirectionalSlabBlock slabBlock) {
BlockPlaceContext placeContext = new BlockPlaceContext(player, InteractionHand.MAIN_HAND, itemStack, event.getTarget());
BlockPos placePos = placeContext.getClickedPos();
BlockState foundState = player.level().getBlockState(placePos);
Expand Down

0 comments on commit 8ae13d8

Please sign in to comment.