Skip to content

Commit

Permalink
fix item stack issue (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Jul 1, 2024
1 parent fea58c2 commit 89ec961
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 55 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## Change
- update Forge & MaFgLib version
- fix item stack issue (#16)
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ loom.platform=forge
yarn_mappings=1.18.2+build.4

# Mod Properties
mod_version=0.1.6
mod_version=0.1.7
maven_group=org.thinkingstudio.bocchud
archives_base_name=BoccHUD
mod_id=bocchud
Expand Down
52 changes: 0 additions & 52 deletions src/main/java/fi/dy/masa/minihud/mixin/MixinItemStack.java

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/java/org/thinkingstudio/bocchud/BoccHUD.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ public BoccHUD() {
gui.setParent(screen);
return gui;
});

ClientEventHandler.register();
}
}
40 changes: 40 additions & 0 deletions src/main/java/org/thinkingstudio/bocchud/ClientEventHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.thinkingstudio.bocchud;

import fi.dy.masa.minihud.config.Configs;
import fi.dy.masa.minihud.util.MiscUtils;
import net.minecraft.block.BeehiveBlock;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Items;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.eventbus.api.EventPriority;

public class ClientEventHandler {
public static void register() {
MinecraftForge.EVENT_BUS.<ItemTooltipEvent>addListener(EventPriority.HIGHEST, event -> {
var itemStack = event.getItemStack();
var list = event.getToolTip();

if (Configs.Generic.AXOLOTL_TOOLTIPS.getBooleanValue() &&
itemStack.getItem() == Items.AXOLOTL_BUCKET)
{
MiscUtils.addAxolotlTooltip(itemStack, list);
return;
}

if (Configs.Generic.BEE_TOOLTIPS.getBooleanValue() &&
itemStack.getItem() instanceof BlockItem &&
((BlockItem) itemStack.getItem()).getBlock() instanceof BeehiveBlock)
{
MiscUtils.addBeeTooltip(itemStack, list);
}

if (Configs.Generic.HONEY_TOOLTIPS.getBooleanValue() &&
itemStack.getItem() instanceof BlockItem &&
((BlockItem) itemStack.getItem()).getBlock() instanceof BeehiveBlock)
{
MiscUtils.addHoneyTooltip(itemStack, list);
}
});
}
}
1 change: 0 additions & 1 deletion src/main/resources/bocchud.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"MixinConduitBlockEntity",
"MixinDebugRenderer",
"MixinHeightmapDebugRenderer",
"MixinItemStack",
"MixinMinecraftClient",
"MixinMinecraftServer",
"MixinNeighborUpdateDebugRenderer",
Expand Down

0 comments on commit 89ec961

Please sign in to comment.