mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-22 16:57:40 +01:00
Move to checker qual nullability annotations
This commit is contained in:
parent
8d7ed4c16c
commit
066fef0513
@ -7,7 +7,7 @@ object Versions {
|
|||||||
const val guava = "17.0"
|
const val guava = "17.0"
|
||||||
const val fabricLoader = "0.4.8+build.154"
|
const val fabricLoader = "0.4.8+build.154"
|
||||||
const val log4j = "2.8.1"
|
const val log4j = "2.8.1"
|
||||||
const val jetbrainsAnnotations = "20.1.0"
|
const val checkerQual = "3.12.0"
|
||||||
|
|
||||||
// Platforms
|
// Platforms
|
||||||
const val spigot = "1.16.5-R0.1-SNAPSHOT"
|
const val spigot = "1.16.5-R0.1-SNAPSHOT"
|
||||||
|
@ -11,5 +11,5 @@ dependencies {
|
|||||||
compileOnly("io.netty", "netty-all", Versions.netty)
|
compileOnly("io.netty", "netty-all", Versions.netty)
|
||||||
compileOnlyApi("us.myles", "viaversion", Versions.viaversion)
|
compileOnlyApi("us.myles", "viaversion", Versions.viaversion)
|
||||||
compileOnlyApi("com.google.guava", "guava", Versions.guava)
|
compileOnlyApi("com.google.guava", "guava", Versions.guava)
|
||||||
compileOnlyApi("org.jetbrains", "annotations", Versions.jetbrainsAnnotations)
|
compileOnlyApi("org.checkerframework", "checker-qual", Versions.checkerQual)
|
||||||
}
|
}
|
@ -19,7 +19,7 @@ package nl.matsv.viabackwards.api;
|
|||||||
|
|
||||||
import nl.matsv.viabackwards.api.data.BackwardsMappings;
|
import nl.matsv.viabackwards.api.data.BackwardsMappings;
|
||||||
import nl.matsv.viabackwards.api.entities.storage.EntityTracker;
|
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.Via;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.protocol.ClientboundPacketType;
|
import us.myles.ViaVersion.api.protocol.ClientboundPacketType;
|
||||||
|
@ -19,7 +19,7 @@ package nl.matsv.viabackwards.api.data;
|
|||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import nl.matsv.viabackwards.api.BackwardsProtocol;
|
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.Via;
|
||||||
import us.myles.ViaVersion.api.data.MappingData;
|
import us.myles.ViaVersion.api.data.MappingData;
|
||||||
import us.myles.ViaVersion.api.data.Mappings;
|
import us.myles.ViaVersion.api.data.Mappings;
|
||||||
@ -71,8 +71,7 @@ public class BackwardsMappings extends MappingData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
protected @Nullable Mappings loadFromArray(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
||||||
protected Mappings loadFromArray(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
|
||||||
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
|
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
|
||||||
|
|
||||||
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
|
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
|
||||||
@ -80,8 +79,7 @@ public class BackwardsMappings extends MappingData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
protected @Nullable Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
||||||
protected Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
|
||||||
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
|
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
|
||||||
|
|
||||||
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : 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");
|
return checkValidity(id, this.itemMappings.inverse().get(id), "item");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable MappedItem getMappedItem(int id) {
|
||||||
public MappedItem getMappedItem(int id) {
|
|
||||||
return backwardsItemMappings != null ? backwardsItemMappings.get(id) : null;
|
return backwardsItemMappings != null ? backwardsItemMappings.get(id) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable String getMappedNamedSound(String id) {
|
||||||
public String getMappedNamedSound(String id) {
|
|
||||||
if (backwardsItemMappings == null) {
|
if (backwardsItemMappings == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -142,13 +138,11 @@ public class BackwardsMappings extends MappingData {
|
|||||||
return backwardsSoundMappings.get(id);
|
return backwardsSoundMappings.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable Int2ObjectMap<MappedItem> getBackwardsItemMappings() {
|
||||||
public Int2ObjectMap<MappedItem> getBackwardsItemMappings() {
|
|
||||||
return backwardsItemMappings;
|
return backwardsItemMappings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable Map<String, String> getBackwardsSoundMappings() {
|
||||||
public Map<String, String> getBackwardsSoundMappings() {
|
|
||||||
return backwardsSoundMappings;
|
return backwardsSoundMappings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
package nl.matsv.viabackwards.api.data;
|
package nl.matsv.viabackwards.api.data;
|
||||||
|
|
||||||
import nl.matsv.viabackwards.utils.Block;
|
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;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||||
|
|
||||||
public class MappedLegacyBlockItem {
|
public class MappedLegacyBlockItem {
|
||||||
@ -60,8 +60,7 @@ public class MappedLegacyBlockItem {
|
|||||||
return blockEntityHandler != null;
|
return blockEntityHandler != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable BlockEntityHandler getBlockEntityHandler() {
|
||||||
public BlockEntityHandler getBlockEntityHandler() {
|
|
||||||
return blockEntityHandler;
|
return blockEntityHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.EntityTracker;
|
||||||
import nl.matsv.viabackwards.api.entities.storage.MetaStorage;
|
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.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
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.
|
* May be null, use {@link #createMeta(Metadata)} for adding metadata.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
public @Nullable List<Metadata> getExtraData() {
|
||||||
public List<Metadata> getExtraData() {
|
|
||||||
return extraData;
|
return extraData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
package nl.matsv.viabackwards.api.entities.meta;
|
package nl.matsv.viabackwards.api.entities.meta;
|
||||||
|
|
||||||
import nl.matsv.viabackwards.api.exceptions.RemovedValueException;
|
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.entities.EntityType;
|
||||||
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
||||||
|
|
||||||
@ -109,8 +109,7 @@ public class MetaHandlerSettings {
|
|||||||
return filterIndex;
|
return filterIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable MetaHandler getHandler() {
|
||||||
public MetaHandler getHandler() {
|
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
package nl.matsv.viabackwards.api.entities.storage;
|
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;
|
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter;
|
||||||
|
|
||||||
public class EntityData {
|
public class EntityData {
|
||||||
@ -58,8 +58,7 @@ public class EntityData {
|
|||||||
/**
|
/**
|
||||||
* @return custom mobname, can be either a String or a JsonElement
|
* @return custom mobname, can be either a String or a JsonElement
|
||||||
*/
|
*/
|
||||||
@Nullable
|
public @Nullable Object getMobName() {
|
||||||
public Object getMobName() {
|
|
||||||
return mobName;
|
return mobName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,8 +66,7 @@ public class EntityData {
|
|||||||
return replacementId;
|
return replacementId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable MetaCreator getDefaultMeta() {
|
||||||
public MetaCreator getDefaultMeta() {
|
|
||||||
return defaultMeta;
|
return defaultMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
package nl.matsv.viabackwards.api.entities.storage;
|
package nl.matsv.viabackwards.api.entities.storage;
|
||||||
|
|
||||||
import nl.matsv.viabackwards.api.BackwardsProtocol;
|
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.StoredObject;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.entities.EntityType;
|
import us.myles.ViaVersion.api.entities.EntityType;
|
||||||
@ -41,8 +41,7 @@ public class EntityTracker extends StoredObject {
|
|||||||
trackers.put(protocol, new ProtocolEntityTracker());
|
trackers.put(protocol, new ProtocolEntityTracker());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable ProtocolEntityTracker get(BackwardsProtocol protocol) {
|
||||||
public ProtocolEntityTracker get(BackwardsProtocol protocol) {
|
|
||||||
return trackers.get(protocol);
|
return trackers.get(protocol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
package nl.matsv.viabackwards.api.entities.storage;
|
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 us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -46,8 +46,7 @@ public class MetaStorage {
|
|||||||
this.metaDataList.add(data);
|
this.metaDataList.add(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable Metadata get(int index) {
|
||||||
public Metadata get(int index) {
|
|
||||||
for (Metadata meta : this.metaDataList) {
|
for (Metadata meta : this.metaDataList) {
|
||||||
if (index == meta.getId()) {
|
if (index == meta.getId()) {
|
||||||
return meta;
|
return meta;
|
||||||
|
@ -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.EntityTracker;
|
||||||
import nl.matsv.viabackwards.api.entities.storage.MetaStorage;
|
import nl.matsv.viabackwards.api.entities.storage.MetaStorage;
|
||||||
import nl.matsv.viabackwards.api.exceptions.RemovedValueException;
|
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.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.Via;
|
import us.myles.ViaVersion.api.Via;
|
||||||
import us.myles.ViaVersion.api.data.ParticleMappings;
|
import us.myles.ViaVersion.api.data.ParticleMappings;
|
||||||
@ -91,8 +91,7 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends Re
|
|||||||
return entityTypes.containsKey(type);
|
return entityTypes.containsKey(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
protected @Nullable EntityData getEntityData(EntityType type) {
|
||||||
protected EntityData getEntityData(EntityType type) {
|
|
||||||
return entityTypes.get(type);
|
return entityTypes.get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ package nl.matsv.viabackwards.api.rewriters;
|
|||||||
|
|
||||||
import nl.matsv.viabackwards.api.BackwardsProtocol;
|
import nl.matsv.viabackwards.api.BackwardsProtocol;
|
||||||
import nl.matsv.viabackwards.api.data.MappedItem;
|
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.api.minecraft.item.Item;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.ByteTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.ByteTag;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||||
@ -38,8 +38,7 @@ public abstract class ItemRewriter<T extends BackwardsProtocol> extends ItemRewr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
public @Nullable Item handleItemToClient(Item item) {
|
||||||
public Item handleItemToClient(Item item) {
|
|
||||||
if (item == null) return null;
|
if (item == null) return null;
|
||||||
|
|
||||||
CompoundTag display = item.getTag() != null ? item.getTag().get("display") : null;
|
CompoundTag display = item.getTag() != null ? item.getTag().get("display") : null;
|
||||||
@ -100,8 +99,7 @@ public abstract class ItemRewriter<T extends BackwardsProtocol> extends ItemRewr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
public @Nullable Item handleItemToServer(Item item) {
|
||||||
public Item handleItemToServer(Item item) {
|
|
||||||
if (item == null) return null;
|
if (item == null) return null;
|
||||||
|
|
||||||
super.handleItemToServer(item);
|
super.handleItemToServer(item);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
package nl.matsv.viabackwards.api.rewriters;
|
package nl.matsv.viabackwards.api.rewriters;
|
||||||
|
|
||||||
import nl.matsv.viabackwards.api.BackwardsProtocol;
|
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.api.minecraft.item.Item;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.ListTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.ListTag;
|
||||||
@ -36,8 +36,7 @@ public abstract class ItemRewriterBase<T extends BackwardsProtocol> extends Rewr
|
|||||||
nbtTagName = "VB|" + protocol.getClass().getSimpleName();
|
nbtTagName = "VB|" + protocol.getClass().getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable Item handleItemToClient(Item item) {
|
||||||
public Item handleItemToClient(Item item) {
|
|
||||||
if (item == null) return null;
|
if (item == null) return null;
|
||||||
if (protocol.getMappingData() != null && protocol.getMappingData().getItemMappings() != null) {
|
if (protocol.getMappingData() != null && protocol.getMappingData().getItemMappings() != null) {
|
||||||
item.setIdentifier(protocol.getMappingData().getNewItemId(item.getIdentifier()));
|
item.setIdentifier(protocol.getMappingData().getNewItemId(item.getIdentifier()));
|
||||||
@ -45,8 +44,7 @@ public abstract class ItemRewriterBase<T extends BackwardsProtocol> extends Rewr
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable Item handleItemToServer(Item item) {
|
||||||
public Item handleItemToServer(Item item) {
|
|
||||||
if (item == null) return null;
|
if (item == null) return null;
|
||||||
if (protocol.getMappingData() != null && protocol.getMappingData().getItemMappings() != null) {
|
if (protocol.getMappingData() != null && protocol.getMappingData().getItemMappings() != null) {
|
||||||
item.setIdentifier(protocol.getMappingData().getOldItemId(item.getIdentifier()));
|
item.setIdentifier(protocol.getMappingData().getOldItemId(item.getIdentifier()));
|
||||||
|
@ -23,7 +23,7 @@ import nl.matsv.viabackwards.api.data.MappedLegacyBlockItem;
|
|||||||
import nl.matsv.viabackwards.api.data.VBMappingDataLoader;
|
import nl.matsv.viabackwards.api.data.VBMappingDataLoader;
|
||||||
import nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.data.BlockColors;
|
import nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.data.BlockColors;
|
||||||
import nl.matsv.viabackwards.utils.Block;
|
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.Chunk;
|
||||||
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
|
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
|
||||||
import us.myles.ViaVersion.api.minecraft.item.Item;
|
import us.myles.ViaVersion.api.minecraft.item.Item;
|
||||||
@ -92,8 +92,7 @@ public abstract class LegacyBlockItemRewriter<T extends BackwardsProtocol> exten
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
public @Nullable Item handleItemToClient(Item item) {
|
||||||
public Item handleItemToClient(Item item) {
|
|
||||||
if (item == null) return null;
|
if (item == null) return null;
|
||||||
|
|
||||||
MappedLegacyBlockItem data = replacementData.get(item.getIdentifier());
|
MappedLegacyBlockItem data = replacementData.get(item.getIdentifier());
|
||||||
@ -145,8 +144,7 @@ public abstract class LegacyBlockItemRewriter<T extends BackwardsProtocol> exten
|
|||||||
return (b.getId() << 4 | (b.getData() & 15));
|
return (b.getId() << 4 | (b.getData() & 15));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public @Nullable Block handleBlock(int blockId, int data) {
|
||||||
public Block handleBlock(int blockId, int data) {
|
|
||||||
MappedLegacyBlockItem settings = replacementData.get(blockId);
|
MappedLegacyBlockItem settings = replacementData.get(blockId);
|
||||||
if (settings == null || !settings.isBlock()) return null;
|
if (settings == null || !settings.isBlock()) return null;
|
||||||
|
|
||||||
|
@ -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.EntityData;
|
||||||
import nl.matsv.viabackwards.api.entities.storage.EntityObjectData;
|
import nl.matsv.viabackwards.api.entities.storage.EntityObjectData;
|
||||||
import nl.matsv.viabackwards.api.entities.storage.MetaStorage;
|
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.EntityType;
|
||||||
import us.myles.ViaVersion.api.entities.ObjectType;
|
import us.myles.ViaVersion.api.entities.ObjectType;
|
||||||
import us.myles.ViaVersion.api.minecraft.metadata.MetaType;
|
import us.myles.ViaVersion.api.minecraft.metadata.MetaType;
|
||||||
@ -56,8 +56,7 @@ public abstract class LegacyEntityRewriter<T extends BackwardsProtocol> extends
|
|||||||
return entData;
|
return entData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
protected @Nullable EntityData getObjectData(ObjectType type) {
|
||||||
protected EntityData getObjectData(ObjectType type) {
|
|
||||||
return objectTypes.get(type);
|
return objectTypes.get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.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.Protocol1_11_1To1_12;
|
||||||
import nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.data.MapColorMapping;
|
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.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.minecraft.BlockChangeRecord;
|
import us.myles.ViaVersion.api.minecraft.BlockChangeRecord;
|
||||||
import us.myles.ViaVersion.api.minecraft.chunks.Chunk;
|
import us.myles.ViaVersion.api.minecraft.chunks.Chunk;
|
||||||
|
@ -20,7 +20,7 @@ package nl.matsv.viabackwards.protocol.protocol1_12_2to1_13.data;
|
|||||||
|
|
||||||
import nl.matsv.viabackwards.ViaBackwards;
|
import nl.matsv.viabackwards.ViaBackwards;
|
||||||
import nl.matsv.viabackwards.api.data.VBMappings;
|
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.Via;
|
||||||
import us.myles.ViaVersion.api.data.MappingDataLoader;
|
import us.myles.ViaVersion.api.data.MappingDataLoader;
|
||||||
import us.myles.ViaVersion.api.data.Mappings;
|
import us.myles.ViaVersion.api.data.Mappings;
|
||||||
@ -95,8 +95,7 @@ public class BackwardsMappings extends nl.matsv.viabackwards.api.data.BackwardsM
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
protected @Nullable Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
||||||
protected Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
|
|
||||||
if (key.equals("blockstates")) {
|
if (key.equals("blockstates")) {
|
||||||
short[] oldToNew = new short[8582];
|
short[] oldToNew = new short[8582];
|
||||||
Arrays.fill(oldToNew, (short) -1);
|
Arrays.fill(oldToNew, (short) -1);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package nl.matsv.viabackwards.protocol.protocol1_13_2to1_14.data;
|
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.protocol.Protocol;
|
||||||
import us.myles.ViaVersion.api.rewriters.CommandRewriter;
|
import us.myles.ViaVersion.api.rewriters.CommandRewriter;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
@ -37,8 +37,7 @@ public class CommandRewriter1_14 extends CommandRewriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
protected @Nullable String handleArgumentType(String argumentType) {
|
||||||
protected String handleArgumentType(String argumentType) {
|
|
||||||
switch (argumentType) {
|
switch (argumentType) {
|
||||||
case "minecraft:nbt_compound_tag":
|
case "minecraft:nbt_compound_tag":
|
||||||
return "minecraft:nbt";
|
return "minecraft:nbt";
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.data;
|
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.protocol.Protocol;
|
||||||
import us.myles.ViaVersion.api.rewriters.CommandRewriter;
|
import us.myles.ViaVersion.api.rewriters.CommandRewriter;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
@ -33,8 +33,7 @@ public class CommandRewriter1_13_1 extends CommandRewriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
protected @Nullable String handleArgumentType(String argumentType) {
|
||||||
protected String handleArgumentType(String argumentType) {
|
|
||||||
if (argumentType.equals("minecraft:column_pos")) {
|
if (argumentType.equals("minecraft:column_pos")) {
|
||||||
return "minecraft:vec2";
|
return "minecraft:vec2";
|
||||||
} else if (argumentType.equals("minecraft:dimension")) {
|
} else if (argumentType.equals("minecraft:dimension")) {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package nl.matsv.viabackwards.protocol.protocol1_15_2to1_16.data;
|
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.protocol.Protocol;
|
||||||
import us.myles.ViaVersion.api.rewriters.CommandRewriter;
|
import us.myles.ViaVersion.api.rewriters.CommandRewriter;
|
||||||
|
|
||||||
@ -28,8 +28,7 @@ public class CommandRewriter1_16 extends CommandRewriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
protected @Nullable String handleArgumentType(String argumentType) {
|
||||||
protected String handleArgumentType(String argumentType) {
|
|
||||||
if (argumentType.equals("minecraft:uuid")) {
|
if (argumentType.equals("minecraft:uuid")) {
|
||||||
return "minecraft:game_profile";
|
return "minecraft:game_profile";
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package nl.matsv.viabackwards.protocol.protocol1_16_1to1_16_2.data;
|
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.protocol.Protocol;
|
||||||
import us.myles.ViaVersion.api.rewriters.CommandRewriter;
|
import us.myles.ViaVersion.api.rewriters.CommandRewriter;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
@ -33,8 +33,7 @@ public class CommandRewriter1_16_2 extends CommandRewriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
protected @Nullable String handleArgumentType(String argumentType) {
|
||||||
protected String handleArgumentType(String argumentType) {
|
|
||||||
if (argumentType.equals("minecraft:angle")) {
|
if (argumentType.equals("minecraft:angle")) {
|
||||||
return "brigadier:string";
|
return "brigadier:string";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user