Skip to content

Commit

Permalink
fixed shapes and cover overlays not accounting for cover replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Dec 17, 2024
1 parent 84a079a commit 01c3082
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import muramasa.antimatter.block.IInfoProvider;
import muramasa.antimatter.blockentity.BlockEntityBase;
import muramasa.antimatter.client.RenderHelper;
import muramasa.antimatter.cover.CoverReplacements;
import muramasa.antimatter.cover.IHaveCover;
import muramasa.antimatter.data.AntimatterDefaultTools;
import muramasa.antimatter.item.ICustomDurability;
Expand Down Expand Up @@ -65,9 +66,9 @@ public static boolean onBlockHighlight(LevelRenderer levelRenderer, Camera camer
Player player = MC.player;
Level world = player.getCommandSenderWorld();
ItemStack stack = player.getMainHandItem();
if (stack.isEmpty() || (!(stack.getItem() instanceof IBasicAntimatterTool) && !(stack.getItem() instanceof IHaveCover)))
if (stack.isEmpty() || (!(stack.getItem() instanceof IBasicAntimatterTool) && !(stack.getItem() instanceof IHaveCover) && !CoverReplacements.hasReplacement(stack.getItem())))
return false;
if (stack.getItem() instanceof IHaveCover) {
if (stack.getItem() instanceof IHaveCover || CoverReplacements.hasReplacement(stack.getItem())) {
if (player.isCrouching()) return false;
RenderHelper.onDrawHighlight(player, levelRenderer, camera, target, partialTick, poseStack, bufferSource, b -> b instanceof BlockMachine || b instanceof BlockPipe, BehaviourExtendedHighlight.COVER_FUNCTION);
return true;
Expand Down
3 changes: 2 additions & 1 deletion common/src/main/java/muramasa/antimatter/pipe/BlockPipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import muramasa.antimatter.client.AntimatterModelManager;
import muramasa.antimatter.client.glu.Util;
import muramasa.antimatter.cover.CoverFactory;
import muramasa.antimatter.cover.CoverReplacements;
import muramasa.antimatter.cover.ICover;
import muramasa.antimatter.cover.IHaveCover;
import muramasa.antimatter.data.AntimatterDefaultTools;
Expand Down Expand Up @@ -408,7 +409,7 @@ public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, Co
if (Utils.isPlayerHolding(player, InteractionHand.MAIN_HAND, getToolType(), AntimatterDefaultTools.CROWBAR, AntimatterDefaultTools.SCREWDRIVER)) {
return Shapes.block();
}
if (!player.getMainHandItem().isEmpty() && player.getMainHandItem().getItem() instanceof IHaveCover) {
if (!player.getMainHandItem().isEmpty() && (player.getMainHandItem().getItem() instanceof IHaveCover || CoverReplacements.hasReplacement(player.getMainHandItem().getItem()))) {
return Shapes.block();
}
}
Expand Down

0 comments on commit 01c3082

Please sign in to comment.