Update to Minecraft 1.21

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-06-14 01:05:00 +10:00
parent 7c6204e1a9
commit eed041d629
255 changed files with 3585 additions and 3261 deletions

View File

@@ -15,7 +15,7 @@ public final class ApiVersion implements Comparable<ApiVersion> {
static {
versions = new HashMap<>();
CURRENT = getOrCreateVersion("1.20.6");
CURRENT = getOrCreateVersion("1.21");
FLATTENING = getOrCreateVersion("1.13");
FIELD_NAME_PARITY = getOrCreateVersion("1.20.5");
NONE = getOrCreateVersion("none");

View File

@@ -23,6 +23,7 @@ import joptsimple.OptionSpec;
import org.bukkit.Material;
import org.bukkit.craftbukkit.legacy.FieldRename;
import org.bukkit.craftbukkit.legacy.MaterialRerouting;
import org.bukkit.craftbukkit.legacy.MethodRerouting;
import org.bukkit.craftbukkit.legacy.reroute.RerouteArgument;
import org.bukkit.craftbukkit.legacy.reroute.RerouteBuilder;
import org.bukkit.craftbukkit.legacy.reroute.RerouteMethodData;
@@ -76,6 +77,7 @@ public class Commodore {
public static final List<Map<String, RerouteMethodData>> REROUTES = new ArrayList<>(); // Only used for testing
private static final Map<String, RerouteMethodData> FIELD_RENAME_METHOD_REROUTE = createReroutes(FieldRename.class);
private static final Map<String, RerouteMethodData> MATERIAL_METHOD_REROUTE = createReroutes(MaterialRerouting.class);
private static final Map<String, RerouteMethodData> METHOD_REROUTE = createReroutes(MethodRerouting.class);
public static void main(String[] args) {
OptionParser parser = new OptionParser();
@@ -282,6 +284,9 @@ public class Commodore {
if (checkReroute(visitor, FIELD_RENAME_METHOD_REROUTE, opcode, owner, name, desc, samMethodType, instantiatedMethodType)) {
return;
}
if (checkReroute(visitor, METHOD_REROUTE, opcode, owner, name, desc, samMethodType, instantiatedMethodType)) {
return;
}
// SPIGOT-4496
if (owner.equals("org/bukkit/map/MapView") && name.equals("getId") && desc.equals("()S")) {

View File

@@ -230,7 +230,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
* @return string
*/
public String getMappingsVersion() {
return "ee13f98a43b9c5abffdcc0bb24154460";
return "229d7afc75b70a6c388337687ac4da1f";
}
@Override

View File

@@ -17,7 +17,7 @@ public final class CraftNamespacedKey {
}
public static NamespacedKey fromString(String string) {
return fromMinecraft(new MinecraftKey(string));
return fromMinecraft(MinecraftKey.parse(string));
}
public static NamespacedKey fromMinecraft(MinecraftKey minecraft) {
@@ -25,6 +25,6 @@ public final class CraftNamespacedKey {
}
public static MinecraftKey toMinecraft(NamespacedKey key) {
return new MinecraftKey(key.getNamespace(), key.getKey());
return MinecraftKey.fromNamespaceAndPath(key.getNamespace(), key.getKey());
}
}