From 8e7606ea1b64cfbba160c884174f5cc5a1209e0f Mon Sep 17 00:00:00 2001 From: KennyTV Date: Fri, 4 Jun 2021 15:42:25 +0200 Subject: [PATCH] 1.17-rc1 --- .../com/viaversion/viaversion/api/ViaAPI.java | 2 +- .../viaversion/api/minecraft/item/Item.java | 41 +++++++++++++++++++ .../api/protocol/version/ProtocolVersion.java | 2 +- gradle.properties | 2 +- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java b/api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java index 52aa3358a..2f6bd45e7 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java +++ b/api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java @@ -52,7 +52,7 @@ public interface ViaAPI { * @return API version incremented with meaningful API changes */ default int apiVersion() { - return 2; + return 3; } /** diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/item/Item.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/item/Item.java index bb92fcf3c..a3e30390d 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/item/Item.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/item/Item.java @@ -27,23 +27,64 @@ import org.checkerframework.checker.nullness.qual.Nullable; public interface Item { + /** + * Returns the item identifier. + * + * @return item identifier + */ int identifier(); + /** + * Sets the item identifier. + * + * @param identifier item identifier + */ void setIdentifier(int identifier); + /** + * Returns the item amount. + * + * @return item amount + */ int amount(); + /** + * Returns the item amount. + * + * @param amount item amount + */ void setAmount(int amount); + /** + * Returns the item data. Always 0 for 1.13+ items. + * + * @return item data + */ default short data() { return 0; } + /** + * Sets the item data used in versions before 1.13. + * + * @param data item data + * @throws UnsupportedOperationException if the item implementation does not store data + */ default void setData(short data) { throw new UnsupportedOperationException(); } + /** + * Returns the item compound tag if present. + * + * @return item tag + */ @Nullable CompoundTag tag(); + /** + * Sets the item compound tag. + * + * @param tag item tag + */ void setTag(@Nullable CompoundTag tag); } diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index 8f68c2d06..0c1a0e9fc 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -76,7 +76,7 @@ public class ProtocolVersion { public static final ProtocolVersion v1_16_2 = register(751, "1.16.2"); public static final ProtocolVersion v1_16_3 = register(753, "1.16.3"); public static final ProtocolVersion v1_16_4 = register(754, "1.16.4/5", new VersionRange("1.16", 4, 5)); - public static final ProtocolVersion v1_17 = register(755, 33, "1.17"); + public static final ProtocolVersion v1_17 = register(755, 34, "1.17"); public static final ProtocolVersion unknown = register(-1, "UNKNOWN"); public static ProtocolVersion register(int version, String name) { diff --git a/gradle.properties b/gradle.properties index 754db90ad..2795b4b2a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project properties - we put these here so they can be modified without causing a recompile of the build scripts -projectVersion=4.0.0-1.17-pre5-SNAPSHOT +projectVersion=4.0.0-1.17-rc1-SNAPSHOT # Gradle properties org.gradle.daemon=true