use of me.juancarloscp52.bedrockify.client.features.HeldItemTooltips.HeldItemTooltips in project BedrockIfy by juancarloscp52.
the class BedrockifyClient method onInitializeClient.
@Override
public void onInitializeClient() {
LOGGER.info("Initializing BedrockIfy Client.");
overlay = new Overlay((MinecraftClient.getInstance()));
reachAroundPlacement = new ReachAroundPlacement(MinecraftClient.getInstance());
heldItemTooltips = new HeldItemTooltips();
settingsGUI = new SettingsGUI();
keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding("bedrockIfy.key.settings", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_B, "BedrockIfy"));
ClientTickEvents.END_CLIENT_TICK.register(client -> {
while (keyBinding.wasPressed()) {
client.openScreen(settingsGUI.getConfigScreen(client.currentScreen, true));
}
});
instance = this;
}
use of me.juancarloscp52.bedrockify.client.features.HeldItemTooltips.HeldItemTooltips in project BedrockIfy by juancarloscp52.
the class ItemTooltipsMixin method interceptItemStack.
/**
* Show the item tooltip when changing from a item to another of the same type and name IFF different tooltips.
*/
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isEmpty()Z", ordinal = 1))
private boolean interceptItemStack(ItemStack itemStack) {
ItemStack nextItem = this.client.player.inventory.getMainHandStack();
HeldItemTooltips heldItemTooltips = BedrockifyClient.getInstance().heldItemTooltips;
if (itemStack.getItem() == this.currentStack.getItem() && !heldItemTooltips.equals(currentStack, nextItem)) {
this.heldItemTooltipFade = 41;
return true;
}
return currentStack.isEmpty();
}
Aggregations