diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHUD.java b/src/main/java/com/tanishisherewith/dynamichud/DynamicHUD.java similarity index 92% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHUD.java rename to src/main/java/com/tanishisherewith/dynamichud/DynamicHUD.java index b3bb2cd..84166ea 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHUD.java +++ b/src/main/java/com/tanishisherewith/dynamichud/DynamicHUD.java @@ -1,11 +1,11 @@ -package com.tanishisherewith.dynamichud.newTrial; - -import com.tanishisherewith.dynamichud.newTrial.config.GlobalConfig; -import com.tanishisherewith.dynamichud.newTrial.screens.AbstractMoveableScreen; -import com.tanishisherewith.dynamichud.newTrial.widget.Widget; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetManager; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetRenderer; -import com.tanishisherewith.dynamichud.newTrial.widgets.TextWidget; +package com.tanishisherewith.dynamichud; + +import com.tanishisherewith.dynamichud.config.GlobalConfig; +import com.tanishisherewith.dynamichud.screens.AbstractMoveableScreen; +import com.tanishisherewith.dynamichud.widget.Widget; +import com.tanishisherewith.dynamichud.widget.WidgetManager; +import com.tanishisherewith.dynamichud.widget.WidgetRenderer; +import com.tanishisherewith.dynamichud.widgets.TextWidget; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; @@ -144,7 +144,7 @@ public void onInitializeClient() { ServerPlayConnectionEvents.DISCONNECT.register((handler, packetSender) -> saveWidgetsSafely(widgetsFile, FILE_MAP.get(widgetsFile.getName()))); //When minecraft closes - ClientLifecycleEvents.CLIENT_STOPPING.register((minecraftClient)->saveWidgetsSafely(widgetsFile,FILE_MAP.get(widgetsFile.getName()))); + ClientLifecycleEvents.CLIENT_STOPPING.register((minecraftClient) -> saveWidgetsSafely(widgetsFile, FILE_MAP.get(widgetsFile.getName()))); printInfo(String.format("Integration of mod %s was successful", modId)); } catch (Throwable e) { @@ -159,7 +159,7 @@ public void onInitializeClient() { ServerLifecycleEvents.SERVER_STOPPING.register(server -> GlobalConfig.HANDLER.save()); ServerLifecycleEvents.END_DATA_PACK_RELOAD.register((server, resourceManager, s) -> GlobalConfig.HANDLER.save()); ServerPlayConnectionEvents.DISCONNECT.register((handler, packetSender) -> GlobalConfig.HANDLER.save()); - ClientLifecycleEvents.CLIENT_STOPPING.register((minecraftClient)->GlobalConfig.HANDLER.save()); + ClientLifecycleEvents.CLIENT_STOPPING.register((minecraftClient) -> GlobalConfig.HANDLER.save()); HudRenderCallback.EVENT.register(new HudRender()); diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHudIntegration.java b/src/main/java/com/tanishisherewith/dynamichud/DynamicHudIntegration.java similarity index 88% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHudIntegration.java rename to src/main/java/com/tanishisherewith/dynamichud/DynamicHudIntegration.java index e28a507..d8959f7 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHudIntegration.java +++ b/src/main/java/com/tanishisherewith/dynamichud/DynamicHudIntegration.java @@ -1,9 +1,9 @@ -package com.tanishisherewith.dynamichud.newTrial; +package com.tanishisherewith.dynamichud; -import com.tanishisherewith.dynamichud.newTrial.screens.AbstractMoveableScreen; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetData; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetManager; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetRenderer; +import com.tanishisherewith.dynamichud.screens.AbstractMoveableScreen; +import com.tanishisherewith.dynamichud.widget.WidgetData; +import com.tanishisherewith.dynamichud.widget.WidgetManager; +import com.tanishisherewith.dynamichud.widget.WidgetRenderer; import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.option.KeyBinding; @@ -64,7 +64,7 @@ public interface DynamicHudIntegration { /** * Initializes the DynamicHud integration. *
- * Suggested to be used to initialize {@link com.tanishisherewith.dynamichud.newTrial.utils.DynamicValueRegistry} and widgets with their respective values + * Suggested to be used to initialize {@link com.tanishisherewith.dynamichud.utils.DynamicValueRegistry} and widgets with their respective values *
*/ void init(); diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHudTest.java b/src/main/java/com/tanishisherewith/dynamichud/DynamicHudTest.java similarity index 82% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHudTest.java rename to src/main/java/com/tanishisherewith/dynamichud/DynamicHudTest.java index fd888c5..cc256c6 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/DynamicHudTest.java +++ b/src/main/java/com/tanishisherewith/dynamichud/DynamicHudTest.java @@ -1,11 +1,11 @@ -package com.tanishisherewith.dynamichud.newTrial; +package com.tanishisherewith.dynamichud; -import com.tanishisherewith.dynamichud.newTrial.screens.AbstractMoveableScreen; -import com.tanishisherewith.dynamichud.newTrial.utils.DynamicValueRegistry; -import com.tanishisherewith.dynamichud.newTrial.widget.Widget; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetManager; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetRenderer; -import com.tanishisherewith.dynamichud.newTrial.widgets.TextWidget; +import com.tanishisherewith.dynamichud.screens.AbstractMoveableScreen; +import com.tanishisherewith.dynamichud.utils.DynamicValueRegistry; +import com.tanishisherewith.dynamichud.widget.Widget; +import com.tanishisherewith.dynamichud.widget.WidgetManager; +import com.tanishisherewith.dynamichud.widget.WidgetRenderer; +import com.tanishisherewith.dynamichud.widgets.TextWidget; import net.minecraft.client.gui.screen.TitleScreen; import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; import net.minecraft.text.Text; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/HudRender.java b/src/main/java/com/tanishisherewith/dynamichud/HudRender.java similarity index 83% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/HudRender.java rename to src/main/java/com/tanishisherewith/dynamichud/HudRender.java index 2a80dc3..b4e301e 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/HudRender.java +++ b/src/main/java/com/tanishisherewith/dynamichud/HudRender.java @@ -1,6 +1,6 @@ -package com.tanishisherewith.dynamichud.newTrial; +package com.tanishisherewith.dynamichud; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetRenderer; +import com.tanishisherewith.dynamichud.widget.WidgetRenderer; import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; import net.minecraft.client.gui.DrawContext; diff --git a/src/main/java/com/tanishisherewith/dynamichud/ModMenuIntegration.java b/src/main/java/com/tanishisherewith/dynamichud/ModMenuIntegration.java index c9aec49..30fffb4 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/ModMenuIntegration.java +++ b/src/main/java/com/tanishisherewith/dynamichud/ModMenuIntegration.java @@ -1,6 +1,6 @@ package com.tanishisherewith.dynamichud; -import com.tanishisherewith.dynamichud.newTrial.config.GlobalConfig; +import com.tanishisherewith.dynamichud.config.GlobalConfig; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; import net.minecraft.client.gui.screen.Screen; @@ -8,6 +8,7 @@ public class ModMenuIntegration implements ModMenuApi { public static Screen YACL_CONFIG_SCREEN = GlobalConfig.get().createYACLGUI(); + @Override public ConfigScreenFactory> getModConfigScreenFactory() { return parent -> YACL_CONFIG_SCREEN; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/config/GlobalConfig.java b/src/main/java/com/tanishisherewith/dynamichud/config/GlobalConfig.java similarity index 97% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/config/GlobalConfig.java rename to src/main/java/com/tanishisherewith/dynamichud/config/GlobalConfig.java index 4ce8478..0fd6e0a 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/config/GlobalConfig.java +++ b/src/main/java/com/tanishisherewith/dynamichud/config/GlobalConfig.java @@ -1,4 +1,4 @@ -package com.tanishisherewith.dynamichud.newTrial.config; +package com.tanishisherewith.dynamichud.config; import dev.isxander.yacl3.api.*; import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/helpers/ColorHelper.java b/src/main/java/com/tanishisherewith/dynamichud/helpers/ColorHelper.java similarity index 98% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/helpers/ColorHelper.java rename to src/main/java/com/tanishisherewith/dynamichud/helpers/ColorHelper.java index 7426687..b119142 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/helpers/ColorHelper.java +++ b/src/main/java/com/tanishisherewith/dynamichud/helpers/ColorHelper.java @@ -1,4 +1,4 @@ -package com.tanishisherewith.dynamichud.newTrial.helpers; +package com.tanishisherewith.dynamichud.helpers; import net.minecraft.util.math.MathHelper; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/helpers/DrawHelper.java b/src/main/java/com/tanishisherewith/dynamichud/helpers/DrawHelper.java similarity index 99% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/helpers/DrawHelper.java rename to src/main/java/com/tanishisherewith/dynamichud/helpers/DrawHelper.java index ab6b5b0..3794f06 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/helpers/DrawHelper.java +++ b/src/main/java/com/tanishisherewith/dynamichud/helpers/DrawHelper.java @@ -1,8 +1,8 @@ -package com.tanishisherewith.dynamichud.newTrial.helpers; +package com.tanishisherewith.dynamichud.helpers; import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; -import com.tanishisherewith.dynamichud.newTrial.DynamicHUD; +import com.tanishisherewith.dynamichud.DynamicHUD; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.*; import net.minecraft.client.util.math.MatrixStack; diff --git a/src/main/java/com/tanishisherewith/dynamichud/mixins/ScreenMixin.java b/src/main/java/com/tanishisherewith/dynamichud/mixins/ScreenMixin.java index 226f3ad..1ce36e5 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/mixins/ScreenMixin.java +++ b/src/main/java/com/tanishisherewith/dynamichud/mixins/ScreenMixin.java @@ -1,8 +1,8 @@ package com.tanishisherewith.dynamichud.mixins; -import com.tanishisherewith.dynamichud.newTrial.DynamicHUD; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetManager; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetRenderer; +import com.tanishisherewith.dynamichud.DynamicHUD; +import com.tanishisherewith.dynamichud.widget.WidgetManager; +import com.tanishisherewith.dynamichud.widget.WidgetRenderer; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; @@ -14,23 +14,27 @@ @Mixin(Screen.class) public abstract class ScreenMixin { - @Shadow public int width; + @Shadow + public int width; - @Shadow public int height; + @Shadow + public int height; @Inject(at = @At("TAIL"), method = "render") private void render(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { - for(WidgetRenderer widgetRenderer: DynamicHUD.getWidgetRenderers()){ - widgetRenderer.renderWidgets(context,mouseX,mouseY); + for (WidgetRenderer widgetRenderer : DynamicHUD.getWidgetRenderers()) { + widgetRenderer.renderWidgets(context, mouseX, mouseY); } } + @Inject(at = @At("HEAD"), method = "resize") - private void onScreenResize(MinecraftClient client,int width, int height, CallbackInfo ci) { - WidgetManager.onScreenResized(width,height,this.width,this.height); + private void onScreenResize(MinecraftClient client, int width, int height, CallbackInfo ci) { + WidgetManager.onScreenResized(width, height, this.width, this.height); } + @Inject(at = @At("HEAD"), method = "close") private void onClose(CallbackInfo ci) { - for(WidgetRenderer widgetRenderer: DynamicHUD.getWidgetRenderers()){ + for (WidgetRenderer widgetRenderer : DynamicHUD.getWidgetRenderers()) { widgetRenderer.onCloseScreen(); } } diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/screens/AbstractMoveableScreen.java b/src/main/java/com/tanishisherewith/dynamichud/screens/AbstractMoveableScreen.java similarity index 96% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/screens/AbstractMoveableScreen.java rename to src/main/java/com/tanishisherewith/dynamichud/screens/AbstractMoveableScreen.java index 313823a..f1bcfe7 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/screens/AbstractMoveableScreen.java +++ b/src/main/java/com/tanishisherewith/dynamichud/screens/AbstractMoveableScreen.java @@ -1,6 +1,6 @@ -package com.tanishisherewith.dynamichud.newTrial.screens; +package com.tanishisherewith.dynamichud.screens; -import com.tanishisherewith.dynamichud.newTrial.widget.WidgetRenderer; +import com.tanishisherewith.dynamichud.widget.WidgetRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.text.Text; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/DynamicValueRegistry.java b/src/main/java/com/tanishisherewith/dynamichud/utils/DynamicValueRegistry.java similarity index 98% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/DynamicValueRegistry.java rename to src/main/java/com/tanishisherewith/dynamichud/utils/DynamicValueRegistry.java index 6eee0ba..f3c8390 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/DynamicValueRegistry.java +++ b/src/main/java/com/tanishisherewith/dynamichud/utils/DynamicValueRegistry.java @@ -1,4 +1,4 @@ -package com.tanishisherewith.dynamichud.newTrial.utils; +package com.tanishisherewith.dynamichud.utils; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/System.java b/src/main/java/com/tanishisherewith/dynamichud/utils/System.java similarity index 91% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/System.java rename to src/main/java/com/tanishisherewith/dynamichud/utils/System.java index f741907..3cbc6a0 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/System.java +++ b/src/main/java/com/tanishisherewith/dynamichud/utils/System.java @@ -1,4 +1,4 @@ -package com.tanishisherewith.dynamichud.newTrial.utils; +package com.tanishisherewith.dynamichud.utils; import java.util.List; import java.util.Map; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/UID.java b/src/main/java/com/tanishisherewith/dynamichud/utils/UID.java similarity index 93% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/UID.java rename to src/main/java/com/tanishisherewith/dynamichud/utils/UID.java index cbe721b..6a1735f 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/UID.java +++ b/src/main/java/com/tanishisherewith/dynamichud/utils/UID.java @@ -1,4 +1,4 @@ -package com.tanishisherewith.dynamichud.newTrial.utils; +package com.tanishisherewith.dynamichud.utils; import java.util.Random; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/Util.java b/src/main/java/com/tanishisherewith/dynamichud/utils/Util.java similarity index 86% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/Util.java rename to src/main/java/com/tanishisherewith/dynamichud/utils/Util.java index d1e04c4..b7f2ccc 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/Util.java +++ b/src/main/java/com/tanishisherewith/dynamichud/utils/Util.java @@ -1,6 +1,6 @@ -package com.tanishisherewith.dynamichud.newTrial.utils; +package com.tanishisherewith.dynamichud.utils; -import com.tanishisherewith.dynamichud.newTrial.DynamicHUD; +import com.tanishisherewith.dynamichud.DynamicHUD; public class Util { public static Quadrant getQuadrant(int x, int y) { diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/contextmenu/ContextMenu.java b/src/main/java/com/tanishisherewith/dynamichud/utils/contextmenu/ContextMenu.java similarity index 95% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/contextmenu/ContextMenu.java rename to src/main/java/com/tanishisherewith/dynamichud/utils/contextmenu/ContextMenu.java index 2750069..6de1633 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/contextmenu/ContextMenu.java +++ b/src/main/java/com/tanishisherewith/dynamichud/utils/contextmenu/ContextMenu.java @@ -1,6 +1,6 @@ -package com.tanishisherewith.dynamichud.newTrial.utils.contextmenu; +package com.tanishisherewith.dynamichud.utils.contextmenu; -import com.tanishisherewith.dynamichud.newTrial.helpers.DrawHelper; +import com.tanishisherewith.dynamichud.helpers.DrawHelper; import net.minecraft.client.gui.DrawContext; import java.awt.*; @@ -46,7 +46,7 @@ public void render(DrawContext drawContext, int x, int y, int height) { int yOffset = y1 + 3; this.width = 10; for (Option> option : options) { - if(!option.shouldRender())continue; + if (!option.shouldRender()) continue; option.render(drawContext, x + 2, yOffset); this.width = Math.max(this.width, option.width + padding); yOffset += option.height + 1; diff --git a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/contextmenu/Option.java b/src/main/java/com/tanishisherewith/dynamichud/utils/contextmenu/Option.java similarity index 86% rename from src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/contextmenu/Option.java rename to src/main/java/com/tanishisherewith/dynamichud/utils/contextmenu/Option.java index 4f2e080..7d1831d 100644 --- a/src/main/java/com/tanishisherewith/dynamichud/newTrial/utils/contextmenu/Option.java +++ b/src/main/java/com/tanishisherewith/dynamichud/utils/contextmenu/Option.java @@ -1,6 +1,6 @@ -package com.tanishisherewith.dynamichud.newTrial.utils.contextmenu; +package com.tanishisherewith.dynamichud.utils.contextmenu; -import com.tanishisherewith.dynamichud.newTrial.widget.Widget; +import com.tanishisherewith.dynamichud.widget.Widget; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; @@ -12,13 +12,13 @@ public abstract class Option- * The {@link #getter} gets a boolean value to display/close the subMenu by default. + * The {@link #getter} gets a boolean value to display/close the subMenu by default. *
- * The {@link #setter} returns a boolean value depending on if the subMenu is visible or not
+ * The {@link #setter} returns a boolean value depending on if the subMenu is visible or not
*/
public class SubMenuOption extends Option
- * The mouse position values are only passed when in a {@link com.tanishisherewith.dynamichud.newTrial.screens.AbstractMoveableScreen} screen.
+ * The mouse position values are only passed when in a {@link com.tanishisherewith.dynamichud.screens.AbstractMoveableScreen} screen.
*