Skip to content

Commit

Permalink
Added empty private constructors to hide implicit public ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Desoroxxx committed Aug 11, 2024
1 parent 1bf4def commit 3feddb7
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/dev/redstudio/redcore/math/ClampUtil.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -11,6 +14,7 @@
* @since 0.5
*/
@SuppressWarnings({"unused", "ManualMinMaxCalculation", "DuplicatedCode"})
@NoArgsConstructor(access = PRIVATE)
public final class ClampUtil {

/**
Expand Down
4 changes: 4 additions & 0 deletions core/src/main/java/dev/redstudio/redcore/math/MathUtil.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
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.
*
* @author Desoroxxx
* @since 0.2
*/
@SuppressWarnings("unused")
@NoArgsConstructor(access = PRIVATE)
public final class MathUtil {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
* <p>
Expand All @@ -9,6 +13,7 @@
* @author Luna Lage (Desoroxxx)
* @since 0.6
*/
@NoArgsConstructor(access = PRIVATE)
public class DecimalUtils {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
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.
*
* @author Desoroxxx
* @since 0.3
*/
@SideOnly(Side.CLIENT)
@NoArgsConstructor(access = PRIVATE)
public class RedClientTickEvent extends Event {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
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;
import net.minecraftforge.fml.common.gameevent.TickEvent;
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
*
* @author Desoroxxx
* @since 0.3
*/
@SideOnly(Side.CLIENT)
@NoArgsConstructor(access = PRIVATE)
public class RedClientTicker {

private static int biTickCount, pentaTickCount, decaTickCount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
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.
*
* @author Luna Lage (Desoroxxx)
* @since 0.6
*/
@SuppressWarnings("unused")
@NoArgsConstructor(access = PRIVATE)
public final class AABBUtil {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
* <p>
Expand All @@ -16,6 +19,7 @@
* @author Desoroxxx
* @since 0.4
*/
@NoArgsConstructor(access = PRIVATE)
public final class NetworkUtil {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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?)
Expand All @@ -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.
Expand Down

0 comments on commit 3feddb7

Please sign in to comment.