diff --git a/patches/unapplied/api/Added-PlayerChangeBeaconEffectEvent.patch b/patches/api/Added-PlayerChangeBeaconEffectEvent.patch similarity index 100% rename from patches/unapplied/api/Added-PlayerChangeBeaconEffectEvent.patch rename to patches/api/Added-PlayerChangeBeaconEffectEvent.patch diff --git a/patches/unapplied/api/Added-PlayerStonecutterRecipeSelectEvent.patch b/patches/api/Added-PlayerStonecutterRecipeSelectEvent.patch similarity index 100% rename from patches/unapplied/api/Added-PlayerStonecutterRecipeSelectEvent.patch rename to patches/api/Added-PlayerStonecutterRecipeSelectEvent.patch diff --git a/patches/unapplied/api/Added-Vanilla-Entity-Tags.patch b/patches/api/Added-Vanilla-Entity-Tags.patch similarity index 68% rename from patches/unapplied/api/Added-Vanilla-Entity-Tags.patch rename to patches/api/Added-Vanilla-Entity-Tags.patch index 9cbed09c8c..acf2968d12 100644 --- a/patches/unapplied/api/Added-Vanilla-Entity-Tags.patch +++ b/patches/api/Added-Vanilla-Entity-Tags.patch @@ -18,37 +18,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @deprecated use {@link #REGISTRY_ENTITY_TYPES} + */ + @Deprecated(forRemoval = true) -+ String REGISTRY_ENTITIES = "entities"; ++ String REGISTRY_ENTITIES = REGISTRY_ENTITY_TYPES; + /** + * Vanilla entity tag representing arrow entities. + * @deprecated use {@link #ENTITY_TYPES_ARROWS} + */ + @Deprecated(forRemoval = true) -+ Tag ARROWS = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("arrows"), org.bukkit.entity.EntityType.class); ++ Tag ARROWS = ENTITY_TYPES_ARROWS; + /** + * Vanilla entity tag representing entities that live in beehives + * @deprecated use {@link #ENTITY_TYPES_BEEHIVE_INHABITORS} + */ + @Deprecated(forRemoval = true) -+ Tag BEEHIVE_INHABITORS = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("beehive_inhabitors"), org.bukkit.entity.EntityType.class); ++ Tag BEEHIVE_INHABITORS = ENTITY_TYPES_BEEHIVE_INHABITORS; + /** + * Vanilla entity tag representing projectiles that impact + * @deprecated use {@link #ENTITY_TYPES_IMPACT_PROJECTILES} + */ + @Deprecated(forRemoval = true) -+ Tag IMPACT_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("impact_projectiles"), org.bukkit.entity.EntityType.class); ++ Tag IMPACT_PROJECTILES = ENTITY_TYPES_IMPACT_PROJECTILES; + /** + * Vanilla entity tag for village raiders + * @deprecated use {@link #ENTITY_TYPES_RAIDERS} + */ + @Deprecated(forRemoval = true) -+ Tag RAIDERS = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("raiders"), org.bukkit.entity.EntityType.class); ++ Tag RAIDERS = ENTITY_TYPES_RAIDERS; + /** + * Vanilla entity tag for skeleton types + * @deprecated use {@link #ENTITY_TYPES_SKELETONS} + */ + @Deprecated(forRemoval = true) -+ Tag SKELETONS = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("skeletons"), org.bukkit.entity.EntityType.class); ++ Tag SKELETONS = ENTITY_TYPES_SKELETONS; + // Paper end /** diff --git a/patches/unapplied/api/added-Wither-API.patch b/patches/api/added-Wither-API.patch similarity index 100% rename from patches/unapplied/api/added-Wither-API.patch rename to patches/api/added-Wither-API.patch diff --git a/patches/unapplied/server/Add-toggle-for-always-placing-the-dragon-egg.patch b/patches/server/Add-toggle-for-always-placing-the-dragon-egg.patch similarity index 93% rename from patches/unapplied/server/Add-toggle-for-always-placing-the-dragon-egg.patch rename to patches/server/Add-toggle-for-always-placing-the-dragon-egg.patch index a37473749a..a358dae811 100644 --- a/patches/unapplied/server/Add-toggle-for-always-placing-the-dragon-egg.patch +++ b/patches/server/Add-toggle-for-always-placing-the-dragon-egg.patch @@ -9,16 +9,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { - } perPlayerMobSpawns = getBoolean("per-player-mob-spawns", true); } -+ + + public boolean enderDragonsDeathAlwaysPlacesDragonEgg = false; + private void enderDragonsDeathAlwaysPlacesDragonEgg() { + enderDragonsDeathAlwaysPlacesDragonEgg = getBoolean("ender-dragons-death-always-places-dragon-egg", enderDragonsDeathAlwaysPlacesDragonEgg); + } - } - ++ + public boolean phantomIgnoreCreative = true; + public boolean phantomOnlyAttackInsomniacs = true; + private void phantomSettings() { diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java diff --git a/patches/unapplied/server/Added-PlayerStonecutterRecipeSelectEvent.patch b/patches/server/Added-PlayerStonecutterRecipeSelectEvent.patch similarity index 100% rename from patches/unapplied/server/Added-PlayerStonecutterRecipeSelectEvent.patch rename to patches/server/Added-PlayerStonecutterRecipeSelectEvent.patch diff --git a/patches/unapplied/server/Added-firing-of-PlayerChangeBeaconEffectEvent.patch b/patches/server/Added-firing-of-PlayerChangeBeaconEffectEvent.patch similarity index 100% rename from patches/unapplied/server/Added-firing-of-PlayerChangeBeaconEffectEvent.patch rename to patches/server/Added-firing-of-PlayerChangeBeaconEffectEvent.patch diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index 3b931ec112..1d8ec3303a 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -6936,6 +6936,43 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + throw new UnsupportedOperationException("Not supported."); + } +} +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { + private static final Map MATERIAL_ITEM = new HashMap<>(); + private static final Map MATERIAL_BLOCK = new HashMap<>(); + private static final Map MATERIAL_FLUID = new HashMap<>(); ++ // Paper start ++ private static final Map> ENTITY_TYPE_ENTITY_TYPES = new HashMap<>(); ++ private static final Map, org.bukkit.entity.EntityType> ENTITY_TYPES_ENTITY_TYPE = new HashMap<>(); + + static { ++ for (org.bukkit.entity.EntityType type : org.bukkit.entity.EntityType.values()) { ++ if (type == org.bukkit.entity.EntityType.UNKNOWN) continue; ++ ENTITY_TYPE_ENTITY_TYPES.put(type, net.minecraft.core.Registry.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey()))); ++ ENTITY_TYPES_ENTITY_TYPE.put(net.minecraft.core.Registry.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey())), type); ++ } ++ // Paper end + for (Block block : net.minecraft.core.Registry.BLOCK) { + BLOCK_MATERIAL.put(block, Material.getMaterial(net.minecraft.core.Registry.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT))); + } +@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { + public static ResourceLocation key(Material mat) { + return CraftNamespacedKey.toMinecraft(mat.getKey()); + } ++ // Paper start ++ public static net.minecraft.world.entity.EntityType getEntityTypes(org.bukkit.entity.EntityType type) { ++ return ENTITY_TYPE_ENTITY_TYPES.get(type); ++ } ++ public static org.bukkit.entity.EntityType getEntityType(net.minecraft.world.entity.EntityType entityTypes) { ++ return ENTITY_TYPES_ENTITY_TYPE.get(entityTypes); ++ } ++ // Paper end + // ======================================================================== + + public static byte toLegacyData(BlockState data) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java diff --git a/patches/server/Timings-v2.patch b/patches/server/Timings-v2.patch index 0ea5d870fa..8a587ed5a9 100644 --- a/patches/server/Timings-v2.patch +++ b/patches/server/Timings-v2.patch @@ -2118,8 +2118,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { - return CraftNamespacedKey.toMinecraft(mat.getKey()); } + // Paper end // ======================================================================== + // Paper start + @Override diff --git a/patches/unapplied/server/added-Wither-API.patch b/patches/server/added-Wither-API.patch similarity index 100% rename from patches/unapplied/server/added-Wither-API.patch rename to patches/server/added-Wither-API.patch diff --git a/patches/unapplied/server/Added-Vanilla-Entity-Tags.patch b/patches/unapplied/server/Added-Vanilla-Entity-Tags.patch deleted file mode 100644 index a0c31830c9..0000000000 --- a/patches/unapplied/server/Added-Vanilla-Entity-Tags.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Sun, 3 Jan 2021 20:03:35 -0800 -Subject: [PATCH] Added Vanilla Entity Tags - - -diff --git a/src/main/java/io/papermc/paper/CraftEntityTag.java b/src/main/java/io/papermc/paper/CraftEntityTag.java -new file mode 100644 -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 ---- /dev/null -+++ b/src/main/java/io/papermc/paper/CraftEntityTag.java -@@ -0,0 +0,0 @@ -+package io.papermc.paper; -+ -+import org.bukkit.craftbukkit.tag.CraftTag; -+import org.bukkit.craftbukkit.util.CraftMagicNumbers; -+import org.bukkit.entity.EntityType; -+ -+import java.util.Collections; -+import java.util.Set; -+import java.util.stream.Collectors; -+import net.minecraft.resources.ResourceLocation; -+import net.minecraft.tags.TagCollection; -+ -+@Deprecated(forRemoval = true) -+public class CraftEntityTag extends CraftTag, EntityType> { -+ -+ public CraftEntityTag(TagCollection> registry, ResourceLocation tag) { -+ super(registry, tag); -+ } -+ -+ @Override -+ public boolean isTagged(EntityType item) { -+ return getHandle().contains(CraftMagicNumbers.getEntityTypes(item)); -+ } -+ -+ @Override -+ public Set getValues() { -+ return Collections.unmodifiableSet(getHandle().getValues().stream().map(CraftMagicNumbers::getEntityType).collect(Collectors.toSet())); -+ } -+} -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -0,0 +0,0 @@ public final class CraftServer implements Server { - Preconditions.checkArgument(clazz == org.bukkit.entity.EntityType.class, "Entity type namespace must have entity type"); - - return (org.bukkit.Tag) new CraftEntityTag(EntityTypeTags.getAllTags(), key); -+ // Paper start -+ case org.bukkit.Tag.REGISTRY_ENTITIES: -+ Preconditions.checkArgument(clazz == org.bukkit.entity.EntityType.class, "Entity namespace must have entitytype type"); -+ return (org.bukkit.Tag) new io.papermc.paper.CraftEntityTag(net.minecraft.tags.EntityTypeTags.getAllTags(), key); -+ // Paper end - default: - throw new IllegalArgumentException(); - } -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { - private static final Map MATERIAL_ITEM = new HashMap<>(); - private static final Map MATERIAL_BLOCK = new HashMap<>(); - private static final Map MATERIAL_FLUID = new HashMap<>(); -+ // Paper start -+ private static final Map> ENTITY_TYPE_ENTITY_TYPES = new HashMap<>(); -+ private static final Map, org.bukkit.entity.EntityType> ENTITY_TYPES_ENTITY_TYPE = new HashMap<>(); - - static { -+ for (org.bukkit.entity.EntityType type : org.bukkit.entity.EntityType.values()) { -+ if (type == org.bukkit.entity.EntityType.UNKNOWN) continue; -+ ENTITY_TYPE_ENTITY_TYPES.put(type, net.minecraft.core.Registry.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey()))); -+ ENTITY_TYPES_ENTITY_TYPE.put(net.minecraft.core.Registry.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey())), type); -+ } -+ // Paper end - for (Block block : net.minecraft.core.Registry.BLOCK) { - BLOCK_MATERIAL.put(block, Material.getMaterial(net.minecraft.core.Registry.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT))); - } -@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { - public static ResourceLocation key(Material mat) { - return CraftNamespacedKey.toMinecraft(mat.getKey()); - } -+ // Paper start -+ public static net.minecraft.world.entity.EntityType getEntityTypes(org.bukkit.entity.EntityType type) { -+ return ENTITY_TYPE_ENTITY_TYPES.get(type); -+ } -+ public static org.bukkit.entity.EntityType getEntityType(net.minecraft.world.entity.EntityType entityTypes) { -+ return ENTITY_TYPES_ENTITY_TYPE.get(entityTypes); -+ } -+ // Paper end - // ======================================================================== - // Paper start - @Override