From 788ab3185f796963cfbd36c32ee7dd20bad6a453 Mon Sep 17 00:00:00 2001 From: LambdAurora Date: Tue, 26 Nov 2024 19:42:46 +0100 Subject: [PATCH] Cleanup some leftovers. --- .../lambdynlights/api/behavior/BeaconLightBehavior.java | 3 +++ .../api/behavior/DynamicLightBehaviorManager.java | 4 +++- .../lambdynlights/api/behavior/LineLightBehavior.java | 3 ++- .../lambdynlights/echo/BeaconBlockEntityLightSource.java | 7 +++++++ .../lambdynlights/echo/GuardianEntityLightSource.java | 7 +++++++ .../lambdynlights/echo/TheEndGatewayBeamLightBehavior.java | 5 ++++- .../lambdynlights/engine/DynamicLightBehaviorSources.java | 3 ++- 7 files changed, 28 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/BeaconLightBehavior.java b/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/BeaconLightBehavior.java index 48694a91..10d4cfe3 100644 --- a/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/BeaconLightBehavior.java +++ b/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/BeaconLightBehavior.java @@ -23,6 +23,9 @@ * @param z the Z-coordinate of the beam * @param luminance the luminance of the beam * @param level the world in which the beam is in + * @author LambdAurora, Akarys + * @version 4.0.0 + * @since 4.0.0 */ public record BeaconLightBehavior(int x, OptionalInt y, int z, @Range(from = 0, to = 15) int luminance, Level level) implements DynamicLightBehavior { public BeaconLightBehavior(int x, int z, @Range(from = 0, to = 15) int luminance, Level level) { diff --git a/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/DynamicLightBehaviorManager.java b/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/DynamicLightBehaviorManager.java index 89d1ba48..2c3d5d6e 100644 --- a/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/DynamicLightBehaviorManager.java +++ b/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/DynamicLightBehaviorManager.java @@ -9,6 +9,8 @@ package dev.lambdaurora.lambdynlights.api.behavior; +import org.jetbrains.annotations.NotNull; + /** * Represents the dynamic lighting behavior manager, * which provides the ability to add and remove custom dynamic lighting sources. @@ -24,7 +26,7 @@ public interface DynamicLightBehaviorManager { * * @param source the source to add */ - void add(DynamicLightBehavior source); + void add(@NotNull DynamicLightBehavior source); /** * Removes the given dynamic lighting source from the client world. diff --git a/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/LineLightBehavior.java b/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/LineLightBehavior.java index 4c91bf71..dfed0f7d 100644 --- a/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/LineLightBehavior.java +++ b/api/src/main/java/dev/lambdaurora/lambdynlights/api/behavior/LineLightBehavior.java @@ -10,6 +10,7 @@ package dev.lambdaurora.lambdynlights.api.behavior; import net.minecraft.util.math.MathHelper; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Range; import org.joml.Vector3d; @@ -143,7 +144,7 @@ public boolean hasChanged() { } @Override - public BoundingBox getBoundingBox() { + public @NotNull BoundingBox getBoundingBox() { return new BoundingBox( MathHelper.floor(this.startPoint.x()), MathHelper.floor(this.startPoint.y()), diff --git a/src/main/java/dev/lambdaurora/lambdynlights/echo/BeaconBlockEntityLightSource.java b/src/main/java/dev/lambdaurora/lambdynlights/echo/BeaconBlockEntityLightSource.java index f2040307..8e73ae27 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/echo/BeaconBlockEntityLightSource.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/echo/BeaconBlockEntityLightSource.java @@ -11,6 +11,13 @@ import dev.lambdaurora.lambdynlights.api.behavior.BeaconLightBehavior; +/** + * Represents a beacon beam light source. + * + * @author LambdAurora + * @version 4.0.0 + * @since 4.0.0 + */ public interface BeaconBlockEntityLightSource { int lambdynlights$getLevels(); diff --git a/src/main/java/dev/lambdaurora/lambdynlights/echo/GuardianEntityLightSource.java b/src/main/java/dev/lambdaurora/lambdynlights/echo/GuardianEntityLightSource.java index 4c776a01..ff902af9 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/echo/GuardianEntityLightSource.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/echo/GuardianEntityLightSource.java @@ -15,6 +15,13 @@ import net.minecraft.world.entity.monster.Guardian; import org.joml.Vector3d; +/** + * Represents a Guardian laser light source. + * + * @author LambdAurora + * @version 4.0.0 + * @since 4.0.0 + */ public interface GuardianEntityLightSource { LineLightBehavior lambdynlights$getDynamicLightBeam(); diff --git a/src/main/java/dev/lambdaurora/lambdynlights/echo/TheEndGatewayBeamLightBehavior.java b/src/main/java/dev/lambdaurora/lambdynlights/echo/TheEndGatewayBeamLightBehavior.java index e36c44da..084fd58a 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/echo/TheEndGatewayBeamLightBehavior.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/echo/TheEndGatewayBeamLightBehavior.java @@ -9,7 +9,6 @@ package dev.lambdaurora.lambdynlights.echo; -import dev.lambdaurora.lambdynlights.LambDynLights; import dev.lambdaurora.lambdynlights.api.behavior.DynamicLightBehavior; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity; @@ -19,7 +18,11 @@ /** * Represents an end gateway beam dynamic lighting behavior. * + * @param gateway the End gateway block entity * @param level the world in which the beam is in + * @author LambdAurora + * @version 4.0.0 + * @since 4.0.0 */ public record TheEndGatewayBeamLightBehavior(TheEndGatewayBlockEntity gateway, Level level) implements DynamicLightBehavior { private int getWorldBottom() { diff --git a/src/main/java/dev/lambdaurora/lambdynlights/engine/DynamicLightBehaviorSources.java b/src/main/java/dev/lambdaurora/lambdynlights/engine/DynamicLightBehaviorSources.java index b2d444c8..082e86ae 100644 --- a/src/main/java/dev/lambdaurora/lambdynlights/engine/DynamicLightBehaviorSources.java +++ b/src/main/java/dev/lambdaurora/lambdynlights/engine/DynamicLightBehaviorSources.java @@ -13,6 +13,7 @@ import dev.lambdaurora.lambdynlights.api.behavior.DynamicLightBehavior; import dev.lambdaurora.lambdynlights.api.behavior.DynamicLightBehaviorManager; import dev.lambdaurora.lambdynlights.engine.source.DeferredDynamicLightSource; +import org.jetbrains.annotations.NotNull; /** * Represents the dynamic lighting behavior manager implementation. @@ -29,7 +30,7 @@ public DynamicLightBehaviorSources(LambDynLights mod) { } @Override - public void add(DynamicLightBehavior source) { + public void add(@NotNull DynamicLightBehavior source) { this.mod.addLightSource(new DeferredDynamicLightSource(source)); }