From 066fef051317aaf02e997bcf4afe9a09d35e84a5 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Fri, 2 Apr 2021 14:19:24 +0200 Subject: [PATCH] Move to checker qual nullability annotations --- buildSrc/src/main/kotlin/Versions.kt | 2 +- common/build.gradle.kts | 2 +- .../viabackwards/api/BackwardsProtocol.java | 2 +- .../api/data/BackwardsMappings.java | 20 +++++++------------ .../api/data/MappedLegacyBlockItem.java | 5 ++--- .../api/entities/meta/MetaHandlerEvent.java | 5 ++--- .../entities/meta/MetaHandlerSettings.java | 5 ++--- .../api/entities/storage/EntityData.java | 8 +++----- .../api/entities/storage/EntityTracker.java | 5 ++--- .../api/entities/storage/MetaStorage.java | 5 ++--- .../api/rewriters/EntityRewriterBase.java | 5 ++--- .../api/rewriters/ItemRewriter.java | 8 +++----- .../api/rewriters/ItemRewriterBase.java | 8 +++----- .../rewriters/LegacyBlockItemRewriter.java | 8 +++----- .../api/rewriters/LegacyEntityRewriter.java | 5 ++--- .../packets/BlockItemPackets1_12.java | 2 +- .../data/BackwardsMappings.java | 5 ++--- .../data/CommandRewriter1_14.java | 5 ++--- .../data/CommandRewriter1_13_1.java | 5 ++--- .../data/CommandRewriter1_16.java | 5 ++--- .../data/CommandRewriter1_16_2.java | 5 ++--- 21 files changed, 47 insertions(+), 73 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 4ccb5ffc..eed844a2 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -7,7 +7,7 @@ object Versions { const val guava = "17.0" const val fabricLoader = "0.4.8+build.154" const val log4j = "2.8.1" - const val jetbrainsAnnotations = "20.1.0" + const val checkerQual = "3.12.0" // Platforms const val spigot = "1.16.5-R0.1-SNAPSHOT" diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 17131050..49375bfc 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -11,5 +11,5 @@ dependencies { compileOnly("io.netty", "netty-all", Versions.netty) compileOnlyApi("us.myles", "viaversion", Versions.viaversion) compileOnlyApi("com.google.guava", "guava", Versions.guava) - compileOnlyApi("org.jetbrains", "annotations", Versions.jetbrainsAnnotations) + compileOnlyApi("org.checkerframework", "checker-qual", Versions.checkerQual) } \ No newline at end of file diff --git a/common/src/main/java/nl/matsv/viabackwards/api/BackwardsProtocol.java b/common/src/main/java/nl/matsv/viabackwards/api/BackwardsProtocol.java index a32cc25d..32cee59a 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/BackwardsProtocol.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/BackwardsProtocol.java @@ -19,7 +19,7 @@ package nl.matsv.viabackwards.api; import nl.matsv.viabackwards.api.data.BackwardsMappings; import nl.matsv.viabackwards.api.entities.storage.EntityTracker; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.protocol.ClientboundPacketType; diff --git a/common/src/main/java/nl/matsv/viabackwards/api/data/BackwardsMappings.java b/common/src/main/java/nl/matsv/viabackwards/api/data/BackwardsMappings.java index c6445e28..bec56b31 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/data/BackwardsMappings.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/data/BackwardsMappings.java @@ -19,7 +19,7 @@ package nl.matsv.viabackwards.api.data; import com.google.common.base.Preconditions; import nl.matsv.viabackwards.api.BackwardsProtocol; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.data.MappingData; import us.myles.ViaVersion.api.data.Mappings; @@ -71,8 +71,7 @@ public class BackwardsMappings extends MappingData { } @Override - @Nullable - protected Mappings loadFromArray(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { + protected @Nullable Mappings loadFromArray(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { if (!oldMappings.has(key) || !newMappings.has(key)) return null; JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null; @@ -80,8 +79,7 @@ public class BackwardsMappings extends MappingData { } @Override - @Nullable - protected Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { + protected @Nullable Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { if (!oldMappings.has(key) || !newMappings.has(key)) return null; JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null; @@ -124,13 +122,11 @@ public class BackwardsMappings extends MappingData { return checkValidity(id, this.itemMappings.inverse().get(id), "item"); } - @Nullable - public MappedItem getMappedItem(int id) { + public @Nullable MappedItem getMappedItem(int id) { return backwardsItemMappings != null ? backwardsItemMappings.get(id) : null; } - @Nullable - public String getMappedNamedSound(String id) { + public @Nullable String getMappedNamedSound(String id) { if (backwardsItemMappings == null) { return null; } @@ -142,13 +138,11 @@ public class BackwardsMappings extends MappingData { return backwardsSoundMappings.get(id); } - @Nullable - public Int2ObjectMap getBackwardsItemMappings() { + public @Nullable Int2ObjectMap getBackwardsItemMappings() { return backwardsItemMappings; } - @Nullable - public Map getBackwardsSoundMappings() { + public @Nullable Map getBackwardsSoundMappings() { return backwardsSoundMappings; } } diff --git a/common/src/main/java/nl/matsv/viabackwards/api/data/MappedLegacyBlockItem.java b/common/src/main/java/nl/matsv/viabackwards/api/data/MappedLegacyBlockItem.java index dc5c8225..40ab4454 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/data/MappedLegacyBlockItem.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/data/MappedLegacyBlockItem.java @@ -18,7 +18,7 @@ package nl.matsv.viabackwards.api.data; import nl.matsv.viabackwards.utils.Block; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag; public class MappedLegacyBlockItem { @@ -60,8 +60,7 @@ public class MappedLegacyBlockItem { return blockEntityHandler != null; } - @Nullable - public BlockEntityHandler getBlockEntityHandler() { + public @Nullable BlockEntityHandler getBlockEntityHandler() { return blockEntityHandler; } diff --git a/common/src/main/java/nl/matsv/viabackwards/api/entities/meta/MetaHandlerEvent.java b/common/src/main/java/nl/matsv/viabackwards/api/entities/meta/MetaHandlerEvent.java index 3f8c737b..af686c9f 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/entities/meta/MetaHandlerEvent.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/entities/meta/MetaHandlerEvent.java @@ -20,7 +20,7 @@ package nl.matsv.viabackwards.api.entities.meta; import nl.matsv.viabackwards.api.entities.storage.EntityTracker; import nl.matsv.viabackwards.api.entities.storage.MetaStorage; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.minecraft.metadata.Metadata; @@ -87,8 +87,7 @@ public class MetaHandlerEvent { /** * May be null, use {@link #createMeta(Metadata)} for adding metadata. */ - @Nullable - public List getExtraData() { + public @Nullable List getExtraData() { return extraData; } } diff --git a/common/src/main/java/nl/matsv/viabackwards/api/entities/meta/MetaHandlerSettings.java b/common/src/main/java/nl/matsv/viabackwards/api/entities/meta/MetaHandlerSettings.java index cbdd36e3..26308a99 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/entities/meta/MetaHandlerSettings.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/entities/meta/MetaHandlerSettings.java @@ -19,7 +19,7 @@ package nl.matsv.viabackwards.api.entities.meta; import nl.matsv.viabackwards.api.exceptions.RemovedValueException; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.entities.EntityType; import us.myles.ViaVersion.api.minecraft.metadata.Metadata; @@ -109,8 +109,7 @@ public class MetaHandlerSettings { return filterIndex; } - @Nullable - public MetaHandler getHandler() { + public @Nullable MetaHandler getHandler() { return handler; } diff --git a/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/EntityData.java b/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/EntityData.java index 5f3f9b38..0e2d8daa 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/EntityData.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/EntityData.java @@ -18,7 +18,7 @@ package nl.matsv.viabackwards.api.entities.storage; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter; public class EntityData { @@ -58,8 +58,7 @@ public class EntityData { /** * @return custom mobname, can be either a String or a JsonElement */ - @Nullable - public Object getMobName() { + public @Nullable Object getMobName() { return mobName; } @@ -67,8 +66,7 @@ public class EntityData { return replacementId; } - @Nullable - public MetaCreator getDefaultMeta() { + public @Nullable MetaCreator getDefaultMeta() { return defaultMeta; } diff --git a/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/EntityTracker.java b/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/EntityTracker.java index 201678c9..ab2c1f3d 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/EntityTracker.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/EntityTracker.java @@ -19,7 +19,7 @@ package nl.matsv.viabackwards.api.entities.storage; import nl.matsv.viabackwards.api.BackwardsProtocol; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.data.StoredObject; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.entities.EntityType; @@ -41,8 +41,7 @@ public class EntityTracker extends StoredObject { trackers.put(protocol, new ProtocolEntityTracker()); } - @Nullable - public ProtocolEntityTracker get(BackwardsProtocol protocol) { + public @Nullable ProtocolEntityTracker get(BackwardsProtocol protocol) { return trackers.get(protocol); } diff --git a/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/MetaStorage.java b/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/MetaStorage.java index bc8146fa..bb5b3fab 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/MetaStorage.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/entities/storage/MetaStorage.java @@ -18,7 +18,7 @@ package nl.matsv.viabackwards.api.entities.storage; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.minecraft.metadata.Metadata; import java.util.List; @@ -46,8 +46,7 @@ public class MetaStorage { this.metaDataList.add(data); } - @Nullable - public Metadata get(int index) { + public @Nullable Metadata get(int index) { for (Metadata meta : this.metaDataList) { if (index == meta.getId()) { return meta; diff --git a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/EntityRewriterBase.java b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/EntityRewriterBase.java index 0d3394e1..f5348571 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/EntityRewriterBase.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/EntityRewriterBase.java @@ -26,7 +26,7 @@ import nl.matsv.viabackwards.api.entities.storage.EntityData; import nl.matsv.viabackwards.api.entities.storage.EntityTracker; import nl.matsv.viabackwards.api.entities.storage.MetaStorage; import nl.matsv.viabackwards.api.exceptions.RemovedValueException; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.PacketWrapper; import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.data.ParticleMappings; @@ -91,8 +91,7 @@ public abstract class EntityRewriterBase extends Re return entityTypes.containsKey(type); } - @Nullable - protected EntityData getEntityData(EntityType type) { + protected @Nullable EntityData getEntityData(EntityType type) { return entityTypes.get(type); } diff --git a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/ItemRewriter.java b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/ItemRewriter.java index 8b2d6702..86a336b9 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/ItemRewriter.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/ItemRewriter.java @@ -19,7 +19,7 @@ package nl.matsv.viabackwards.api.rewriters; import nl.matsv.viabackwards.api.BackwardsProtocol; import nl.matsv.viabackwards.api.data.MappedItem; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.minecraft.item.Item; import us.myles.viaversion.libs.opennbt.tag.builtin.ByteTag; import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag; @@ -38,8 +38,7 @@ public abstract class ItemRewriter extends ItemRewr } @Override - @Nullable - public Item handleItemToClient(Item item) { + public @Nullable Item handleItemToClient(Item item) { if (item == null) return null; CompoundTag display = item.getTag() != null ? item.getTag().get("display") : null; @@ -100,8 +99,7 @@ public abstract class ItemRewriter extends ItemRewr } @Override - @Nullable - public Item handleItemToServer(Item item) { + public @Nullable Item handleItemToServer(Item item) { if (item == null) return null; super.handleItemToServer(item); diff --git a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/ItemRewriterBase.java b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/ItemRewriterBase.java index bf2ae4ab..c0621076 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/ItemRewriterBase.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/ItemRewriterBase.java @@ -18,7 +18,7 @@ package nl.matsv.viabackwards.api.rewriters; import nl.matsv.viabackwards.api.BackwardsProtocol; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.minecraft.item.Item; import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag; import us.myles.viaversion.libs.opennbt.tag.builtin.ListTag; @@ -36,8 +36,7 @@ public abstract class ItemRewriterBase extends Rewr nbtTagName = "VB|" + protocol.getClass().getSimpleName(); } - @Nullable - public Item handleItemToClient(Item item) { + public @Nullable Item handleItemToClient(Item item) { if (item == null) return null; if (protocol.getMappingData() != null && protocol.getMappingData().getItemMappings() != null) { item.setIdentifier(protocol.getMappingData().getNewItemId(item.getIdentifier())); @@ -45,8 +44,7 @@ public abstract class ItemRewriterBase extends Rewr return item; } - @Nullable - public Item handleItemToServer(Item item) { + public @Nullable Item handleItemToServer(Item item) { if (item == null) return null; if (protocol.getMappingData() != null && protocol.getMappingData().getItemMappings() != null) { item.setIdentifier(protocol.getMappingData().getOldItemId(item.getIdentifier())); diff --git a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyBlockItemRewriter.java b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyBlockItemRewriter.java index be45f337..2c659bbb 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyBlockItemRewriter.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyBlockItemRewriter.java @@ -23,7 +23,7 @@ import nl.matsv.viabackwards.api.data.MappedLegacyBlockItem; import nl.matsv.viabackwards.api.data.VBMappingDataLoader; import nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.data.BlockColors; import nl.matsv.viabackwards.utils.Block; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.minecraft.chunks.Chunk; import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection; import us.myles.ViaVersion.api.minecraft.item.Item; @@ -92,8 +92,7 @@ public abstract class LegacyBlockItemRewriter exten } @Override - @Nullable - public Item handleItemToClient(Item item) { + public @Nullable Item handleItemToClient(Item item) { if (item == null) return null; MappedLegacyBlockItem data = replacementData.get(item.getIdentifier()); @@ -145,8 +144,7 @@ public abstract class LegacyBlockItemRewriter exten return (b.getId() << 4 | (b.getData() & 15)); } - @Nullable - public Block handleBlock(int blockId, int data) { + public @Nullable Block handleBlock(int blockId, int data) { MappedLegacyBlockItem settings = replacementData.get(blockId); if (settings == null || !settings.isBlock()) return null; diff --git a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyEntityRewriter.java b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyEntityRewriter.java index 7407c4f8..787a8bc5 100644 --- a/common/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyEntityRewriter.java +++ b/common/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyEntityRewriter.java @@ -22,7 +22,7 @@ import nl.matsv.viabackwards.api.BackwardsProtocol; import nl.matsv.viabackwards.api.entities.storage.EntityData; import nl.matsv.viabackwards.api.entities.storage.EntityObjectData; import nl.matsv.viabackwards.api.entities.storage.MetaStorage; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.entities.EntityType; import us.myles.ViaVersion.api.entities.ObjectType; import us.myles.ViaVersion.api.minecraft.metadata.MetaType; @@ -56,8 +56,7 @@ public abstract class LegacyEntityRewriter extends return entData; } - @Nullable - protected EntityData getObjectData(ObjectType type) { + protected @Nullable EntityData getObjectData(ObjectType type) { return objectTypes.get(type); } diff --git a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/BlockItemPackets1_12.java b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/BlockItemPackets1_12.java index 6a77e8de..6cd0637c 100644 --- a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/BlockItemPackets1_12.java +++ b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/BlockItemPackets1_12.java @@ -21,7 +21,7 @@ package nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.packets; import nl.matsv.viabackwards.api.rewriters.LegacyBlockItemRewriter; import nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.Protocol1_11_1To1_12; import nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.data.MapColorMapping; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.PacketWrapper; import us.myles.ViaVersion.api.minecraft.BlockChangeRecord; import us.myles.ViaVersion.api.minecraft.chunks.Chunk; diff --git a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java index 5708190b..211f7e03 100644 --- a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java +++ b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java @@ -20,7 +20,7 @@ package nl.matsv.viabackwards.protocol.protocol1_12_2to1_13.data; import nl.matsv.viabackwards.ViaBackwards; import nl.matsv.viabackwards.api.data.VBMappings; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.data.MappingDataLoader; import us.myles.ViaVersion.api.data.Mappings; @@ -95,8 +95,7 @@ public class BackwardsMappings extends nl.matsv.viabackwards.api.data.BackwardsM } @Override - @Nullable - protected Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { + protected @Nullable Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { if (key.equals("blockstates")) { short[] oldToNew = new short[8582]; Arrays.fill(oldToNew, (short) -1); diff --git a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/data/CommandRewriter1_14.java b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/data/CommandRewriter1_14.java index 2a0cf19e..75e615ec 100644 --- a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/data/CommandRewriter1_14.java +++ b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/data/CommandRewriter1_14.java @@ -17,7 +17,7 @@ */ package nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.data; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.rewriters.CommandRewriter; import us.myles.ViaVersion.api.type.Type; @@ -37,8 +37,7 @@ public class CommandRewriter1_14 extends CommandRewriter { } @Override - @Nullable - protected String handleArgumentType(String argumentType) { + protected @Nullable String handleArgumentType(String argumentType) { switch (argumentType) { case "minecraft:nbt_compound_tag": return "minecraft:nbt"; diff --git a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13to1_13_1/data/CommandRewriter1_13_1.java b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13to1_13_1/data/CommandRewriter1_13_1.java index 6e98482f..c33e943a 100644 --- a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13to1_13_1/data/CommandRewriter1_13_1.java +++ b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13to1_13_1/data/CommandRewriter1_13_1.java @@ -17,7 +17,7 @@ */ package nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.data; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.rewriters.CommandRewriter; import us.myles.ViaVersion.api.type.Type; @@ -33,8 +33,7 @@ public class CommandRewriter1_13_1 extends CommandRewriter { } @Override - @Nullable - protected String handleArgumentType(String argumentType) { + protected @Nullable String handleArgumentType(String argumentType) { if (argumentType.equals("minecraft:column_pos")) { return "minecraft:vec2"; } else if (argumentType.equals("minecraft:dimension")) { diff --git a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/data/CommandRewriter1_16.java b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/data/CommandRewriter1_16.java index 62c8fcd3..6bb82257 100644 --- a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/data/CommandRewriter1_16.java +++ b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/data/CommandRewriter1_16.java @@ -17,7 +17,7 @@ */ package nl.matsv.viabackwards.protocol.protocol1_15_2to1_16.data; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.rewriters.CommandRewriter; @@ -28,8 +28,7 @@ public class CommandRewriter1_16 extends CommandRewriter { } @Override - @Nullable - protected String handleArgumentType(String argumentType) { + protected @Nullable String handleArgumentType(String argumentType) { if (argumentType.equals("minecraft:uuid")) { return "minecraft:game_profile"; } diff --git a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_16_1to1_16_2/data/CommandRewriter1_16_2.java b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_16_1to1_16_2/data/CommandRewriter1_16_2.java index 769dc5cf..1d3860ae 100644 --- a/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_16_1to1_16_2/data/CommandRewriter1_16_2.java +++ b/common/src/main/java/nl/matsv/viabackwards/protocol/protocol1_16_1to1_16_2/data/CommandRewriter1_16_2.java @@ -17,7 +17,7 @@ */ package nl.matsv.viabackwards.protocol.protocol1_16_1to1_16_2.data; -import org.jetbrains.annotations.Nullable; +import org.checkerframework.checker.nullness.qual.Nullable; import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.rewriters.CommandRewriter; import us.myles.ViaVersion.api.type.Type; @@ -33,8 +33,7 @@ public class CommandRewriter1_16_2 extends CommandRewriter { } @Override - @Nullable - protected String handleArgumentType(String argumentType) { + protected @Nullable String handleArgumentType(String argumentType) { if (argumentType.equals("minecraft:angle")) { return "brigadier:string"; }