Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 75faba7fde
commit b3a8254758
619 changed files with 10708 additions and 8451 deletions

View File

@@ -193,6 +193,9 @@ public class Commodore
case "ZOMBIE_PIGMAN_SPAWN_EGG":
name = "ZOMBIFIED_PIGLIN_SPAWN_EGG";
break;
case "GRASS_PATH":
name = "DIRT_PATH";
break;
}
}

View File

@@ -38,7 +38,7 @@ public final class CraftChatMessage {
}
public static ChatColor getColor(EnumChatFormat format) {
return ChatColor.getByChar(format.character);
return ChatColor.getByChar(format.code);
}
private static final class StringMessage {
@@ -46,11 +46,11 @@ public final class CraftChatMessage {
// Separate pattern with no group 3, new lines are part of previous string
private static final Pattern INCREMENTAL_PATTERN_KEEP_NEWLINES = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-orx])|((?:(?:https?):\\/\\/)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + " ]|$))))", Pattern.CASE_INSENSITIVE);
// ChatColor.b does not explicitly reset, its more of empty
private static final ChatModifier RESET = ChatModifier.a.setBold(false).setItalic(false).setUnderline(false).setStrikethrough(false).setRandom(false);
private static final ChatModifier RESET = ChatModifier.EMPTY.setBold(false).setItalic(false).setUnderline(false).setStrikethrough(false).setRandom(false);
private final List<IChatBaseComponent> list = new ArrayList<IChatBaseComponent>();
private IChatMutableComponent currentChatComponent = new ChatComponentText("");
private ChatModifier modifier = ChatModifier.a;
private ChatModifier modifier = ChatModifier.EMPTY;
private final IChatBaseComponent[] output;
private int currentIndex;
private StringBuilder hex;

View File

@@ -5,7 +5,7 @@ import net.minecraft.world.damagesource.DamageSource;
// Util class to create custom DamageSources.
public final class CraftDamageSource extends DamageSource {
public static DamageSource copyOf(final DamageSource original) {
CraftDamageSource newSource = new CraftDamageSource(original.translationIndex);
CraftDamageSource newSource = new CraftDamageSource(original.msgId);
// Check ignoresArmor
if (original.ignoresArmor()) {

View File

@@ -11,12 +11,12 @@ public class CraftDimensionUtil {
public static ResourceKey<World> getMainDimensionKey(World world) {
ResourceKey<DimensionManager> typeKey = world.getTypeKey();
if (typeKey == DimensionManager.OVERWORLD) {
if (typeKey == DimensionManager.OVERWORLD_LOCATION) {
return World.OVERWORLD;
} else if (typeKey == DimensionManager.THE_NETHER) {
return World.THE_NETHER;
} else if (typeKey == DimensionManager.THE_END) {
return World.THE_END;
} else if (typeKey == DimensionManager.NETHER_LOCATION) {
return World.NETHER;
} else if (typeKey == DimensionManager.END_LOCATION) {
return World.END;
}
return world.getDimensionKey();

View File

@@ -198,7 +198,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
return Material.getMaterial(material);
}
Dynamic<NBTBase> name = new Dynamic<>(DynamicOpsNBT.a, NBTTagString.a("minecraft:" + material.toLowerCase(Locale.ROOT)));
Dynamic<NBTBase> name = new Dynamic<>(DynamicOpsNBT.INSTANCE, NBTTagString.a("minecraft:" + material.toLowerCase(Locale.ROOT)));
Dynamic<NBTBase> converted = DataConverterRegistry.a().update(DataConverterTypes.ITEM_NAME, name, version, this.getDataVersion());
if (name.equals(converted)) {
@@ -224,7 +224,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
* @return string
*/
public String getMappingsVersion() {
return "d4b392244df170796f8779ef0fc1f2e9";
return "acd6e6c27e5a0a9440afba70a96c27c9";
}
@Override
@@ -248,7 +248,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
private static File getBukkitDataPackFolder() {
return new File(MinecraftServer.getServer().a(SavedFile.DATAPACKS).toFile(), "bukkit");
return new File(MinecraftServer.getServer().a(SavedFile.DATAPACK_DIR).toFile(), "bukkit");
}
@Override
@@ -258,11 +258,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
MinecraftKey minecraftkey = CraftNamespacedKey.toMinecraft(key);
JsonElement jsonelement = AdvancementDataWorld.DESERIALIZER.fromJson(advancement, JsonElement.class);
JsonElement jsonelement = AdvancementDataWorld.GSON.fromJson(advancement, JsonElement.class);
JsonObject jsonobject = ChatDeserializer.m(jsonelement, "advancement");
net.minecraft.advancements.Advancement.SerializedAdvancement nms = net.minecraft.advancements.Advancement.SerializedAdvancement.a(jsonobject, new LootDeserializationContext(minecraftkey, MinecraftServer.getServer().getLootPredicateManager()));
if (nms != null) {
MinecraftServer.getServer().getAdvancementData().REGISTRY.a(Maps.newHashMap(Collections.singletonMap(minecraftkey, nms)));
MinecraftServer.getServer().getAdvancementData().advancements.a(Maps.newHashMap(Collections.singletonMap(minecraftkey, nms)));
Advancement bukkit = Bukkit.getAdvancement(key);
if (bukkit != null) {
@@ -290,7 +290,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
return file.delete();
}
private static final List<String> SUPPORTED_API = Arrays.asList("1.13", "1.14", "1.15", "1.16");
private static final List<String> SUPPORTED_API = Arrays.asList("1.13", "1.14", "1.15", "1.16", "1.17");
@Override
public void checkSupported(PluginDescriptionFile pdf) throws InvalidPluginException {

View File

@@ -4,8 +4,10 @@ import java.util.List;
import java.util.Random;
import java.util.function.Predicate;
import net.minecraft.core.BlockPosition;
import net.minecraft.core.EnumDirection;
import net.minecraft.core.IRegistryCustom;
import net.minecraft.core.particles.ParticleParam;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.WorldServer;
import net.minecraft.sounds.SoundCategory;
import net.minecraft.sounds.SoundEffect;
@@ -25,6 +27,8 @@ import net.minecraft.world.level.chunk.ChunkStatus;
import net.minecraft.world.level.chunk.IChunkAccess;
import net.minecraft.world.level.chunk.IChunkProvider;
import net.minecraft.world.level.dimension.DimensionManager;
import net.minecraft.world.level.entity.EntityTypeTest;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.levelgen.HeightMap;
import net.minecraft.world.level.lighting.LightEngine;
import net.minecraft.world.level.material.Fluid;
@@ -59,6 +63,11 @@ public class DummyGeneratorAccess implements GeneratorAccess {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public MinecraftServer getMinecraftServer() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public IChunkProvider getChunkProvider() {
throw new UnsupportedOperationException("Not supported yet.");
@@ -81,6 +90,11 @@ public class DummyGeneratorAccess implements GeneratorAccess {
@Override
public void a(EntityHuman entityhuman, int i, BlockPosition blockposition, int j) {
// Used by PowderSnowBlock.removeFluid
}
@Override
public void a(Entity entity, GameEvent gameevent, BlockPosition blockposition) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -90,7 +104,7 @@ public class DummyGeneratorAccess implements GeneratorAccess {
}
@Override
public IRegistryCustom r() {
public IRegistryCustom t() {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -100,7 +114,7 @@ public class DummyGeneratorAccess implements GeneratorAccess {
}
@Override
public <T extends Entity> List<T> a(Class<? extends T> type, AxisAlignedBB aabb, Predicate<? super T> prdct) {
public <T extends Entity> List<T> a(EntityTypeTest<Entity, T> ett, AxisAlignedBB aabb, Predicate<? super T> prdct) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -120,12 +134,12 @@ public class DummyGeneratorAccess implements GeneratorAccess {
}
@Override
public int c() {
public int n_() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public BiomeManager d() {
public BiomeManager r_() {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -135,8 +149,8 @@ public class DummyGeneratorAccess implements GeneratorAccess {
}
@Override
public boolean s_() {
throw new UnsupportedOperationException("Not supported yet.");
public boolean isClientSide() {
return false;
}
@Override
@@ -150,7 +164,12 @@ public class DummyGeneratorAccess implements GeneratorAccess {
}
@Override
public LightEngine e() {
public float a(EnumDirection ed, boolean bln) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public LightEngine k_() {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -179,6 +198,11 @@ public class DummyGeneratorAccess implements GeneratorAccess {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean b(BlockPosition bp, Predicate<Fluid> prdct) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
return false;