mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-07 15:42:19 -07:00
moonrise
This commit is contained in:
@@ -451,7 +451,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ 4067,
|
||||
+ 4068,
|
||||
+ 4081,
|
||||
+ // All up to 1.21.3
|
||||
+ 4173,
|
||||
+ 4175,
|
||||
+ 4176,
|
||||
+ 4180,
|
||||
+ 4181
|
||||
+ // All up to 1.21.4-pre2
|
||||
+ };
|
||||
+ Arrays.sort(converterVersions);
|
||||
+
|
||||
@@ -1201,6 +1206,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public static final int V1_21_2_RC2 = 4079;
|
||||
+ public static final int V1_21_2 = 4080;
|
||||
+ public static final int V1_21_3 = 4082;
|
||||
+ public static final int V24W44A = 4174;
|
||||
+ public static final int V24W45A = 4177;
|
||||
+ public static final int V24W46A = 4178;
|
||||
+ public static final int V1_21_4_PRE1 = 4179;
|
||||
+ public static final int V1_21_4_PRE2 = 4182;
|
||||
+
|
||||
+ private MCVersions() {}
|
||||
+}
|
||||
@@ -9664,6 +9674,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ V4071.register();
|
||||
+ // V1.21.3
|
||||
+ V4081.register();
|
||||
+ // V1.21.4
|
||||
+ V4173.register();
|
||||
+ V4175.register();
|
||||
+ V4176.register();
|
||||
+ V4180.register();
|
||||
+ V4181.register();
|
||||
+ }
|
||||
+
|
||||
+ private MCTypeRegistry() {}
|
||||
@@ -24374,6 +24390,202 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ private V4081() {}
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4173.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4173.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4173.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft.versions;
|
||||
+
|
||||
+import ca.spottedleaf.dataconverter.converters.DataConverter;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.converters.helpers.RenameHelper;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+import ca.spottedleaf.dataconverter.types.MapType;
|
||||
+
|
||||
+public final class V4173 {
|
||||
+
|
||||
+ private static final int VERSION = MCVersions.V1_21_3 + 91;
|
||||
+
|
||||
+ public static void register() {
|
||||
+ MCTypeRegistry.ENTITY.addStructureConverter(new DataConverter<>(VERSION) {
|
||||
+ @Override
|
||||
+ public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) {
|
||||
+ RenameHelper.renameSingle(data, "TNTFuse", "fuse");
|
||||
+ return null;
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ private V4173() {}
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4175.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4175.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4175.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft.versions;
|
||||
+
|
||||
+import ca.spottedleaf.dataconverter.converters.DataConverter;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.converters.helpers.RenameHelper;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+import ca.spottedleaf.dataconverter.types.ListType;
|
||||
+import ca.spottedleaf.dataconverter.types.MapType;
|
||||
+import ca.spottedleaf.dataconverter.types.TypeUtil;
|
||||
+
|
||||
+public final class V4175 {
|
||||
+
|
||||
+ private static final int VERSION = MCVersions.V24W44A + 1;
|
||||
+
|
||||
+ public static void register() {
|
||||
+ MCTypeRegistry.DATA_COMPONENTS.addStructureConverter(new DataConverter<>(VERSION) {
|
||||
+ @Override
|
||||
+ public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) {
|
||||
+ RenameHelper.renameSingle(data.getMap("minecraft:equippable"), "model", "asset_id");
|
||||
+
|
||||
+ final Number modelData = data.getNumber("minecraft:custom_model_data");
|
||||
+ if (modelData != null) {
|
||||
+ final TypeUtil typeUtil = data.getTypeUtil();
|
||||
+
|
||||
+ final MapType<String> newModelData = typeUtil.createEmptyMap();
|
||||
+ data.setMap("minecraft:custom_model_data", newModelData);
|
||||
+
|
||||
+ final ListType floats = typeUtil.createEmptyList();
|
||||
+ newModelData.setList("floats", floats);
|
||||
+
|
||||
+ floats.addFloat(modelData.floatValue());
|
||||
+ }
|
||||
+
|
||||
+ return null;
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ private V4175() {}
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4176.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4176.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4176.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft.versions;
|
||||
+
|
||||
+import ca.spottedleaf.dataconverter.converters.DataConverter;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+import ca.spottedleaf.dataconverter.types.MapType;
|
||||
+
|
||||
+public final class V4176 {
|
||||
+
|
||||
+ private static final int VERSION = MCVersions.V24W44A + 2;
|
||||
+
|
||||
+ private static void fixInvalidLock(final MapType<String> root, final String path) {
|
||||
+ final MapType<String> lock = root.getMap(path);
|
||||
+ if (lock == null || lock.size() != 1) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ final MapType<String> components = lock.getMap("components");
|
||||
+ if (components == null || components.size() != 1 || !"\"\"".equals(components.getString("minecraft:custom_name"))) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ root.remove(path);
|
||||
+ }
|
||||
+
|
||||
+ public static void register() {
|
||||
+ MCTypeRegistry.TILE_ENTITY.addStructureConverter(new DataConverter<>(VERSION) {
|
||||
+ @Override
|
||||
+ public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) {
|
||||
+ fixInvalidLock(data, "lock");
|
||||
+ return null;
|
||||
+ }
|
||||
+ });
|
||||
+ MCTypeRegistry.DATA_COMPONENTS.addStructureConverter(new DataConverter<>(VERSION) {
|
||||
+ @Override
|
||||
+ public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) {
|
||||
+ fixInvalidLock(data, "minecraft:lock");
|
||||
+ return null;
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ private V4176() {}
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4180.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4180.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4180.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft.versions;
|
||||
+
|
||||
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.converters.leveldat.ConverterRemoveFeatureFlag;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+import java.util.Arrays;
|
||||
+import java.util.HashSet;
|
||||
+
|
||||
+public final class V4180 {
|
||||
+
|
||||
+ private static final int VERSION = MCVersions.V1_21_4_PRE1 + 1;
|
||||
+
|
||||
+ public static void register() {
|
||||
+ MCTypeRegistry.LEVEL.addStructureConverter(new ConverterRemoveFeatureFlag(VERSION, new HashSet<>(
|
||||
+ Arrays.asList(
|
||||
+ "minecraft:winter_drop"
|
||||
+ )
|
||||
+ )));
|
||||
+ }
|
||||
+
|
||||
+ private V4180() {}
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4181.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4181.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V4181.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft.versions;
|
||||
+
|
||||
+import ca.spottedleaf.dataconverter.converters.DataConverter;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.converters.helpers.RenameHelper;
|
||||
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
|
||||
+import ca.spottedleaf.dataconverter.types.MapType;
|
||||
+
|
||||
+public final class V4181 {
|
||||
+
|
||||
+ private static final int VERSION = MCVersions.V1_21_4_PRE1 + 2;
|
||||
+
|
||||
+ public static void register() {
|
||||
+ final DataConverter<MapType<String>, MapType<String>> furnaceConverter = new DataConverter<>(VERSION) {
|
||||
+ @Override
|
||||
+ public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) {
|
||||
+ RenameHelper.renameSingle(data, "CookTime", "cooking_time_spent");
|
||||
+ RenameHelper.renameSingle(data, "CookTimeTotal", "cooking_total_time");
|
||||
+ RenameHelper.renameSingle(data, "BurnTime", "lit_time_remaining");
|
||||
+
|
||||
+ final Object litTotalTime = data.getGeneric("lit_total_time");
|
||||
+ if (litTotalTime != null) {
|
||||
+ data.setGeneric("lit_time_remaining", litTotalTime);
|
||||
+ }
|
||||
+
|
||||
+ return null;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
+ MCTypeRegistry.TILE_ENTITY.addConverterForId("minecraft:furnace", furnaceConverter);
|
||||
+ MCTypeRegistry.TILE_ENTITY.addConverterForId("minecraft:smoker", furnaceConverter);
|
||||
+ MCTypeRegistry.TILE_ENTITY.addConverterForId("minecraft:blast_furnace", furnaceConverter);
|
||||
+ }
|
||||
+
|
||||
+ private V4181() {}
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V501.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V501.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
@@ -30239,7 +30451,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/data/structures/StructureUpdater.java
|
||||
+++ b/src/main/java/net/minecraft/data/structures/StructureUpdater.java
|
||||
@@ -0,0 +0,0 @@ public class StructureUpdater implements SnbtToNbt.Filter {
|
||||
LOGGER.warn("SNBT Too old, do not forget to update: {} < {}: {}", i, 4053, name);
|
||||
LOGGER.warn("SNBT Too old, do not forget to update: {} < {}: {}", i, 4173, name);
|
||||
}
|
||||
|
||||
- CompoundTag compoundTag = DataFixTypes.STRUCTURE.updateToCurrentVersion(DataFixers.getDataFixer(), nbt, i);
|
||||
|
Reference in New Issue
Block a user