From c3bb792398eb8186d39b53df6363fc1feae8a7a3 Mon Sep 17 00:00:00 2001 From: Morpheus Date: Tue, 12 Mar 2024 20:32:39 +0000 Subject: [PATCH] Fix compilation warnings (#2484) --- .../api/command/registrar/tree/CommandTreeNode.java | 4 ++-- .../org/spongepowered/api/registry/RegistryTypes.java | 8 ++++---- .../java/org/spongepowered/api/state/StateMatcher.java | 4 ++-- .../api/world/volume/biome/BiomeVolumeFactory.java | 8 ++++---- .../api/world/volume/block/BlockVolumeFactory.java | 8 ++++---- .../spongepowered/api/world/volume/game/ChunkVolume.java | 8 ++++---- .../api/world/volume/stream/VolumeApplicator.java | 2 +- .../api/world/volume/stream/VolumeApplicators.java | 4 ++-- .../api/world/volume/stream/VolumeElement.java | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/main/java/org/spongepowered/api/command/registrar/tree/CommandTreeNode.java b/src/main/java/org/spongepowered/api/command/registrar/tree/CommandTreeNode.java index cc5846fa74c..af2482e808e 100644 --- a/src/main/java/org/spongepowered/api/command/registrar/tree/CommandTreeNode.java +++ b/src/main/java/org/spongepowered/api/command/registrar/tree/CommandTreeNode.java @@ -85,7 +85,7 @@ static CommandTreeNode literal() { * @return This, for chaining. * @see CommandTreeNodeTypes for the node types that can be created */ - T child(final String key, final CommandTreeNode.Argument<@NonNull ?> childNode); + T child(final String key, final CommandTreeNode.Argument childNode); /** * Creates a child of this node with the given key that accepts a @@ -150,7 +150,7 @@ default > T child(final String key, final * @param redirectTarget The node to redirect to * @return This, for chaining */ - T redirect(CommandTreeNode<@NonNull ?> redirectTarget); + T redirect(CommandTreeNode redirectTarget); /** * Declares that this element can only be parsed by those with the given diff --git a/src/main/java/org/spongepowered/api/registry/RegistryTypes.java b/src/main/java/org/spongepowered/api/registry/RegistryTypes.java index d4d773c1af6..0988ad0d9f0 100644 --- a/src/main/java/org/spongepowered/api/registry/RegistryTypes.java +++ b/src/main/java/org/spongepowered/api/registry/RegistryTypes.java @@ -220,7 +220,7 @@ public final class RegistryTypes { public static final DefaultedRegistryType ENTITY_CATEGORY = RegistryTypes.spongeKeyInGame("mob_category"); - public static final DefaultedRegistryType> ENTITY_TYPE = RegistryTypes.minecraftKeyInGame("entity_type"); + public static final DefaultedRegistryType> ENTITY_TYPE = RegistryTypes.minecraftKeyInGame("entity_type"); public static final DefaultedRegistryType FEATURE = RegistryTypes.minecraftKeyInServer("worldgen/configured_feature"); @@ -252,7 +252,7 @@ public final class RegistryTypes { public static final DefaultedRegistryType POTION_TYPE = RegistryTypes.minecraftKeyInGame("potion"); - public static final DefaultedRegistryType> RECIPE_TYPE = RegistryTypes.minecraftKeyInGame("recipe_type"); + public static final DefaultedRegistryType> RECIPE_TYPE = RegistryTypes.minecraftKeyInGame("recipe_type"); public static final DefaultedRegistryType SOUND_TYPE = RegistryTypes.minecraftKeyInGame("sound_event"); @@ -266,7 +266,7 @@ public final class RegistryTypes { public static final DefaultedRegistryType STRUCTURE_TYPE = RegistryTypes.minecraftKeyInGame("worldgen/structure_type"); - public static final DefaultedRegistryType> TRIGGER = RegistryTypes.minecraftKeyInGame("trigger_type"); + public static final DefaultedRegistryType> TRIGGER = RegistryTypes.minecraftKeyInGame("trigger_type"); public static final DefaultedRegistryType VILLAGER_TYPE = RegistryTypes.minecraftKeyInGame("villager_type"); @@ -318,7 +318,7 @@ public final class RegistryTypes { public static final DefaultedRegistryType> COMMAND_REGISTRAR_TYPE = RegistryTypes.spongeKeyInGame("command_registrar_type"); - public static final DefaultedRegistryType> COMMAND_TREE_NODE_TYPE = RegistryTypes.spongeKeyInGame("command_tree_node_type"); + public static final DefaultedRegistryType> COMMAND_TREE_NODE_TYPE = RegistryTypes.spongeKeyInGame("command_tree_node_type"); public static final DefaultedRegistryType COMPARATOR_MODE = RegistryTypes.spongeKeyInGame("comparator_mode"); diff --git a/src/main/java/org/spongepowered/api/state/StateMatcher.java b/src/main/java/org/spongepowered/api/state/StateMatcher.java index 33a701a1d26..dfd711a77f8 100644 --- a/src/main/java/org/spongepowered/api/state/StateMatcher.java +++ b/src/main/java/org/spongepowered/api/state/StateMatcher.java @@ -141,7 +141,7 @@ default Builder type(final Supplier type) { * @param stateProperty The state property * @return This builder, for chaining */ - Builder supportsStateProperty(StateProperty<@NonNull ?> stateProperty); + Builder supportsStateProperty(StateProperty stateProperty); /** * Adds a {@link StateProperty} that needs to be present @@ -154,7 +154,7 @@ default Builder type(final Supplier type) { * @param stateProperty The state property * @return This builder, for chaining */ - default Builder supportsStateProperty(final Supplier> stateProperty) { + default Builder supportsStateProperty(final Supplier> stateProperty) { return this.supportsStateProperty(stateProperty.get()); } diff --git a/src/main/java/org/spongepowered/api/world/volume/biome/BiomeVolumeFactory.java b/src/main/java/org/spongepowered/api/world/volume/biome/BiomeVolumeFactory.java index 7e7e74706dd..1c84537c3e0 100644 --- a/src/main/java/org/spongepowered/api/world/volume/biome/BiomeVolumeFactory.java +++ b/src/main/java/org/spongepowered/api/world/volume/biome/BiomeVolumeFactory.java @@ -35,13 +35,13 @@ public interface BiomeVolumeFactory { BiomeVolume.Mutable empty(Palette palette, RegistryReference defaultBiome, Vector3i min, Vector3i max); - BiomeVolume.Mutable copyFromRange(BiomeVolume.Streamable<@NonNull ?> existing, Vector3i newMin, Vector3i newMax); + BiomeVolume.Mutable copyFromRange(BiomeVolume.Streamable existing, Vector3i newMin, Vector3i newMax); - BiomeVolume.Mutable copy(BiomeVolume.Streamable<@NonNull ?> existing); + BiomeVolume.Mutable copy(BiomeVolume.Streamable existing); - BiomeVolume.Immutable immutableOf(BiomeVolume.Streamable<@NonNull ?> existing); + BiomeVolume.Immutable immutableOf(BiomeVolume.Streamable existing); - BiomeVolume.Immutable immutableOf(BiomeVolume.Streamable<@NonNull ?> existing, Vector3i newMin, Vector3i newMax); + BiomeVolume.Immutable immutableOf(BiomeVolume.Streamable existing, Vector3i newMin, Vector3i newMax); UnrealizedBiomeVolume.Mutable empty(Vector3i min, Vector3i max); diff --git a/src/main/java/org/spongepowered/api/world/volume/block/BlockVolumeFactory.java b/src/main/java/org/spongepowered/api/world/volume/block/BlockVolumeFactory.java index 110b93b1f74..6cbb4b75528 100644 --- a/src/main/java/org/spongepowered/api/world/volume/block/BlockVolumeFactory.java +++ b/src/main/java/org/spongepowered/api/world/volume/block/BlockVolumeFactory.java @@ -35,12 +35,12 @@ public interface BlockVolumeFactory { BlockVolume.Mutable empty(Palette palette, RegistryReference defaultState, Vector3i min, Vector3i max); - BlockVolume.Mutable copyFromRange(BlockVolume.Streamable<@NonNull ?> existing, Vector3i newMin, Vector3i newMax); + BlockVolume.Mutable copyFromRange(BlockVolume.Streamable existing, Vector3i newMin, Vector3i newMax); - BlockVolume.Mutable copy(BlockVolume.Streamable<@NonNull ?> existing); + BlockVolume.Mutable copy(BlockVolume.Streamable existing); - BlockVolume.Immutable immutableOf(BlockVolume.Streamable<@NonNull ?> existing); + BlockVolume.Immutable immutableOf(BlockVolume.Streamable existing); - BlockVolume.Immutable immutableOf(BlockVolume.Streamable<@NonNull ?> existing, Vector3i newMin, Vector3i newMax); + BlockVolume.Immutable immutableOf(BlockVolume.Streamable existing, Vector3i newMin, Vector3i newMax); } diff --git a/src/main/java/org/spongepowered/api/world/volume/game/ChunkVolume.java b/src/main/java/org/spongepowered/api/world/volume/game/ChunkVolume.java index 8aabb48a529..ea60c7bddb8 100644 --- a/src/main/java/org/spongepowered/api/world/volume/game/ChunkVolume.java +++ b/src/main/java/org/spongepowered/api/world/volume/game/ChunkVolume.java @@ -67,7 +67,7 @@ public interface ChunkVolume extends Volume { * @param z The z coordinate * @return The chunk, may be empty */ - Chunk<@NonNull ?> chunk(int x, int y, int z); + Chunk chunk(int x, int y, int z); /** * Gets the loaded chunk at the given chunk coordinate position. The position @@ -81,7 +81,7 @@ public interface ChunkVolume extends Volume { * @param chunkPosition The position * @return The chunk, if available */ - default Chunk<@NonNull ?> chunk(final Vector3i chunkPosition) { + default Chunk chunk(final Vector3i chunkPosition) { Objects.requireNonNull(chunkPosition, "chunkPosition"); return this.chunk(chunkPosition.x(), chunkPosition.y(), chunkPosition.z()); } @@ -92,7 +92,7 @@ public interface ChunkVolume extends Volume { * @param blockPosition The position * @return The chunk, if available */ - default Chunk<@NonNull ?> chunkAtBlock(final Vector3i blockPosition) { + default Chunk chunkAtBlock(final Vector3i blockPosition) { Objects.requireNonNull(blockPosition, "blockPosition"); return this.chunkAtBlock(blockPosition.x(), blockPosition.y(), blockPosition.z()); } @@ -109,7 +109,7 @@ public interface ChunkVolume extends Volume { * @param bz The z coordinate * @return The chunk, if available */ - Chunk<@NonNull ?> chunkAtBlock(final int bx, final int by, final int bz); + Chunk chunkAtBlock(final int bx, final int by, final int bz); /** * Gets whether a {@link Chunk} is loaded at the particular chunk diff --git a/src/main/java/org/spongepowered/api/world/volume/stream/VolumeApplicator.java b/src/main/java/org/spongepowered/api/world/volume/stream/VolumeApplicator.java index 4c7ce441c3c..dc3562cae4b 100644 --- a/src/main/java/org/spongepowered/api/world/volume/stream/VolumeApplicator.java +++ b/src/main/java/org/spongepowered/api/world/volume/stream/VolumeApplicator.java @@ -30,6 +30,6 @@ @FunctionalInterface public interface VolumeApplicator { - R apply(M volume, VolumeElement<@NonNull ?, T> element); + R apply(M volume, VolumeElement element); } diff --git a/src/main/java/org/spongepowered/api/world/volume/stream/VolumeApplicators.java b/src/main/java/org/spongepowered/api/world/volume/stream/VolumeApplicators.java index 98a6803760d..24cf68286d7 100644 --- a/src/main/java/org/spongepowered/api/world/volume/stream/VolumeApplicators.java +++ b/src/main/java/org/spongepowered/api/world/volume/stream/VolumeApplicators.java @@ -168,7 +168,7 @@ public static > VolumeApplicator & LocationCreator<@NonNull ?, ? extends ServerLocation>> VolumeApplicator> applyBlockEntityArchetype() { + public static & LocationCreator> VolumeApplicator> applyBlockEntityArchetype() { return (volume, element) -> element.type().apply(volume.location(element.position().round())); } @@ -212,7 +212,7 @@ public static > VolumeApplicator & LocationCreator<@NonNull ?, ? extends ServerLocation>> VolumeApplicator> applyEntityArchetype() { + public static & LocationCreator> VolumeApplicator> applyEntityArchetype() { return (volume, element) -> element.type().apply(volume.location(element.position())); } diff --git a/src/main/java/org/spongepowered/api/world/volume/stream/VolumeElement.java b/src/main/java/org/spongepowered/api/world/volume/stream/VolumeElement.java index 2b4d94e3f27..b4c782bed13 100644 --- a/src/main/java/org/spongepowered/api/world/volume/stream/VolumeElement.java +++ b/src/main/java/org/spongepowered/api/world/volume/stream/VolumeElement.java @@ -70,7 +70,7 @@ public boolean equals(final @Nullable Object o) { if (o == null || this.getClass() != o.getClass()) { return false; } - final VolumeElement<@NonNull ?, ?> that = (VolumeElement<@NonNull ?, ?>) o; + final VolumeElement that = (VolumeElement) o; return volume.get().equals(that.volume()) && type.get().equals(that.type()) && position.equals(that.position());