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

@@ -342,7 +342,7 @@ public final class CraftLegacy {
}
String name = blockTag.get("Name").asString("");
Block block = BuiltInRegistries.BLOCK.get(new MinecraftKey(name));
Block block = BuiltInRegistries.BLOCK.get(MinecraftKey.parse(name));
if (block == null) {
continue;
}
@@ -416,7 +416,7 @@ public final class CraftLegacy {
}
// Preconditions.checkState(newId.contains("minecraft:"), "Unknown new material for " + matData);
Item newMaterial = BuiltInRegistries.ITEM.get(new MinecraftKey(newId));
Item newMaterial = BuiltInRegistries.ITEM.get(MinecraftKey.parse(newId));
if (newMaterial == Items.AIR) {
continue;

View File

@@ -0,0 +1,12 @@
package org.bukkit.craftbukkit.legacy;
import org.bukkit.craftbukkit.legacy.reroute.NotInBukkit;
import org.bukkit.event.entity.EntityCombustEvent;
public class MethodRerouting {
@NotInBukkit
public static int getDuration(EntityCombustEvent event) {
return (int) event.getDuration();
}
}