From 3feddb70124554b279ffcadd6a9496d249e37269 Mon Sep 17 00:00:00 2001 From: Desoroxxx Date: Sun, 11 Aug 2024 15:29:52 +0200 Subject: [PATCH] Added empty private constructors to hide implicit public ones --- Changelog.md | 2 ++ core/src/main/java/dev/redstudio/redcore/math/ClampUtil.java | 4 ++++ core/src/main/java/dev/redstudio/redcore/math/MathUtil.java | 4 ++++ .../main/java/dev/redstudio/redcore/utils/DecimalUtils.java | 5 +++++ .../dev/redstudio/redcore/ticking/RedClientTickEvent.java | 3 +++ .../java/dev/redstudio/redcore/ticking/RedClientTicker.java | 4 ++++ .../src/main/java/dev/redstudio/redcore/utils/AABBUtil.java | 4 ++++ .../main/java/dev/redstudio/redcore/utils/NetworkUtil.java | 4 ++++ .../main/java/dev/redstudio/redcore/utils/OptiNotFine.java | 3 +++ 9 files changed, 33 insertions(+) diff --git a/Changelog.md b/Changelog.md index 636d839..13a5323 100644 --- a/Changelog.md +++ b/Changelog.md @@ -20,6 +20,7 @@ The method `RedLogger#printFramedError` has been renamed to `RedLogger#logFramed - `UPPER_SNAKE_CASE` - Added `RedLogger#logFramed` which allows logging lists in a readable manner (e.g., versioning information) - Added `DecimalUtils` a utility class which currently allows for truncating decimal numbers for human reading +- Added empty private constructors to hide implicit public ones ### Changed @@ -43,6 +44,7 @@ The method `RedLogger#printFramedError` has been renamed to `RedLogger#logFramed - `AABBUtil` a utility class for handling axis aligned bounding boxes - `AABBUtil#orientAABB` a utility method for orienting a north facing AABB towards any `EnumFacing` allowing you to make only one AABB that works for every direction +- Added empty private constructors to hide implicit public ones #### Removed diff --git a/core/src/main/java/dev/redstudio/redcore/math/ClampUtil.java b/core/src/main/java/dev/redstudio/redcore/math/ClampUtil.java index 333de16..e56757c 100644 --- a/core/src/main/java/dev/redstudio/redcore/math/ClampUtil.java +++ b/core/src/main/java/dev/redstudio/redcore/math/ClampUtil.java @@ -1,6 +1,9 @@ package dev.redstudio.redcore.math; +import lombok.NoArgsConstructor; + import static dev.redstudio.redcore.ProjectConstants.LOGGER; +import static lombok.AccessLevel.PRIVATE; /** * A utility class that offers efficient clamping methods. @@ -11,6 +14,7 @@ * @since 0.5 */ @SuppressWarnings({"unused", "ManualMinMaxCalculation", "DuplicatedCode"}) +@NoArgsConstructor(access = PRIVATE) public final class ClampUtil { /** diff --git a/core/src/main/java/dev/redstudio/redcore/math/MathUtil.java b/core/src/main/java/dev/redstudio/redcore/math/MathUtil.java index efdf714..dac15bd 100644 --- a/core/src/main/java/dev/redstudio/redcore/math/MathUtil.java +++ b/core/src/main/java/dev/redstudio/redcore/math/MathUtil.java @@ -1,7 +1,10 @@ package dev.redstudio.redcore.math; +import lombok.NoArgsConstructor; import net.jafama.FastMath; +import static lombok.AccessLevel.PRIVATE; + /** * A utility class that offers efficient mathematical operations such as absolute value calculation, linear interpolation, and rounding operations. * @@ -9,6 +12,7 @@ * @since 0.2 */ @SuppressWarnings("unused") +@NoArgsConstructor(access = PRIVATE) public final class MathUtil { /** diff --git a/core/src/main/java/dev/redstudio/redcore/utils/DecimalUtils.java b/core/src/main/java/dev/redstudio/redcore/utils/DecimalUtils.java index baf1790..61bdead 100644 --- a/core/src/main/java/dev/redstudio/redcore/utils/DecimalUtils.java +++ b/core/src/main/java/dev/redstudio/redcore/utils/DecimalUtils.java @@ -1,5 +1,9 @@ package dev.redstudio.redcore.utils; +import lombok.NoArgsConstructor; + +import static lombok.AccessLevel.PRIVATE; + /** * Utility class for handling decimal numbers, notably for display purposes. *

@@ -9,6 +13,7 @@ * @author Luna Lage (Desoroxxx) * @since 0.6 */ +@NoArgsConstructor(access = PRIVATE) public class DecimalUtils { /** diff --git a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/ticking/RedClientTickEvent.java b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/ticking/RedClientTickEvent.java index 9bc0ef9..df4ba8a 100644 --- a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/ticking/RedClientTickEvent.java +++ b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/ticking/RedClientTickEvent.java @@ -5,6 +5,8 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import static lombok.AccessLevel.PRIVATE; + /** * This class has different client tick events, that fire less often than the client ticks. * @@ -12,6 +14,7 @@ * @since 0.3 */ @SideOnly(Side.CLIENT) +@NoArgsConstructor(access = PRIVATE) public class RedClientTickEvent extends Event { /** diff --git a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/ticking/RedClientTicker.java b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/ticking/RedClientTicker.java index 0f36716..79a376f 100644 --- a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/ticking/RedClientTicker.java +++ b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/ticking/RedClientTicker.java @@ -1,5 +1,6 @@ package dev.redstudio.redcore.ticking; +import lombok.NoArgsConstructor; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -7,6 +8,8 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import static lombok.AccessLevel.PRIVATE; + /** * This class is responsible for ticking the different click tick events * @@ -14,6 +17,7 @@ * @since 0.3 */ @SideOnly(Side.CLIENT) +@NoArgsConstructor(access = PRIVATE) public class RedClientTicker { private static int biTickCount, pentaTickCount, decaTickCount; diff --git a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/AABBUtil.java b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/AABBUtil.java index fe9c0f0..47b0b92 100644 --- a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/AABBUtil.java +++ b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/AABBUtil.java @@ -1,8 +1,11 @@ package dev.redstudio.redcore.utils; +import lombok.NoArgsConstructor; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.AxisAlignedBB; +import static lombok.AccessLevel.PRIVATE; + /** * A utility class for handling axis aligned bounding boxes. * @@ -10,6 +13,7 @@ * @since 0.6 */ @SuppressWarnings("unused") +@NoArgsConstructor(access = PRIVATE) public final class AABBUtil { /** diff --git a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/NetworkUtil.java b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/NetworkUtil.java index dfd2ef7..4919938 100644 --- a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/NetworkUtil.java +++ b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/NetworkUtil.java @@ -1,9 +1,12 @@ package dev.redstudio.redcore.utils; +import lombok.NoArgsConstructor; import net.minecraft.util.IThreadListener; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import static lombok.AccessLevel.PRIVATE; + /** * A utility class for handling network related tasks. *

@@ -16,6 +19,7 @@ * @author Desoroxxx * @since 0.4 */ +@NoArgsConstructor(access = PRIVATE) public final class NetworkUtil { /** diff --git a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/OptiNotFine.java b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/OptiNotFine.java index 27794bf..7cdc15e 100644 --- a/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/OptiNotFine.java +++ b/mc/1-8---1-12/src/main/java/dev/redstudio/redcore/utils/OptiNotFine.java @@ -1,6 +1,7 @@ package dev.redstudio.redcore.utils; import dev.redstudio.redcore.ticking.RedClientTicker; +import lombok.NoArgsConstructor; import net.minecraft.client.Minecraft; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -13,6 +14,7 @@ import java.lang.reflect.Field; import static dev.redstudio.redcore.ProjectConstants.RED_LOGGER; +import static lombok.AccessLevel.PRIVATE; /** * This class provides methods to communicate with OptiNotFine (Can you see that I hate OptiFine?) @@ -21,6 +23,7 @@ * @since 0.3 */ @SideOnly(Side.CLIENT) +@NoArgsConstructor(access = PRIVATE) public final class OptiNotFine { // Todo: Instead of periodically forcing fast render off, force it once and then disable the slider.