From e5fb17177bb8b36c0e28221bca05a7a56be5eb1b Mon Sep 17 00:00:00 2001 From: ImMorpheus Date: Sun, 12 Nov 2023 18:13:00 +0100 Subject: [PATCH] Standardize nullability checks with checkerframework --- .../commands/CommandSourceStackAccessor.java | 3 +-- .../accessor/world/entity/DisplayAccessor.java | 3 +-- .../AbstractFurnaceBlockEntityAccessor.java | 3 +-- .../network/chat/SpongeChatDecorator.java | 2 +- .../registrar/SpongeCommandRegistrarType.java | 6 +++--- .../common/data/DataSerializer.java | 4 ++-- .../provider/entity/AbstractRaiderData.java | 3 +-- .../provider/entity/DisplayEntityData.java | 3 +-- .../item/recipe/SpongeRecipeRegistration.java | 2 +- .../recipe/cooking/ResultFunctionRecipe.java | 2 +- .../ingredient/IngredientResultUtil.java | 3 +-- .../recipe/smithing/SpongeSmithingRecipe.java | 2 +- .../stonecutting/SpongeStonecuttingRecipe.java | 2 +- .../common/resource/SpongeResourcePath.java | 6 +++--- .../carver/SpongeCarverTemplate.java | 2 +- .../world/schematic/SchematicTranslator.java | 3 +-- .../world/server/SpongeWorldManager.java | 2 +- .../world/server/SpongeWorldTemplate.java | 4 ++-- .../api/item/merchant/MerchantMixin_API.java | 3 +-- .../CriterionProgressMixin_API.java | 3 +-- .../advancements/FrameTypeMixin_API.java | 3 +-- .../minecraft/client/MinecraftMixin_API.java | 3 +-- .../core/MappedRegistryMixin_API.java | 3 +-- .../minecraft/map/MapDecorationMixin_API.java | 3 +-- .../network/FriendlyByteBufMixin_API.java | 3 +-- .../network/chat/ChatTypeMixin_API.java | 10 +++++----- .../server/level/ServerLevelMixin_API.java | 10 ++++------ .../server/level/ServerPlayerMixin_API.java | 18 ++++++++---------- .../players/GameProfileCacheMixin_API.java | 3 +-- .../rcon/RconConsoleSourceMixin_API.java | 3 +-- .../damagesource/DamageSourceMixin_API.java | 7 +++---- .../world/entity/EntityMixin_API.java | 3 +-- .../VillagerTrades_ItemListingMixin_API.java | 3 +-- .../minecraft/world/item/ItemMixin_API.java | 3 +-- .../world/item/ItemStackMixin_API.java | 4 ++-- .../item/crafting/IngredientMixin_API.java | 3 +-- .../world/item/crafting/RecipeMixin_API.java | 15 +++++++-------- .../item/trading/MerchantOfferMixin_API.java | 5 ++--- .../world/level/BlockGetterMixin_API.java | 5 ++--- .../world/level/EntityGetterMixin_API.java | 7 +++---- .../world/level/ExplosionMixin_API.java | 3 +-- .../minecraft/world/level/LevelMixin_API.java | 10 +++++----- ...CheckerboardColumnBiomeSourceMixin_API.java | 3 +-- .../biome/MultiNoiseBiomeSourceMixin_API.java | 3 +-- .../biome/TheEndBiomeSourceMixin_API.java | 3 +-- .../BaseContainerBlockEntityMixin_API.java | 3 +-- .../entity/BeaconBlockEntityMixin_API.java | 3 +-- .../block/entity/BlockEntityMixin_API.java | 3 +-- .../world/level/chunk/ProtoChunkMixin_API.java | 2 +- .../pools/StructurePoolElementMixin_API.java | 5 ++--- .../level/saveddata/MapItemSavedDataMixin.java | 7 +++---- .../storage/ServerLevelDataMixin_API.java | 2 +- .../world/scores/PlayerTeamMixin_API.java | 3 +-- ...izableContainerBlockEntityMixin_BugFix.java | 3 +-- .../advancements/AdvancementProgressMixin.java | 3 +-- .../advancements/CriterionProgressMixin.java | 3 +-- .../adventure/chat/SignedMessageMixin.java | 4 ++-- .../block/DyeColorBlockPropertiesMixin.java | 3 +-- .../mixin/core/client/MinecraftMixin.java | 3 +-- .../mixin/core/nbt/CompoundTagMixin.java | 3 +-- .../mixin/core/network/ConnectionMixin.java | 5 ++--- .../syncher/EntityDataAccessorMixin.java | 3 +-- .../core/server/MinecraftServerMixin.java | 3 +-- .../core/server/PlayerAdvancementsMixin.java | 3 +-- .../core/server/ServerScoreboardMixin.java | 5 ++--- .../server/commands/TeleportCommandMixin.java | 5 ++--- .../core/server/level/ServerLevelMixin.java | 9 ++++----- .../ServerCommonPacketListenerImplMixin.java | 2 +- .../core/server/players/BanListEntryMixin.java | 3 +-- .../server/players/IpBanListEntryMixin.java | 3 +-- .../core/server/players/PlayerListMixin.java | 7 +++---- .../server/players/StoredUserEntryMixin.java | 3 +-- .../mixin/core/village/MerchantOfferMixin.java | 5 ++--- .../world/entity/ActiveChunkReferentMixin.java | 3 +-- .../mixin/core/world/entity/EntityMixin.java | 3 +-- .../core/world/entity/LivingEntityMixin.java | 3 +-- .../entity/LivingEntityMixin_Attack_impl.java | 6 +++--- .../mixin/core/world/entity/MobMixin.java | 5 ++--- .../world/entity/ai/goal/BreedGoalMixin.java | 8 +++----- .../core/world/entity/ai/goal/GoalMixin.java | 3 +-- .../entity/ai/goal/GoalSelectorMixin.java | 3 +-- .../boss/enderdragon/EndCrystalMixin.java | 9 +++------ .../boss/enderdragon/EnderDragonMixin.java | 3 +-- .../core/world/entity/item/PrimedTntMixin.java | 6 ++---- .../world/entity/monster/CreeperMixin.java | 6 ++---- .../world/entity/monster/EnderManMixin.java | 3 +-- .../EnderMan_EndermanLeaveBlockGoalMixin.java | 3 +-- .../EnderMan_EndermanTakeBlockGoalMixin.java | 3 +-- .../core/world/entity/player/PlayerMixin.java | 3 +-- .../entity/projectile/AbstractArrowMixin.java | 3 +-- .../entity/projectile/FishingHookMixin.java | 7 +++---- .../entity/projectile/LargeFireballMixin.java | 6 ++---- .../entity/projectile/ProjectileMixin.java | 3 +-- .../projectile/ThrownEnderpearlMixin.java | 3 +-- .../entity/projectile/WitherSkullMixin.java | 6 ++---- .../AbstractMinecartContainerMixin.java | 5 ++--- .../world/entity/vehicle/MinecartTNTMixin.java | 6 ++---- .../core/world/item/EnderEyeItemMixin.java | 3 +-- .../core/world/item/FishingRodItemMixin.java | 3 +-- .../mixin/core/world/item/ItemStackMixin.java | 3 +-- .../core/world/level/BaseSpawnerMixin.java | 2 +- .../mixin/core/world/level/LevelMixin.java | 2 +- .../core/world/level/block/TntBlockMixin.java | 3 +-- .../AbstractFurnaceBlockEntityMixin.java | 3 +-- .../block/entity/BeaconBlockEntityMixin.java | 3 +-- .../level/block/entity/BlockEntityMixin.java | 3 +-- .../world/level/chunk/LevelChunkMixin.java | 10 ++++------ .../LegacyStructureDataHandlerMixin.java | 3 +-- .../core/world/scores/ObjectiveMixin.java | 3 +-- .../mixin/core/world/scores/ScoreMixin.java | 3 +-- ...raitMixin_ArmorEquipable_Inventory_API.java | 3 +-- ...SpongeUserInventoryMixin_Inventory_API.java | 3 +-- .../ContainerMixin_Inventory_API.java | 5 ++--- .../player/InventoryMixin_Inventory_API.java | 3 +-- .../AbstractContainerMenuMixin_Inventory.java | 3 +-- .../inventory/ResultSlotMixin_Inventory.java | 3 +-- .../TraitMixin_InventoryBridge_Inventory.java | 3 +-- ...ctContainerMenuMixin_Adapter_Inventory.java | 3 +-- ...actContainerMenuMixin_Bridge_Inventory.java | 3 +-- ...actContainerMenuMixin_Fabric_Inventory.java | 3 +-- ...tractContainerMenuMixin_Menu_Inventory.java | 3 +-- ...tContainerMixin_MenuProvider_Inventory.java | 2 +- .../TamableAnimalMixin_Optimization_Owner.java | 3 +-- .../entity/LivingEntityMixin_Tracker.java | 3 +-- .../entity/item/PrimedTntMixin_Tracker.java | 3 +-- .../entity/player/PlayerMixin_Tracker.java | 3 +-- .../world/level/LevelMixin_Tracker.java | 3 +-- .../common/test/stub/StubKey.java | 6 +++--- .../common/test/stub/block/StubBlock.java | 4 ++-- .../common/util/DefinableClassLoader.java | 2 +- vanilla/build.gradle.kts | 1 - .../launch/plugin/VanillaPluginManager.java | 2 +- .../vanilla/chat/ChatFormatter.java | 3 +-- .../client/gui/widget/MetadataPanel.java | 3 +-- .../client/gui/widget/list/FilterableList.java | 3 +-- .../level/ServerPlayerMixin_Vanilla.java | 6 ++---- .../core/world/entity/EntityMixin_Vanilla.java | 3 +-- 137 files changed, 209 insertions(+), 332 deletions(-) diff --git a/src/accessors/java/org/spongepowered/common/accessor/commands/CommandSourceStackAccessor.java b/src/accessors/java/org/spongepowered/common/accessor/commands/CommandSourceStackAccessor.java index 54adce0d1f0..e5617504307 100644 --- a/src/accessors/java/org/spongepowered/common/accessor/commands/CommandSourceStackAccessor.java +++ b/src/accessors/java/org/spongepowered/common/accessor/commands/CommandSourceStackAccessor.java @@ -36,14 +36,13 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Invoker; import org.spongepowered.common.UntransformedInvokerError; import java.util.function.IntConsumer; -import javax.annotation.Nullable; - @Mixin(CommandSourceStack.class) public interface CommandSourceStackAccessor { diff --git a/src/accessors/java/org/spongepowered/common/accessor/world/entity/DisplayAccessor.java b/src/accessors/java/org/spongepowered/common/accessor/world/entity/DisplayAccessor.java index b57ccfda974..a50bf5207e4 100644 --- a/src/accessors/java/org/spongepowered/common/accessor/world/entity/DisplayAccessor.java +++ b/src/accessors/java/org/spongepowered/common/accessor/world/entity/DisplayAccessor.java @@ -28,12 +28,11 @@ import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.util.Brightness; import net.minecraft.world.entity.Display; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Invoker; import org.spongepowered.common.UntransformedInvokerError; -import javax.annotation.Nullable; - @Mixin(Display.class) public interface DisplayAccessor { diff --git a/src/accessors/java/org/spongepowered/common/accessor/world/level/block/entity/AbstractFurnaceBlockEntityAccessor.java b/src/accessors/java/org/spongepowered/common/accessor/world/level/block/entity/AbstractFurnaceBlockEntityAccessor.java index ef5e8a7e59f..6a859a96749 100644 --- a/src/accessors/java/org/spongepowered/common/accessor/world/level/block/entity/AbstractFurnaceBlockEntityAccessor.java +++ b/src/accessors/java/org/spongepowered/common/accessor/world/level/block/entity/AbstractFurnaceBlockEntityAccessor.java @@ -32,13 +32,12 @@ import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeManager; import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; import org.spongepowered.asm.mixin.gen.Invoker; import org.spongepowered.common.UntransformedInvokerError; -import javax.annotation.Nullable; - @Mixin(AbstractFurnaceBlockEntity.class) public interface AbstractFurnaceBlockEntityAccessor { diff --git a/src/main/java/org/spongepowered/common/bridge/network/chat/SpongeChatDecorator.java b/src/main/java/org/spongepowered/common/bridge/network/chat/SpongeChatDecorator.java index 42b16cc778b..4fc27bc7dfe 100644 --- a/src/main/java/org/spongepowered/common/bridge/network/chat/SpongeChatDecorator.java +++ b/src/main/java/org/spongepowered/common/bridge/network/chat/SpongeChatDecorator.java @@ -27,7 +27,7 @@ import net.minecraft.network.chat.ChatDecorator; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.event.SpongeEventFactory; import org.spongepowered.api.event.message.PlayerChatEvent; diff --git a/src/main/java/org/spongepowered/common/command/registrar/SpongeCommandRegistrarType.java b/src/main/java/org/spongepowered/common/command/registrar/SpongeCommandRegistrarType.java index 834f1417965..e0ce31c54d1 100644 --- a/src/main/java/org/spongepowered/common/command/registrar/SpongeCommandRegistrarType.java +++ b/src/main/java/org/spongepowered/common/command/registrar/SpongeCommandRegistrarType.java @@ -25,7 +25,7 @@ package org.spongepowered.common.command.registrar; import io.leangen.geantyref.TypeToken; -import org.jetbrains.annotations.NotNull; +import org.checkerframework.checker.nullness.qual.NonNull; import org.spongepowered.api.command.manager.CommandManager; import org.spongepowered.api.command.registrar.CommandRegistrar; import org.spongepowered.api.command.registrar.CommandRegistrarType; @@ -52,12 +52,12 @@ public SpongeCommandRegistrarType( } @Override - public @NotNull TypeToken handledType() { + public @NonNull TypeToken handledType() { return this.handledType; } @Override - public @NotNull CommandRegistrar create(final CommandManager.@NotNull Mutable manager) { + public @NonNull CommandRegistrar create(final CommandManager.@NonNull Mutable manager) { return this.supplier.apply(manager); } } diff --git a/src/main/java/org/spongepowered/common/data/DataSerializer.java b/src/main/java/org/spongepowered/common/data/DataSerializer.java index 4fc03a041c7..9b83d2f6b6a 100644 --- a/src/main/java/org/spongepowered/common/data/DataSerializer.java +++ b/src/main/java/org/spongepowered/common/data/DataSerializer.java @@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableList; import org.apache.commons.lang3.ArrayUtils; -import org.jetbrains.annotations.NotNull; +import org.checkerframework.checker.nullness.qual.NonNull; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.persistence.DataContainer; @@ -136,7 +136,7 @@ private static DataQuery serializeMapKey(final Object value) { throw new UnsupportedOperationException("Unsupported map-key type " + value.getClass()); } - @NotNull + @NonNull private static Object serializeArray(final DataView.SafetyMode safetyMode, final Object value) { switch (safetyMode) { case ALL_DATA_CLONED: diff --git a/src/main/java/org/spongepowered/common/data/provider/entity/AbstractRaiderData.java b/src/main/java/org/spongepowered/common/data/provider/entity/AbstractRaiderData.java index 9a1a064374f..d74354fbe9a 100644 --- a/src/main/java/org/spongepowered/common/data/provider/entity/AbstractRaiderData.java +++ b/src/main/java/org/spongepowered/common/data/provider/entity/AbstractRaiderData.java @@ -25,13 +25,12 @@ package org.spongepowered.common.data.provider.entity; import net.minecraft.world.entity.raid.Raider; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Keys; import org.spongepowered.common.accessor.world.entity.raid.RaiderAccessor; import org.spongepowered.common.bridge.world.entity.raid.RaidBridge; import org.spongepowered.common.data.provider.DataProviderRegistrator; -import javax.annotation.Nullable; - public final class AbstractRaiderData { private AbstractRaiderData() { diff --git a/src/main/java/org/spongepowered/common/data/provider/entity/DisplayEntityData.java b/src/main/java/org/spongepowered/common/data/provider/entity/DisplayEntityData.java index 23dd9d37617..4b6cf2b870c 100644 --- a/src/main/java/org/spongepowered/common/data/provider/entity/DisplayEntityData.java +++ b/src/main/java/org/spongepowered/common/data/provider/entity/DisplayEntityData.java @@ -28,6 +28,7 @@ import net.minecraft.util.Brightness; import net.minecraft.world.entity.Display; import net.minecraft.world.item.ItemDisplayContext; +import org.checkerframework.checker.nullness.qual.Nullable; import org.joml.Quaterniond; import org.joml.Vector3f; import org.spongepowered.api.block.BlockState; @@ -48,8 +49,6 @@ import java.awt.Color; -import javax.annotation.Nullable; - public class DisplayEntityData { private DisplayEntityData() { diff --git a/src/main/java/org/spongepowered/common/item/recipe/SpongeRecipeRegistration.java b/src/main/java/org/spongepowered/common/item/recipe/SpongeRecipeRegistration.java index b7fa59d71cb..918907f8601 100644 --- a/src/main/java/org/spongepowered/common/item/recipe/SpongeRecipeRegistration.java +++ b/src/main/java/org/spongepowered/common/item/recipe/SpongeRecipeRegistration.java @@ -39,7 +39,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.data.persistence.DataContainer; import org.spongepowered.api.data.persistence.DataFormats; diff --git a/src/main/java/org/spongepowered/common/item/recipe/cooking/ResultFunctionRecipe.java b/src/main/java/org/spongepowered/common/item/recipe/cooking/ResultFunctionRecipe.java index 112f0d93298..b52af04827a 100644 --- a/src/main/java/org/spongepowered/common/item/recipe/cooking/ResultFunctionRecipe.java +++ b/src/main/java/org/spongepowered/common/item/recipe/cooking/ResultFunctionRecipe.java @@ -24,7 +24,7 @@ */ package org.spongepowered.common.item.recipe.cooking; -import javax.annotation.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; public interface ResultFunctionRecipe { @Nullable String resultFunctionId(); diff --git a/src/main/java/org/spongepowered/common/item/recipe/ingredient/IngredientResultUtil.java b/src/main/java/org/spongepowered/common/item/recipe/ingredient/IngredientResultUtil.java index f5e5034468f..03e427e8f65 100644 --- a/src/main/java/org/spongepowered/common/item/recipe/ingredient/IngredientResultUtil.java +++ b/src/main/java/org/spongepowered/common/item/recipe/ingredient/IngredientResultUtil.java @@ -32,14 +32,13 @@ import net.minecraft.core.NonNullList; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.Container; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.common.SpongeCommon; import java.text.MessageFormat; import java.util.Map; import java.util.function.Function; -import javax.annotation.Nullable; - public final class IngredientResultUtil { private static final Map> cachedResultFunctions = new Object2ObjectOpenHashMap<>(); diff --git a/src/main/java/org/spongepowered/common/item/recipe/smithing/SpongeSmithingRecipe.java b/src/main/java/org/spongepowered/common/item/recipe/smithing/SpongeSmithingRecipe.java index 661fefca04e..89c9771dda0 100644 --- a/src/main/java/org/spongepowered/common/item/recipe/smithing/SpongeSmithingRecipe.java +++ b/src/main/java/org/spongepowered/common/item/recipe/smithing/SpongeSmithingRecipe.java @@ -30,7 +30,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.SmithingTransformRecipe; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.common.item.recipe.cooking.ResultFunctionRecipe; import org.spongepowered.common.item.recipe.ingredient.IngredientResultUtil; diff --git a/src/main/java/org/spongepowered/common/item/recipe/stonecutting/SpongeStonecuttingRecipe.java b/src/main/java/org/spongepowered/common/item/recipe/stonecutting/SpongeStonecuttingRecipe.java index ca83e393c53..bed676a1154 100644 --- a/src/main/java/org/spongepowered/common/item/recipe/stonecutting/SpongeStonecuttingRecipe.java +++ b/src/main/java/org/spongepowered/common/item/recipe/stonecutting/SpongeStonecuttingRecipe.java @@ -29,7 +29,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.StonecutterRecipe; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.common.item.recipe.cooking.ResultFunctionRecipe; import org.spongepowered.common.item.recipe.ingredient.IngredientResultUtil; diff --git a/src/main/java/org/spongepowered/common/resource/SpongeResourcePath.java b/src/main/java/org/spongepowered/common/resource/SpongeResourcePath.java index 937c0bac021..b464983721f 100644 --- a/src/main/java/org/spongepowered/common/resource/SpongeResourcePath.java +++ b/src/main/java/org/spongepowered/common/resource/SpongeResourcePath.java @@ -26,8 +26,8 @@ import org.apache.commons.io.FilenameUtils; import org.apache.logging.log4j.util.Strings; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.resource.ResourcePath; @@ -97,7 +97,7 @@ public String extension() { } @Override - public int compareTo(@NotNull final ResourcePath o) { + public int compareTo(@NonNull final ResourcePath o) { return this.key.compareTo(o.key()); } diff --git a/src/main/java/org/spongepowered/common/world/generation/carver/SpongeCarverTemplate.java b/src/main/java/org/spongepowered/common/world/generation/carver/SpongeCarverTemplate.java index ee32d72fba0..169dd8dfeb7 100644 --- a/src/main/java/org/spongepowered/common/world/generation/carver/SpongeCarverTemplate.java +++ b/src/main/java/org/spongepowered/common/world/generation/carver/SpongeCarverTemplate.java @@ -33,7 +33,7 @@ import net.minecraft.world.level.levelgen.carver.CarverConfiguration; import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver; import net.minecraft.world.level.levelgen.carver.WorldCarver; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.data.persistence.DataContainer; import org.spongepowered.api.data.persistence.DataFormats; diff --git a/src/main/java/org/spongepowered/common/world/schematic/SchematicTranslator.java b/src/main/java/org/spongepowered/common/world/schematic/SchematicTranslator.java index b71e6eda349..eada1999b34 100644 --- a/src/main/java/org/spongepowered/common/world/schematic/SchematicTranslator.java +++ b/src/main/java/org/spongepowered/common/world/schematic/SchematicTranslator.java @@ -32,7 +32,6 @@ import net.minecraft.util.datafix.DataFixTypes; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import org.jetbrains.annotations.NotNull; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.block.BlockState; @@ -246,7 +245,7 @@ private static Function> deserializeEnt }; } - @NotNull + @NonNull private static Consumer deserializeBlockEntities( final Vector3i offset, final SpongeArchetypeVolume archetypeVolume, final boolean needsFixers diff --git a/src/main/java/org/spongepowered/common/world/server/SpongeWorldManager.java b/src/main/java/org/spongepowered/common/world/server/SpongeWorldManager.java index 0c266bf8d65..af8a5c4b87f 100644 --- a/src/main/java/org/spongepowered/common/world/server/SpongeWorldManager.java +++ b/src/main/java/org/spongepowered/common/world/server/SpongeWorldManager.java @@ -67,7 +67,7 @@ import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.PrimaryLevelData; import net.minecraft.world.level.storage.WorldData; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Server; import org.spongepowered.api.Sponge; diff --git a/src/main/java/org/spongepowered/common/world/server/SpongeWorldTemplate.java b/src/main/java/org/spongepowered/common/world/server/SpongeWorldTemplate.java index e301c4acdfd..fc0aa426c21 100644 --- a/src/main/java/org/spongepowered/common/world/server/SpongeWorldTemplate.java +++ b/src/main/java/org/spongepowered/common/world/server/SpongeWorldTemplate.java @@ -42,8 +42,8 @@ import net.minecraft.world.level.GameType; import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.dimension.LevelStem; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import org.jetbrains.annotations.NotNull; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.data.DataHolder; import org.spongepowered.api.data.DataManipulator; @@ -287,7 +287,7 @@ protected WorldTemplate build0() { return new SpongeWorldTemplate(this.key, levelStem, this.pack); } - @NotNull + @NonNull private static Holder dimensionTypeHolder(final WorldType worldType) { final Registry dimensionTypeRegistry = SpongeCommon.server().registryAccess().registryOrThrow(Registries.DIMENSION_TYPE); final ResourceLocation key = dimensionTypeRegistry.getKey((DimensionType) (Object) worldType); diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/item/merchant/MerchantMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/item/merchant/MerchantMixin_API.java index b5c4cdfc786..ec599414691 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/item/merchant/MerchantMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/item/merchant/MerchantMixin_API.java @@ -28,6 +28,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.trading.MerchantOffer; import net.minecraft.world.item.trading.MerchantOffers; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Keys; import org.spongepowered.api.entity.living.Humanoid; import org.spongepowered.api.item.merchant.Merchant; @@ -38,8 +39,6 @@ import java.util.Collections; -import javax.annotation.Nullable; - @Mixin(value = Merchant.class) @Implements(@Interface(iface = net.minecraft.world.item.trading.Merchant.class, prefix = "imerchant$")) public interface MerchantMixin_API extends Merchant { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/advancements/CriterionProgressMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/advancements/CriterionProgressMixin_API.java index 6c93e3987f9..134a08854fc 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/advancements/CriterionProgressMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/advancements/CriterionProgressMixin_API.java @@ -28,6 +28,7 @@ import net.minecraft.advancements.AdvancementHolder; import net.minecraft.advancements.CriterionProgress; import net.minecraft.resources.ResourceLocation; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.advancement.AdvancementProgress; import org.spongepowered.api.advancement.criteria.AdvancementCriterion; import org.spongepowered.asm.mixin.Mixin; @@ -38,8 +39,6 @@ import java.time.Instant; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(CriterionProgress.class) public abstract class CriterionProgressMixin_API implements org.spongepowered.api.advancement.criteria.CriterionProgress { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/advancements/FrameTypeMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/advancements/FrameTypeMixin_API.java index 3e71da2dc96..79cd3835bff 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/advancements/FrameTypeMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/advancements/FrameTypeMixin_API.java @@ -27,6 +27,7 @@ import net.kyori.adventure.text.format.TextColor; import net.minecraft.ChatFormatting; import net.minecraft.advancements.FrameType; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.advancement.AdvancementType; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -34,8 +35,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.common.adventure.SpongeAdventure; -import javax.annotation.Nullable; - @Mixin(FrameType.class) public abstract class FrameTypeMixin_API implements AdvancementType { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/MinecraftMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/MinecraftMixin_API.java index 957f066152b..c0300eacaab 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/MinecraftMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/MinecraftMixin_API.java @@ -29,6 +29,7 @@ import net.minecraft.client.server.IntegratedServer; import net.minecraft.network.Connection; import net.minecraft.server.packs.repository.PackRepository; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.Game; import org.spongepowered.api.Sponge; import org.spongepowered.api.client.LocalServer; @@ -51,8 +52,6 @@ import java.util.Locale; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(Minecraft.class) public abstract class MinecraftMixin_API implements SpongeClient, SpongeRegistryHolder { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/core/MappedRegistryMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/core/MappedRegistryMixin_API.java index ea0a4aed5c6..9dc16501b4d 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/core/MappedRegistryMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/core/MappedRegistryMixin_API.java @@ -30,6 +30,7 @@ import net.minecraft.core.MappedRegistry; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.registry.Registry; import org.spongepowered.api.registry.RegistryEntry; @@ -50,8 +51,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nullable; - @Mixin(MappedRegistry.class) @Implements(@Interface(iface = Registry.class, prefix = "registry$", remap = Interface.Remap.NONE)) public abstract class MappedRegistryMixin_API implements Registry { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/map/MapDecorationMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/map/MapDecorationMixin_API.java index b08c33edb4c..d9a3e0f1fd1 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/map/MapDecorationMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/map/MapDecorationMixin_API.java @@ -27,6 +27,7 @@ import com.google.common.base.Preconditions; import net.minecraft.network.chat.Component; import net.minecraft.world.level.saveddata.maps.MapDecoration; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.persistence.DataContainer; import org.spongepowered.api.map.decoration.MapDecorationType; import org.spongepowered.api.map.decoration.orientation.MapDecorationOrientation; @@ -40,8 +41,6 @@ import org.spongepowered.common.util.MapUtil; import org.spongepowered.math.vector.Vector2i; -import javax.annotation.Nullable; - @Mixin(MapDecoration.class) public abstract class MapDecorationMixin_API implements org.spongepowered.api.map.decoration.MapDecoration { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/network/FriendlyByteBufMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/network/FriendlyByteBufMixin_API.java index e8ffbb8b673..2dd2487141e 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/network/FriendlyByteBufMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/network/FriendlyByteBufMixin_API.java @@ -33,6 +33,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.network.FriendlyByteBuf; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.persistence.DataView; import org.spongepowered.api.network.channel.ChannelBuf; import org.spongepowered.asm.mixin.Implements; @@ -48,8 +49,6 @@ import java.io.IOException; import java.util.UUID; -import javax.annotation.Nullable; - @Mixin(FriendlyByteBuf.class) @Implements(@Interface(iface = ChannelBuf.class, prefix = "cbuf$", remap = Remap.NONE)) public abstract class FriendlyByteBufMixin_API extends ByteBuf { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/network/chat/ChatTypeMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/network/chat/ChatTypeMixin_API.java index ac9bbc58cf0..c411a991455 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/network/chat/ChatTypeMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/network/chat/ChatTypeMixin_API.java @@ -29,8 +29,8 @@ import net.minecraft.network.chat.ChatType; import net.minecraft.network.chat.ChatTypeDecoration; import net.minecraft.network.chat.Component; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -49,7 +49,7 @@ public abstract class ChatTypeMixin_API implements org.spongepowered.api.adventu @Shadow public abstract ChatType.Bound bind(final Component $$0); @Override - public @NotNull Bound bind(@NotNull final ComponentLike name, @Nullable final ComponentLike target) { + public @NonNull Bound bind(@NonNull final ComponentLike name, @Nullable final ComponentLike target) { ChatType.Bound ret = this.bind(SpongeAdventure.asVanilla(name.asComponent())); if (target != null) { ret = ret.withTargetName(SpongeAdventure.asVanilla(target.asComponent())); @@ -77,12 +77,12 @@ public static abstract class BoundMixin_API implements net.kyori.adventure.chat. // @formatter:on @Override - public net.kyori.adventure.chat.@NotNull ChatType type() { + public net.kyori.adventure.chat.@NonNull ChatType type() { return (net.kyori.adventure.chat.ChatType) (Object) this.shadow$chatType(); } @Override - public net.kyori.adventure.text.@NotNull Component name() { + public net.kyori.adventure.text.@NonNull Component name() { return SpongeAdventure.asAdventure(this.shadow$name()); } diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/level/ServerLevelMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/level/ServerLevelMixin_API.java index d12eccf0260..cde40bb5ee6 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/level/ServerLevelMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/level/ServerLevelMixin_API.java @@ -46,7 +46,8 @@ import net.minecraft.world.level.storage.ServerLevelData; import net.minecraft.world.ticks.LevelTicks; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; -import org.jetbrains.annotations.NotNull; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Server; import org.spongepowered.api.block.BlockSnapshot; @@ -100,9 +101,6 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - @SuppressWarnings({"unchecked", "rawtypes"}) @Mixin(ServerLevel.class) public abstract class ServerLevelMixin_API extends LevelMixin_API implements @@ -117,7 +115,7 @@ public abstract class ServerLevelMixin_API extends LevelMixin_API shadow$players(); @Shadow public abstract Raids shadow$getRaids(); @@ -142,7 +140,7 @@ public boolean isLoaded() { // Pointered (via Audience) @Override - public @NotNull Pointers pointers() { + public @NonNull Pointers pointers() { if (this.api$pointers == null) { return this.api$pointers = Pointers.builder() .withDynamic(Identity.UUID, this::uniqueId) diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/level/ServerPlayerMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/level/ServerPlayerMixin_API.java index ab652500583..f4c35cc7886 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/level/ServerPlayerMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/level/ServerPlayerMixin_API.java @@ -68,7 +68,7 @@ import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.phys.Vec3; import org.checkerframework.checker.nullness.qual.NonNull; -import org.jetbrains.annotations.NotNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.advancement.AdvancementProgress; import org.spongepowered.api.advancement.AdvancementTemplate; import org.spongepowered.api.advancement.AdvancementTree; @@ -130,8 +130,6 @@ import java.util.Optional; import java.util.Set; -import javax.annotation.Nullable; - @Mixin(net.minecraft.server.level.ServerPlayer.class) public abstract class ServerPlayerMixin_API extends PlayerMixin_API implements ServerPlayer { @@ -418,7 +416,7 @@ public Optional setWorldBorder(final @Nullable WorldBorder border) // Audience @Override - public @NotNull Pointers pointers() { + public @NonNull Pointers pointers() { Pointers pointers = this.api$pointers; if (pointers == null) { synchronized (this) { @@ -450,7 +448,7 @@ public void sendMessage(final Identity identity, final Component message, final } @Override - public void sendMessage(final @NotNull Component message) { + public void sendMessage(final @NonNull Component message) { if (this.impl$isFake) { return; } @@ -458,7 +456,7 @@ public void sendMessage(final @NotNull Component message) { } @Override - public void sendMessage(final @NotNull Component message, final net.kyori.adventure.chat.ChatType.@NotNull Bound boundChatType) { + public void sendMessage(final @NonNull Component message, final net.kyori.adventure.chat.ChatType.@NonNull Bound boundChatType) { if (this.impl$isFake) { return; } @@ -466,7 +464,7 @@ public void sendMessage(final @NotNull Component message, final net.kyori.advent } @Override - public void sendMessage(final @NotNull SignedMessage signedMessage, final net.kyori.adventure.chat.ChatType.@NotNull Bound boundChatType) { + public void sendMessage(final @NonNull SignedMessage signedMessage, final net.kyori.adventure.chat.ChatType.@NonNull Bound boundChatType) { if (this.impl$isFake) { return; } @@ -478,7 +476,7 @@ public void sendMessage(final @NotNull SignedMessage signedMessage, final net.ky } @Override - public void deleteMessage(final SignedMessage.@NotNull Signature signature) { + public void deleteMessage(final SignedMessage.@NonNull Signature signature) { if (this.impl$isFake) { return; } @@ -527,7 +525,7 @@ public void showTitle(final Title title) { } @Override - public void sendTitlePart(final @NotNull TitlePart part, final @NotNull T value) { + public void sendTitlePart(final @NonNull TitlePart part, final @NonNull T value) { if (this.impl$isFake) { return; } @@ -593,7 +591,7 @@ public void playSound(final Sound sound) { } @Override - public void playSound(final @NonNull Sound sound, final Sound.@NotNull Emitter emitter) { + public void playSound(final @NonNull Sound sound, final Sound.@NonNull Emitter emitter) { Objects.requireNonNull(sound, "sound"); Objects.requireNonNull(emitter, "emitter"); if (this.impl$isFake) { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/players/GameProfileCacheMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/players/GameProfileCacheMixin_API.java index 09a49941865..e6d3552b6ad 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/players/GameProfileCacheMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/players/GameProfileCacheMixin_API.java @@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.profile.GameProfile; import org.spongepowered.api.profile.GameProfileCache; import org.spongepowered.asm.mixin.Final; @@ -49,8 +50,6 @@ import java.util.function.Predicate; import java.util.stream.Stream; -import javax.annotation.Nullable; - @Mixin(net.minecraft.server.players.GameProfileCache.class) public abstract class GameProfileCacheMixin_API implements GameProfileCache { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/rcon/RconConsoleSourceMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/rcon/RconConsoleSourceMixin_API.java index 2709611afec..9701717736e 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/rcon/RconConsoleSourceMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/server/rcon/RconConsoleSourceMixin_API.java @@ -30,7 +30,6 @@ import net.kyori.adventure.text.Component; import net.minecraft.server.rcon.RconConsoleSource; import org.checkerframework.checker.nullness.qual.NonNull; -import org.jetbrains.annotations.NotNull; import org.spongepowered.api.network.RconConnection; import org.spongepowered.api.network.RemoteConnection; import org.spongepowered.asm.mixin.Mixin; @@ -92,7 +91,7 @@ public void sendMessage(final @NonNull Identity identity, final @NonNull Compone } @Override - public @NotNull Pointers pointers() { + public @NonNull Pointers pointers() { return RconConsoleSourceMixin_API.API$POINTERS; } } diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/damagesource/DamageSourceMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/damagesource/DamageSourceMixin_API.java index de599fc2180..151459ff6dc 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/damagesource/DamageSourceMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/damagesource/DamageSourceMixin_API.java @@ -26,6 +26,7 @@ import net.minecraft.core.Holder; import net.minecraft.world.phys.Vec3; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.event.cause.entity.damage.DamageType; @@ -40,15 +41,13 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(value = net.minecraft.world.damagesource.DamageSource.class) public abstract class DamageSourceMixin_API implements DamageSource { // @formatter:off - @Shadow @Final @Nullable private net.minecraft.world.entity.Entity directEntity; + @Shadow @Final private net.minecraft.world.entity.@Nullable Entity directEntity; - @Shadow @Final @Nullable private net.minecraft.world.entity.Entity causingEntity; + @Shadow @Final private net.minecraft.world.entity.@Nullable Entity causingEntity; @Shadow @Final private Holder type; @Shadow @Final @Nullable private Vec3 damageSourcePosition; // @formatter:on diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/entity/EntityMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/entity/EntityMixin_API.java index 707f37af96b..a7de7fc4ea1 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/entity/EntityMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/entity/EntityMixin_API.java @@ -40,6 +40,7 @@ import net.minecraft.world.entity.RelativeMovement; import net.minecraft.world.level.entity.EntityInLevelCallback; import net.minecraft.world.phys.Vec3; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Keys; import org.spongepowered.api.data.persistence.DataContainer; import org.spongepowered.api.data.persistence.Queries; @@ -77,8 +78,6 @@ import java.util.UUID; import java.util.function.UnaryOperator; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.entity.Entity.class) @Implements(@Interface(iface = org.spongepowered.api.entity.Entity.class, prefix = "entity$", remap = Remap.NONE)) public abstract class EntityMixin_API implements org.spongepowered.api.entity.Entity { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/entity/npc/VillagerTrades_ItemListingMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/entity/npc/VillagerTrades_ItemListingMixin_API.java index 7c7cb33ccaf..9bbed6e93d7 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/entity/npc/VillagerTrades_ItemListingMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/entity/npc/VillagerTrades_ItemListingMixin_API.java @@ -28,14 +28,13 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.npc.VillagerTrades; import net.minecraft.world.item.trading.MerchantOffer; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.item.merchant.TradeOffer; import org.spongepowered.api.item.merchant.TradeOfferGenerator; import org.spongepowered.api.util.RandomProvider; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import javax.annotation.Nullable; - @Mixin(VillagerTrades.ItemListing.class) public interface VillagerTrades_ItemListingMixin_API extends TradeOfferGenerator { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemMixin_API.java index 9cd3aab1100..d06bfa664e2 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemMixin_API.java @@ -29,6 +29,7 @@ import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraft.world.item.Rarity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.block.BlockType; import org.spongepowered.api.item.ItemRarity; import org.spongepowered.api.item.ItemType; @@ -46,8 +47,6 @@ import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.annotation.Nullable; - @Mixin(Item.class) public abstract class ItemMixin_API implements ItemType, SpongeImmutableDataHolder { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemStackMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemStackMixin_API.java index c391855af6a..47376fba877 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemStackMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/ItemStackMixin_API.java @@ -36,8 +36,8 @@ import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.item.Item; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.data.SerializableDataHolder; @@ -222,7 +222,7 @@ public Component asComponent() { } @Override - public @NotNull HoverEvent asHoverEvent(@NotNull final UnaryOperator op) { + public @NonNull HoverEvent asHoverEvent(@NonNull final UnaryOperator op) { final HoverEvent.ShowItem event = HoverEvent.ShowItem.of( SpongeAdventure.asAdventure(SpongeCommon.vanillaRegistry(Registries.ITEM).getKey(this.shadow$getItem())), this.shadow$getCount(), diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/crafting/IngredientMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/crafting/IngredientMixin_API.java index 4e292a6f3eb..b9b54a45b56 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/crafting/IngredientMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/crafting/IngredientMixin_API.java @@ -26,6 +26,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Implements; import org.spongepowered.asm.mixin.Interface; import org.spongepowered.asm.mixin.Interface.Remap; @@ -37,8 +38,6 @@ import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nullable; - @Mixin(Ingredient.class) @Implements(@Interface(iface = org.spongepowered.api.item.recipe.crafting.Ingredient.class, prefix = "ingredient$", remap = Remap.NONE)) public abstract class IngredientMixin_API { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/crafting/RecipeMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/crafting/RecipeMixin_API.java index fabc102ccd5..25636748add 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/crafting/RecipeMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/crafting/RecipeMixin_API.java @@ -30,6 +30,7 @@ import net.minecraft.core.RegistryAccess; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; +import org.checkerframework.checker.nullness.qual.NonNull; import org.spongepowered.api.item.inventory.Inventory; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.item.recipe.Recipe; @@ -45,8 +46,6 @@ import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; - @Mixin(net.minecraft.world.item.crafting.Recipe.class) public interface RecipeMixin_API extends Recipe { @@ -60,26 +59,26 @@ public interface RecipeMixin_API extends Recipe { @Shadow NonNullList shadow$getIngredients(); // @formatter:on - @Nonnull + @NonNull @Override default ItemStackSnapshot exemplaryResult() { return ItemStackUtil.snapshotOf(this.shadow$getResultItem(SpongeCommon.server().registryAccess())); } @Override - default boolean isValid(@Nonnull final Inventory inv, @Nonnull final ServerWorld world) { + default boolean isValid(@NonNull final Inventory inv, @NonNull final ServerWorld world) { return this.shadow$matches(toNativeInventory(inv), (net.minecraft.world.level.Level) world); } - @Nonnull + @NonNull @Override - default ItemStackSnapshot result(@Nonnull final Inventory inv) { + default ItemStackSnapshot result(@NonNull final Inventory inv) { return ItemStackUtil.snapshotOf(this.shadow$assemble(toNativeInventory(inv), SpongeCommon.server().registryAccess())); } - @Nonnull + @NonNull @Override - default List remainingItems(@Nonnull final Inventory inv) { + default List remainingItems(@NonNull final Inventory inv) { return this.shadow$getRemainingItems(toNativeInventory(inv)).stream() .map(ItemStackUtil::snapshotOf) .collect(Collectors.toList()); diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/trading/MerchantOfferMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/trading/MerchantOfferMixin_API.java index d76aa0e4d6e..b3b25f14fb4 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/trading/MerchantOfferMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/item/trading/MerchantOfferMixin_API.java @@ -25,6 +25,7 @@ package org.spongepowered.common.mixin.api.minecraft.world.item.trading; import net.minecraft.world.item.trading.MerchantOffer; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.persistence.DataContainer; import org.spongepowered.api.data.persistence.Queries; import org.spongepowered.api.item.inventory.ItemStack; @@ -36,14 +37,12 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(MerchantOffer.class) public abstract class MerchantOfferMixin_API implements TradeOffer { // @formatter:off @Shadow public abstract net.minecraft.world.item.ItemStack shadow$getCostA(); - @Shadow @Nullable public abstract net.minecraft.world.item.ItemStack shadow$getCostB(); + @Shadow public abstract net.minecraft.world.item.@Nullable ItemStack shadow$getCostB(); @Shadow public abstract net.minecraft.world.item.ItemStack shadow$getResult(); @Shadow public abstract int shadow$getUses(); @Shadow public abstract int shadow$getMaxUses(); diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/BlockGetterMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/BlockGetterMixin_API.java index c901e45e791..c0aa643a6db 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/BlockGetterMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/BlockGetterMixin_API.java @@ -28,6 +28,7 @@ import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.LevelHeightAccessor; import net.minecraft.world.level.block.state.BlockState; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.block.entity.BlockEntity; import org.spongepowered.api.fluid.FluidState; import org.spongepowered.api.world.volume.game.PrimitiveGameVolume; @@ -41,14 +42,12 @@ import java.util.Collections; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(BlockGetter.class) @Implements(@Interface(iface = PrimitiveGameVolume.class, prefix = "primitive$")) public interface BlockGetterMixin_API extends PrimitiveGameVolume { //@formatter:off - @Shadow @Nullable net.minecraft.world.level.block.entity.BlockEntity shadow$getBlockEntity(BlockPos p_175625_1_); + @Shadow net.minecraft.world.level.block.entity.@Nullable BlockEntity shadow$getBlockEntity(BlockPos p_175625_1_); @Shadow BlockState shadow$getBlockState(BlockPos p_180495_1_); @Shadow net.minecraft.world.level.material.FluidState shadow$getFluidState(BlockPos p_204610_1_); @Shadow int shadow$getLightEmission(BlockPos p_217298_1_); diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/EntityGetterMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/EntityGetterMixin_API.java index 240d58b2dd0..af6f0a283cc 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/EntityGetterMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/EntityGetterMixin_API.java @@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableList; import net.minecraft.world.level.EntityGetter; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.util.AABB; @@ -43,16 +44,14 @@ import java.util.UUID; import java.util.function.Predicate; -import javax.annotation.Nullable; - @Mixin(EntityGetter.class) public interface EntityGetterMixin_API extends EntityVolume { //@formatter:off - @Shadow List shadow$getEntities(@Nullable net.minecraft.world.entity.Entity p_175674_1_, net.minecraft.world.phys.AABB p_175674_2_, @Nullable Predicate p_175674_3_); + @Shadow List shadow$getEntities(net.minecraft.world.entity.@Nullable Entity p_175674_1_, net.minecraft.world.phys.AABB p_175674_2_, @Nullable Predicate p_175674_3_); @Shadow List shadow$getEntitiesOfClass(Class p_175647_1_, net.minecraft.world.phys.AABB p_175647_2_, @Nullable Predicate p_175647_3_); @Shadow List shadow$players(); - @Shadow List shadow$getEntities(@Nullable net.minecraft.world.entity.Entity param0, net.minecraft.world.phys.AABB param1); + @Shadow List shadow$getEntities(net.minecraft.world.entity.@Nullable Entity param0, net.minecraft.world.phys.AABB param1); //@formatter:on @Override diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/ExplosionMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/ExplosionMixin_API.java index 40bbb018e64..480737ccfea 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/ExplosionMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/ExplosionMixin_API.java @@ -25,6 +25,7 @@ package org.spongepowered.common.mixin.api.minecraft.world.level; import net.minecraft.world.entity.Entity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.explosive.Explosive; import org.spongepowered.api.world.explosion.Explosion; import org.spongepowered.api.world.server.ServerLocation; @@ -36,8 +37,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.level.Explosion.class) public abstract class ExplosionMixin_API implements Explosion { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/LevelMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/LevelMixin_API.java index a9744afe156..8da236b99c5 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/LevelMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/LevelMixin_API.java @@ -121,20 +121,20 @@ public abstract class LevelMixin_API, L extends Location shadow$dimension(); @Shadow public abstract void shadow$setBlockEntity(net.minecraft.world.level.block.entity.BlockEntity var1); @Shadow public abstract LevelChunk shadow$getChunkAt(BlockPos param0); @Shadow public abstract List shadow$getEntities( - @org.jetbrains.annotations.Nullable net.minecraft.world.entity.Entity param0, + net.minecraft.world.entity.@Nullable Entity param0, net.minecraft.world.phys.AABB param1, - @org.jetbrains.annotations.Nullable Predicate param2); + @Nullable Predicate param2); @Shadow public abstract List shadow$getEntities( EntityTypeTest entityTypeTest, net.minecraft.world.phys.AABB param1, - @org.jetbrains.annotations.Nullable Predicate param2); + @Nullable Predicate param2); @Shadow public abstract ResourceKey dimension(); // @formatter:on @@ -414,7 +414,7 @@ public ArchetypeVolume createArchetypeVolume(final Vector3i min, final Vector3i return volume; } - private void api$playRecord(final Vector3i position, @javax.annotation.Nullable final MusicDisc recordType) { + private void api$playRecord(final Vector3i position, @Nullable final MusicDisc recordType) { this.shadow$getServer().getPlayerList().broadcastAll(SpongeMusicDisc.createPacket(position, recordType), this.shadow$dimension()); } diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/CheckerboardColumnBiomeSourceMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/CheckerboardColumnBiomeSourceMixin_API.java index 941c0344d4c..a5341aefecb 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/CheckerboardColumnBiomeSourceMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/CheckerboardColumnBiomeSourceMixin_API.java @@ -29,6 +29,7 @@ import net.minecraft.core.registries.Registries; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.CheckerboardColumnBiomeSource; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.registry.RegistryTypes; import org.spongepowered.api.world.biome.provider.CheckerboardBiomeConfig; @@ -40,8 +41,6 @@ import java.util.stream.Collectors; -import javax.annotation.Nullable; - @Mixin(CheckerboardColumnBiomeSource.class) public abstract class CheckerboardColumnBiomeSourceMixin_API extends BiomeSourceMixin_API implements ConfigurableBiomeProvider { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/MultiNoiseBiomeSourceMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/MultiNoiseBiomeSourceMixin_API.java index b5d2db7e0c9..34612ba01a0 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/MultiNoiseBiomeSourceMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/MultiNoiseBiomeSourceMixin_API.java @@ -30,6 +30,7 @@ import net.minecraft.world.level.biome.Climate; import net.minecraft.world.level.biome.MultiNoiseBiomeSource; import net.minecraft.world.level.biome.MultiNoiseBiomeSourceParameterList; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.world.biome.provider.ConfigurableBiomeProvider; import org.spongepowered.api.world.biome.provider.MultiNoiseBiomeConfig; import org.spongepowered.asm.mixin.Final; @@ -37,8 +38,6 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.common.world.biome.provider.SpongeMultiNoiseBiomeConfig; -import javax.annotation.Nullable; - @Mixin(MultiNoiseBiomeSource.class) public abstract class MultiNoiseBiomeSourceMixin_API extends BiomeSourceMixin_API implements ConfigurableBiomeProvider { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/TheEndBiomeSourceMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/TheEndBiomeSourceMixin_API.java index 019e7d9b3c4..c4fd1fd24c9 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/TheEndBiomeSourceMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/biome/TheEndBiomeSourceMixin_API.java @@ -28,6 +28,7 @@ import net.minecraft.core.registries.Registries; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.TheEndBiomeSource; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.registry.RegistryTypes; import org.spongepowered.api.world.biome.provider.ConfigurableBiomeProvider; @@ -37,8 +38,6 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.common.SpongeCommon; -import javax.annotation.Nullable; - @Mixin(TheEndBiomeSource.class) public abstract class TheEndBiomeSourceMixin_API extends BiomeSourceMixin_API implements ConfigurableBiomeProvider { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BaseContainerBlockEntityMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BaseContainerBlockEntityMixin_API.java index be8f7bf6b2e..77b33cdf5db 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BaseContainerBlockEntityMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BaseContainerBlockEntityMixin_API.java @@ -30,6 +30,7 @@ import net.minecraft.world.LockCode; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.block.entity.carrier.NameableCarrierBlockEntity; import org.spongepowered.api.data.persistence.DataContainer; import org.spongepowered.api.data.persistence.DataView; @@ -43,8 +44,6 @@ import java.util.List; import java.util.Set; -import javax.annotation.Nullable; - @Mixin(BaseContainerBlockEntity.class) public abstract class BaseContainerBlockEntityMixin_API extends BlockEntityMixin_API implements NameableCarrierBlockEntity { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BeaconBlockEntityMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BeaconBlockEntityMixin_API.java index 64e95624a98..5123d406798 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BeaconBlockEntityMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BeaconBlockEntityMixin_API.java @@ -27,6 +27,7 @@ import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.level.block.entity.BeaconBlockEntity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.block.entity.carrier.Beacon; import org.spongepowered.api.data.persistence.DataContainer; import org.spongepowered.api.data.value.Value; @@ -36,8 +37,6 @@ import java.util.Set; -import javax.annotation.Nullable; - @Mixin(BeaconBlockEntity.class) public abstract class BeaconBlockEntityMixin_API extends BlockEntityMixin_API implements Beacon { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BlockEntityMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BlockEntityMixin_API.java index cbb126d8436..3e26a137d77 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BlockEntityMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BlockEntityMixin_API.java @@ -27,6 +27,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.block.BlockState; import org.spongepowered.api.block.entity.BlockEntity; @@ -54,8 +55,6 @@ import java.util.HashSet; import java.util.Set; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.level.block.entity.BlockEntity.class) public abstract class BlockEntityMixin_API implements BlockEntity { diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/ProtoChunkMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/ProtoChunkMixin_API.java index 47d4c47da38..3a7654e4f78 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/ProtoChunkMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/chunk/ProtoChunkMixin_API.java @@ -64,7 +64,7 @@ public abstract class ProtoChunkMixin_API extends ChunkAccess implements GenerationChunk, SpongeServerLocationBaseDataHolder { //@formatter:off - @Shadow @javax.annotation.Nullable private BelowZeroRetrogen belowZeroRetrogen; + @Shadow @Nullable private BelowZeroRetrogen belowZeroRetrogen; @Shadow public abstract Map shadow$getBlockEntities(); @Shadow public abstract void shadow$setBlockEntity(final net.minecraft.world.level.block.entity.BlockEntity param1); @Shadow public abstract void shadow$removeBlockEntity(final BlockPos param0); diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/levelgen/structure/pools/StructurePoolElementMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/levelgen/structure/pools/StructurePoolElementMixin_API.java index ed2f3875719..1c277ea0257 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/levelgen/structure/pools/StructurePoolElementMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/levelgen/structure/pools/StructurePoolElementMixin_API.java @@ -35,6 +35,7 @@ import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement; import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.world.generation.structure.jigsaw.JigsawPoolElement; import org.spongepowered.api.world.server.ServerLocation; import org.spongepowered.asm.mixin.Mixin; @@ -42,13 +43,11 @@ import org.spongepowered.common.SpongeCommon; import org.spongepowered.common.util.VecHelper; -import javax.annotation.Nullable; - @Mixin(StructurePoolElement.class) public abstract class StructurePoolElementMixin_API implements JigsawPoolElement { // @formatter:off - @Shadow @Nullable private volatile StructureTemplatePool.Projection projection; + @Shadow private volatile StructureTemplatePool.@Nullable Projection projection; @Shadow public abstract boolean shadow$place(final StructureTemplateManager var1, final WorldGenLevel var2, final StructureManager var3, diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/saveddata/MapItemSavedDataMixin.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/saveddata/MapItemSavedDataMixin.java index cec6eebd0a4..27b61304fa7 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/saveddata/MapItemSavedDataMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/saveddata/MapItemSavedDataMixin.java @@ -29,6 +29,8 @@ import net.minecraft.world.level.saveddata.SavedData; import net.minecraft.world.level.saveddata.maps.MapDecoration; import net.minecraft.world.level.saveddata.maps.MapItemSavedData; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.Keys; import org.spongepowered.api.map.MapInfo; @@ -50,9 +52,6 @@ import java.util.UUID; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - @Mixin(MapItemSavedData.class) public abstract class MapItemSavedDataMixin extends SavedData implements MapItemSavedDataBridge, DataCompoundHolder { /* @@ -126,7 +125,7 @@ public abstract class MapItemSavedDataMixin extends SavedData implements MapItem this.impl$mapId = mapId; } - @Nonnull + @NonNull @Override public UUID bridge$getUniqueId() { return this.impl$uuid; diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/storage/ServerLevelDataMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/storage/ServerLevelDataMixin_API.java index 57dab155849..73179bbfe81 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/storage/ServerLevelDataMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/storage/ServerLevelDataMixin_API.java @@ -51,7 +51,7 @@ public interface ServerLevelDataMixin_API extends ServerWorldProperties { @Shadow int shadow$getWanderingTraderSpawnChance(); @Shadow void shadow$setWanderingTraderSpawnChance(int p_230397_1_); @Shadow void shadow$setWanderingTraderId(UUID p_230394_1_); - @Shadow @javax.annotation.Nullable UUID shadow$getWanderingTraderId(); + @Shadow @Nullable UUID shadow$getWanderingTraderId(); @Shadow void shadow$setDayTime(long p_76068_1_); // @formatter:on diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/scores/PlayerTeamMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/scores/PlayerTeamMixin_API.java index bca3e939527..e5cd023b341 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/scores/PlayerTeamMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/scores/PlayerTeamMixin_API.java @@ -29,6 +29,7 @@ import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.minecraft.world.scores.PlayerTeam; import net.minecraft.world.scores.Scoreboard; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.scoreboard.Team; import org.spongepowered.api.scoreboard.Visibility; import org.spongepowered.asm.mixin.Final; @@ -46,8 +47,6 @@ import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; - @Mixin(PlayerTeam.class) @Implements(@Interface(iface = Team.class, prefix = "team$", remap = Remap.NONE)) public abstract class PlayerTeamMixin_API implements Team { diff --git a/src/mixins/java/org/spongepowered/common/mixin/bugfix/world/level/block/entity/RandomizableContainerBlockEntityMixin_BugFix.java b/src/mixins/java/org/spongepowered/common/mixin/bugfix/world/level/block/entity/RandomizableContainerBlockEntityMixin_BugFix.java index 34c249ad83e..f408882cbf0 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/bugfix/world/level/block/entity/RandomizableContainerBlockEntityMixin_BugFix.java +++ b/src/mixins/java/org/spongepowered/common/mixin/bugfix/world/level/block/entity/RandomizableContainerBlockEntityMixin_BugFix.java @@ -26,14 +26,13 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import javax.annotation.Nullable; - @Mixin(RandomizableContainerBlockEntity.class) public abstract class RandomizableContainerBlockEntityMixin_BugFix { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/advancements/AdvancementProgressMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/advancements/AdvancementProgressMixin.java index d40b8713c52..8492830ecb3 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/advancements/AdvancementProgressMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/advancements/AdvancementProgressMixin.java @@ -31,6 +31,7 @@ import net.minecraft.advancements.AdvancementRequirements; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.PlayerAdvancements; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.advancement.Advancement; import org.spongepowered.api.advancement.criteria.AdvancementCriterion; @@ -71,8 +72,6 @@ import java.util.Objects; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(AdvancementProgress.class) public abstract class AdvancementProgressMixin implements AdvancementProgressBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/advancements/CriterionProgressMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/advancements/CriterionProgressMixin.java index f6ff258586c..cc6958a4b54 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/advancements/CriterionProgressMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/advancements/CriterionProgressMixin.java @@ -25,6 +25,7 @@ package org.spongepowered.common.mixin.core.advancements; import net.minecraft.advancements.CriterionProgress; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.advancement.criteria.AdvancementCriterion; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -34,8 +35,6 @@ import org.spongepowered.common.bridge.advancements.AdvancementProgressBridge; import org.spongepowered.common.bridge.advancements.CriterionProgressBridge; -import javax.annotation.Nullable; - @Mixin(CriterionProgress.class) public abstract class CriterionProgressMixin implements CriterionProgressBridge, ImplementationBackedCriterionProgress { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/adventure/chat/SignedMessageMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/adventure/chat/SignedMessageMixin.java index 276aef23bec..b7238d4a311 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/adventure/chat/SignedMessageMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/adventure/chat/SignedMessageMixin.java @@ -26,7 +26,7 @@ import net.kyori.adventure.chat.SignedMessage; import net.minecraft.network.chat.MessageSignature; -import org.jetbrains.annotations.NotNull; +import org.checkerframework.checker.nullness.qual.NonNull; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -38,7 +38,7 @@ public interface SignedMessageMixin { * @reason make adventure methods produce native implementations */ @Overwrite - static SignedMessage.@NotNull Signature signature(final byte[] bytes) { + static SignedMessage.@NonNull Signature signature(final byte[] bytes) { return (SignedMessage.Signature) (Object) new MessageSignature(bytes); } diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/block/DyeColorBlockPropertiesMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/block/DyeColorBlockPropertiesMixin.java index 97c2ba0cdb0..c3468ffc2fc 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/block/DyeColorBlockPropertiesMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/block/DyeColorBlockPropertiesMixin.java @@ -25,14 +25,13 @@ package org.spongepowered.common.mixin.core.block; import net.minecraft.world.level.block.Block; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.type.DyeColor; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.common.bridge.block.DyeColorBlockBridge; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(value = { Block.Properties.class, Block.class diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/client/MinecraftMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/client/MinecraftMixin.java index 786ec2f0832..d3e4607ec40 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/client/MinecraftMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/client/MinecraftMixin.java @@ -29,6 +29,7 @@ import net.minecraft.client.main.GameConfig; import net.minecraft.client.server.IntegratedServer; import net.minecraft.util.thread.ReentrantBlockableEventLoop; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -44,8 +45,6 @@ import org.spongepowered.common.launch.Launch; import org.spongepowered.common.launch.Lifecycle; -import javax.annotation.Nullable; - @Mixin(Minecraft.class) public abstract class MinecraftMixin extends ReentrantBlockableEventLoop implements MinecraftBridge, SpongeClient { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/nbt/CompoundTagMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/nbt/CompoundTagMixin.java index c2a621b2574..5edc7f26754 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/nbt/CompoundTagMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/nbt/CompoundTagMixin.java @@ -27,6 +27,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import org.apache.logging.log4j.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -37,8 +38,6 @@ import java.util.Map; -import javax.annotation.Nullable; - /** * @author Zidane - Minecraft 1.14.4 * diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/network/ConnectionMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/network/ConnectionMixin.java index bc003c24de2..572625736ae 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/network/ConnectionMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/network/ConnectionMixin.java @@ -34,6 +34,7 @@ import net.minecraft.network.PacketSendListener; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.Packet; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.api.MinecraftVersion; import org.spongepowered.api.ResourceKey; @@ -62,8 +63,6 @@ import java.util.Set; import java.util.function.Consumer; -import javax.annotation.Nullable; - @Mixin(Connection.class) public abstract class ConnectionMixin extends SimpleChannelInboundHandler> implements ConnectionBridge { @@ -78,7 +77,7 @@ public abstract class ConnectionMixin extends SimpleChannelInboundHandler implements EntityDataAccessorBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/MinecraftServerMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/MinecraftServerMixin.java index 94c79d83c74..d985a826454 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/MinecraftServerMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/MinecraftServerMixin.java @@ -42,6 +42,7 @@ import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.PrimaryLevelData; import net.minecraft.world.level.storage.WorldData; +import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; import org.spongepowered.api.Game; import org.spongepowered.api.Sponge; @@ -89,8 +90,6 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; -import javax.annotation.Nullable; - @Mixin(MinecraftServer.class) public abstract class MinecraftServerMixin implements SpongeServer, MinecraftServerBridge, CommandSourceProviderBridge, SubjectProxy, CommandSourceBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/PlayerAdvancementsMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/PlayerAdvancementsMixin.java index 8e084d37bb8..73f85710dce 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/PlayerAdvancementsMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/PlayerAdvancementsMixin.java @@ -35,6 +35,7 @@ import net.minecraft.advancements.CriterionProgress; import net.minecraft.server.PlayerAdvancements; import net.minecraft.server.players.PlayerList; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; import org.spongepowered.api.advancement.AdvancementTree; @@ -65,8 +66,6 @@ import java.util.Optional; import java.util.Set; -import javax.annotation.Nullable; - @Mixin(PlayerAdvancements.class) public abstract class PlayerAdvancementsMixin implements PlayerAdvancementsBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/ServerScoreboardMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/ServerScoreboardMixin.java index ed7e0f7780a..85cccaad434 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/ServerScoreboardMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/ServerScoreboardMixin.java @@ -39,6 +39,7 @@ import net.minecraft.world.scores.Score; import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.criteria.ObjectiveCriteria; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.scoreboard.Team; import org.spongepowered.api.scoreboard.criteria.Criterion; import org.spongepowered.api.scoreboard.displayslot.DisplaySlot; @@ -71,8 +72,6 @@ import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; - @SuppressWarnings({"ConstantConditions", "rawtypes"}) @Mixin(ServerScoreboard.class) public abstract class ServerScoreboardMixin extends Scoreboard implements ServerScoreboardBridge { @@ -327,7 +326,7 @@ private boolean onUpdateScoreValue(final Set set, final Object object) { */ @Override @Overwrite - public void setDisplayObjective(final net.minecraft.world.scores.DisplaySlot slot, @Nullable final net.minecraft.world.scores.Objective objective) { + public void setDisplayObjective(final net.minecraft.world.scores.DisplaySlot slot, final net.minecraft.world.scores.@Nullable Objective objective) { final Objective apiObjective = objective == null ? null : ((ObjectiveBridge) objective).bridge$getSpongeObjective(); this.bridge$updateDisplaySlot(apiObjective, (DisplaySlot) (Object) slot); } diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/commands/TeleportCommandMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/commands/TeleportCommandMixin.java index 0652f348721..d8837562c12 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/commands/TeleportCommandMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/commands/TeleportCommandMixin.java @@ -36,6 +36,7 @@ import net.minecraft.world.entity.PathfinderMob; import net.minecraft.world.entity.RelativeMovement; import net.minecraft.world.level.ChunkPos; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.Sponge; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.event.EventContextKeys; @@ -56,8 +57,6 @@ import java.util.Set; -import javax.annotation.Nullable; - @Mixin(TeleportCommand.class) public abstract class TeleportCommandMixin { @@ -67,7 +66,7 @@ public abstract class TeleportCommandMixin { */ @Overwrite private static void performTeleport(CommandSourceStack source, Entity entityIn, ServerLevel worldIn, double x, double y, double z, - Set relativeList, float yaw, float pitch, @Nullable TeleportCommand.LookAt facing) { + Set relativeList, float yaw, float pitch, TeleportCommand.@Nullable LookAt facing) { double actualX = x; double actualY = y; diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java index 7935577548a..3a64a3a7aad 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java @@ -59,6 +59,8 @@ import net.minecraft.world.level.storage.WorldData; import net.minecraft.world.phys.Vec3; import net.minecraft.world.ticks.LevelTicks; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.Sponge; @@ -120,9 +122,6 @@ import java.util.concurrent.Executor; import java.util.function.BooleanSupplier; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - @Mixin(ServerLevel.class) public abstract class ServerLevelMixin extends LevelMixin implements ServerLevelBridge, PlatformServerLevelBridge, ResourceKeyBridge { @@ -132,11 +131,11 @@ public abstract class ServerLevelMixin extends LevelMixin implements ServerLevel @Shadow @Final private LevelTicks fluidTicks; @Shadow private int emptyTime; - @Shadow @Nonnull public abstract MinecraftServer shadow$getServer(); + @Shadow @NonNull public abstract MinecraftServer shadow$getServer(); @Shadow protected abstract void shadow$saveLevelData(); @Shadow @Final private MinecraftServer server; - @Shadow public abstract void levelEvent(@org.jetbrains.annotations.Nullable Player $$0, int $$1, BlockPos $$2, int $$3); + @Shadow public abstract void levelEvent(@Nullable Player $$0, int $$1, BlockPos $$2, int $$3); @Shadow @Final @Mutable @Nullable private EndDragonFight dragonFight; // @formatter:on diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/network/ServerCommonPacketListenerImplMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/network/ServerCommonPacketListenerImplMixin.java index a45e6d39b17..9194add3a4b 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/network/ServerCommonPacketListenerImplMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/network/ServerCommonPacketListenerImplMixin.java @@ -50,7 +50,7 @@ public abstract class ServerCommonPacketListenerImplMixin { // @formatter:off @Shadow @Final protected Connection connection; @Shadow @Final protected MinecraftServer server; - @Shadow public abstract void shadow$send(final Packet $$0, @org.jetbrains.annotations.Nullable final PacketSendListener $$1); + @Shadow public abstract void shadow$send(final Packet $$0, @Nullable final PacketSendListener $$1); @Shadow public abstract void shadow$disconnect(Component reason); // @formatter:on diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/players/BanListEntryMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/players/BanListEntryMixin.java index e82e11536de..56cb9626a12 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/players/BanListEntryMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/players/BanListEntryMixin.java @@ -27,6 +27,7 @@ import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.minecraft.server.players.BanListEntry; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -37,8 +38,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(BanListEntry.class) public abstract class BanListEntryMixin extends StoredUserEntryMixin implements BanListEntryBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/players/IpBanListEntryMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/players/IpBanListEntryMixin.java index 1b8625b6a83..ecfe8bb3454 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/players/IpBanListEntryMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/players/IpBanListEntryMixin.java @@ -26,6 +26,7 @@ import com.google.gson.JsonObject; import net.minecraft.server.players.IpBanListEntry; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -35,8 +36,6 @@ import java.net.InetAddress; import java.net.UnknownHostException; -import javax.annotation.Nullable; - @Mixin(IpBanListEntry.class) public abstract class IpBanListEntryMixin extends BanListEntryMixin implements IpBanListEntryBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/players/PlayerListMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/players/PlayerListMixin.java index 2fe62209963..be766403a38 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/players/PlayerListMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/players/PlayerListMixin.java @@ -57,6 +57,7 @@ import net.minecraft.world.level.border.WorldBorder; import net.minecraft.world.level.storage.PlayerDataStorage; import net.minecraft.world.phys.Vec3; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.Opcodes; import org.slf4j.Logger; import org.spongepowered.api.Sponge; @@ -133,8 +134,6 @@ import java.util.function.Function; import java.util.function.Predicate; -import javax.annotation.Nullable; - @Mixin(PlayerList.class) public abstract class PlayerListMixin implements PlayerListBridge { @@ -155,7 +154,7 @@ public abstract class PlayerListMixin implements PlayerListBridge { @Shadow public abstract boolean shadow$canBypassPlayerLimit(com.mojang.authlib.GameProfile param0); @Shadow protected abstract boolean shadow$verifyChatTrusted(final PlayerChatMessage $$0); @Shadow protected abstract void shadow$broadcastChatMessage(final PlayerChatMessage $$0, final Predicate $$1, - @Nullable final net.minecraft.server.level.ServerPlayer $$2, final ChatType.Bound $$4); + final net.minecraft.server.level.@Nullable ServerPlayer $$2, final ChatType.Bound $$4); // @formatter:on private boolean impl$isGameMechanicRespawn = false; @@ -267,7 +266,7 @@ public abstract class PlayerListMixin implements PlayerListBridge { private net.minecraft.server.level.ServerLevel impl$onInitPlayer_getWorld(final MinecraftServer minecraftServer, final ResourceKey dimension, final Connection networkManager, final net.minecraft.server.level.ServerPlayer mcPlayer ) { - @Nullable final net.minecraft.network.chat.Component kickReason = ((ConnectionBridge) networkManager).bridge$getKickReason(); + final net.minecraft.network.chat.@Nullable Component kickReason = ((ConnectionBridge) networkManager).bridge$getKickReason(); final Component disconnectMessage; if (kickReason != null) { disconnectMessage = SpongeAdventure.asAdventure(kickReason); diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/server/players/StoredUserEntryMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/server/players/StoredUserEntryMixin.java index 73e134e7db7..2b40d54ef27 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/server/players/StoredUserEntryMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/server/players/StoredUserEntryMixin.java @@ -25,11 +25,10 @@ package org.spongepowered.common.mixin.core.server.players; import net.minecraft.server.players.StoredUserEntry; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import javax.annotation.Nullable; - @Mixin(StoredUserEntry.class) public abstract class StoredUserEntryMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/village/MerchantOfferMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/village/MerchantOfferMixin.java index f8be99f53c0..c08515965b5 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/village/MerchantOfferMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/village/MerchantOfferMixin.java @@ -25,18 +25,17 @@ package org.spongepowered.common.mixin.core.village; import net.minecraft.world.item.trading.MerchantOffer; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.item.inventory.ItemStackComparators; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import javax.annotation.Nullable; - @Mixin(MerchantOffer.class) public abstract class MerchantOfferMixin { @Shadow public abstract net.minecraft.world.item.ItemStack shadow$getBaseCostA(); - @Shadow @Nullable public abstract net.minecraft.world.item.ItemStack shadow$getCostB(); + @Shadow public abstract net.minecraft.world.item.@Nullable ItemStack shadow$getCostB(); @Shadow public abstract net.minecraft.world.item.ItemStack shadow$getResult(); @Shadow public abstract int shadow$getUses(); @Shadow public abstract int shadow$getMaxUses(); diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ActiveChunkReferentMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ActiveChunkReferentMixin.java index 5275bbd41f2..84c8e6c2da1 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ActiveChunkReferentMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ActiveChunkReferentMixin.java @@ -25,6 +25,7 @@ package org.spongepowered.common.mixin.core.world.entity; import net.minecraft.world.level.block.entity.BlockEntity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.common.bridge.world.level.chunk.ActiveChunkReferantBridge; import org.spongepowered.common.bridge.world.level.chunk.LevelChunkBridge; @@ -32,8 +33,6 @@ import java.lang.ref.WeakReference; -import javax.annotation.Nullable; - @Mixin({BlockEntity.class}) public abstract class ActiveChunkReferentMixin implements ActiveChunkReferantBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/EntityMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/EntityMixin.java index d2ce9cf6518..7abd15c4307 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/EntityMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/EntityMixin.java @@ -63,6 +63,7 @@ import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.Team; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.DataHolder; @@ -135,8 +136,6 @@ import java.util.Optional; import java.util.UUID; -import javax.annotation.Nullable; - @Mixin(Entity.class) public abstract class EntityMixin implements EntityBridge, PlatformEntityBridge, VanishableBridge, CommandSourceProviderBridge, DataCompoundHolder { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/LivingEntityMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/LivingEntityMixin.java index 77eb64d4f3f..3a17ab57744 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/LivingEntityMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/LivingEntityMixin.java @@ -44,6 +44,7 @@ import net.minecraft.world.entity.ai.attributes.AttributeMap; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.Sponge; import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.data.Transaction; @@ -97,8 +98,6 @@ import java.util.List; import java.util.Optional; -import javax.annotation.Nullable; - @SuppressWarnings("ConstantConditions") @Mixin(LivingEntity.class) public abstract class LivingEntityMixin extends EntityMixin implements LivingEntityBridge, PlatformLivingEntityBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/LivingEntityMixin_Attack_impl.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/LivingEntityMixin_Attack_impl.java index 40b2b8fd4f4..760baef8879 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/LivingEntityMixin_Attack_impl.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/LivingEntityMixin_Attack_impl.java @@ -40,7 +40,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import org.apache.logging.log4j.Level; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -63,7 +63,7 @@ public abstract class LivingEntityMixin_Attack_impl extends EntityMixin @Shadow public int hurtDuration; @Shadow public int hurtTime; @Shadow protected int lastHurtByPlayerTime; - @Shadow @javax.annotation.Nullable protected Player lastHurtByPlayer; + @Shadow @Nullable protected Player lastHurtByPlayer; @Shadow private long lastDamageStamp; @Shadow public abstract boolean shadow$hasEffect(MobEffect param0); @@ -74,7 +74,7 @@ public abstract class LivingEntityMixin_Attack_impl extends EntityMixin @Shadow public abstract void shadow$setLastHurtByMob(@Nullable LivingEntity param0); @Shadow public abstract void shadow$knockback(double param0, double param1, double param2); @Shadow protected abstract boolean shadow$checkTotemDeathProtection(DamageSource param0); - @Shadow @javax.annotation.Nullable protected abstract SoundEvent shadow$getDeathSound(); + @Shadow @Nullable protected abstract SoundEvent shadow$getDeathSound(); @Shadow protected abstract float shadow$getSoundVolume(); @Shadow protected abstract float shadow$getVoicePitch(); @Shadow public abstract void shadow$die(DamageSource param0); diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/MobMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/MobMixin.java index 5efee231482..95c0c0c3623 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/MobMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/MobMixin.java @@ -34,6 +34,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.api.Sponge; import org.spongepowered.api.entity.Entity; @@ -68,8 +69,6 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Nullable; - @Mixin(Mob.class) public abstract class MobMixin extends LivingEntityMixin { @@ -77,7 +76,7 @@ public abstract class MobMixin extends LivingEntityMixin { @Shadow @Final protected GoalSelector goalSelector; @Shadow @Final protected GoalSelector targetSelector; @Shadow @Nullable private LivingEntity target; - @Shadow @Nullable public abstract net.minecraft.world.entity.Entity shadow$getLeashHolder(); + @Shadow public abstract net.minecraft.world.entity.@Nullable Entity shadow$getLeashHolder(); @Shadow protected abstract void shadow$registerGoals(); @Shadow protected abstract void shadow$maybeDisableShield(Player p_233655_1_, ItemStack p_233655_2_, ItemStack p_233655_3_); // @formatter:on diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/BreedGoalMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/BreedGoalMixin.java index 54ba8d4690e..56d98721d96 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/BreedGoalMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/BreedGoalMixin.java @@ -25,6 +25,7 @@ package org.spongepowered.common.mixin.core.world.entity.ai.goal; import net.minecraft.world.entity.ai.goal.BreedGoal; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.living.animal.Animal; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.event.SpongeEventFactory; @@ -38,8 +39,6 @@ import org.spongepowered.common.event.ShouldFire; import org.spongepowered.common.event.tracking.PhaseTracker; -import javax.annotation.Nullable; - @Mixin(BreedGoal.class) public abstract class BreedGoalMixin { @@ -47,18 +46,17 @@ public abstract class BreedGoalMixin { @Shadow @Final protected net.minecraft.world.entity.animal.Animal animal; @Shadow protected net.minecraft.world.entity.animal.Animal partner; - @Shadow @Nullable private net.minecraft.world.entity.animal.Animal shadow$getFreePartner() { + @Shadow private net.minecraft.world.entity.animal.@Nullable Animal shadow$getFreePartner() { // Shadow implements return null; } // @formatter:on - @Nullable @Redirect(method = "canUse", at = @At( value = "INVOKE", target = "Lnet/minecraft/world/entity/ai/goal/BreedGoal;getFreePartner()Lnet/minecraft/world/entity/animal/Animal;")) - private net.minecraft.world.entity.animal.Animal impl$callFindMateEvent(final BreedGoal entityAIMate) { + private net.minecraft.world.entity.animal.@Nullable Animal impl$callFindMateEvent(final BreedGoal entityAIMate) { net.minecraft.world.entity.animal.Animal nearbyMate = this.shadow$getFreePartner(); if (nearbyMate == null) { return null; diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/GoalMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/GoalMixin.java index 05100b02754..7833c13df1e 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/GoalMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/GoalMixin.java @@ -26,6 +26,7 @@ import com.google.common.base.MoreObjects; import net.minecraft.world.entity.ai.goal.Goal; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.ai.goal.GoalExecutor; import org.spongepowered.api.entity.ai.goal.GoalType; import org.spongepowered.asm.mixin.Mixin; @@ -38,8 +39,6 @@ import java.util.Optional; import java.util.function.Supplier; -import javax.annotation.Nullable; - @Mixin(Goal.class) public abstract class GoalMixin implements GoalBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/GoalSelectorMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/GoalSelectorMixin.java index 66a4ef488ab..ddfce546134 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/GoalSelectorMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/ai/goal/GoalSelectorMixin.java @@ -29,6 +29,7 @@ import net.minecraft.world.entity.ai.goal.Goal; import net.minecraft.world.entity.ai.goal.GoalSelector; import net.minecraft.world.entity.ai.goal.WrappedGoal; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.ai.goal.GoalExecutor; import org.spongepowered.api.entity.ai.goal.GoalExecutorType; import org.spongepowered.api.entity.living.Agent; @@ -49,8 +50,6 @@ import java.util.Set; -import javax.annotation.Nullable; - @Mixin(GoalSelector.class) public abstract class GoalSelectorMixin implements GoalSelectorBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/boss/enderdragon/EndCrystalMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/boss/enderdragon/EndCrystalMixin.java index 56bf74f16c2..b51f8180849 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/boss/enderdragon/EndCrystalMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/boss/enderdragon/EndCrystalMixin.java @@ -29,6 +29,7 @@ import net.minecraft.world.entity.boss.enderdragon.EndCrystal; import net.minecraft.world.level.ExplosionDamageCalculator; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.world.explosion.Explosion; import org.spongepowered.api.world.server.ServerLocation; @@ -45,8 +46,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(EndCrystal.class) public abstract class EndCrystalMixin extends EntityMixin implements ExplosiveBridge, EndCrystalBridge { @@ -70,8 +69,7 @@ public abstract class EndCrystalMixin extends EntityMixin implements ExplosiveBr target = "Lnet/minecraft/world/level/Level;explode(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;Lnet/minecraft/world/level/ExplosionDamageCalculator;DDDFZLnet/minecraft/world/level/Level$ExplosionInteraction;)Lnet/minecraft/world/level/Explosion;" ) ) - @Nullable - private net.minecraft.world.level.Explosion impl$throwEventWithEntity(final net.minecraft.world.level.Level world, + private net.minecraft.world.level.@Nullable Explosion impl$throwEventWithEntity(final net.minecraft.world.level.Level world, final Entity entityIn, final DamageSource damageSource, final ExplosionDamageCalculator exDamageCalc, final double xIn, final double yIn, final double zIn, final float explosionRadius, final boolean fire, final Level.ExplosionInteraction modeIn) { // TODO fire? @@ -79,9 +77,8 @@ public abstract class EndCrystalMixin extends EntityMixin implements ExplosiveBr return this.bridge$throwExplosionEventAndExplode(world, entityIn, xIn, yIn, zIn, modeIn.compareTo(Level.ExplosionInteraction.TNT) <= 0, damageSource); } - @Nullable @Override - public net.minecraft.world.level.Explosion bridge$throwExplosionEventAndExplode(final net.minecraft.world.level.Level world, + public net.minecraft.world.level.@Nullable Explosion bridge$throwExplosionEventAndExplode(final net.minecraft.world.level.Level world, @Nullable final Entity nil, final double x, final double y, final double z, final boolean smoking, @Nullable final DamageSource source) { final CauseStackManager causeStackManager = PhaseTracker.getCauseStackManager(); diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/boss/enderdragon/EnderDragonMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/boss/enderdragon/EnderDragonMixin.java index 04dfe4f7506..6c0da06f9dc 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/boss/enderdragon/EnderDragonMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/boss/enderdragon/EnderDragonMixin.java @@ -31,6 +31,7 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -39,8 +40,6 @@ import org.spongepowered.common.bridge.world.entity.GrieferBridge; import org.spongepowered.common.mixin.core.world.entity.MobMixin; -import javax.annotation.Nullable; - @Mixin(EnderDragon.class) public abstract class EnderDragonMixin extends MobMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/item/PrimedTntMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/item/PrimedTntMixin.java index 22f39418bea..7e3354ea434 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/item/PrimedTntMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/item/PrimedTntMixin.java @@ -29,6 +29,7 @@ import net.minecraft.world.entity.item.PrimedTnt; import net.minecraft.world.level.Explosion.BlockInteraction; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Keys; import org.spongepowered.api.entity.explosive.fused.PrimedTNT; import org.spongepowered.api.event.CauseStackManager; @@ -51,8 +52,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(PrimedTnt.class) public abstract class PrimedTntMixin extends EntityMixin implements PrimedTntBridge, FusedExplosiveBridge, ExplosiveBridge { @@ -105,7 +104,6 @@ public abstract class PrimedTntMixin extends EntityMixin implements PrimedTntBri this.shadow$setFuse(fuseTicks); } - @Nullable @Redirect( method = "explode", at = @At( @@ -113,7 +111,7 @@ public abstract class PrimedTntMixin extends EntityMixin implements PrimedTntBri target = "Lnet/minecraft/world/level/Level;explode(Lnet/minecraft/world/entity/Entity;DDDFLnet/minecraft/world/level/Level$ExplosionInteraction;)Lnet/minecraft/world/level/Explosion;" ) ) - private net.minecraft.world.level.Explosion impl$useSpongeExplosion(final Level world, + private net.minecraft.world.level.@Nullable Explosion impl$useSpongeExplosion(final Level world, final Entity entityIn, final double xIn, final double yIn, final double zIn, final float explosionRadius, final Level.ExplosionInteraction modeIn) { return SpongeCommonEventFactory.detonateExplosive(this, Explosion.builder() diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/CreeperMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/CreeperMixin.java index dc708df0dc3..23f4b870988 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/CreeperMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/CreeperMixin.java @@ -28,6 +28,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.living.monster.Creeper; import org.spongepowered.api.world.explosion.Explosion; import org.spongepowered.api.world.server.ServerLocation; @@ -47,8 +48,6 @@ import java.util.Optional; import java.util.function.Consumer; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.entity.monster.Creeper.class) public abstract class CreeperMixin extends MonsterMixin implements FusedExplosiveBridge, ExplosiveBridge { @@ -138,8 +137,7 @@ public abstract class CreeperMixin extends MonsterMixin implements FusedExplosiv } @Redirect(method = "explodeCreeper", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;explode(Lnet/minecraft/world/entity/Entity;DDDFLnet/minecraft/world/level/Level$ExplosionInteraction;)Lnet/minecraft/world/level/Explosion;")) - @Nullable - private net.minecraft.world.level.Explosion impl$useSpongeExplosion(final net.minecraft.world.level.Level world, final Entity self, final double x, + private net.minecraft.world.level.@Nullable Explosion impl$useSpongeExplosion(final net.minecraft.world.level.Level world, final Entity self, final double x, final double y, final double z, final float strength, final Level.ExplosionInteraction mode) { return SpongeCommonEventFactory.detonateExplosive(this, Explosion.builder() .location(ServerLocation.of((ServerWorld) world, x, y, z)) diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderManMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderManMixin.java index 368f27f705f..b5c220cf671 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderManMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderManMixin.java @@ -26,12 +26,11 @@ import net.minecraft.world.entity.monster.EnderMan; import net.minecraft.world.level.block.state.BlockState; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.common.event.tracking.phase.tick.EntityTickContext; -import javax.annotation.Nullable; - @Mixin(EnderMan.class) public abstract class EnderManMixin extends MonsterMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderMan_EndermanLeaveBlockGoalMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderMan_EndermanLeaveBlockGoalMixin.java index 9910181964c..3a2c33b27ac 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderMan_EndermanLeaveBlockGoalMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderMan_EndermanLeaveBlockGoalMixin.java @@ -29,6 +29,7 @@ import net.minecraft.world.entity.monster.EnderMan; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.state.BlockState; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.event.Cause; import org.spongepowered.api.event.SpongeEventFactory; import org.spongepowered.api.event.block.ChangeBlockEvent; @@ -47,8 +48,6 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Nullable; - @Mixin(targets = "net/minecraft/world/entity/monster/EnderMan$EndermanLeaveBlockGoal") public abstract class EnderMan_EndermanLeaveBlockGoalMixin extends Goal { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderMan_EndermanTakeBlockGoalMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderMan_EndermanTakeBlockGoalMixin.java index 8d054a79553..95b49b5596b 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderMan_EndermanTakeBlockGoalMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/monster/EnderMan_EndermanTakeBlockGoalMixin.java @@ -28,6 +28,7 @@ import net.minecraft.world.entity.monster.EnderMan; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -35,8 +36,6 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.common.bridge.world.entity.GrieferBridge; -import javax.annotation.Nullable; - @Mixin(targets = "net/minecraft/world/entity/monster/EnderMan$EndermanTakeBlockGoal") public abstract class EnderMan_EndermanTakeBlockGoalMixin extends Goal { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/player/PlayerMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/player/PlayerMixin.java index 3d3ba645658..03628bf8854 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/player/PlayerMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/player/PlayerMixin.java @@ -55,6 +55,7 @@ import net.minecraft.world.phys.AABB; import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.Team; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.entity.living.Living; import org.spongepowered.api.event.CauseStackManager; @@ -91,8 +92,6 @@ import java.util.List; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.entity.player.Player.class) public abstract class PlayerMixin extends LivingEntityMixin implements PlayerBridge, GameProfileHolderBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/AbstractArrowMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/AbstractArrowMixin.java index 671d44b904c..5796f8ed7da 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/AbstractArrowMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/AbstractArrowMixin.java @@ -32,6 +32,7 @@ import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.projectile.source.ProjectileSource; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -41,8 +42,6 @@ import org.spongepowered.common.bridge.world.level.LevelBridge; import org.spongepowered.common.event.SpongeCommonEventFactory; -import javax.annotation.Nullable; - @Mixin(AbstractArrow.class) public abstract class AbstractArrowMixin extends ProjectileMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/FishingHookMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/FishingHookMixin.java index b0720fc5990..b04273fcea3 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/FishingHookMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/FishingHookMixin.java @@ -41,6 +41,7 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.HitResult; import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Transaction; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.entity.projectile.FishingBobber; @@ -66,13 +67,11 @@ import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nullable; - @Mixin(FishingHook.class) public abstract class FishingHookMixin extends ProjectileMixin { // @formatter:off - @Shadow @Nullable private net.minecraft.world.entity.Entity hookedIn; + @Shadow private net.minecraft.world.entity.@Nullable Entity hookedIn; @Shadow private int nibble; @Shadow @Final private int luck; @@ -81,7 +80,7 @@ public abstract class FishingHookMixin extends ProjectileMixin { // @formatter:on @Inject(method = "setHookedEntity", at = @At("HEAD"), cancellable = true) - private void onSetHookedEntity(@Nullable final net.minecraft.world.entity.Entity hookedIn, final CallbackInfo ci) { + private void onSetHookedEntity(final net.minecraft.world.entity.@Nullable Entity hookedIn, final CallbackInfo ci) { if (hookedIn != null && SpongeCommon .post(SpongeEventFactory.createFishingEventHookEntity(PhaseTracker.getCauseStackManager().currentCause(), (Entity) hookedIn, (FishingBobber) this))) { this.hookedIn = null; diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/LargeFireballMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/LargeFireballMixin.java index c0893e134fb..ed564bd5957 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/LargeFireballMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/LargeFireballMixin.java @@ -27,6 +27,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.projectile.LargeFireball; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Keys; import org.spongepowered.api.entity.projectile.Projectile; import org.spongepowered.api.entity.projectile.explosive.fireball.ExplosiveFireball; @@ -48,8 +49,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(LargeFireball.class) public abstract class LargeFireballMixin extends AbstractHurtingProjectileMixin implements LargeFireballBridge, ExplosiveBridge { @@ -70,8 +69,7 @@ public abstract class LargeFireballMixin extends AbstractHurtingProjectileMixin target = "Lnet/minecraft/world/level/Level;explode(Lnet/minecraft/world/entity/Entity;DDDFZLnet/minecraft/world/level/Level$ExplosionInteraction;)Lnet/minecraft/world/level/Explosion;" ) ) - @Nullable - public net.minecraft.world.level.Explosion impl$throwExplosionEventAndExplode(final net.minecraft.world.level.Level worldObj, @Nullable final Entity nil, + public net.minecraft.world.level.@Nullable Explosion impl$throwExplosionEventAndExplode(final net.minecraft.world.level.Level worldObj, @Nullable final Entity nil, final double x, final double y, final double z, final float strength, final boolean flaming, final Level.ExplosionInteraction mode) { return this.bridge$throwExplosionEventAndExplode(worldObj, nil, x, y, z, strength, flaming, mode); } diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/ProjectileMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/ProjectileMixin.java index a54d8680781..0793c0f19d2 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/ProjectileMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/ProjectileMixin.java @@ -27,6 +27,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.projectile.Projectile; import net.minecraft.world.phys.HitResult; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.Sponge; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.event.EventContextKeys; @@ -42,8 +43,6 @@ import org.spongepowered.common.event.tracking.PhaseTracker; import org.spongepowered.common.mixin.core.world.entity.EntityMixin; -import javax.annotation.Nullable; - @Mixin(Projectile.class) public abstract class ProjectileMixin extends EntityMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/ThrownEnderpearlMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/ThrownEnderpearlMixin.java index b0bf0fa6456..94ac18ebc52 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/ThrownEnderpearlMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/ThrownEnderpearlMixin.java @@ -27,6 +27,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.projectile.ThrownEnderpearl; import net.minecraft.world.phys.HitResult; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.event.EventContextKeys; import org.spongepowered.api.event.SpongeEventFactory; @@ -43,8 +44,6 @@ import org.spongepowered.common.util.VecHelper; import org.spongepowered.math.vector.Vector3d; -import javax.annotation.Nullable; - @Mixin(ThrownEnderpearl.class) public abstract class ThrownEnderpearlMixin extends ThrowableProjectileMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/WitherSkullMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/WitherSkullMixin.java index 7168700f0ca..2377fa1317f 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/WitherSkullMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/projectile/WitherSkullMixin.java @@ -26,6 +26,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Keys; import org.spongepowered.api.entity.projectile.Projectile; import org.spongepowered.api.entity.projectile.explosive.WitherSkull; @@ -48,8 +49,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.entity.projectile.WitherSkull.class) public abstract class WitherSkullMixin extends AbstractHurtingProjectileMixin implements WitherSkullBridge, ExplosiveBridge { @@ -82,10 +81,9 @@ public abstract class WitherSkullMixin extends AbstractHurtingProjectileMixin im this.impl$explosionRadius = explosionRadius == null ? Constants.Entity.WitherSkull.DEFAULT_EXPLOSION_RADIUS : explosionRadius; } - @Nullable @Redirect(method = "onHit", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;explode(Lnet/minecraft/world/entity/Entity;DDDFZLnet/minecraft/world/level/Level$ExplosionInteraction;)Lnet/minecraft/world/level/Explosion;")) - public net.minecraft.world.level.Explosion impl$CreateAndProcessExplosionEvent(final net.minecraft.world.level.Level worldObj, final Entity self, + public net.minecraft.world.level.@Nullable Explosion impl$CreateAndProcessExplosionEvent(final net.minecraft.world.level.Level worldObj, final Entity self, final double x, final double y, final double z, final float strength, final boolean flaming, final Level.ExplosionInteraction mode) { return this.bridge$throwExplosionEventAndExplosde(worldObj, self, x, y, z, strength, flaming, mode); } diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/vehicle/AbstractMinecartContainerMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/vehicle/AbstractMinecartContainerMixin.java index 53f61fe5540..f19f01d48fe 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/vehicle/AbstractMinecartContainerMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/vehicle/AbstractMinecartContainerMixin.java @@ -26,10 +26,9 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.vehicle.AbstractMinecartContainer; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; -import javax.annotation.Nullable; - @Mixin(AbstractMinecartContainer.class) public abstract class AbstractMinecartContainerMixin extends AbstractMinecartMixin { @@ -44,7 +43,7 @@ public abstract class AbstractMinecartContainerMixin extends AbstractMinecartMix */ @Override @Nullable - protected @org.checkerframework.checker.nullness.qual.Nullable Entity impl$postProcessChangeDimension(final Entity entity) { + protected Entity impl$postProcessChangeDimension(final Entity entity) { return entity; } diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/vehicle/MinecartTNTMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/vehicle/MinecartTNTMixin.java index d0f79488f2d..9a73dfd65c5 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/vehicle/MinecartTNTMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/entity/vehicle/MinecartTNTMixin.java @@ -29,6 +29,7 @@ import net.minecraft.world.entity.vehicle.MinecartTNT; import net.minecraft.world.level.ExplosionDamageCalculator; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Keys; import org.spongepowered.api.entity.vehicle.minecart.TNTMinecart; import org.spongepowered.api.event.CauseStackManager; @@ -55,8 +56,6 @@ import java.util.ArrayList; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(MinecartTNT.class) public abstract class MinecartTNTMixin extends AbstractMinecartMixin implements FusedExplosiveBridge, ExplosiveBridge { @@ -142,8 +141,7 @@ public abstract class MinecartTNTMixin extends AbstractMinecartMixin implements target = "Lnet/minecraft/world/level/Level;explode(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/damagesource/DamageSource;Lnet/minecraft/world/level/ExplosionDamageCalculator;DDDFZLnet/minecraft/world/level/Level$ExplosionInteraction;)Lnet/minecraft/world/level/Explosion;" ) ) - @Nullable - private net.minecraft.world.level.Explosion impl$useSpongeExplosion(final net.minecraft.world.level.Level world, final Entity entityIn, + private net.minecraft.world.level.@Nullable Explosion impl$useSpongeExplosion(final net.minecraft.world.level.Level world, final Entity entityIn, final DamageSource damageSource, final ExplosionDamageCalculator calculator, final double xIn, final double yIn, final double zIn, final float explosionRadius, final boolean fire, final Level.ExplosionInteraction modeIn) { // TODO ExplosionDamageCalculator & fire diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/item/EnderEyeItemMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/item/EnderEyeItemMixin.java index eb529a996e6..a5e13d456cc 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/item/EnderEyeItemMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/item/EnderEyeItemMixin.java @@ -35,6 +35,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.phys.BlockHitResult; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.Keys; import org.spongepowered.api.entity.EntityTypes; import org.spongepowered.api.entity.projectile.EyeOfEnder; @@ -56,8 +57,6 @@ import org.spongepowered.common.event.tracking.PhaseTracker; import org.spongepowered.math.vector.Vector3d; -import javax.annotation.Nullable; - @Mixin(EnderEyeItem.class) public abstract class EnderEyeItemMixin extends ItemMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/item/FishingRodItemMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/item/FishingRodItemMixin.java index 21470a3ab12..2fbc110f0ef 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/item/FishingRodItemMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/item/FishingRodItemMixin.java @@ -34,6 +34,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.projectile.FishingBobber; import org.spongepowered.api.event.SpongeEventFactory; import org.spongepowered.asm.mixin.Mixin; @@ -44,8 +45,6 @@ import org.spongepowered.common.SpongeCommon; import org.spongepowered.common.event.tracking.PhaseTracker; -import javax.annotation.Nullable; - @Mixin(FishingRodItem.class) public abstract class FishingRodItemMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/item/ItemStackMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/item/ItemStackMixin.java index 7698f1fb182..b35e6f1bb0d 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/item/ItemStackMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/item/ItemStackMixin.java @@ -27,6 +27,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.DataTransactionResult; import org.spongepowered.api.data.Key; import org.spongepowered.api.data.value.Value; @@ -45,8 +46,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.item.ItemStack.class) public abstract class ItemStackMixin implements SpongeDataHolderBridge, DataCompoundHolder { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/BaseSpawnerMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/BaseSpawnerMixin.java index 649184afd35..98d7e85ada3 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/BaseSpawnerMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/BaseSpawnerMixin.java @@ -30,7 +30,7 @@ import net.minecraft.world.level.BaseSpawner; import net.minecraft.world.level.Level; import net.minecraft.world.level.SpawnData; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/LevelMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/LevelMixin.java index 95c93aabc12..ac666522470 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/LevelMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/LevelMixin.java @@ -93,7 +93,7 @@ public abstract class LevelMixin implements LevelBridge, LevelAccessor { @Shadow public abstract LevelChunk shadow$getChunkAt(BlockPos p_175726_1_); @Shadow public abstract DifficultyInstance shadow$getCurrentDifficultyAt(BlockPos p_175649_1_); @Shadow public abstract boolean shadow$isRaining(); - @Shadow @javax.annotation.Nullable public abstract net.minecraft.world.level.block.entity.BlockEntity shadow$getBlockEntity(BlockPos p_175625_1_); + @Shadow public abstract net.minecraft.world.level.block.entity.@Nullable BlockEntity shadow$getBlockEntity(BlockPos p_175625_1_); @Shadow public abstract WorldBorder shadow$getWorldBorder(); //@Shadow protected abstract void shadow$postGameEventInRadius(@javax.annotation.Nullable net.minecraft.world.entity.Entity $$0, GameEvent $$1, BlockPos $$2, int $$3); // @formatter on diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/TntBlockMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/TntBlockMixin.java index fd927cd08e0..e4c25d85225 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/TntBlockMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/TntBlockMixin.java @@ -31,6 +31,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.TntBlock; import net.minecraft.world.level.block.state.BlockState; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.living.Living; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.event.EventContextKeys; @@ -47,8 +48,6 @@ import org.spongepowered.common.event.tracking.PhaseTracker; import org.spongepowered.common.mixin.core.block.BlockMixin; -import javax.annotation.Nullable; - @Mixin(TntBlock.class) public abstract class TntBlockMixin extends BlockMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin.java index 8b5855ca383..951e841b4ce 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/AbstractFurnaceBlockEntityMixin.java @@ -36,6 +36,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity; import net.minecraft.world.level.block.state.BlockState; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.block.entity.carrier.furnace.FurnaceBlockEntity; @@ -64,8 +65,6 @@ import java.util.Collections; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(AbstractFurnaceBlockEntity.class) public abstract class AbstractFurnaceBlockEntityMixin extends BaseContainerBlockEntityMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/BeaconBlockEntityMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/BeaconBlockEntityMixin.java index 1226ac92085..6cd5a1d20fb 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/BeaconBlockEntityMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/BeaconBlockEntityMixin.java @@ -26,12 +26,11 @@ import net.minecraft.world.effect.MobEffect; import net.minecraft.world.level.block.entity.BeaconBlockEntity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; -import javax.annotation.Nullable; - @Mixin(BeaconBlockEntity.class) public abstract class BeaconBlockEntityMixin extends BlockEntityMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/BlockEntityMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/BlockEntityMixin.java index 58902c254a0..cb5b521eb0c 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/BlockEntityMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/block/entity/BlockEntityMixin.java @@ -30,6 +30,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.world.server.ServerWorld; import org.spongepowered.asm.mixin.Final; @@ -45,8 +46,6 @@ import org.spongepowered.common.data.provider.nbt.NBTDataType; import org.spongepowered.common.data.provider.nbt.NBTDataTypes; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.level.block.entity.BlockEntity.class) public abstract class BlockEntityMixin implements BlockEntityBridge, DataCompoundHolder { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/chunk/LevelChunkMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/chunk/LevelChunkMixin.java index b0b019d6d80..a72f33cf387 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/chunk/LevelChunkMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/chunk/LevelChunkMixin.java @@ -41,6 +41,7 @@ import net.minecraft.world.level.chunk.UpgradeData; import net.minecraft.world.level.levelgen.blending.BlendingData; import net.minecraft.world.ticks.LevelChunkTicks; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.util.Direction; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -71,8 +72,6 @@ import java.util.function.BiConsumer; import java.util.function.Function; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.level.chunk.LevelChunk.class) public abstract class LevelChunkMixin extends ChunkAccess implements LevelChunkBridge, CacheKeyBridge { @@ -292,13 +291,12 @@ public LevelChunkMixin( // Fast neighbor methods for internal use @Override - public void bridge$setNeighborChunk(final int index, @Nullable final net.minecraft.world.level.chunk.LevelChunk chunk) { + public void bridge$setNeighborChunk(final int index, final net.minecraft.world.level.chunk.@Nullable LevelChunk chunk) { this.impl$neighbors[index] = chunk; } - @Nullable @Override - public net.minecraft.world.level.chunk.LevelChunk bridge$getNeighborChunk(final int index) { + public net.minecraft.world.level.chunk.@Nullable LevelChunk bridge$getNeighborChunk(final int index) { return this.impl$neighbors[index]; } @@ -325,7 +323,7 @@ public LevelChunkMixin( } @Override - public void bridge$setNeighbor(final Direction direction, @Nullable final net.minecraft.world.level.chunk.LevelChunk neighbor) { + public void bridge$setNeighbor(final Direction direction, final net.minecraft.world.level.chunk.@Nullable LevelChunk neighbor) { this.impl$neighbors[DirectionUtil.directionToIndex(direction)] = neighbor; } diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/levelgen/structure/LegacyStructureDataHandlerMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/levelgen/structure/LegacyStructureDataHandlerMixin.java index 3c2c76da3b5..e93a9d76da2 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/level/levelgen/structure/LegacyStructureDataHandlerMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/level/levelgen/structure/LegacyStructureDataHandlerMixin.java @@ -28,12 +28,11 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.levelgen.structure.LegacyStructureDataHandler; import net.minecraft.world.level.storage.DimensionDataStorage; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.common.hooks.PlatformHooks; -import javax.annotation.Nullable; - @Mixin(LegacyStructureDataHandler.class) public abstract class LegacyStructureDataHandlerMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/scores/ObjectiveMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/scores/ObjectiveMixin.java index 5cc4e3c48e3..351ae8d8cd0 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/scores/ObjectiveMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/scores/ObjectiveMixin.java @@ -28,6 +28,7 @@ import net.minecraft.world.scores.Objective; import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.criteria.ObjectiveCriteria; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.scoreboard.objective.displaymode.ObjectiveDisplayMode; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -41,8 +42,6 @@ import org.spongepowered.common.bridge.world.scores.ScoreboardBridge; import org.spongepowered.common.scoreboard.SpongeObjective; -import javax.annotation.Nullable; - @Mixin(Objective.class) public abstract class ObjectiveMixin implements ObjectiveBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/core/world/scores/ScoreMixin.java b/src/mixins/java/org/spongepowered/common/mixin/core/world/scores/ScoreMixin.java index 6a496ebe214..8500da22cd6 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/core/world/scores/ScoreMixin.java +++ b/src/mixins/java/org/spongepowered/common/mixin/core/world/scores/ScoreMixin.java @@ -26,6 +26,7 @@ import net.minecraft.world.scores.Score; import net.minecraft.world.scores.Scoreboard; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -37,8 +38,6 @@ import org.spongepowered.common.bridge.world.scores.ScoreboardBridge; import org.spongepowered.common.scoreboard.SpongeScore; -import javax.annotation.Nullable; - @Mixin(Score.class) public abstract class ScoreMixin implements ScoreBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/TraitMixin_ArmorEquipable_Inventory_API.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/TraitMixin_ArmorEquipable_Inventory_API.java index ec2f4d41d14..0278f153bb5 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/TraitMixin_ArmorEquipable_Inventory_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/TraitMixin_ArmorEquipable_Inventory_API.java @@ -30,6 +30,7 @@ import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.decoration.ArmorStand; import net.minecraft.world.entity.player.Player; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.data.type.HandType; import org.spongepowered.api.item.inventory.ArmorEquipable; import org.spongepowered.api.item.inventory.ItemStack; @@ -46,8 +47,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - // All living implementors of ArmorEquipable @Mixin({ArmorStand.class, Mob.class, Player.class}) public abstract class TraitMixin_ArmorEquipable_Inventory_API implements ArmorEquipable { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/common/entity/player/SpongeUserInventoryMixin_Inventory_API.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/common/entity/player/SpongeUserInventoryMixin_Inventory_API.java index 781b705b49f..9db05aa1cfe 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/common/entity/player/SpongeUserInventoryMixin_Inventory_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/common/entity/player/SpongeUserInventoryMixin_Inventory_API.java @@ -24,6 +24,7 @@ */ package org.spongepowered.common.mixin.inventory.api.common.entity.player; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.living.player.User; import org.spongepowered.api.item.inventory.Slot; import org.spongepowered.api.item.inventory.entity.PrimaryPlayerInventory; @@ -42,8 +43,6 @@ import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(value = SpongeUserInventory.class, remap = false) public abstract class SpongeUserInventoryMixin_Inventory_API implements UserInventory, InventoryAdapter { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/inventory/container/ContainerMixin_Inventory_API.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/inventory/container/ContainerMixin_Inventory_API.java index 6213678c022..5f169c84429 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/inventory/container/ContainerMixin_Inventory_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/inventory/container/ContainerMixin_Inventory_API.java @@ -29,6 +29,7 @@ import net.minecraft.world.inventory.ContainerListener; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.living.player.server.ServerPlayer; import org.spongepowered.api.item.inventory.ContainerType; import org.spongepowered.api.item.inventory.Inventory; @@ -49,14 +50,12 @@ import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; - @Mixin(value = AbstractContainerMenu.class, priority = 998) public abstract class ContainerMixin_Inventory_API implements org.spongepowered.api.item.inventory.Container, DefaultImplementedAdapterInventory.WithClear { @Shadow @Final private List containerListeners; - @Shadow @Final @Nullable private net.minecraft.world.inventory.MenuType menuType; + @Shadow @Final private net.minecraft.world.inventory.@Nullable MenuType menuType; @Override public boolean isViewedSlot(final org.spongepowered.api.item.inventory.Slot slot) { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/world/entity/player/InventoryMixin_Inventory_API.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/world/entity/player/InventoryMixin_Inventory_API.java index 5214de086fc..c0d3d7afb3e 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/api/world/entity/player/InventoryMixin_Inventory_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/api/world/entity/player/InventoryMixin_Inventory_API.java @@ -24,6 +24,7 @@ */ package org.spongepowered.common.mixin.inventory.api.world.entity.player; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.item.inventory.Slot; import org.spongepowered.api.item.inventory.entity.PlayerInventory; import org.spongepowered.api.item.inventory.entity.PrimaryPlayerInventory; @@ -37,8 +38,6 @@ import org.spongepowered.common.inventory.lens.Lens; import org.spongepowered.common.inventory.lens.impl.minecraft.PlayerInventoryLens; -import javax.annotation.Nullable; - @Mixin(net.minecraft.world.entity.player.Inventory.class) public abstract class InventoryMixin_Inventory_API implements PlayerInventory { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/event/world/inventory/AbstractContainerMenuMixin_Inventory.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/event/world/inventory/AbstractContainerMenuMixin_Inventory.java index f9fc122e960..cbf86aea792 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/event/world/inventory/AbstractContainerMenuMixin_Inventory.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/event/world/inventory/AbstractContainerMenuMixin_Inventory.java @@ -36,6 +36,7 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.item.inventory.transaction.SlotTransaction; import org.spongepowered.asm.mixin.Final; @@ -63,8 +64,6 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Nullable; - @Mixin(AbstractContainerMenu.class) public abstract class AbstractContainerMenuMixin_Inventory implements TrackedContainerBridge, InventoryAdapter { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/event/world/inventory/ResultSlotMixin_Inventory.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/event/world/inventory/ResultSlotMixin_Inventory.java index b7b0cdaad7d..e14fe83c440 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/event/world/inventory/ResultSlotMixin_Inventory.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/event/world/inventory/ResultSlotMixin_Inventory.java @@ -38,6 +38,7 @@ import net.minecraft.world.item.crafting.RecipeManager; import net.minecraft.world.item.crafting.RecipeType; import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.item.inventory.Inventory; import org.spongepowered.api.item.inventory.crafting.CraftingInventory; import org.spongepowered.api.item.inventory.query.QueryTypes; @@ -54,8 +55,6 @@ import org.spongepowered.common.event.tracking.PhaseTracker; import org.spongepowered.common.event.tracking.context.transaction.TransactionalCaptureSupplier; -import javax.annotation.Nullable; - @Mixin(ResultSlot.class) public abstract class ResultSlotMixin_Inventory extends Slot { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/TraitMixin_InventoryBridge_Inventory.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/TraitMixin_InventoryBridge_Inventory.java index ca32cefae3b..572dedb3d32 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/TraitMixin_InventoryBridge_Inventory.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/TraitMixin_InventoryBridge_Inventory.java @@ -38,6 +38,7 @@ import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.level.block.entity.BaseContainerBlockEntity; import net.minecraft.world.level.block.entity.CampfireBlockEntity; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.common.bridge.world.inventory.InventoryBridge; import org.spongepowered.common.bridge.world.inventory.LensGeneratorBridge; @@ -49,8 +50,6 @@ import org.spongepowered.common.inventory.lens.impl.LensRegistrar; import org.spongepowered.common.inventory.lens.impl.slot.SlotLensProvider; -import javax.annotation.Nullable; - /** * Mixin into all known vanilla {@link Container} and {@link AbstractContainerMenu} */ diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Adapter_Inventory.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Adapter_Inventory.java index dce5434df45..20e15f85552 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Adapter_Inventory.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Adapter_Inventory.java @@ -28,6 +28,7 @@ import net.minecraft.core.NonNullList; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.Slot; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.item.inventory.Inventory; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -48,8 +49,6 @@ import java.util.Map; import java.util.Optional; -import javax.annotation.Nullable; - @Mixin(AbstractContainerMenu.class) public abstract class AbstractContainerMenuMixin_Adapter_Inventory implements InventoryBridge, LensGeneratorBridge, InventoryAdapter, ContainerBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Bridge_Inventory.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Bridge_Inventory.java index f96c3124778..8c264267592 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Bridge_Inventory.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Bridge_Inventory.java @@ -30,6 +30,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.ContainerListener; import net.minecraft.world.inventory.Slot; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.item.inventory.Carrier; import org.spongepowered.api.world.server.ServerLocation; import org.spongepowered.asm.mixin.Final; @@ -47,8 +48,6 @@ import java.util.Set; import java.util.function.Predicate; -import javax.annotation.Nullable; - @Mixin(AbstractContainerMenu.class) public abstract class AbstractContainerMenuMixin_Bridge_Inventory implements CarriedBridge, ContainerBridge, InventoryAdapter { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Fabric_Inventory.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Fabric_Inventory.java index d6d44161509..1867f277f57 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Fabric_Inventory.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Fabric_Inventory.java @@ -29,6 +29,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -38,8 +39,6 @@ import java.util.Collection; import java.util.Set; -import javax.annotation.Nullable; - @Mixin(AbstractContainerMenu.class) public abstract class AbstractContainerMenuMixin_Fabric_Inventory implements Fabric, InventoryBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Menu_Inventory.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Menu_Inventory.java index ddd6369bd67..cd516881925 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Menu_Inventory.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/AbstractContainerMenuMixin_Menu_Inventory.java @@ -30,6 +30,7 @@ import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -40,8 +41,6 @@ import org.spongepowered.common.bridge.world.inventory.container.MenuBridge; import org.spongepowered.common.inventory.custom.SpongeInventoryMenu; -import javax.annotation.Nullable; - @Mixin(AbstractContainerMenu.class) public abstract class AbstractContainerMenuMixin_Menu_Inventory implements MenuBridge { diff --git a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/PlayerEnderChestContainerMixin_MenuProvider_Inventory.java b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/PlayerEnderChestContainerMixin_MenuProvider_Inventory.java index ea04ad2ec83..fb24da210ae 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/PlayerEnderChestContainerMixin_MenuProvider_Inventory.java +++ b/src/mixins/java/org/spongepowered/common/mixin/inventory/impl/world/inventory/PlayerEnderChestContainerMixin_MenuProvider_Inventory.java @@ -32,7 +32,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.ChestMenu; import net.minecraft.world.inventory.PlayerEnderChestContainer; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.common.accessor.world.level.block.EnderChestBlockAccessor; diff --git a/src/mixins/java/org/spongepowered/common/mixin/optimization/world/entity/TamableAnimalMixin_Optimization_Owner.java b/src/mixins/java/org/spongepowered/common/mixin/optimization/world/entity/TamableAnimalMixin_Optimization_Owner.java index c15b55b99da..d7394ce4112 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/optimization/world/entity/TamableAnimalMixin_Optimization_Owner.java +++ b/src/mixins/java/org/spongepowered/common/mixin/optimization/world/entity/TamableAnimalMixin_Optimization_Owner.java @@ -26,6 +26,7 @@ import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.world.entity.TamableAnimal; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -35,8 +36,6 @@ import java.util.Optional; import java.util.UUID; -import javax.annotation.Nullable; - @Mixin(TamableAnimal.class) public abstract class TamableAnimalMixin_Optimization_Owner extends AgableMobMixin { diff --git a/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/LivingEntityMixin_Tracker.java b/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/LivingEntityMixin_Tracker.java index a6dd1442ea3..3c09df3be46 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/LivingEntityMixin_Tracker.java +++ b/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/LivingEntityMixin_Tracker.java @@ -31,6 +31,7 @@ import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.LivingEntity; import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.event.EventContextKeys; import org.spongepowered.asm.mixin.Mixin; @@ -47,8 +48,6 @@ import java.util.List; -import javax.annotation.Nullable; - @Mixin(LivingEntity.class) public abstract class LivingEntityMixin_Tracker extends EntityMixin_Tracker { diff --git a/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/item/PrimedTntMixin_Tracker.java b/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/item/PrimedTntMixin_Tracker.java index e4acaf77013..235de221041 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/item/PrimedTntMixin_Tracker.java +++ b/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/item/PrimedTntMixin_Tracker.java @@ -26,6 +26,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.item.PrimedTnt; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.living.Living; import org.spongepowered.api.event.CauseStackManager; import org.spongepowered.api.event.EventContextKeys; @@ -34,8 +35,6 @@ import org.spongepowered.common.event.tracking.phase.tick.EntityTickContext; import org.spongepowered.common.mixin.tracker.world.entity.EntityMixin_Tracker; -import javax.annotation.Nullable; - @Mixin(PrimedTnt.class) public abstract class PrimedTntMixin_Tracker extends EntityMixin_Tracker { diff --git a/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/player/PlayerMixin_Tracker.java b/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/player/PlayerMixin_Tracker.java index ff6f74545ba..96792660301 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/player/PlayerMixin_Tracker.java +++ b/src/mixins/java/org/spongepowered/common/mixin/tracker/world/entity/player/PlayerMixin_Tracker.java @@ -29,6 +29,7 @@ import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.event.entity.DestructEntityEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -38,8 +39,6 @@ import org.spongepowered.common.event.SpongeCommonEventFactory; import org.spongepowered.common.mixin.tracker.world.entity.LivingEntityMixin_Tracker; -import javax.annotation.Nullable; - @Mixin(Player.class) public abstract class PlayerMixin_Tracker extends LivingEntityMixin_Tracker { diff --git a/src/mixins/java/org/spongepowered/common/mixin/tracker/world/level/LevelMixin_Tracker.java b/src/mixins/java/org/spongepowered/common/mixin/tracker/world/level/LevelMixin_Tracker.java index 8b2f5e86a8f..4ca2922ff05 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/tracker/world/level/LevelMixin_Tracker.java +++ b/src/mixins/java/org/spongepowered/common/mixin/tracker/world/level/LevelMixin_Tracker.java @@ -37,6 +37,7 @@ import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.storage.WritableLevelData; import net.minecraft.world.phys.AABB; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -54,8 +55,6 @@ import java.util.function.Consumer; import java.util.function.Predicate; -import javax.annotation.Nullable; - @Mixin(Level.class) public abstract class LevelMixin_Tracker implements LevelBridge, LevelAccessor { diff --git a/src/test/java/org/spongepowered/common/test/stub/StubKey.java b/src/test/java/org/spongepowered/common/test/stub/StubKey.java index d4fdd7439fd..c67fd9206e5 100644 --- a/src/test/java/org/spongepowered/common/test/stub/StubKey.java +++ b/src/test/java/org/spongepowered/common/test/stub/StubKey.java @@ -24,7 +24,7 @@ */ package org.spongepowered.common.test.stub; -import org.jetbrains.annotations.NotNull; +import org.checkerframework.checker.nullness.qual.NonNull; import org.spongepowered.api.ResourceKey; import java.util.Objects; @@ -39,12 +39,12 @@ public StubKey(final String namespace, final String key) { } @Override - public @NotNull String namespace() { + public @NonNull String namespace() { return this.namespace; } @Override - public @NotNull String value() { + public @NonNull String value() { return this.key; } diff --git a/src/test/java/org/spongepowered/common/test/stub/block/StubBlock.java b/src/test/java/org/spongepowered/common/test/stub/block/StubBlock.java index ebb322efd8c..c4d67ca5f4f 100644 --- a/src/test/java/org/spongepowered/common/test/stub/block/StubBlock.java +++ b/src/test/java/org/spongepowered/common/test/stub/block/StubBlock.java @@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableList; import net.kyori.adventure.text.Component; -import org.jetbrains.annotations.NotNull; +import org.checkerframework.checker.nullness.qual.NonNull; import org.spongepowered.api.ResourceKey; import org.spongepowered.api.block.BlockSoundGroup; import org.spongepowered.api.block.BlockState; @@ -107,7 +107,7 @@ public boolean hasBlockEntity() { } @Override - public @NotNull Component asComponent() { + public @NonNull Component asComponent() { return null; } diff --git a/src/test/java/org/spongepowered/common/util/DefinableClassLoader.java b/src/test/java/org/spongepowered/common/util/DefinableClassLoader.java index 57a7023dbcd..29c849276fa 100644 --- a/src/test/java/org/spongepowered/common/util/DefinableClassLoader.java +++ b/src/test/java/org/spongepowered/common/util/DefinableClassLoader.java @@ -24,7 +24,7 @@ */ package org.spongepowered.common.util; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Opcodes; diff --git a/vanilla/build.gradle.kts b/vanilla/build.gradle.kts index 9d536fcac7f..bcc3e186701 100644 --- a/vanilla/build.gradle.kts +++ b/vanilla/build.gradle.kts @@ -343,7 +343,6 @@ dependencies { exclude(group = "org.apache.logging.log4j", module = "log4j-api") } appLaunch("com.lmax:disruptor:3.4.4") - "applaunchCompileOnly"("org.jetbrains:annotations:23.1.0") testplugins?.also { vanillaAppLaunchRuntime(project(it.path)) { diff --git a/vanilla/src/launch/java/org/spongepowered/vanilla/launch/plugin/VanillaPluginManager.java b/vanilla/src/launch/java/org/spongepowered/vanilla/launch/plugin/VanillaPluginManager.java index 3f38f4de93d..f2251dffbf4 100644 --- a/vanilla/src/launch/java/org/spongepowered/vanilla/launch/plugin/VanillaPluginManager.java +++ b/vanilla/src/launch/java/org/spongepowered/vanilla/launch/plugin/VanillaPluginManager.java @@ -27,7 +27,7 @@ import com.google.inject.Singleton; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import org.apache.logging.log4j.Level; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.common.launch.plugin.SpongePluginManager; import org.spongepowered.common.util.PrettyPrinter; import org.spongepowered.plugin.InvalidPluginException; diff --git a/vanilla/src/main/java/org/spongepowered/vanilla/chat/ChatFormatter.java b/vanilla/src/main/java/org/spongepowered/vanilla/chat/ChatFormatter.java index bbd55e8c4ef..7922090389c 100644 --- a/vanilla/src/main/java/org/spongepowered/vanilla/chat/ChatFormatter.java +++ b/vanilla/src/main/java/org/spongepowered/vanilla/chat/ChatFormatter.java @@ -28,6 +28,7 @@ import net.minecraft.network.chat.ClickEvent; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.common.adventure.SpongeAdventure; import java.net.URI; @@ -35,8 +36,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.Nullable; - public final class ChatFormatter { private static final String DEFAULT_SCHEME = "http://"; diff --git a/vanilla/src/main/java/org/spongepowered/vanilla/client/gui/widget/MetadataPanel.java b/vanilla/src/main/java/org/spongepowered/vanilla/client/gui/widget/MetadataPanel.java index c09093af4a8..e1eb98debb0 100644 --- a/vanilla/src/main/java/org/spongepowered/vanilla/client/gui/widget/MetadataPanel.java +++ b/vanilla/src/main/java/org/spongepowered/vanilla/client/gui/widget/MetadataPanel.java @@ -37,6 +37,7 @@ import net.minecraft.network.chat.ClickEvent; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.plugin.metadata.PluginMetadata; import org.spongepowered.vanilla.client.gui.screen.PluginScreen; import org.spongepowered.vanilla.util.Bounds; @@ -52,8 +53,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.annotation.Nullable; - public final class MetadataPanel extends ScrollPanel implements NarratableEntry { private static final Component NO_RESULTS = Component.literal("No data...").withStyle(ChatFormatting.GRAY); diff --git a/vanilla/src/main/java/org/spongepowered/vanilla/client/gui/widget/list/FilterableList.java b/vanilla/src/main/java/org/spongepowered/vanilla/client/gui/widget/list/FilterableList.java index b88e8c57008..05cd1da4597 100644 --- a/vanilla/src/main/java/org/spongepowered/vanilla/client/gui/widget/list/FilterableList.java +++ b/vanilla/src/main/java/org/spongepowered/vanilla/client/gui/widget/list/FilterableList.java @@ -42,6 +42,7 @@ import net.minecraft.client.renderer.GameRenderer; import net.minecraft.network.chat.Component; import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.common.accessor.client.gui.components.AbstractSelectionListAccessor; import org.spongepowered.vanilla.util.Bounds; @@ -51,8 +52,6 @@ import java.util.function.Consumer; import java.util.function.Supplier; -import javax.annotation.Nullable; - @SuppressWarnings("unchecked") public class FilterableList

, E extends FilterableList.Entry> extends AbstractSelectionList { diff --git a/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/server/level/ServerPlayerMixin_Vanilla.java b/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/server/level/ServerPlayerMixin_Vanilla.java index f564acf9ab2..0536dc07ba2 100644 --- a/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/server/level/ServerPlayerMixin_Vanilla.java +++ b/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/server/level/ServerPlayerMixin_Vanilla.java @@ -27,6 +27,7 @@ import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.dimension.DimensionType; import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.entity.living.player.server.ServerPlayer; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -43,8 +44,6 @@ import org.spongepowered.common.world.portal.PortalLogic; import org.spongepowered.vanilla.mixin.core.world.entity.LivingEntityMixin_Vanilla; -import javax.annotation.Nullable; - @Mixin(net.minecraft.server.level.ServerPlayer.class) public abstract class ServerPlayerMixin_Vanilla extends LivingEntityMixin_Vanilla implements ServerPlayerBridge { @@ -71,8 +70,7 @@ public abstract class ServerPlayerMixin_Vanilla extends LivingEntityMixin_Vanill * the correct type. */ @Overwrite - @Nullable - public net.minecraft.world.entity.Entity changeDimension(final ServerLevel target) { + public net.minecraft.world.entity.@Nullable Entity changeDimension(final ServerLevel target) { return this.bridge$changeDimension(target, (PortalLogic) target.getPortalForcer()); } diff --git a/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/world/entity/EntityMixin_Vanilla.java b/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/world/entity/EntityMixin_Vanilla.java index ca75fe14808..b9797c685c9 100644 --- a/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/world/entity/EntityMixin_Vanilla.java +++ b/vanilla/src/mixins/java/org/spongepowered/vanilla/mixin/core/world/entity/EntityMixin_Vanilla.java @@ -26,14 +26,13 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.level.Level; +import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.common.bridge.world.entity.EntityBridge; import org.spongepowered.common.world.portal.PortalLogic; -import javax.annotation.Nullable; - @Mixin(Entity.class) public abstract class EntityMixin_Vanilla implements EntityBridge {