Apply more API-implementing patches

This commit is contained in:
Jason Penilla 2024-04-24 17:36:24 -07:00
parent 11044315fd
commit 1df7e21459
No known key found for this signature in database
GPG Key ID: 0E75A301420E48F8
15 changed files with 73 additions and 84 deletions

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerTradeEvent and PlayerPurchaseEvent
Co-authored-by: Alexander <protonull@protonmail.com>
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
index 9bc5a9592cabe087effc03e5347ea1d75794960b..4e6c2f6b2e54a4c126e9a026b9cad05ce835ad66 100644
index 6e29b5729b8184d13065c9c4e18f6e450c9d88a6..d323cf157f2a910916baa9ce3f7e5bc81648c47d 100644
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
@@ -137,11 +137,24 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
@@ -139,11 +139,24 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
@Override
public void overrideXp(int experience) {}
@ -37,7 +37,7 @@ index 9bc5a9592cabe087effc03e5347ea1d75794960b..4e6c2f6b2e54a4c126e9a026b9cad05c
CriteriaTriggers.TRADE.trigger((ServerPlayer) this.tradingPlayer, this, offer.getResult());
}
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
index eef0d3c59f0ce6e89033a5e228d31b63339c2773..48f634a7521d31c1e9dfd3cfc83139d428dbd37a 100644
index 4c7e91977fa590abfe7eb3704d8008ed6d4e3ab3..32910f677b0522ac8ec513fa0d00b714b52cfae4 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -768,6 +768,14 @@ public abstract class AbstractContainerMenu {
@ -55,7 +55,7 @@ index eef0d3c59f0ce6e89033a5e228d31b63339c2773..48f634a7521d31c1e9dfd3cfc83139d4
boolean flag1 = false;
int k = startIndex;
@@ -790,18 +798,27 @@ public abstract class AbstractContainerMenu {
@@ -791,6 +799,11 @@ public abstract class AbstractContainerMenu {
slot = (Slot) this.slots.get(k);
itemstack1 = slot.getItem();
@ -64,26 +64,27 @@ index eef0d3c59f0ce6e89033a5e228d31b63339c2773..48f634a7521d31c1e9dfd3cfc83139d4
+ itemstack1 = itemstack1.copy();
+ }
+ // Paper end - Add PlayerTradeEvent and PlayerPurchaseEvent
if (!itemstack1.isEmpty() && ItemStack.isSameItemSameTags(stack, itemstack1)) {
int l = itemstack1.getCount() + stack.getCount();
if (l <= stack.getMaxStackSize()) {
if (!itemstack1.isEmpty() && ItemStack.isSameItemSameComponents(stack, itemstack1)) {
l = itemstack1.getCount() + stack.getCount();
int i1 = slot.getMaxStackSize(itemstack1);
@@ -798,12 +811,16 @@ public abstract class AbstractContainerMenu {
if (l <= i1) {
stack.setCount(0);
itemstack1.setCount(l);
+ if (!isCheck) { // Paper - Add PlayerTradeEvent and PlayerPurchaseEvent
slot.setChanged();
+ } // Paper - Add PlayerTradeEvent and PlayerPurchaseEvent
flag1 = true;
} else if (itemstack1.getCount() < stack.getMaxStackSize()) {
stack.shrink(stack.getMaxStackSize() - itemstack1.getCount());
itemstack1.setCount(stack.getMaxStackSize());
} else if (itemstack1.getCount() < i1) {
stack.shrink(i1 - itemstack1.getCount());
itemstack1.setCount(i1);
+ if (!isCheck) { // Paper - Add PlayerTradeEvent and PlayerPurchaseEvent
slot.setChanged();
+ } // Paper - Add PlayerTradeEvent and PlayerPurchaseEvent
flag1 = true;
}
}
@@ -832,14 +849,33 @@ public abstract class AbstractContainerMenu {
@@ -834,10 +851,21 @@ public abstract class AbstractContainerMenu {
slot = (Slot) this.slots.get(k);
itemstack1 = slot.getItem();
@ -93,35 +94,23 @@ index eef0d3c59f0ce6e89033a5e228d31b63339c2773..48f634a7521d31c1e9dfd3cfc83139d4
+ }
+ // Paper end - Add PlayerTradeEvent and PlayerPurchaseEvent
if (itemstack1.isEmpty() && slot.mayPlace(stack)) {
if (stack.getCount() > slot.getMaxStackSize()) {
+ // Paper start - Add PlayerTradeEvent and PlayerPurchaseEvent
+ if (isCheck) {
+ stack.shrink(slot.getMaxStackSize());
+ } else {
+ // Paper end - Add PlayerTradeEvent and PlayerPurchaseEvent
slot.setByPlayer(stack.split(slot.getMaxStackSize()));
+ } // Paper - Add PlayerTradeEvent and PlayerPurchaseEvent
} else {
+ // Paper start - Add PlayerTradeEvent and PlayerPurchaseEvent
+ if (isCheck) {
+ stack.shrink(stack.getCount());
+ } else {
+ // Paper end - Add PlayerTradeEvent and PlayerPurchaseEvent
slot.setByPlayer(stack.split(stack.getCount()));
+ } // Paper - Add PlayerTradeEvent and PlayerPurchaseEvent
}
+ if (!isCheck) { // Paper - Add PlayerTradeEvent and PlayerPurchaseEvent
l = slot.getMaxStackSize(stack);
+ // Paper start - Add PlayerTradeEvent and PlayerPurchaseEvent
+ if (isCheck) {
+ stack.shrink(Math.min(stack.getCount(), l));
+ } else {
+ // Paper end - Add PlayerTradeEvent and PlayerPurchaseEvent
slot.setByPlayer(stack.split(Math.min(stack.getCount(), l)));
slot.setChanged();
+ } // Paper - Add PlayerTradeEvent and PlayerPurchaseEvent
flag1 = true;
break;
}
diff --git a/src/main/java/net/minecraft/world/inventory/MerchantMenu.java b/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
index 743a2adc465be5477d204185967265389d7102de..9c17c14de888ef3fbf4139cbad3889ece1d74aa1 100644
index ecefd4075c097e2118ec23e87baf36465c40f85f..2992e86f5f83431e230162380b33721df785ba91 100644
--- a/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/MerchantMenu.java
@@ -134,12 +134,12 @@ public class MerchantMenu extends AbstractContainerMenu {
@@ -135,12 +135,12 @@ public class MerchantMenu extends AbstractContainerMenu {
itemstack = itemstack1.copy();
if (slot == 2) {
@ -137,7 +126,7 @@ index 743a2adc465be5477d204185967265389d7102de..9c17c14de888ef3fbf4139cbad3889ec
} else if (slot != 0 && slot != 1) {
if (slot >= 3 && slot < 30) {
if (!this.moveItemStackTo(itemstack1, 30, 39, false)) {
@@ -152,6 +152,7 @@ public class MerchantMenu extends AbstractContainerMenu {
@@ -153,6 +153,7 @@ public class MerchantMenu extends AbstractContainerMenu {
return ItemStack.EMPTY;
}
@ -145,7 +134,7 @@ index 743a2adc465be5477d204185967265389d7102de..9c17c14de888ef3fbf4139cbad3889ec
if (itemstack1.isEmpty()) {
slot1.setByPlayer(ItemStack.EMPTY);
} else {
@@ -163,6 +164,21 @@ public class MerchantMenu extends AbstractContainerMenu {
@@ -164,6 +165,21 @@ public class MerchantMenu extends AbstractContainerMenu {
}
slot1.onTake(player, itemstack1);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add ShulkerDuplicateEvent
diff --git a/src/main/java/net/minecraft/world/entity/monster/Shulker.java b/src/main/java/net/minecraft/world/entity/monster/Shulker.java
index b73dac8f68041f8a2e0752d70cc9d08b5cfd1cde..f3c2a2ffb74daa89a516db4c188ce675c79932bf 100644
index c1f73e10d8473251425300cedbed2b82da6a79ce..5215fa54666979ef4da074ddfdb082e7274f2957 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java
@@ -484,6 +484,11 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
@@ -485,6 +485,11 @@ public class Shulker extends AbstractGolem implements VariantHolder<Optional<Dye
if (entityshulker != null) {
entityshulker.setVariant(this.getVariant());
entityshulker.moveTo(vec3d);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add api for spawn egg texture colors
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 68ca4a408e6ee728f50918c2d28088d110a108e3..b4478fc70b6d1ecbfe0accb111e4eebeaab3ffbb 100644
index 1cfd122fd734b359705e8091215dc5f6332e6f0b..bc6d26573ade3715c7a0c8ec8626c42152f1c7a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -665,6 +665,15 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -663,6 +663,15 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
// Paper end

View File

@ -707,7 +707,7 @@ index 2e96308696e131f3f013469a395e5ddda2c5d529..65a66e484c1c39c5f41d97db52f31c67
} catch (Throwable e) {
LOGGER.error("Failed to run bootstrapper for %s. This plugin will not be loaded.".formatted(provider.getSource()), e);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ab7bc27e870227e6746b77a7b5e109e2cf198b5f..9f7ed337463cc9bb370a5541d9de5cd8f9c1a78a 100644
index ca4cce36d462567f9fbab53dd904cad6db382f72..6d9a20fcd77b13e572fad03dd86c17404b3ae8c7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1017,6 +1017,11 @@ public final class CraftServer implements Server {
@ -739,10 +739,10 @@ index d96399e9bf1a58db5a4a22e58abb99e7660e0694..66bdac50130f523f9dc4379b103b7a46
+ // Paper end - lifecycle events
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index b4478fc70b6d1ecbfe0accb111e4eebeaab3ffbb..3f0b3b45b4ad64679a3a18f4b105e603aab1637e 100644
index bc6d26573ade3715c7a0c8ec8626c42152f1c7a5..14bd0fe7e6781d6c15cdc66713f36ded22c5a4f1 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -674,6 +674,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -672,6 +672,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
}
// Paper end - spawn egg color visibility

View File

@ -8,25 +8,25 @@ public net.minecraft.world.level.block.entity.ConduitBlockEntity effectBlocks
public net.minecraft.world.level.block.entity.ConduitBlockEntity destroyTarget
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
index 761d009cdeea28b6fd593c5bf1e4dcfa45f3fc27..37e0b762b86e74f607a4541ecb7b24ad7a591d0e 100644
index 73e532dc998e5701c1a73da846da3d3a79871b81..3228ac4d0c4c5939728d9231868f825d221db03a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
@@ -187,7 +187,7 @@ public class ConduitBlockEntity extends BlockEntity {
private static void applyEffects(Level world, BlockPos pos, List<BlockPos> activatingBlocks) {
int i = activatingBlocks.size();
@@ -194,7 +194,7 @@ public class ConduitBlockEntity extends BlockEntity {
public static int getRange(List<BlockPos> list) {
// CraftBukkit end
int i = list.size();
- int j = i / 7 * 16;
+ int j = i / 7 * 16; // Paper - Conduit API; diff on change
int k = pos.getX();
int l = pos.getY();
int i1 = pos.getZ();
// CraftBukkit start
return j;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java b/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java
index 29bcac10a7edf53015941e4c28c4f2d9a5a3db56..f0b0348e105fb27c829ec29e638433c57bfd5f64 100644
index c1759aeb3e6ad0e4eb66cba3da1b120dd1dce812..edc0e458e00bbc140a699d75eb5a693551f26dfc 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java
@@ -18,4 +18,23 @@ public class CraftConduit extends CraftBlockEntityState<ConduitBlockEntity> impl
public CraftConduit copy() {
return new CraftConduit(this);
@@ -127,4 +127,23 @@ public class CraftConduit extends CraftBlockEntityState<ConduitBlockEntity> impl
AABB bounds = ConduitBlockEntity.getDestroyRangeAABB(this.getPosition());
return new BoundingBox(bounds.minX, bounds.minY, bounds.minZ, bounds.maxX, bounds.maxY, bounds.maxZ);
}
+
+ // Paper start - Conduit API

View File

@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack Tooltip API
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 3f0b3b45b4ad64679a3a18f4b105e603aab1637e..3c7a771c48cc2732cc038ca11bb93ec5f8c2d667 100644
index 14bd0fe7e6781d6c15cdc66713f36ded22c5a4f1..d6aa8b0d5d23114d252eaa907a5e50eb24298635 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -664,6 +664,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -662,6 +662,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
return org.bukkit.craftbukkit.CraftStatistic.getNMSStatistic(statistic).getName();
}
// Paper end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add getChunkSnapshot includeLightData parameter
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index 105f925fb1a78879d2eb618f0c672c8b9a759dd9..dca5f25cf331b5550e9be491b4e8a3466531e021 100644
index 5b59b19a6d913ebdfc28a755e3a1a8b8384a3116..7dae8d91b74cc7df0745f0c121e3bea09b8d0b6d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -283,12 +283,21 @@ public class CraftChunk implements Chunk {
@@ -327,12 +327,21 @@ public class CraftChunk implements Chunk {
@Override
public ChunkSnapshot getChunkSnapshot(boolean includeMaxBlockY, boolean includeBiome, boolean includeBiomeTempRain) {
@ -32,7 +32,7 @@ index 105f925fb1a78879d2eb618f0c672c8b9a759dd9..dca5f25cf331b5550e9be491b4e8a346
boolean[] sectionEmpty = new boolean[cs.length];
PalettedContainerRO<Holder<net.minecraft.world.level.biome.Biome>>[] biome = (includeBiome || includeBiomeTempRain) ? new PalettedContainer[cs.length] : null;
@@ -305,6 +314,7 @@ public class CraftChunk implements Chunk {
@@ -349,6 +358,7 @@ public class CraftChunk implements Chunk {
}
// Paper end - Fix ChunkSnapshot#isSectionEmpty(int)
@ -40,7 +40,7 @@ index 105f925fb1a78879d2eb618f0c672c8b9a759dd9..dca5f25cf331b5550e9be491b4e8a346
LevelLightEngine lightengine = this.worldServer.getLightEngine();
DataLayer skyLightArray = lightengine.getLayerListener(LightLayer.SKY).getDataLayerData(SectionPos.of(this.x, chunk.getSectionYFromSectionIndex(i), this.z)); // SPIGOT-7498: Convert section index
if (skyLightArray == null) {
@@ -320,6 +330,7 @@ public class CraftChunk implements Chunk {
@@ -364,6 +374,7 @@ public class CraftChunk implements Chunk {
sectionEmitLights[i] = new byte[2048];
System.arraycopy(emitLightArray.getData(), 0, sectionEmitLights[i], 0, 2048);
}

View File

@ -173,7 +173,7 @@ index 0000000000000000000000000000000000000000..c0c2805cb045cdd835b402776a6923fe
+
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index 7c7dbd030ada8d2fab494b6a125664ddc3955639..35f7de6b50d3adae7bdd0da5f779f0a466d25522 100644
index 0e307c2bb788c1ec856613b0203f5fc7aca7e85d..1d16cd01e55f3e5bb8f49ad4c9f777d30180aab5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -107,6 +107,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@ -191,7 +191,7 @@ index 7c7dbd030ada8d2fab494b6a125664ddc3955639..35f7de6b50d3adae7bdd0da5f779f0a4
public BlockData getBlockData(Location location) {
return this.getBlockData(location.getBlockX(), location.getBlockY(), location.getBlockZ());
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
index ca9bb98ccfc3863c2ba538953470ab9e2b8a2f29..a2edef9739bad941f8e581da126bbfeac7cab5d8 100644
index 06ab1ac654e0c6f0ab7208783d186ed306ce204f..032ad671d232ab6f199c1d23f17de43a633587e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
@@ -303,4 +303,11 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe

View File

@ -5,10 +5,10 @@ Subject: [PATCH] improve BanList types
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9f7ed337463cc9bb370a5541d9de5cd8f9c1a78a..c490a29bcf7410bc54959ee71375605964379ed5 100644
index 6d9a20fcd77b13e572fad03dd86c17404b3ae8c7..e09288cbce63bcdc4243b7cf6e714cbe23913ed1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2215,6 +2215,21 @@ public final class CraftServer implements Server {
@@ -2230,6 +2230,21 @@ public final class CraftServer implements Server {
};
}

View File

@ -8,12 +8,12 @@ public net.minecraft.world.level.block.entity.HopperBlockEntity setCooldown(I)V
public net.minecraft.world.level.block.entity.HopperBlockEntity cooldownTime
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java b/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
index d446f18df647484e2f05ab642b73e914b06fdfed..af5f27fb5ebad1e05da2b7d1a0710a2ef9c6ebbe 100644
index 2995b407415c77288a54c3f4eb8cb93e1a289283..f3c4d3835a18475e2cd2f519ac3dd9d9b59c454d 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
@@ -34,4 +34,17 @@ public class CraftHopper extends CraftLootable<HopperBlockEntity> implements Hop
public CraftHopper copy() {
return new CraftHopper(this);
@@ -40,4 +40,17 @@ public class CraftHopper extends CraftLootable<HopperBlockEntity> implements Hop
public CraftHopper copy(Location location) {
return new CraftHopper(this, location);
}
+
+ // Paper start - Expanded Hopper API

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockBreakProgressUpdateEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index bf5e47e8c3706590fdc0731bd9a5858b56d06136..502bdc726b7890b00ee36871d905dea44e8719e3 100644
index e7339dbd6a42b67eb65260200c5eba89c626a298..0b3b9ce294bb59fb71209de37f7a8d2519360768 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1772,6 +1772,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1322,6 +1322,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Player) entityhuman = (Player) entity;
// CraftBukkit end

View File

@ -5,12 +5,12 @@ Subject: [PATCH] Deprecate ItemStack#setType
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index f67b048c3831fcab24acd12249cbd32d386c3ffe..534d3f02ad14ac246ef947a118c07cca81d600dc 100644
index 6138bcfeac622e091267b226f5be3a807f01312d..8a31b154460db1c5102c27ceee2b83f60ad5f506 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -711,4 +711,19 @@ public final class CraftItemStack extends ItemStack {
@@ -713,4 +713,19 @@ public final class CraftItemStack extends ItemStack {
static boolean hasItemMeta(net.minecraft.world.item.ItemStack item) {
return !(item == null || item.getTag() == null || item.getTag().isEmpty());
return !(item == null || item.getComponentsPatch().isEmpty());
}
+ // Paper start - with type
+ @Override

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add CartographyItemEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2ad17823bf442ce0455227b64e5d3bb10d0ee2c1..fe2ef36ab5dc4b933abf24dbfd0e811c53239cf0 100644
index f03cef6fffddcf3aea30c2c9033046c0b1f42aa5..06b4e0d93913f8348831debf18dd00a80b2ebec6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3101,6 +3101,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3100,6 +3100,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}
@ -29,10 +29,10 @@ index 2ad17823bf442ce0455227b64e5d3bb10d0ee2c1..fe2ef36ab5dc4b933abf24dbfd0e811c
AbstractContainerMenu oldContainer = this.player.containerMenu; // SPIGOT-1224
this.cserver.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java
index 45bf1c95d86bdfc709c5f1a1fbefb18e1cc51f4c..5ae3fd3ec22b4c3aa6bbd0cbda770f39dcab24a1 100644
index ab98637bf967ac19f0bc06e8cb7f18a8b13ec809..a90e2c56c54797b2fec40eb3865835c5f640a544 100644
--- a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java
@@ -69,7 +69,7 @@ public class CartographyTableMenu extends AbstractContainerMenu {
@@ -71,7 +71,7 @@ public class CartographyTableMenu extends AbstractContainerMenu {
this.resultContainer = new ResultContainer(this.createBlockHolder(context)) { // Paper - Add missing InventoryHolders
@Override
public void setChanged() {

View File

@ -7,10 +7,10 @@ Subject: [PATCH] More Raid API
public net.minecraft.world.entity.raid.Raid raidEvent
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
index c983214d9c396585255883b764195456885a08df..bf2c23fad919820512ce031cf28a000b249b2876 100644
index 364d233ca318bbf8c1bc3acfbaf2d2420fdf922f..fdff9788eaf663be79214b2ca491f0f0444f6136 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -106,6 +106,11 @@ public class Raid {
@@ -110,6 +110,11 @@ public class Raid {
private Raid.RaidStatus status;
private int celebrationTicks;
private Optional<BlockPos> waveSpawnPos;
@ -22,7 +22,7 @@ index c983214d9c396585255883b764195456885a08df..bf2c23fad919820512ce031cf28a000b
public Raid(int id, ServerLevel world, BlockPos pos) {
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
@@ -149,6 +154,11 @@ public class Raid {
@@ -153,6 +158,11 @@ public class Raid {
this.heroesOfTheVillage.add(NbtUtils.loadUUID(nbtbase));
}
}
@ -34,7 +34,7 @@ index c983214d9c396585255883b764195456885a08df..bf2c23fad919820512ce031cf28a000b
}
@@ -859,6 +869,11 @@ public class Raid {
@@ -870,6 +880,11 @@ public class Raid {
}
nbt.put("HeroesOfTheVillage", nbttaglist);
@ -47,7 +47,7 @@ index c983214d9c396585255883b764195456885a08df..bf2c23fad919820512ce031cf28a000b
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRaid.java b/src/main/java/org/bukkit/craftbukkit/CraftRaid.java
index 9650859b40576ff1d03b77ab3594499e47eeaf6a..611fc24ee90644359010b8d2bfb90f9eb2a04675 100644
index b8ce1c1c2447f9cff1717bfcfd6eb911ade0d4b3..51f21af9d75769abdcba713b9aa33392e994d9b0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRaid.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRaid.java
@@ -103,4 +103,34 @@ public final class CraftRaid implements Raid {
@ -86,10 +86,10 @@ index 9650859b40576ff1d03b77ab3594499e47eeaf6a..611fc24ee90644359010b8d2bfb90f9e
+ // Paper end - more Raid API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 01797d9791f19dfda4b168218eadeaae97f11eab..00357d78182b3ff87e3d9a45705b072af56739c8 100644
index 9be7221d24f7036e2fe76bbea2c7585cc75f9854..94bcfdf2892fe43267acb79592ceb5b2040fa290 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2397,6 +2397,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2363,6 +2363,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return (raid == null) ? null : new CraftRaid(raid);
}