3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00

Add missing DataConverter and fix some imports

not fully sure those imports (or well, those classes being outside of the mc package) are right, but who cares 🤷
Dieser Commit ist enthalten in:
MiniDigger | Martin 2022-06-08 14:01:30 +02:00
Ursprung d28b20944b
Commit 2f0b2b93df

Datei anzeigen

@ -17513,15 +17513,15 @@ index 0000000000000000000000000000000000000000..d971d232f417eda2bef9f9bfbfcbe162
+}
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3086.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3086.java
new file mode 100644
index 0000000000000000000000000000000000000000..86e854b2efd7d23c131ad758152b56870fd5e169
index 0000000000000000000000000000000000000000..6a6f6cb083ead170bc5ef50bd26aa4f4f133ff13
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3086.java
@@ -0,0 +1,49 @@
+package ca.spottedleaf.dataconverter.minecraft.versions;
+
+import ca.spottedleaf.dataconverter.converters.advancements.ConverterCriteriaRename;
+import ca.spottedleaf.dataconverter.converters.entity.ConverterEntityVariant;
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
+import ca.spottedleaf.dataconverter.minecraft.converters.advancements.ConverterCriteriaRename;
+import ca.spottedleaf.dataconverter.minecraft.converters.entity.ConverterEntityVariant;
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
+import com.google.common.collect.ImmutableMap;
+import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
@ -17568,14 +17568,14 @@ index 0000000000000000000000000000000000000000..86e854b2efd7d23c131ad758152b5687
+}
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3087.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3087.java
new file mode 100644
index 0000000000000000000000000000000000000000..70de020f19b356a3c93f4d1d84674d32a4136a24
index 0000000000000000000000000000000000000000..be6b3619d684c3f9ad61024f14177a42504251e2
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3087.java
@@ -0,0 +1,22 @@
+package ca.spottedleaf.dataconverter.minecraft.versions;
+
+import ca.spottedleaf.dataconverter.converters.entity.ConverterEntityVariant;
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
+import ca.spottedleaf.dataconverter.minecraft.converters.entity.ConverterEntityVariant;
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
+import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
+
@ -17594,6 +17594,75 @@ index 0000000000000000000000000000000000000000..70de020f19b356a3c93f4d1d84674d32
+ MCTypeRegistry.ENTITY.addConverterForId("minecraft:frog", new ConverterEntityVariant(VERSION, "Variant", FROG_ID_CONVERSION::get));
+ }
+}
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3088.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3088.java
new file mode 100644
index 0000000000000000000000000000000000000000..bd7d5436b3eaf7ae133c506fe4a7406b79803bc7
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3088.java
@@ -0,0 +1,63 @@
+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;
+import ca.spottedleaf.dataconverter.types.Types;
+import ca.spottedleaf.dataconverter.util.NamespaceUtil;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public final class V3088 {
+
+ // this class originally targeted 3079 but was changed to target a later version without changing the converter, zero clue why
+ protected static final int VERSION = MCVersions.V22W14A;
+
+ private static final Set<String> STATUSES_TO_SKIP_BLENDING = new HashSet<>(
+ Arrays.asList(
+ "minecraft:empty",
+ "minecraft:structure_starts",
+ "minecraft:structure_references",
+ "minecraft:biomes"
+ )
+ );
+
+ public static void register() {
+ MCTypeRegistry.CHUNK.addStructureConverter(new DataConverter<>(VERSION) {
+
+ private static MapType<String> createBlendingData(final int height, final int minY) {
+ final MapType<String> ret = Types.NBT.createEmptyMap();
+
+ ret.setInt("min_section", minY >> 4);
+ ret.setInt("max_section", (minY + height) >> 4);
+
+ return ret;
+ }
+
+ @Override
+ public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) {
+ data.remove("blending_data");
+
+ final String status = NamespaceUtil.correctNamespace(data.getString("Status"));
+ if (status == null) {
+ return null;
+ }
+
+ final MapType<String> belowZeroRetrogen = data.getMap("below_zero_retrogen");
+
+ if (!STATUSES_TO_SKIP_BLENDING.contains(status)) {
+ data.setMap("blending_data", createBlendingData(384, -64));
+ } else if (belowZeroRetrogen != null) {
+ final String realStatus = NamespaceUtil.correctNamespace(belowZeroRetrogen.getString("target_status", "empty"));
+ if (!STATUSES_TO_SKIP_BLENDING.contains(realStatus)) {
+ data.setMap("blending_data", createBlendingData(256, 0));
+ }
+ }
+
+ return null;
+ }
+ });
+ }
+}
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3090.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3090.java
new file mode 100644
index 0000000000000000000000000000000000000000..b3250a0b5ae2ab0aa5fffaace882052388861fd8
@ -17702,17 +17771,17 @@ index 0000000000000000000000000000000000000000..522dcc0fe2ec30bb295a50de40030854
+}
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3097.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3097.java
new file mode 100644
index 0000000000000000000000000000000000000000..d5ac17b59c0dcc9baaeff022ecbf827c237cf9d6
index 0000000000000000000000000000000000000000..2dfb4f4f9fdd064021a9f43352c7a7ddb19297e1
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3097.java
@@ -0,0 +1,61 @@
+package ca.spottedleaf.dataconverter.minecraft.versions;
+
+import ca.spottedleaf.dataconverter.converters.DataConverter;
+import ca.spottedleaf.dataconverter.converters.advancements.ConverterCriteriaRename;
+import ca.spottedleaf.dataconverter.converters.entity.ConverterEntityVariantRename;
+import ca.spottedleaf.dataconverter.converters.poi.ConverterPoiDelete;
+import ca.spottedleaf.dataconverter.minecraft.MCVersions;
+import ca.spottedleaf.dataconverter.minecraft.converters.advancements.ConverterCriteriaRename;
+import ca.spottedleaf.dataconverter.minecraft.converters.entity.ConverterEntityVariantRename;
+import ca.spottedleaf.dataconverter.minecraft.converters.poi.ConverterPoiDelete;
+import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry;
+import ca.spottedleaf.dataconverter.types.MapType;
+import java.util.HashMap;