Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation warnings #2484

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static CommandTreeNode<Basic> 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<? extends @NonNull Object> childNode);

/**
* Creates a child of this node with the given key that accepts a
Expand Down Expand Up @@ -150,7 +150,7 @@ default <C extends CommandTreeNode.Argument<C>> 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<? extends @NonNull Object> redirectTarget);

/**
* Declares that this element can only be parsed by those with the given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public final class RegistryTypes {

public static final DefaultedRegistryType<EntityCategory> ENTITY_CATEGORY = RegistryTypes.spongeKeyInGame("mob_category");

public static final DefaultedRegistryType<EntityType<@NonNull ? extends Entity>> ENTITY_TYPE = RegistryTypes.minecraftKeyInGame("entity_type");
public static final DefaultedRegistryType<EntityType<? extends @NonNull Entity>> ENTITY_TYPE = RegistryTypes.minecraftKeyInGame("entity_type");

public static final DefaultedRegistryType<Feature> FEATURE = RegistryTypes.minecraftKeyInServer("worldgen/configured_feature");

Expand Down Expand Up @@ -252,7 +252,7 @@ public final class RegistryTypes {

public static final DefaultedRegistryType<PotionType> POTION_TYPE = RegistryTypes.minecraftKeyInGame("potion");

public static final DefaultedRegistryType<RecipeType<@NonNull ? extends Recipe>> RECIPE_TYPE = RegistryTypes.minecraftKeyInGame("recipe_type");
public static final DefaultedRegistryType<RecipeType<? extends @NonNull Recipe>> RECIPE_TYPE = RegistryTypes.minecraftKeyInGame("recipe_type");

public static final DefaultedRegistryType<SoundType> SOUND_TYPE = RegistryTypes.minecraftKeyInGame("sound_event");

Expand All @@ -266,7 +266,7 @@ public final class RegistryTypes {

public static final DefaultedRegistryType<StructureType> STRUCTURE_TYPE = RegistryTypes.minecraftKeyInGame("worldgen/structure_type");

public static final DefaultedRegistryType<Trigger<@NonNull ?>> TRIGGER = RegistryTypes.minecraftKeyInGame("trigger_type");
public static final DefaultedRegistryType<Trigger<? extends @NonNull Object>> TRIGGER = RegistryTypes.minecraftKeyInGame("trigger_type");

public static final DefaultedRegistryType<VillagerType> VILLAGER_TYPE = RegistryTypes.minecraftKeyInGame("villager_type");

Expand Down Expand Up @@ -318,7 +318,7 @@ public final class RegistryTypes {

public static final DefaultedRegistryType<CommandRegistrarType<?>> COMMAND_REGISTRAR_TYPE = RegistryTypes.spongeKeyInGame("command_registrar_type");

public static final DefaultedRegistryType<CommandTreeNodeType<@NonNull ?>> COMMAND_TREE_NODE_TYPE = RegistryTypes.spongeKeyInGame("command_tree_node_type");
public static final DefaultedRegistryType<CommandTreeNodeType<? extends @NonNull Object>> COMMAND_TREE_NODE_TYPE = RegistryTypes.spongeKeyInGame("command_tree_node_type");

public static final DefaultedRegistryType<ComparatorMode> COMPARATOR_MODE = RegistryTypes.spongeKeyInGame("comparator_mode");

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/spongepowered/api/state/StateMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ default Builder<S, T> type(final Supplier<? extends T> type) {
* @param stateProperty The state property
* @return This builder, for chaining
*/
Builder<S, T> supportsStateProperty(StateProperty<@NonNull ?> stateProperty);
Builder<S, T> supportsStateProperty(StateProperty<? extends @NonNull Object> stateProperty);

/**
* Adds a {@link StateProperty} that needs to be present
Expand All @@ -154,7 +154,7 @@ default Builder<S, T> type(final Supplier<? extends T> type) {
* @param stateProperty The state property
* @return This builder, for chaining
*/
default Builder<S, T> supportsStateProperty(final Supplier<? extends StateProperty<@NonNull ?>> stateProperty) {
default Builder<S, T> supportsStateProperty(final Supplier<? extends StateProperty<? extends @NonNull Object>> stateProperty) {
return this.supportsStateProperty(stateProperty.get());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public interface BiomeVolumeFactory {

BiomeVolume.Mutable empty(Palette<Biome, Biome> palette, RegistryReference<Biome> defaultBiome, Vector3i min, Vector3i max);

BiomeVolume.Mutable copyFromRange(BiomeVolume.Streamable<@NonNull ?> existing, Vector3i newMin, Vector3i newMax);
BiomeVolume.Mutable copyFromRange(BiomeVolume.Streamable<? extends @NonNull Object> existing, Vector3i newMin, Vector3i newMax);

BiomeVolume.Mutable copy(BiomeVolume.Streamable<@NonNull ?> existing);
BiomeVolume.Mutable copy(BiomeVolume.Streamable<? extends @NonNull Object> existing);

BiomeVolume.Immutable immutableOf(BiomeVolume.Streamable<@NonNull ?> existing);
BiomeVolume.Immutable immutableOf(BiomeVolume.Streamable<? extends @NonNull Object> existing);

BiomeVolume.Immutable immutableOf(BiomeVolume.Streamable<@NonNull ?> existing, Vector3i newMin, Vector3i newMax);
BiomeVolume.Immutable immutableOf(BiomeVolume.Streamable<? extends @NonNull Object> existing, Vector3i newMin, Vector3i newMax);

UnrealizedBiomeVolume.Mutable empty(Vector3i min, Vector3i max);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public interface BlockVolumeFactory {

BlockVolume.Mutable empty(Palette<BlockState, BlockType> palette, RegistryReference<BlockType> defaultState, Vector3i min, Vector3i max);

BlockVolume.Mutable copyFromRange(BlockVolume.Streamable<@NonNull ?> existing, Vector3i newMin, Vector3i newMax);
BlockVolume.Mutable copyFromRange(BlockVolume.Streamable<? extends @NonNull Object> existing, Vector3i newMin, Vector3i newMax);

BlockVolume.Mutable copy(BlockVolume.Streamable<@NonNull ?> existing);
BlockVolume.Mutable copy(BlockVolume.Streamable<? extends @NonNull Object> existing);

BlockVolume.Immutable immutableOf(BlockVolume.Streamable<@NonNull ?> existing);
BlockVolume.Immutable immutableOf(BlockVolume.Streamable<? extends @NonNull Object> existing);

BlockVolume.Immutable immutableOf(BlockVolume.Streamable<@NonNull ?> existing, Vector3i newMin, Vector3i newMax);
BlockVolume.Immutable immutableOf(BlockVolume.Streamable<? extends @NonNull Object> existing, Vector3i newMin, Vector3i newMax);

}
Original file line number Diff line number Diff line change
Expand Up @@ -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<? extends @NonNull Object> chunk(int x, int y, int z);

/**
* Gets the loaded chunk at the given chunk coordinate position. The position
Expand All @@ -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<? extends @NonNull Object> chunk(final Vector3i chunkPosition) {
Objects.requireNonNull(chunkPosition, "chunkPosition");
return this.chunk(chunkPosition.x(), chunkPosition.y(), chunkPosition.z());
}
Expand All @@ -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<? extends @NonNull Object> chunkAtBlock(final Vector3i blockPosition) {
Objects.requireNonNull(blockPosition, "blockPosition");
return this.chunkAtBlock(blockPosition.x(), blockPosition.y(), blockPosition.z());
}
Expand All @@ -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<? extends @NonNull Object> chunkAtBlock(final int bx, final int by, final int bz);

/**
* Gets whether a {@link Chunk} is loaded at the particular chunk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
@FunctionalInterface
public interface VolumeApplicator<M extends MutableVolume, T, R> {

R apply(M volume, VolumeElement<@NonNull ?, T> element);
R apply(M volume, VolumeElement<? extends @NonNull Object, T> element);

}
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public static <M extends PhysicsAwareMutableBlockVolume<M>> VolumeApplicator<M,
* @return A volume applicator that applies block entity archetypes
*/
@SuppressWarnings({"unchecked"})
public static <M extends BlockEntityVolume.Modifiable<M> & LocationCreator<@NonNull ?, ? extends ServerLocation>> VolumeApplicator<M, BlockEntityArchetype, Optional<? extends BlockEntity>> applyBlockEntityArchetype() {
public static <M extends BlockEntityVolume.Modifiable<M> & LocationCreator<? extends @NonNull Object, ? extends ServerLocation>> VolumeApplicator<M, BlockEntityArchetype, Optional<? extends BlockEntity>> applyBlockEntityArchetype() {
return (volume, element) -> element.type().apply(volume.location(element.position().round()));
}

Expand Down Expand Up @@ -212,7 +212,7 @@ public static <M extends BiomeVolume.Modifiable<M>> VolumeApplicator<M, Biome, B
}

@SuppressWarnings("unchecked")
public static <M extends EntityVolume.Modifiable<M> & LocationCreator<@NonNull ?, ? extends ServerLocation>> VolumeApplicator<M, EntityArchetype, Optional<? extends Entity>> applyEntityArchetype() {
public static <M extends EntityVolume.Modifiable<M> & LocationCreator<? extends @NonNull Object, ? extends ServerLocation>> VolumeApplicator<M, EntityArchetype, Optional<? extends Entity>> applyEntityArchetype() {
return (volume, element) -> element.type().apply(volume.location(element.position()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<? extends @NonNull Object, ?> that = (VolumeElement<? extends @NonNull Object, ?>) o;
return volume.get().equals(that.volume())
&& type.get().equals(that.type())
&& position.equals(that.position());
Expand Down