mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 18:45:54 +01:00
even moaar patches
This commit is contained in:
parent
f331ac28e0
commit
e141126891
@ -5,7 +5,7 @@ Subject: [PATCH] Added Vanilla Entity Tags
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java
|
||||
index 34d23f53acf00620223731c4fdacffde9cff41a8..a64d04310f1bc32224765e01dd4f020d289dad0c 100644
|
||||
index 34d23f53acf00620223731c4fdacffde9cff41a8..ddd195a834d1756c903644fc1faffe7ebcb238ed 100644
|
||||
--- a/src/main/java/org/bukkit/Tag.java
|
||||
+++ b/src/main/java/org/bukkit/Tag.java
|
||||
@@ -698,6 +698,44 @@ public interface Tag<T extends Keyed> extends Keyed {
|
||||
@ -18,37 +18,37 @@ index 34d23f53acf00620223731c4fdacffde9cff41a8..a64d04310f1bc32224765e01dd4f020d
|
||||
+ * @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<org.bukkit.entity.EntityType> ARROWS = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("arrows"), org.bukkit.entity.EntityType.class);
|
||||
+ Tag<EntityType> ARROWS = ENTITY_TYPES_ARROWS;
|
||||
+ /**
|
||||
+ * Vanilla entity tag representing entities that live in beehives
|
||||
+ * @deprecated use {@link #ENTITY_TYPES_BEEHIVE_INHABITORS}
|
||||
+ */
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Tag<org.bukkit.entity.EntityType> BEEHIVE_INHABITORS = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("beehive_inhabitors"), org.bukkit.entity.EntityType.class);
|
||||
+ Tag<EntityType> BEEHIVE_INHABITORS = ENTITY_TYPES_BEEHIVE_INHABITORS;
|
||||
+ /**
|
||||
+ * Vanilla entity tag representing projectiles that impact
|
||||
+ * @deprecated use {@link #ENTITY_TYPES_IMPACT_PROJECTILES}
|
||||
+ */
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Tag<org.bukkit.entity.EntityType> IMPACT_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("impact_projectiles"), org.bukkit.entity.EntityType.class);
|
||||
+ Tag<EntityType> IMPACT_PROJECTILES = ENTITY_TYPES_IMPACT_PROJECTILES;
|
||||
+ /**
|
||||
+ * Vanilla entity tag for village raiders
|
||||
+ * @deprecated use {@link #ENTITY_TYPES_RAIDERS}
|
||||
+ */
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Tag<org.bukkit.entity.EntityType> RAIDERS = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("raiders"), org.bukkit.entity.EntityType.class);
|
||||
+ Tag<EntityType> RAIDERS = ENTITY_TYPES_RAIDERS;
|
||||
+ /**
|
||||
+ * Vanilla entity tag for skeleton types
|
||||
+ * @deprecated use {@link #ENTITY_TYPES_SKELETONS}
|
||||
+ */
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ Tag<org.bukkit.entity.EntityType> SKELETONS = Bukkit.getTag(REGISTRY_ENTITIES, NamespacedKey.minecraft("skeletons"), org.bukkit.entity.EntityType.class);
|
||||
+ Tag<EntityType> SKELETONS = ENTITY_TYPES_SKELETONS;
|
||||
+ // Paper end
|
||||
|
||||
/**
|
@ -6936,6 +6936,43 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792
|
||||
+ 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 0596f94c6ae22fcfddd7370e1eebd71885ed0e54..af1f7591e99b1aac95bcfabbe20447c1b5ad3adf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -88,8 +88,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>();
|
||||
private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>();
|
||||
private static final Map<Material, net.minecraft.world.level.material.Fluid> MATERIAL_FLUID = new HashMap<>();
|
||||
+ // Paper start
|
||||
+ private static final Map<org.bukkit.entity.EntityType, net.minecraft.world.entity.EntityType<?>> ENTITY_TYPE_ENTITY_TYPES = new HashMap<>();
|
||||
+ private static final Map<net.minecraft.world.entity.EntityType<?>, 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)));
|
||||
}
|
||||
@@ -155,6 +164,14 @@ 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 939789831f14621800c6792d20119079fc51b6f1..aff1a282516119e0f6026f1b35d6ee72859e8670 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
|
||||
|
@ -2114,12 +2114,12 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae
|
||||
this.value = value;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 0596f94c6ae22fcfddd7370e1eebd71885ed0e54..7024e0750a10ce4325b7217c76e03603ef53faa8 100644
|
||||
index af1f7591e99b1aac95bcfabbe20447c1b5ad3adf..bad8455d5128b3b2e188143c704964bdf8e445dd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -156,6 +156,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return CraftNamespacedKey.toMinecraft(mat.getKey());
|
||||
@@ -173,6 +173,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
}
|
||||
// Paper end
|
||||
// ========================================================================
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
@ -2130,7 +2130,7 @@ index 0596f94c6ae22fcfddd7370e1eebd71885ed0e54..7024e0750a10ce4325b7217c76e03603
|
||||
|
||||
public static byte toLegacyData(BlockState data) {
|
||||
return CraftLegacy.toLegacyData(data);
|
||||
@@ -330,6 +336,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -347,6 +353,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
|
@ -140,10 +140,10 @@ index 0000000000000000000000000000000000000000..91d7afc710a2d52b4f429e0381cf6417
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index bbb29440264094ecb82ec1282bdf7aa9f1f2106a..c7a5c9102b0cadeeefdd0dbd0de609f921460485 100644
|
||||
index 1049a7f39cf7ac2019d7ad7935e9205c98b100b7..bb8bad18ed799fd57ea2a1bcae4fb1399c3bde6a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -368,6 +368,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -385,6 +385,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public String getTimingsServerName() {
|
||||
return com.destroystokyo.paper.PaperConfig.timingsServerName;
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add CraftMagicNumbers.isSupportedApiVersion()
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index c7a5c9102b0cadeeefdd0dbd0de609f921460485..db33d1eb9bee8178072cc3b430b88b044a66cd92 100644
|
||||
index bb8bad18ed799fd57ea2a1bcae4fb1399c3bde6a..8f39acd1707fd8989b81fb715a8481733d1eb20d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -373,6 +373,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -390,6 +390,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
||||
return new com.destroystokyo.paper.PaperVersionFetcher();
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization
|
||||
Serializes using NBT which is safer for server data migrations than bukkits format.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index db33d1eb9bee8178072cc3b430b88b044a66cd92..114890cceaf786ca7f76f8d2a62d6243b039285b 100644
|
||||
index 8f39acd1707fd8989b81fb715a8481733d1eb20d..0bb3290f3ff23d7f653ce87943d7c6d156770926 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -378,6 +378,53 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -395,6 +395,53 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public boolean isSupportedApiVersion(String apiVersion) {
|
||||
return apiVersion != null && SUPPORTED_API.contains(apiVersion);
|
||||
}
|
||||
|
@ -42,10 +42,10 @@ index eb99e0c2462a2d1ab4508a5c3f1580b6e31d7465..c536eceef3365a7b726cd970df345ba1
|
||||
|
||||
public net.minecraft.world.item.enchantment.Enchantment getHandle() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 114890cceaf786ca7f76f8d2a62d6243b039285b..458be5e7cff9f9d97323360b7deaf045dff36fa6 100644
|
||||
index 0bb3290f3ff23d7f653ce87943d7c6d156770926..b3afb10f96e0662714ff89244132a6df8bbd3769 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -425,6 +425,30 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -442,6 +442,30 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!");
|
||||
return compound;
|
||||
}
|
||||
|
@ -21,10 +21,10 @@ index 8ec0a2ca0e1aa2e31c73df6ddb6b626d386797d8..41acc6d9e5b01526a2f0d5fa68b2913e
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 458be5e7cff9f9d97323360b7deaf045dff36fa6..5d5720b2a6cbf9d73b6c7413e4ddc5cc114b9448 100644
|
||||
index b3afb10f96e0662714ff89244132a6df8bbd3769..e28bb9f0f27d2d7347f48891256ac8225e1e1459 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -449,6 +449,10 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -466,6 +466,10 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
|
||||
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
|
||||
}
|
||||
|
@ -15,10 +15,10 @@ manually reload the advancement data for all players, which
|
||||
normally takes place as a part of the datapack reloading.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 5d5720b2a6cbf9d73b6c7413e4ddc5cc114b9448..ea45befec7e03f48da00f8a77dcae6561745a01e 100644
|
||||
index e28bb9f0f27d2d7347f48891256ac8225e1e1459..29d079927ac5f48f14e6f41a32b03174cc622dda 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -306,7 +306,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -323,7 +323,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex);
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] added Wither API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
index 9a89e6ff72d285a941be986300ff5c2a723a80e0..c4b075fffae1e535b887740d48bd26da223d6798 100644
|
||||
index 4f9f64def9b5da5bd2714c5f3ba36a4339623758..3657b7021d8b505653fadbdfbd515c112cd11177 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -83,6 +83,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -85,6 +85,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
return entityliving.getMobType() != MobType.UNDEAD && entityliving.attackable();
|
||||
};
|
||||
private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0D).selector(WitherBoss.LIVING_ENTITY_SELECTOR);
|
||||
@ -20,7 +20,7 @@ index 9a89e6ff72d285a941be986300ff5c2a723a80e0..c4b075fffae1e535b887740d48bd26da
|
||||
|
||||
public WitherBoss(EntityType<? extends WitherBoss> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -591,7 +596,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -603,7 +608,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
|
||||
@Override
|
||||
public boolean canChangeDimensions() {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Added firing of PlayerChangeBeaconEffectEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
index 6647cda859006f7afc9aae14f5c305e428b3c5c6..6a198f2590563577877ec8510bbdbab72c359aa7 100644
|
||||
index 61276c2a7d607f57b3e5e4c61bc89d5016d5dd1f..fb4c987512f82e702b20c0eff493a2777624f3b3 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
@@ -160,9 +160,15 @@ public class BeaconMenu extends AbstractContainerMenu {
|
@ -5,25 +5,26 @@ Subject: [PATCH] Add toggle for always placing the dragon egg
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index eece168668e93d2cd0bdcdd0911aef5208084e67..3e694d8a28524f9ea6ba8f1947061b92bc15b13d 100644
|
||||
index 6322748d2eabdf29a46c50166fad265b6c8053d5..1eaea3659dbd99767a045e0f66143bebb604c047 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -802,5 +802,10 @@ public class PaperWorldConfig {
|
||||
}
|
||||
@@ -697,6 +697,11 @@ 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 e1d689aa65b8d993c7223d306363366f3adff62f..f88719dede80c064f6210e078c435ffda32ecc1a 100644
|
||||
index ddfaaac55646527ccd5bb4f5b4d35aa3ddaf34f4..619ce8161deab5b93e2a3c4e652b3249f499fd3b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -363,7 +363,7 @@ public class EndDragonFight {
|
||||
@@ -367,7 +367,7 @@ public class EndDragonFight {
|
||||
this.dragonEvent.setVisible(false);
|
||||
this.spawnExitPortal(true);
|
||||
this.spawnNewGateway();
|
@ -6,7 +6,7 @@ Subject: [PATCH] Added PlayerStonecutterRecipeSelectEvent
|
||||
Co-Authored-By: MiniDigger <admin@minidigger.me>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
|
||||
index c971a534ded962e3be92c71059c75cc1d54970b5..dd1d05ce730fdada2278b5cd9d72955df35c70c5 100644
|
||||
index 221b6ffb426edc034183dbaf37de29c694874c62..c597139b2b88edf629bc0021ebb65d8bea2e6a7d 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
|
||||
@@ -62,7 +62,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
|
@ -1,94 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
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..dd6faad4f2591de0cf4a48744a7bd0280594605b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/CraftEntityTag.java
|
||||
@@ -0,0 +1,29 @@
|
||||
+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<net.minecraft.world.entity.EntityType<?>, EntityType> {
|
||||
+
|
||||
+ public CraftEntityTag(TagCollection<net.minecraft.world.entity.EntityType<?>> registry, ResourceLocation tag) {
|
||||
+ super(registry, tag);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isTagged(EntityType item) {
|
||||
+ return getHandle().contains(CraftMagicNumbers.getEntityTypes(item));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Set<EntityType> 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 374155f592907fc078dd4747ad7710ee83d7da50..35c7ecad55f63701fcb86fb6051723662268b7c9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2391,6 +2391,11 @@ 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<T>) 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<T>) 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 c0a08c3ac18b3ec0964c61c90df3263c50ece83d..eb06ca21a964de3f3d6712387b72e8994f1f03bd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -115,8 +115,17 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>();
|
||||
private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>();
|
||||
private static final Map<Material, net.minecraft.world.level.material.Fluid> MATERIAL_FLUID = new HashMap<>();
|
||||
+ // Paper start
|
||||
+ private static final Map<org.bukkit.entity.EntityType, net.minecraft.world.entity.EntityType<?>> ENTITY_TYPE_ENTITY_TYPES = new HashMap<>();
|
||||
+ private static final Map<net.minecraft.world.entity.EntityType<?>, 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)));
|
||||
}
|
||||
@@ -182,6 +191,14 @@ 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
|
Loading…
Reference in New Issue
Block a user