Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Feb 4, 2021
1 parent a0e2ea2 commit c2093d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static void renderOverlay(MatrixStack matrices) {
if (RayTracing.INSTANCE.getTarget() == null)
return;

if (RayTracing.INSTANCE.getTarget().getType() == HitResult.Type.BLOCK && !RayTracing.INSTANCE.getTargetStack().isEmpty())
if (RayTracing.INSTANCE.getTarget().getType() == HitResult.Type.BLOCK)
renderOverlay(matrices, WailaTickHandler.instance().tooltip);

if (RayTracing.INSTANCE.getTarget().getType() == HitResult.Type.ENTITY && PluginConfig.INSTANCE.get(PluginCore.CONFIG_SHOW_ENTITY))
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/mcp/mobius/waila/overlay/WailaTickHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,13 @@ public void tickClient() {
ItemStack targetStack = RayTracing.INSTANCE.getTargetStack(); // Here we get either the proper stack or the override
accessor.stack = targetStack;

if (!targetStack.isEmpty()) {
instance().handler.gatherBlockComponents(accessor, currentTipHead, TooltipPosition.HEAD);
instance().handler.gatherBlockComponents(accessor, currentTipBody, TooltipPosition.BODY);
instance().handler.gatherBlockComponents(accessor, currentTipTail, TooltipPosition.TAIL);
instance().handler.gatherBlockComponents(accessor, currentTipHead, TooltipPosition.HEAD);
instance().handler.gatherBlockComponents(accessor, currentTipBody, TooltipPosition.BODY);
instance().handler.gatherBlockComponents(accessor, currentTipTail, TooltipPosition.TAIL);

combinePositions(player, currentTip, currentTipHead, currentTipBody, currentTipTail);
combinePositions(player, currentTip, currentTipHead, currentTipBody, currentTipTail);

tooltip = new Tooltip(currentTip, !targetStack.isEmpty());
}
tooltip = new Tooltip(currentTip, !targetStack.isEmpty());
} else if (target != null && target.getType() == HitResult.Type.ENTITY) {
DataAccessor accessor = DataAccessor.INSTANCE;
accessor.set(world, player, target);
Expand Down

0 comments on commit c2093d6

Please sign in to comment.