Dieser Commit ist enthalten in:
Noah van der Aa 2024-04-30 00:16:07 +02:00 committet von GitHub
Ursprung fbe3c00675
Commit 44ee092878
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
134 geänderte Dateien mit 307 neuen und 592 gelöschten Zeilen

Datei anzeigen

@ -40,7 +40,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.5-R0.1-SNAPSHOT</version>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@ -53,7 +53,7 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.5-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
}
java {

Datei anzeigen

@ -68,7 +68,7 @@ repositories {
}
dependencies {
paramMappings("net.fabricmc:yarn:1.20.5+build.1:mergedv2")
paramMappings("net.fabricmc:yarn:1.20.6+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
decompiler("org.vineflower:vineflower:1.10.1")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.13")

Datei anzeigen

@ -1,6 +1,6 @@
group=io.papermc.paper
version=1.20.5-R0.1-SNAPSHOT
mcVersion=1.20.5
version=1.20.6-R0.1-SNAPSHOT
mcVersion=1.20.6
# Set to true while updating Minecraft version
updatingMinecraft=false

Datei anzeigen

@ -70,7 +70,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.5")
@GeneratedFrom("1.20.6")
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);

Datei anzeigen

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.5")
@GeneratedFrom("1.20.6")
@ApiStatus.Experimental
public final class BiomeKeys {
/**

Datei anzeigen

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.5")
@GeneratedFrom("1.20.6")
@ApiStatus.Experimental
public final class GameEventKeys {
/**

Datei anzeigen

@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.5")
@GeneratedFrom("1.20.6")
@ApiStatus.Experimental
public final class StructureKeys {
/**

Datei anzeigen

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.5")
@GeneratedFrom("1.20.6")
@ApiStatus.Experimental
public final class StructureTypeKeys {
/**

Datei anzeigen

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.5")
@GeneratedFrom("1.20.6")
@ApiStatus.Experimental
public final class TrimMaterialKeys {
/**

Datei anzeigen

@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.5")
@GeneratedFrom("1.20.6")
@ApiStatus.Experimental
public final class TrimPatternKeys {
/**

Datei anzeigen

@ -124,7 +124,7 @@ index 0000000000000000000000000000000000000000..6271e2bad0ed937c2c46a8c8fdf186c4
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 278ecb12ecdb5e1fdf394a1c990a4d849e53e05e..0000000000000000000000000000000000000000
index bea9ac450de7ec05f9752d253743e95d79c1cd14..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,267 +0,0 @@
@ -135,7 +135,7 @@ index 278ecb12ecdb5e1fdf394a1c990a4d849e53e05e..00000000000000000000000000000000
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
- <version>1.20.5-R0.1-SNAPSHOT</version>
- <version>1.20.6-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>

Datei anzeigen

@ -600,16 +600,15 @@ index a0f6f1af304190b4c5db4b284d460f625eeb7801..7e21548cac8515c281ec86853e9272ab
* The Block is already broken as this event is called, so #getBlock() will be
* AIR in most cases. Use #getBlockState() for more Information about the broken
diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
index 44f7f6939a27b9a0a796d91eac4b7c97ec90a643..641c71ab66bd2499b35cf3c1d533fd105d096e10 100644
index e534954457a9961a26dbec7ac035bec07e1d6694..8309b030c2120f1496d244f3ebc1094def41c869 100644
--- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
+++ b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
@@ -7,7 +7,9 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
- * Called when a block explodes
+ * Called when a block explodes interacting with blocks. The
+ * event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
@@ -13,6 +13,9 @@ import org.jetbrains.annotations.NotNull;
* Note that due to the nature of explosions, {@link #getBlock()} will always be
* an air block. {@link #getExplodedBlockState()} should be used to get
* information about the block state that exploded.
+ * <p>
+ * The event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
+ * is disabled as no block interaction will occur.
*/
public class BlockExplodeEvent extends BlockEvent implements Cancellable {

Datei anzeigen

@ -1,69 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 22 Oct 2021 16:24:17 -0700
Subject: [PATCH] Add exploded block state to BlockExplodeEvent and
EntityDamageByBlockEvent
Subject: [PATCH] Add exploded block state to EntityDamageByBlockEvent
diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
index 641c71ab66bd2499b35cf3c1d533fd105d096e10..7dcbb75170296c1dd1d784a032bf369602328b29 100644
index 8309b030c2120f1496d244f3ebc1094def41c869..a7c297364805c58ae16895055d8eae0484384b7d 100644
--- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
+++ b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
@@ -10,18 +10,31 @@ import org.jetbrains.annotations.NotNull;
* Called when a block explodes interacting with blocks. The
* event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
* is disabled as no block interaction will occur.
+ * <p>
+ * The {@link Block} returned by this event is not necessarily
+ * the block that caused the explosion, just the block at the location where
+ * the explosion originated. See {@link #getExplodedBlockState()}
*/
public class BlockExplodeEvent extends BlockEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancel;
private final List<Block> blocks;
private float yield;
+ private final org.bukkit.block.BlockState explodedBlockState; // Paper
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
public BlockExplodeEvent(@NotNull final Block what, @NotNull final List<Block> blocks, final float yield) {
+ // Paper start
+ this(what, blocks, yield, null);
+ }
+ @org.jetbrains.annotations.ApiStatus.Internal
+ public BlockExplodeEvent(@NotNull final Block what, @NotNull final List<Block> blocks, final float yield, @org.jetbrains.annotations.Nullable org.bukkit.block.BlockState explodedBlockState) {
+ // Paper end
super(what);
this.blocks = blocks;
this.yield = yield;
@@ -32,6 +32,7 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable {
this.cancel = false;
+ this.explodedBlockState = explodedBlockState; // Paper
}
@Override
@@ -34,6 +47,22 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable {
this.cancel = cancel;
}
+ // Paper start
+ /**
+ * Get a capture of the block that directly caused
+ * the explosion, like a bed or respawn anchor. This
+ * block state is not placed so {@link org.bukkit.block.BlockState#isPlaced}
+ * will be false.
+ * <p>
+ * Can be null if no block directly caused the explosion.
+ *
+ * @return the exploded block state or null if not applicable
+ */
+ public @org.jetbrains.annotations.Nullable org.bukkit.block.BlockState getExplodedBlockState() {
+ return this.explodedBlockState;
+ }
+ // Paper end
+
/**
* Returns the list of blocks that would have been removed or were removed
* from the explosion event.
+ @io.papermc.paper.annotation.DoNotUse // Paper
@Deprecated(forRemoval = true)
public BlockExplodeEvent(@NotNull final Block what, @NotNull final List<Block> blocks, final float yield) {
this(what, what.getState(), blocks, yield);
diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
index 467a0d6cabc5e860628be3b1e62de773efde5d2e..1fb15e2ade8ff3c4d662eca87b078b4577f786e1 100644
--- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java

Datei anzeigen

@ -160,7 +160,7 @@ index 0000000000000000000000000000000000000000..a457cf30d37037ce09fbe5d26e051b95
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 37928a37028bb7ee4843d42f256675e000823774..0000000000000000000000000000000000000000
index 4fabd6c37587aa6a9af11566d64c6b49f5bfadaa..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,604 +0,0 @@
@ -170,7 +170,7 @@ index 37928a37028bb7ee4843d42f256675e000823774..00000000000000000000000000000000
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot</artifactId>
- <packaging>jar</packaging>
- <version>1.20.5-R0.1-SNAPSHOT</version>
- <version>1.20.6-R0.1-SNAPSHOT</version>
- <name>Spigot</name>
- <url>https://www.spigotmc.org/</url>
-

Datei anzeigen

@ -7111,7 +7111,7 @@ index f73604d762efbac400d40f536ec1782fca584efa..4701bf9ee203f2f15b0b68e84bbfa2c4
super(type, world);
this.xpReward = 5;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index a5d1cd1966ad85ad0a241bee9caa8fd7b7424017..2b8b220bf1e132b230abe14770da53de84db9818 100644
index 7442e2b880f6410d3ca57a563f3ad77158a4c8ba..bf19e8e8aa96d646f057b8727f2f01ad2e2497cd 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -952,6 +952,25 @@ public final class ItemStack implements DataComponentHolder {
@ -8131,7 +8131,7 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 2ee0f83f18477fe2c759dc1ccc5ee18dbe791527..38d72d95b1f3ab23710f3335177c59ea6a25270e 100644
index cbbb404a6966fc72d17d0ec735d08c1be52b2d4f..3f91fce6df9b87a6e84df21ed04f25be3729814b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -105,8 +105,17 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -3255,7 +3255,7 @@ index ed54c81a3269360acce674aa4e1d54ccb2461841..c9c849534c3998cfcab7ddcb12a71ccb
}
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 2b8b220bf1e132b230abe14770da53de84db9818..96da768f55ad835a1a55bf359f0d7278bc232304 100644
index bf19e8e8aa96d646f057b8727f2f01ad2e2497cd..d6b02a946bd18ea71278a5026468ec49fabd3a3b 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -186,7 +186,15 @@ public final class ItemStack implements DataComponentHolder {
@ -5141,10 +5141,10 @@ index 9c57b883783145ad4483481a2c2e7f0f188cd174..b653c2c80e8e8524ea6d7625c6a86f82
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 7a5110efc5af1be6644b7afecd6ac025c20e6794..b79f29ccd512ec7d2a8f6a885c1a96dfd58e7dc5 100644
index 64c039bd3b248bd508a2c298032fa9f984b37694..9a22459f15cff45a234c1d497aca27a5433570f7 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -843,6 +843,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -850,6 +850,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return !(this.hasDisplayName() || this.hasItemName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.build().isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isHideTooltip() || this.isUnbreakable() || this.hasEnchantmentGlintOverride() || this.isFireResistant() || this.hasMaxStackSize() || this.hasRarity() || this.hasFood() || this.hasDamage() || this.hasMaxDamage() || this.hasAttributeModifiers() || this.customTag != null);
}
@ -5163,7 +5163,7 @@ index 7a5110efc5af1be6644b7afecd6ac025c20e6794..b79f29ccd512ec7d2a8f6a885c1a96df
@Override
public String getDisplayName() {
return CraftChatMessage.fromComponent(this.displayName);
@@ -873,6 +885,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -880,6 +892,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.itemName != null;
}
@ -5182,7 +5182,7 @@ index 7a5110efc5af1be6644b7afecd6ac025c20e6794..b79f29ccd512ec7d2a8f6a885c1a96df
@Override
public String getLocalizedName() {
return this.getDisplayName();
@@ -892,6 +916,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -899,6 +923,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore != null && !this.lore.isEmpty();
}
@ -5565,7 +5565,7 @@ index b963d471b33cacaeec385dba6b2bf369e3d4426f..51094fe6e37d3c0fad2682353f8de3d1
boolean hadFormat = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 38d72d95b1f3ab23710f3335177c59ea6a25270e..da97b4e91b7952f1459e59c74447a659842990bc 100644
index 3f91fce6df9b87a6e84df21ed04f25be3729814b..e57ba8af99f0ac0151ec1d4c4279393ace6826e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -76,6 +76,43 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -216,7 +216,7 @@ index 0000000000000000000000000000000000000000..8f07539a82f449ad217e316a7513a170
+
+}
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
index cb9f8567ba6aae41a6cde519ac0cff0169a7cea7..333d6d82584fb3bf4e0fce7b03bc2d9c4094deb9 100644
index fc6e13e4f2408ccbfa645eae2d7ebf4dcfc21908..badd85a92f38caae257181f67a322fc79599d1ce 100644
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
@@ -31,6 +31,7 @@ import net.kyori.adventure.text.flattener.ComponentFlattener;

Datei anzeigen

@ -7326,7 +7326,7 @@ index 909b2c98e7a9117d2f737245e4661792ffafb744..d96399e9bf1a58db5a4a22e58abb99e7
@Override
public FileConfiguration getConfig() {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index da97b4e91b7952f1459e59c74447a659842990bc..fb8d14a2bdaaa25a2237fa4161388439ea8cfc0f 100644
index e57ba8af99f0ac0151ec1d4c4279393ace6826e4..c8c66f78335868100adbb4d044037168872d5f94 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -421,6 +421,16 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -1916,7 +1916,7 @@ index 45160b93a24dc74f6368441e2a4fe659ceaf5bf5..6573e72d041714ccc2bf0e3c8734bc21
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index fb8d14a2bdaaa25a2237fa4161388439ea8cfc0f..fdeec67b7f71700f88714b8ad734a5525fb119fd 100644
index c8c66f78335868100adbb4d044037168872d5f94..96f0c447354d8081c614e466b0c17bfdb43c6fe7 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -72,6 +72,7 @@ import org.bukkit.potion.PotionType;

Datei anzeigen

@ -1527,10 +1527,10 @@ index 991ebf07bc0608df0a12f1f26e581cc93255ae01..946001c57c326f2d2f0677bca954e855
private String descriptionId;
@Nullable
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 09ae9c3398e77ee575636a4ebe9e31b447c9fb8e..6eef8da8ead8a044aac757693d719ceea431515e 100644
index 099f85ec8b427392947e815e0b85d7ec49369bc3..fb495fcbf42be3825bfb785a9887148c54f5b00b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -33,10 +33,12 @@ import org.bukkit.inventory.InventoryHolder;
@@ -34,10 +34,12 @@ import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
import org.spigotmc.CustomTimingsHandler; // Spigot
@ -2005,7 +2005,7 @@ index f97eccb6a17c7876e1e002d798eb67bbe80571a0..76effc345d362047e64d064eb64a5222
+ } // Paper
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index fdeec67b7f71700f88714b8ad734a5525fb119fd..9ae089c6dbb1cc919b005fd9672a690f89ca2b42 100644
index 96f0c447354d8081c614e466b0c17bfdb43c6fe7..71a3a506f92b6881602b2e77a9b5ecfb6930cb2a 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -213,6 +213,12 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Support components in ItemMeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 780b7e971a9d4fda1a9c78790c7969a0799f51ab..e663c996146986bc02efb05b4fb452913e4015d7 100644
index 9a22459f15cff45a234c1d497aca27a5433570f7..9c139f25eaef3c1b93fbf254cb08c6a449288ec8 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -860,11 +860,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -867,11 +867,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftChatMessage.fromComponent(this.displayName);
}
@ -32,7 +32,7 @@ index 780b7e971a9d4fda1a9c78790c7969a0799f51ab..e663c996146986bc02efb05b4fb45291
@Override
public boolean hasDisplayName() {
return this.displayName != null;
@@ -1038,6 +1050,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1045,6 +1057,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromComponent));
}
@ -47,7 +47,7 @@ index 780b7e971a9d4fda1a9c78790c7969a0799f51ab..e663c996146986bc02efb05b4fb45291
@Override
public void setLore(List<String> lore) {
if (lore == null || lore.isEmpty()) {
@@ -1052,6 +1072,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1059,6 +1079,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@ -69,7 +69,7 @@ index 780b7e971a9d4fda1a9c78790c7969a0799f51ab..e663c996146986bc02efb05b4fb45291
@Override
public boolean hasCustomModelData() {
return this.customModelData != null;
@@ -1675,6 +1710,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1682,6 +1717,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
for (Object object : addFrom) {

Datei anzeigen

@ -140,7 +140,7 @@ index 0000000000000000000000000000000000000000..22a55be34fde453fedd987173d95b8b3
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 9ae089c6dbb1cc919b005fd9672a690f89ca2b42..2f21520106aa848a9108937474570a8c4e723cfb 100644
index 71a3a506f92b6881602b2e77a9b5ecfb6930cb2a..2c1df47a3ef416b63ac26d7eb33fc85f5b760d23 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -474,6 +474,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -73,7 +73,7 @@ index 8256af275e468a5aa506f0af22428f4082204956..c71d4f91df7ec1cf26888b00fac444bc
entityzombie.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null);
worldserver.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index da52fdde1a17c230b4da2c58708fa69ebcf13431..81db0e4e4bced556d35978a10c9d9789ec527830 100644
index 7a95aff16a973b7b7d00e8409a252d4a2f6c41bf..a1c5e5913430404838205bc4a04b2afcff9d9046 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -193,6 +193,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -26,10 +26,10 @@ index 5f881af95bd5ee94daadfd9e5d64ee6d411255c4..472df81e4aef21e0cf2684a9e04d6ce1
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 6eef8da8ead8a044aac757693d719ceea431515e..0883e1755eae316faaeae8bf95763a0f80313c5a 100644
index fb495fcbf42be3825bfb785a9887148c54f5b00b..8d281ce2a0e44b97957cea2992e273abc86bd157 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -262,7 +262,12 @@ public abstract class BlockEntity {
@@ -263,7 +263,12 @@ public abstract class BlockEntity {
return s + " // " + this.getClass().getCanonicalName();
});
if (this.level != null) {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix lag from explosions processing dead entities
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 73cc11cf4732ede545e924d07480cae14c3ef226..8307c3e77ddc80a02f420503d67ae06fb973dc09 100644
index 296de8e9ae1284d4805932e746291d1148f7f8eb..b8b142f573b297ba72d45be3ae4c2729f3cffe1e 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -226,7 +226,7 @@ public class Explosion {

Datei anzeigen

@ -22,7 +22,7 @@ index fcb2d06f088a938b5bb76e6b42581d8f292d2eaf..231fba80a25601cdfba4f6f44ac7c288
this.profiler.popPush("connection");
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 8307c3e77ddc80a02f420503d67ae06fb973dc09..c769da15f1d0bdbd2bce412aa9fae6d10d1177f7 100644
index b8b142f573b297ba72d45be3ae4c2729f3cffe1e..157eac2a0a92f13ec191ee07774bdb3680e7e5b5 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -278,7 +278,7 @@ public class Explosion {
@ -34,7 +34,7 @@ index 8307c3e77ddc80a02f420503d67ae06fb973dc09..c769da15f1d0bdbd2bce412aa9fae6d1
double d13;
if (entity instanceof LivingEntity) {
@@ -532,4 +532,84 @@ public class Explosion {
@@ -534,4 +534,84 @@ public class Explosion {
private BlockInteraction() {}
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Disable explosion knockback
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index c769da15f1d0bdbd2bce412aa9fae6d10d1177f7..94f72ff58ac5206878a81e89d32e81c17b1bd1fb 100644
index 157eac2a0a92f13ec191ee07774bdb3680e7e5b5..754ca46d11dfe0495aa3109b68b1032e6d7d76e9 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -284,7 +284,7 @@ public class Explosion {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add BeaconEffectEvent
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index c731730abe50c521e5ce22b5fd8844ea1caed7ac..d3ef3d9a67bc54a4c82a39718f01201201dfc44c 100644
index 2508e06ef33a4c219b330aec7d5311c5702b8e1b..cf48d4531821c2b1b031a63c8f007aa7d3fbef1d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -1,5 +1,6 @@

Datei anzeigen

@ -150,7 +150,7 @@ index b6521462d193bff83ace1dc694c6d957a7173969..d302767e8f01fdfcba9c22e2e35677af
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index e663c996146986bc02efb05b4fb452913e4015d7..954aa31f5890deacbf2004aed8722360a87da7f1 100644
index 9c139f25eaef3c1b93fbf254cb08c6a449288ec8..0c385b713234a74ceba802f67f74e4ecab93e269 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@ -195,7 +195,7 @@ index e663c996146986bc02efb05b4fb452913e4015d7..954aa31f5890deacbf2004aed8722360
}
if (meta.hasAttributeModifiers()) {
@@ -385,8 +388,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -391,8 +394,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
}
@ -206,7 +206,7 @@ index e663c996146986bc02efb05b4fb452913e4015d7..954aa31f5890deacbf2004aed8722360
tag.entrySet().forEach((entry) -> {
Holder<net.minecraft.world.item.enchantment.Enchantment> id = entry.getKey();
@@ -640,13 +643,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -646,13 +649,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return modifiers;
}
@ -222,7 +222,7 @@ index e663c996146986bc02efb05b4fb452913e4015d7..954aa31f5890deacbf2004aed8722360
for (Map.Entry<?, ?> entry : ench.entrySet()) {
// Doctor older enchants
String enchantKey = entry.getKey().toString();
@@ -963,14 +966,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -970,14 +973,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override
public Map<Enchantment, Integer> getEnchants() {
@ -239,7 +239,7 @@ index e663c996146986bc02efb05b4fb452913e4015d7..954aa31f5890deacbf2004aed8722360
}
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
@@ -1506,7 +1509,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1513,7 +1516,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.customModelData = this.customModelData;
clone.blockData = this.blockData;
if (this.enchantments != null) {
@ -248,7 +248,7 @@ index e663c996146986bc02efb05b4fb452913e4015d7..954aa31f5890deacbf2004aed8722360
}
if (this.hasAttributeModifiers()) {
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
@@ -1826,4 +1829,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1833,4 +1836,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return (result != null) ? result : Optional.empty();
}

Datei anzeigen

@ -32,7 +32,7 @@ index 31ccca2a4e94cb1b3f43de38907634f7e6e18aa5..385dd65af8b526d128ac4c99cecdb69a
case RELEASE_SHIFT_KEY:
this.player.setShiftKeyDown(false);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 81db0e4e4bced556d35978a10c9d9789ec527830..4ac2d47df8e805b4f895951e839a0af8df7127cc 100644
index a1c5e5913430404838205bc4a04b2afcff9d9046..0654cca68acefccec82cc138acba30515a336cfb 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -588,6 +588,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Shoulder Entities Release API
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 4ac2d47df8e805b4f895951e839a0af8df7127cc..e292c1ab45d2618c4e852875107ec1819dba85c4 100644
index 0654cca68acefccec82cc138acba30515a336cfb..e81acc5c982cd14bc8a3aa5bf06e9636179b8555 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1982,20 +1982,45 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index e292c1ab45d2618c4e852875107ec1819dba85c4..259ec0dea938758f43560b1ed7f46c1042984774 100644
index e81acc5c982cd14bc8a3aa5bf06e9636179b8555..c1c0df2f4cf032a004568ab0e8f21db91e9dc705 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1243,7 +1243,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -13,10 +13,10 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE
If Tile Entity was null, correct Sign to return empty lines instead of null
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 0883e1755eae316faaeae8bf95763a0f80313c5a..90b218ebc947a1d8a8c7dfc677fe145b6386654a 100644
index 8d281ce2a0e44b97957cea2992e273abc86bd157..d22cc83725cee3df20bb6f99de23aceb62923eef 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -57,6 +57,7 @@ public abstract class BlockEntity {
@@ -58,6 +58,7 @@ public abstract class BlockEntity {
this.type = type;
this.worldPosition = pos.immutable();
this.blockState = state;
@ -24,7 +24,7 @@ index 0883e1755eae316faaeae8bf95763a0f80313c5a..90b218ebc947a1d8a8c7dfc677fe145b
}
public static BlockPos getPosFromTag(CompoundTag nbt) {
@@ -78,7 +79,7 @@ public abstract class BlockEntity {
@@ -79,7 +80,7 @@ public abstract class BlockEntity {
// CraftBukkit start - read container
protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) {
@ -33,7 +33,7 @@ index 0883e1755eae316faaeae8bf95763a0f80313c5a..90b218ebc947a1d8a8c7dfc677fe145b
net.minecraft.nbt.Tag persistentDataTag = nbt.get("PublicBukkitValues");
if (persistentDataTag instanceof CompoundTag) {
@@ -342,8 +343,15 @@ public abstract class BlockEntity {
@@ -353,8 +354,15 @@ public abstract class BlockEntity {
// CraftBukkit start - add method
public InventoryHolder getOwner() {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Toggleable player crits
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 259ec0dea938758f43560b1ed7f46c1042984774..fecb622cb33fd75b87b055fb40f127cda6a22a7d 100644
index c1c0df2f4cf032a004568ab0e8f21db91e9dc705..715a66018afa8d67f6e078e1157886390a2ad5dd 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1251,6 +1251,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Configurable sprint interruption on attack
If the sprint interruption is disabled players continue sprinting when they attack entities.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index fecb622cb33fd75b87b055fb40f127cda6a22a7d..0fa9cb53706482f5ea385ce4355273b67911b23a 100644
index 715a66018afa8d67f6e078e1157886390a2ad5dd..c7865bb6fa7fbeee365a70a4858b0addb36d4165 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1299,8 +1299,12 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -7,7 +7,7 @@ Called when a player is firing a bow and the server is choosing an arrow to use.
Plugins can skip selection of certain arrows and control which is used.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 0fa9cb53706482f5ea385ce4355273b67911b23a..705a756522473681516d60946ddd917647650bd4 100644
index c7865bb6fa7fbeee365a70a4858b0addb36d4165..338903091e43b71baa46157a95629c2e6b27b992 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -2219,18 +2219,29 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -179,7 +179,7 @@ index 38c27b4aa37e8b046e3eccdde3f527eb555da6f8..05dee42941a842bf4bba9480a2c04a14
}
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 705a756522473681516d60946ddd917647650bd4..4e1c032c7cdca81021c280a15db89e63a90ffe42 100644
index 338903091e43b71baa46157a95629c2e6b27b992..0efd7b3d748d90b3359560aa717a017092ae0e47 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1295,7 +1295,7 @@ public abstract class Player extends LivingEntity {
@ -218,7 +218,7 @@ index 9f9b7373c9a714597858ddcd8932e31b902cf5a1..f7f26d595072372004143c4e26506ed5
public abstract void explode();
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 94f72ff58ac5206878a81e89d32e81c17b1bd1fb..b5b29210d9a6125d98e7dd737ca25f40545e512b 100644
index 754ca46d11dfe0495aa3109b68b1032e6d7d76e9..4c7795e1ba7bb3135fcf5bab1c8aa857b8e7417b 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -303,6 +303,16 @@ public class Explosion {

Datei anzeigen

@ -109,7 +109,7 @@ index d25c762e449e2bce20487454ad52363b35b9af96..3273c3f06c142d4e3c947ca846459f4a
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName()))); // Paper - Adventure
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 4e1c032c7cdca81021c280a15db89e63a90ffe42..9cc9c6f7e211d9cf42a050f3a265d0bceaf7fd40 100644
index 0efd7b3d748d90b3359560aa717a017092ae0e47..b27a6719edd47f7ecb3f8c5560a36fc201efea36 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -277,7 +277,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Remove unnecessary itemmeta handling
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 96da768f55ad835a1a55bf359f0d7278bc232304..fb345894fec5e81d3c35af9812927220a7d56cd1 100644
index d6b02a946bd18ea71278a5026468ec49fabd3a3b..6dd441484dbae1818a927773a6e6c663c70ccd0e 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -168,7 +168,7 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Allow chests to be placed with NBT data
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index fb345894fec5e81d3c35af9812927220a7d56cd1..bf3785e3b347ebc1ce1e044c9db1a9d23c80f880 100644
index 6dd441484dbae1818a927773a6e6c663c70ccd0e..91f342912372326a6ced16c23550da7727d6d3ad 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -469,6 +469,7 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Noah van der Aa <ndvdaa@gmail.com>
Date: Mon, 29 Apr 2024 23:12:33 +0200
Subject: [PATCH] Catch JsonParseException in block entity names
As a result, data that no longer parses correctly will not crash the server
instead just logging the exception and continuing (and in most cases should
fix the data)
Player data is fixed pretty much immediately but some block data (like
Shulkers) may need to be changed in order for it to re-save properly
No more crashing though.
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
index 81d9a4e6bc1bc4f992ecb77b176daf89d645bbf2..e79b1ccbdf12006d72401b5be1ac25187033ec59 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
@@ -151,7 +151,7 @@ public class SkullBlockEntity extends BlockEntity {
}
if (nbt.contains("custom_name", 8)) {
- this.customName = Component.Serializer.fromJson(nbt.getString("custom_name"), registryLookup);
+ this.customName = BlockEntity.parseCustomNameSafe(nbt.getString("custom_name"), registryLookup); // Paper
} else {
this.customName = null;
}

Datei anzeigen

@ -1,116 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 22 Sep 2018 15:56:59 -0400
Subject: [PATCH] Catch JsonParseException in entity and block entity names
As a result, data that no longer parses correctly will not crash the server
instead just logging the exception and continuing (and in most cases should
fix the data)
Player data is fixed pretty much immediately but some block data (like
Shulkers) may need to be changed in order for it to re-save properly
No more crashing though.
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index c95a0af32178fe24448a5ae7a229c86ec883e8de..5c401c7e30ed5f6f32b1ad6523537aa46173cff5 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -558,4 +558,19 @@ public final class MCUtil {
return builder.build();
}
+
+ @Nullable
+ public static net.minecraft.network.chat.Component getBaseComponentFromNbt(final String key, final net.minecraft.nbt.CompoundTag compound, final net.minecraft.core.HolderLookup.Provider lookupProvider) {
+ if (!compound.contains(key)) {
+ return null;
+ }
+ final String string = compound.getString(key);
+ try {
+ return net.minecraft.network.chat.Component.Serializer.fromJson(string, lookupProvider);
+ } catch (com.google.gson.JsonParseException e) {
+ org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage());
+ }
+
+ return null;
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
index 626e4fe03dea008907823b49f0dd936bbf7e4e04..2d0eac7a8aa94ed6c4ec024bc6024440cbeac702 100644
--- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
+++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
@@ -75,7 +75,7 @@ public abstract class BaseCommandBlock implements CommandSource {
this.command = nbt.getString("Command");
this.successCount = nbt.getInt("SuccessCount");
if (nbt.contains("CustomName", 8)) {
- this.setCustomName(Component.Serializer.fromJson(nbt.getString("CustomName"), registries));
+ this.setCustomName(io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registries)); // Paper - Catch ParseException
} else {
this.setCustomName((Component) null);
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
index df4cd333ecd5c90e910df0c7c5ab5aa44c182903..2656e06ab2269141a13011eaa906f601887ca3e2 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
@@ -77,7 +77,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable {
protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) {
super.loadAdditional(nbt, registryLookup);
if (nbt.contains("CustomName", 8)) {
- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup);
+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException
}
if (nbt.contains("patterns")) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
index ee3b370b6b36914146db33a3211b6bbd2f8f16b7..ff3f26c31bd11b48f48e354ea6b33aa55dcbff5d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
@@ -39,7 +39,7 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
super.loadAdditional(nbt, registryLookup);
this.lockKey = LockCode.fromTag(nbt);
if (nbt.contains("CustomName", 8)) {
- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup);
+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index d3ef3d9a67bc54a4c82a39718f01201201dfc44c..18450017bc3df2f0b1a5715e6021e8e5defa24a1 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -391,7 +391,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
this.secondaryPower = BeaconBlockEntity.loadEffect(nbt, "secondary_effect");
this.levels = nbt.getInt("Levels"); // CraftBukkit - SPIGOT-5053, use where available
if (nbt.contains("CustomName", 8)) {
- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup);
+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException
}
this.lockKey = LockCode.fromTag(nbt);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
index 767994f493fb0a0e4bf097cd7cc178c10e79e937..c3503eaec5c5ece6e27a52fb703d06ec7c767383 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
@@ -45,7 +45,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
protected void loadAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) {
super.loadAdditional(nbt, registryLookup);
if (nbt.contains("CustomName", 8)) {
- this.name = Component.Serializer.fromJson(nbt.getString("CustomName"), registryLookup);
+ this.name = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("CustomName", nbt, registryLookup); // Paper - Catch ParseException
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
index 81d9a4e6bc1bc4f992ecb77b176daf89d645bbf2..40714cb145822b52cbc991a844486f87e46106d8 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
@@ -151,7 +151,7 @@ public class SkullBlockEntity extends BlockEntity {
}
if (nbt.contains("custom_name", 8)) {
- this.customName = Component.Serializer.fromJson(nbt.getString("custom_name"), registryLookup);
+ this.customName = io.papermc.paper.util.MCUtil.getBaseComponentFromNbt("custom_name", nbt, registryLookup); // Paper - Catch ParseException
} else {
this.customName = null;
}

Datei anzeigen

@ -93,7 +93,7 @@ index bac78415e34d41e3a5de482b86185f2202ecf068..a4eee658ecfc0f25e854c17a7715cb16
this.dismountVehicle(entity);
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 9cc9c6f7e211d9cf42a050f3a265d0bceaf7fd40..42911a87a9028a7ba8c3f63f498e4f15bcd07f24 100644
index b27a6719edd47f7ecb3f8c5560a36fc201efea36..bbafbeff99a7c1bd2d9e27982671a017071f829c 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1150,7 +1150,13 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Optimize call to getFluid for explosions
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index b5b29210d9a6125d98e7dd737ca25f40545e512b..30109db978563fab1a33b450f0ca82e176539703 100644
index 4c7795e1ba7bb3135fcf5bab1c8aa857b8e7417b..0f02361110143c839fde6ada38e9e0b512aef978 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -192,7 +192,7 @@ public class Explosion {

Datei anzeigen

@ -6,7 +6,7 @@ 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 2f21520106aa848a9108937474570a8c4e723cfb..13568d93bf9c0243a9505d1c0aa36fb912bf2bb7 100644
index 2c1df47a3ef416b63ac26d7eb33fc85f5b760d23..488946dfe508d2d2a22b9dc4f687b2292d830260 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -479,6 +479,53 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -7,7 +7,7 @@ This fixes a lot of game state issues where packets were delayed for processing
due to 1.15's new queue but processed while dead.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 42911a87a9028a7ba8c3f63f498e4f15bcd07f24..8fe41d4291736fd8c45d73429062a597d54ac30b 100644
index bbafbeff99a7c1bd2d9e27982671a017071f829c..f07c2bd727a8e3e65bb2e6b1367a4bb392febe23 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1162,7 +1162,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -40,10 +40,10 @@ index a6cd53e08a0770b93876f98efa7ebfe5b77a2f15..8011266f5fe082c0a81a7a828fe2cf74
} else {
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
index 2d0eac7a8aa94ed6c4ec024bc6024440cbeac702..e40069d937de5fd00741ae6873abeecc46b93732 100644
index efd6fcb0528d3c903e720edeb2f704347b34c18d..8c2dcc4134d96351cee75773214f3f47e71533e9 100644
--- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
+++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
@@ -203,7 +203,7 @@ public abstract class BaseCommandBlock implements CommandSource {
@@ -204,7 +204,7 @@ public abstract class BaseCommandBlock implements CommandSource {
}
public InteractionResult usedBy(Player player) {

Datei anzeigen

@ -30,10 +30,10 @@ index de40e522960469b98f987bd688489740446d9f85..a0a34f680e21007ebf2c2497d2e6505e
public CraftAttributeMap(AttributeMap handle) {
this.handle = handle;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index e88364dfe067c605856390d2cce07ba320632df9..069666c797c39b5119e41a3c18727f89fcc3b8c5 100644
index 0c385b713234a74ceba802f67f74e4ecab93e269..0464c7b6cc6cb523fa833c870e4028c3f599ea65 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -607,7 +607,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -613,7 +613,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Prevent headless pistons from being created
Prevent headless pistons from being created by explosions or tree/mushroom growth.
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 30109db978563fab1a33b450f0ca82e176539703..d29b4268431472c6132efdfcd305e9616c57da21 100644
index 0f02361110143c839fde6ada38e9e0b512aef978..414297ab9e953049b5f0b091e54d37c6e9edf861 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -206,6 +206,15 @@ public class Explosion {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] PortalCreateEvent needs to know its entity
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index bf3785e3b347ebc1ce1e044c9db1a9d23c80f880..1fe34b2b160569b41ce87910eff56d590731e708 100644
index 91f342912372326a6ced16c23550da7727d6d3ad..b4cb9ff5553995dddfb99b6b3ac1250b92a65d9d 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -501,7 +501,7 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -21,7 +21,7 @@ index c8e4e37b706bd8cb9698ac2d13d0d8668e2d1d14..909575a02bf5f7040eb9c8edb034e7b6
+ // Paper end - Expose entity id counter
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 13568d93bf9c0243a9505d1c0aa36fb912bf2bb7..b338b83d333b420c54c0362e2fc9839332fcc32e 100644
index 488946dfe508d2d2a22b9dc4f687b2292d830260..05f073907538991cc74996cf5235351848bc03e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -526,6 +526,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -15,7 +15,7 @@ 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 b338b83d333b420c54c0362e2fc9839332fcc32e..07befa14f64c5ae097378023a5b352278df2731a 100644
index 05f073907538991cc74996cf5235351848bc03e1..30bca0a9ead81055b1e7b8d9411c515e817e3a7b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -333,7 +333,13 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Beacon API - custom effect ranges
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index 18450017bc3df2f0b1a5715e6021e8e5defa24a1..cdb6b89ad4c34be419f66f4f6e6a11068273765d 100644
index cf48d4531821c2b1b031a63c8f007aa7d3fbef1d..dc39e7e3d166b0f7fb09e04b222b8db00d42b11b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -86,6 +86,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Expose LivingEntity hurt direction
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 8fe41d4291736fd8c45d73429062a597d54ac30b..ecae1708feee507df1440ad2822e7af8c3c278de 100644
index f07c2bd727a8e3e65bb2e6b1367a4bb392febe23..47ace2c3f395a86db3aa67d597686c8275a91323 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -187,7 +187,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -67,7 +67,7 @@ index 1460060f2ff42ebaa7b2418b375ce661c73bd17f..b9180b7552796331d09c3aef1e863a25
// Check if a World already exists with the UID.
if (this.getWorld(world.getUID()) != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 07befa14f64c5ae097378023a5b352278df2731a..c0592a85a1a0781b83232533b9ca1b30b116eb98 100644
index 30bca0a9ead81055b1e7b8d9411c515e817e3a7b..a914618ddcca61f30316a97c73f88698d44bc301 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -537,6 +537,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Expose protocol version
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index c0592a85a1a0781b83232533b9ca1b30b116eb98..d11d0a9a2c6b13033437a22b7270e7d37bfe8046 100644
index a914618ddcca61f30316a97c73f88698d44bc301..d27175bf9899b7ee79ab697eb2c20cd2e7ca6499 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -542,6 +542,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerDeepSleepEvent
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index ecae1708feee507df1440ad2822e7af8c3c278de..1f4351c1701465a3b5dfcb8d61aa5035956bbd42 100644
index 47ace2c3f395a86db3aa67d597686c8275a91323..bed2f9903378c16d630a08156f5c39047b613ad4 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -260,6 +260,13 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerBedFailEnterEvent
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
index 68326d7c3bd14e5a66971f34e6ec8ec8e93b728a..03035ed3df2f32e14a8eb9bc3d536ef64b5d87ba 100644
index 28689e333bb2ddb3c22e793b5c3d379233034840..c353643a9c9b400d351ef49e1b7d4f516ed0b0eb 100644
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
@@ -118,14 +118,23 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Introduce beacon activation/deactivation events
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index cdb6b89ad4c34be419f66f4f6e6a11068273765d..00ce8c45d906d8a468d93f464638f367d77e40fb 100644
index dc39e7e3d166b0f7fb09e04b222b8db00d42b11b..a11f487197274da7cf3217f24e1cae2a343a7331 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -225,6 +225,15 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack repair check API
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index d11d0a9a2c6b13033437a22b7270e7d37bfe8046..c2a7801ee4f6642813778f5e8ae89db46a253a3d 100644
index d27175bf9899b7ee79ab697eb2c20cd2e7ca6499..bb72e1180a354a41c2f268fec49efd98354d1395 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -547,6 +547,14 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Fix item default attributes API
(previously added this API but upstream also added it)
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index c2a7801ee4f6642813778f5e8ae89db46a253a3d..61686e63b2d1a98b9747e11058f450a51e2d4d01 100644
index bb72e1180a354a41c2f268fec49efd98354d1395..0254b4e5146ee7e082a467812dc04a2d07094af7 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -396,9 +396,14 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -44,7 +44,7 @@ index ef24112c5360ec329dc8a89546f64bad68d7fd8e..1ac19a789bee22fe512a019e618e2b99
this.awardStat(Stats.DROP);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 1f4351c1701465a3b5dfcb8d61aa5035956bbd42..44e2a0f36359ab914c9328b633dd8a360591751d 100644
index bed2f9903378c16d630a08156f5c39047b613ad4..40fb59c799850915c3ae71a4c4121e664c79d9b2 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -726,6 +726,11 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -17,7 +17,7 @@ index 1ac19a789bee22fe512a019e618e2b99bb07f183..d3f3eed67557b362c0f51a83967f6027
public boolean isRealPlayer; // Paper
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 0273998b72c9d8a1e7de4b1195c547001922cb8e..802ea97fe03028cfe911aa4052d9c82ad23058f2 100644
index dde1d3850af610241e1f76a194efe1a58dc96bd5..8ac5d8ccf731100a1be690cb2ed1be82cadba8ed 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -109,6 +109,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack

Datei anzeigen

@ -167,7 +167,7 @@ index 2b7ad2b9cd525814c9f91d22606c42aa82ce9f94..d7bbdcc97745246718c92c9aba56d9f9
}
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
index e18726915d1491d74084827afd9978800aecb644..a4a90df0b500fb440226b07462faaa87594b12a5 100644
index 3cfe325f14b6b184517de7c6982f54e0895b1eb8..be85535767bc79875c38da78a209d33d4be87c8a 100644
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
@@ -89,9 +89,14 @@ public class RespawnAnchorBlock extends Block {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityDamageItemEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 1fe34b2b160569b41ce87910eff56d590731e708..f5547caeaeeb8fa37f2aa9bfea6f176b1cc3430a 100644
index b4cb9ff5553995dddfb99b6b3ac1250b92a65d9d..2947a43a1d9e49273ed0242691273e50c657cd05 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -647,7 +647,7 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -9,7 +9,7 @@ public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations toBukkitSlo
public org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations fromBukkitSlot(Lorg/bukkit/scoreboard/DisplaySlot;)Lnet/minecraft/world/scores/DisplaySlot;
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java b/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
index 658f3962543a36bc8c16f306ccb3e254b5b3d0a8..a1510dfd4824c0e246543d770f0e74f0f97c4ace 100644
index 9e1896199d10be606a6c6304d849c7c9eb3c9fa1..b8a5ff5702f5a504c5b3aa0d9c27eb15f99471b7 100644
--- a/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java
@@ -27,6 +27,7 @@ public class FieldRename {

Datei anzeigen

@ -81,7 +81,7 @@ index 0000000000000000000000000000000000000000..ec9ebd2d539333293c51b7edfa18f18b
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 61686e63b2d1a98b9747e11058f450a51e2d4d01..5f460ab55025ff5dd66d7e52f92b4e7f36f2bb3f 100644
index 0254b4e5146ee7e082a467812dc04a2d07094af7..5cb1da944f0040e7c5a21db201d41fda3c5bda83 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -560,6 +560,18 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add critical damage API
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
index 435490f2931dae9d4fc5adb713c47a962684eeb5..ec52c7a75d9988475fbb4fe12ef7f4489ef3d894 100644
index 70e946483f09195c82d4b306c487ba22a8f8cf6f..ffb7c966617bdfa2c3f05ec4e753e32996493343 100644
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
@@ -238,4 +238,18 @@ public class DamageSource {
@@ -240,4 +240,18 @@ public class DamageSource {
public Holder<DamageType> typeHolder() {
return this.type;
}
@ -28,7 +28,7 @@ index 435490f2931dae9d4fc5adb713c47a962684eeb5..ec52c7a75d9988475fbb4fe12ef7f448
+ // Paper end - add critical damage API
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 44e2a0f36359ab914c9328b633dd8a360591751d..c3fc0adeafbebaaaab8c155df9829f488e41d8ab 100644
index 40fb59c799850915c3ae71a4c4121e664c79d9b2..7cb10e9c8ba6d100f1ae4d949401cd83034f0f14 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1274,7 +1274,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -39,7 +39,7 @@ index 1002123cd0c6f57cecc4e80f5f21cc6ff5886d37..e96023b71845526383288917e8d7c575
+ // 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 5f460ab55025ff5dd66d7e52f92b4e7f36f2bb3f..f0cbe0ae5123bebce82aa677f196f7e8e096dfc9 100644
index 5cb1da944f0040e7c5a21db201d41fda3c5bda83..d8d13aca9a002f92b3af2bc67b86f4f9dd092603 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -572,6 +572,12 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -50,7 +50,7 @@ index 9edcdc71b28cf08e42fbe44723ba540e8d4f7808..a61638bc8200f6aa25d9c3254aea6c0c
@Override
public boolean isInvisible() { // Paper - moved up from LivingEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index f0cbe0ae5123bebce82aa677f196f7e8e096dfc9..365f7846d4c522811cf992ea1a2da67b025661b9 100644
index d8d13aca9a002f92b3af2bc67b86f4f9dd092603..a14a316d63e34ac4ac7ee81a27a8fbdfcdb2b451 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -510,7 +510,33 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -51,7 +51,7 @@ index 22f9b40e2c9a71f8944b1738e91ee2e189a77cec..c3e8efd58c191ac8f479f8a979e73cc3
@Override
public void doCloseContainer() {
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index c3fc0adeafbebaaaab8c155df9829f488e41d8ab..4003dfeae8b2486045a3dbe4c1adc65a882e70ba 100644
index 7cb10e9c8ba6d100f1ae4d949401cd83034f0f14..f861a942807f8b8af36d6b70a124da7853eda053 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -509,6 +509,11 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -13,10 +13,10 @@ the material type of the block at that location.
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 90b218ebc947a1d8a8c7dfc677fe145b6386654a..df945a152747bea0452ec18c09d59598903aa91f 100644
index d22cc83725cee3df20bb6f99de23aceb62923eef..978125c69b2a9ea465595c7eef10a1aea7ccf26c 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -350,7 +350,7 @@ public abstract class BlockEntity {
@@ -361,7 +361,7 @@ public abstract class BlockEntity {
// Paper end
if (this.level == null) return null;
org.bukkit.block.Block block = this.level.getWorld().getBlockAt(this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ());

Datei anzeigen

@ -8,7 +8,7 @@ snow bucket didn't revert grass that became snowy because of the
placement.
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index f5547caeaeeb8fa37f2aa9bfea6f176b1cc3430a..2f60e67de38bb4b39deb505f23e35aeff9eded73 100644
index 2947a43a1d9e49273ed0242691273e50c657cd05..51a7919b019f2fd5d2e2ab850ed512769b0b1685 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -401,7 +401,7 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Expand PlayerItemDamageEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 2f60e67de38bb4b39deb505f23e35aeff9eded73..0a883564b9dda4fa0e6a7174a6e46b98af8be3e6 100644
index 51a7919b019f2fd5d2e2ab850ed512769b0b1685..acce1b72185d4687ef5a72dd4014d87149f4b092 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -661,10 +661,11 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -5,15 +5,15 @@ Subject: [PATCH] Sanitize sent BlockEntity NBT
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
index 1970c0fa24764f6bbd0cc360b7d32d7906eaf808..db03254682b827d650160d6f2c1a18cf12c861d7 100644
index 4f3ba61f13dbe5773034a19e749b7c4f5dc3d291..5d3e739d28d394ed59fe0003245cc55ac62e6087 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
@@ -23,7 +23,7 @@ public class ClientboundBlockEntityDataPacket implements Packet<ClientGamePacket
public static ClientboundBlockEntityDataPacket create(BlockEntity blockEntity, BiFunction<BlockEntity, RegistryAccess, CompoundTag> nbtGetter) {
RegistryAccess iregistrycustom = blockEntity.getLevel().registryAccess();
@@ -29,7 +29,7 @@ public class ClientboundBlockEntityDataPacket implements Packet<ClientGamePacket
- return new ClientboundBlockEntityDataPacket(blockEntity.getBlockPos(), blockEntity.getType(), (CompoundTag) nbtGetter.apply(blockEntity, iregistrycustom));
+ return new ClientboundBlockEntityDataPacket(blockEntity.getBlockPos(), blockEntity.getType(), (CompoundTag) blockEntity.sanitizeSentNbt(nbtGetter.apply(blockEntity, iregistrycustom))); // Paper - Sanitize sent data
public static ClientboundBlockEntityDataPacket create(BlockEntity blockEntity, BiFunction<BlockEntity, RegistryAccess, CompoundTag> nbtGetter) {
RegistryAccess registryAccess = blockEntity.getLevel().registryAccess();
- return new ClientboundBlockEntityDataPacket(blockEntity.getBlockPos(), blockEntity.getType(), nbtGetter.apply(blockEntity, registryAccess));
+ return new ClientboundBlockEntityDataPacket(blockEntity.getBlockPos(), blockEntity.getType(), blockEntity.sanitizeSentNbt(nbtGetter.apply(blockEntity, registryAccess))); // Paper - Sanitize sent data
}
public static ClientboundBlockEntityDataPacket create(BlockEntity blockEntity) {
@ -30,10 +30,10 @@ index ac900dfdc5c90e9e60d47efa734be8f0a5b20dca..ec1cb034d840633240f2b379b09f7d2f
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index df945a152747bea0452ec18c09d59598903aa91f..a7dfad2696e7145af1355a5db132af14d09a6f30 100644
index 978125c69b2a9ea465595c7eef10a1aea7ccf26c..30a75492a4b25450c194b4cc44deb665711db5af 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -357,6 +357,14 @@ public abstract class BlockEntity {
@@ -368,6 +368,14 @@ public abstract class BlockEntity {
}
// CraftBukkit end

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Nameable Banner API
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
index 2656e06ab2269141a13011eaa906f601887ca3e2..26d2f63d2add276a2f51c399f494a7219413d3e3 100644
index 925608bfa9c848ed6285de5e35d60aa66e12004a..60c26076e7acf869fa0e20fdc14eeec341387d99 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java
@@ -29,7 +29,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable {

Datei anzeigen

@ -8,10 +8,10 @@ in command blocks, and if called asynchronously, would throw
an error
diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
index e40069d937de5fd00741ae6873abeecc46b93732..552f7ab11dc09fa69034f009235cb22429a9ed11 100644
index 8c2dcc4134d96351cee75773214f3f47e71533e9..e6bfcc50cdf728216084bc00a5bb8b6b3b8f72e4 100644
--- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
+++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
@@ -177,6 +177,7 @@ public abstract class BaseCommandBlock implements CommandSource {
@@ -178,6 +178,7 @@ public abstract class BaseCommandBlock implements CommandSource {
@Override
public void sendSystemMessage(Component message) {
if (this.trackOutput) {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Add NamespacedKey biome methods
Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 365f7846d4c522811cf992ea1a2da67b025661b9..c4e517ef6cf5cd4975846459cf66ebd4db66a805 100644
index a14a316d63e34ac4ac7ee81a27a8fbdfcdb2b451..6ab39cc723f0874c28def182eaada05c11d36678 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -604,6 +604,19 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -408,7 +408,7 @@ index 614ddebb92aba91694951fc22900fed362b3426d..d19e799491f790ca967a0731ef95a069
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index 00ce8c45d906d8a468d93f464638f367d77e40fb..ac1547d4f45aa676ae174c6c80716db3437f2914 100644
index a11f487197274da7cf3217f24e1cae2a343a7331..edb7d981bb443b5b395a1985fb7cfd96009d0b0a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -295,7 +295,11 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PrePlayerAttackEntityEvent
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 4003dfeae8b2486045a3dbe4c1adc65a882e70ba..761e8a0c4e1db465c18892999e86885f27ca8075 100644
index f861a942807f8b8af36d6b70a124da7853eda053..90c9856dc16f83c762415aaeeb030bcd07b72d51 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1246,8 +1246,17 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add BlockLockCheckEvent
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
index ff3f26c31bd11b48f48e354ea6b33aa55dcbff5d..02675f15e157ce68506c813b19cf5472bf67bc00 100644
index bf9ae460bdfb247456b895f026f6a7a2e162c5f5..15fd1fe1b55b6421d2c09e8385c9f69fa0152e56 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
@@ -73,17 +73,44 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
@ -56,7 +56,7 @@ index ff3f26c31bd11b48f48e354ea6b33aa55dcbff5d..02675f15e157ce68506c813b19cf5472
protected abstract NonNullList<ItemStack> getItems();
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index ac1547d4f45aa676ae174c6c80716db3437f2914..d575294924df6b970c5773a5cdd8b2a1a9cbce19 100644
index edb7d981bb443b5b395a1985fb7cfd96009d0b0a..62b9b5f508462dd2257094cb48ce6123e29cb64d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -472,7 +472,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Flying Fall Damage
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 761e8a0c4e1db465c18892999e86885f27ca8075..230ffd3c4541ef8979605d733b6463e39cd00206 100644
index 90c9856dc16f83c762415aaeeb030bcd07b72d51..96fc37c871566ec41c42bd0e0f4a147044c239b4 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -194,6 +194,7 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -1,177 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 22 Oct 2021 16:25:07 -0700
Subject: [PATCH] Add exploded block state to BlockExplodeEvent and
EntityDamageByBlockEvent
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
index ec52c7a75d9988475fbb4fe12ef7f4489ef3d894..a78fd4f9ce97ebece45979908382de8f5fc14c1b 100644
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
@@ -21,6 +21,7 @@ public class DamageSource {
private final Entity directEntity;
@Nullable
private final Vec3 damageSourcePosition;
+ public org.bukkit.block.BlockState explodedBlockState; // Paper - add exploded state
// CraftBukkit start
@Nullable
private org.bukkit.block.Block directBlock; // The block that caused the damage. damageSourcePosition is not used for all block damages
@@ -94,6 +95,7 @@ public class DamageSource {
private DamageSource cloneInstance() {
DamageSource damageSource = new DamageSource(this.type, this.directEntity, this.causingEntity, this.damageSourcePosition);
+ damageSource.explodedBlockState = this.explodedBlockState; // Paper - Include explodedBlockState when clone this instance of DamageSource
damageSource.directBlock = this.getDirectBlock();
damageSource.withSweep = this.isSweep();
damageSource.poison = this.isPoison();
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
index 2f5591aa232b834bb9b69a2a349ce93d1a9c63fa..8ba60de95845f4d56f299c5f1b2b5163461ba38d 100644
--- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
@@ -265,8 +265,17 @@ public class DamageSources {
return this.source(DamageTypes.SONIC_BOOM, attacker);
}
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper - add exploded state
public DamageSource badRespawnPointExplosion(Vec3 position) {
- return new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), position);
+ // Paper start - add exploded state
+ return this.badRespawnPointExplosion(position, null);
+ }
+
+ public DamageSource badRespawnPointExplosion(Vec3 position, @Nullable org.bukkit.block.BlockState explodedBlockState) {
+ DamageSource source = new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), position);
+ source.explodedBlockState = explodedBlockState;
+ return source;
+ // Paper end - add exploded state
}
public DamageSource outOfBorder() {
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index d29b4268431472c6132efdfcd305e9616c57da21..0a8e46eef6df0bfda663758fc22b1eb4640aaf4e 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -389,7 +389,7 @@ public class Explosion {
bukkitBlocks = event.blockList();
this.yield = event.getYield();
} else {
- BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield);
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield, this.damageSource.explodedBlockState); // Paper - add exploded state
this.level.getCraftServer().getPluginManager().callEvent(event);
this.wasCanceled = event.isCancelled();
bukkitBlocks = event.blockList();
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
index 03035ed3df2f32e14a8eb9bc3d536ef64b5d87ba..872bec4c366c86177334452315cc4a8097dae3c0 100644
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
@@ -95,6 +95,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
// CraftBukkit - moved world and biome check into EntityHuman
if (false && !BedBlock.canSetSpawn(world)) {
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, pos, state); // Paper - add exploded state (this won't be called due to the false, but it's good for reference)
world.removeBlock(pos, false);
BlockPos blockposition1 = pos.relative(((Direction) state.getValue(BedBlock.FACING)).getOpposite());
@@ -104,7 +105,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
Vec3 vec3d = pos.getCenter();
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state
return InteractionResult.SUCCESS;
} else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) {
if (!this.kickVillagerOutOfBed(world, pos)) {
@@ -146,6 +147,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
private InteractionResult explodeBed(BlockState iblockdata, Level world, BlockPos blockposition) {
{
{
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, blockposition, iblockdata); // Paper - add exploded state
world.removeBlock(blockposition, false);
BlockPos blockposition1 = blockposition.relative(((Direction) iblockdata.getValue(BedBlock.FACING)).getOpposite());
@@ -155,7 +157,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
Vec3 vec3d = blockposition.getCenter();
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state
return InteractionResult.SUCCESS;
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
index a4a90df0b500fb440226b07462faaa87594b12a5..4e2fad1f234356ada6f29445038e43b9a8406cf9 100644
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
@@ -133,6 +133,7 @@ public class RespawnAnchorBlock extends Block {
}
private void explode(BlockState state, Level world, final BlockPos explodedPos) {
+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(world, explodedPos, state, null); // Paper - add exploded state
world.removeBlock(explodedPos, false);
Stream<Direction> stream = Direction.Plane.HORIZONTAL.stream(); // CraftBukkit - decompile error
@@ -149,7 +150,7 @@ public class RespawnAnchorBlock extends Block {
};
Vec3 vec3d = explodedPos.getCenter();
- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), explosiondamagecalculator, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
+ world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), explosiondamagecalculator, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state
}
public static boolean canSetSpawn(Level world) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
index 411c2de93c71e480f95229c882cdf43b8801edc8..489c17d002a5c3580637fda1c51f1bd63814bfa0 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
@@ -291,6 +291,12 @@ public final class CraftBlockStates {
BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag, registry);
return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity);
}
+ // Paper start - add exploded state
+ public static BlockState getUnplacedBlockState(net.minecraft.world.level.BlockGetter levelAccessor, BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockData) {
+ BlockEntity tileEntity = levelAccessor.getBlockEntity(blockPos);
+ return CraftBlockStates.getBlockState(null, blockPos, blockData, tileEntity);
+ }
+ // Paper end - add exploded state
// See BlockStateFactory#createBlockState(World, BlockPosition, IBlockData, TileEntity)
private static CraftBlockState getBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index c52cb55cd1da988ec646e4e1484ec1a72513291d..a226b7cdc9c63ef09d7d48269c287af1ab6dbdc4 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1070,7 +1070,7 @@ public class CraftEventFactory {
Entity damager = (bukkitDamageSource.isIndirect() && source.getDirectEntity() != null) ? source.getDirectEntity() : source.getCausingEntity();
if (source.is(DamageTypeTags.IS_EXPLOSION)) {
if (damager == null) {
- return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
+ return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.explodedBlockState); // Paper - Include BlockState for damage
}
DamageCause damageCause = (damager.getBukkitEntity() instanceof org.bukkit.entity.TNTPrimed) ? DamageCause.BLOCK_EXPLOSION : DamageCause.ENTITY_EXPLOSION;
return CraftEventFactory.callEntityDamageEvent(damager, entity, damageCause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
@@ -1117,7 +1117,7 @@ public class CraftEventFactory {
} else {
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, source.getDirectBlock(), source.getMsgId()));
}
- return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
+ return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.explodedBlockState); // Paper - Include BlockState for damage
}
DamageCause cause;
@@ -1170,8 +1170,13 @@ public class CraftEventFactory {
return CraftEventFactory.callEntityDamageEvent(event, damagee, cancelled);
}
- private static EntityDamageEvent callEntityDamageEvent(Block damager, Entity damagee, DamageCause cause, org.bukkit.damage.DamageSource bukkitDamageSource, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled) {
- EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions);
+ // Paper start
+ private static EntityDamageEvent callEntityDamageEvent(Block damager, Entity damagee, DamageCause cause, org.bukkit.damage.DamageSource bukkitDamageSource, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled) { // Paper
+ return callEntityDamageEvent(damager, damagee, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, null);
+ }
+ private static EntityDamageEvent callEntityDamageEvent(Block damager, Entity damagee, DamageCause cause, org.bukkit.damage.DamageSource bukkitDamageSource, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled, @Nullable org.bukkit.block.BlockState explodedBlockState) {
+ EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, explodedBlockState);
+ // Paper end
return CraftEventFactory.callEntityDamageEvent(event, damagee, cancelled);
}

Datei anzeigen

@ -0,0 +1,67 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 22 Oct 2021 16:25:07 -0700
Subject: [PATCH] Add exploded block state to EntityDamageByBlockEvent
== AT ==
public org.bukkit.craftbukkit.block.CraftBlockStates getBlockState(Lorg/bukkit/World;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/entity/BlockEntity;)Lorg/bukkit/craftbukkit/block/CraftBlockState;
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
index 89928dad3182a0131c3fba19c9c131d6997028eb..349d1683458ec5d641c9823aa7a68dec8820a664 100644
--- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java
@@ -265,6 +265,7 @@ public class DamageSources {
return this.source(DamageTypes.SONIC_BOOM, attacker);
}
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper - add exploded state
public DamageSource badRespawnPointExplosion(Vec3 position) {
// CraftBukkit start
return this.badRespawnPointExplosion(position, null, null, null);
@@ -273,7 +274,7 @@ public class DamageSources {
public DamageSource badRespawnPointExplosion(Vec3 vec3d, net.minecraft.world.level.Level world, net.minecraft.world.level.block.state.BlockState blockData, net.minecraft.core.BlockPos position) {
DamageSource damageSource = new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), vec3d);
if (world != null && blockData != null && position != null) {
- damageSource.blockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(world, position, blockData, null);
+ damageSource.blockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(world.getWorld(), position, blockData, world.getBlockEntity(position)); // Paper
}
return damageSource;
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index c52cb55cd1da988ec646e4e1484ec1a72513291d..0ab1cf162016422007426698dec60ffd875631a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1070,7 +1070,7 @@ public class CraftEventFactory {
Entity damager = (bukkitDamageSource.isIndirect() && source.getDirectEntity() != null) ? source.getDirectEntity() : source.getCausingEntity();
if (source.is(DamageTypeTags.IS_EXPLOSION)) {
if (damager == null) {
- return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
+ return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.blockState); // Paper - Include BlockState for damage
}
DamageCause damageCause = (damager.getBukkitEntity() instanceof org.bukkit.entity.TNTPrimed) ? DamageCause.BLOCK_EXPLOSION : DamageCause.ENTITY_EXPLOSION;
return CraftEventFactory.callEntityDamageEvent(damager, entity, damageCause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
@@ -1117,7 +1117,7 @@ public class CraftEventFactory {
} else {
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, source.getDirectBlock(), source.getMsgId()));
}
- return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
+ return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, source.blockState); // Paper - Include BlockState for damage
}
DamageCause cause;
@@ -1170,8 +1170,13 @@ public class CraftEventFactory {
return CraftEventFactory.callEntityDamageEvent(event, damagee, cancelled);
}
- private static EntityDamageEvent callEntityDamageEvent(Block damager, Entity damagee, DamageCause cause, org.bukkit.damage.DamageSource bukkitDamageSource, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled) {
- EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions);
+ // Paper start
+ private static EntityDamageEvent callEntityDamageEvent(Block damager, Entity damagee, DamageCause cause, org.bukkit.damage.DamageSource bukkitDamageSource, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled) { // Paper
+ return callEntityDamageEvent(damager, damagee, cause, bukkitDamageSource, modifiers, modifierFunctions, cancelled, null);
+ }
+ private static EntityDamageEvent callEntityDamageEvent(Block damager, Entity damagee, DamageCause cause, org.bukkit.damage.DamageSource bukkitDamageSource, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions, boolean cancelled, @Nullable org.bukkit.block.BlockState explodedBlockState) {
+ EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, explodedBlockState);
+ // Paper end
return CraftEventFactory.callEntityDamageEvent(event, damagee, cancelled);
}

Datei anzeigen

@ -69,7 +69,7 @@ index a0c52ce65d4035d135b1536c7408a6867a553447..dc035bf94c5f6574ed8ad369b327b7f7
this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F);
} // Paper - Call EntityDropItemEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index a226b7cdc9c63ef09d7d48269c287af1ab6dbdc4..e9a70547324dabd97dc90820515a11d2b630a704 100644
index 0ab1cf162016422007426698dec60ffd875631a0..160ebf499b2f088a3fb1ca683e3d7b02acbd548f 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -2109,4 +2109,28 @@ public class CraftEventFactory {

Datei anzeigen

@ -10,18 +10,18 @@ but then replaced it with a bed, you could respawn
at the bed in that world.
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
index 872bec4c366c86177334452315cc4a8097dae3c0..e9f8949267208b93f0c56c36ada38274ed4280f5 100644
index c353643a9c9b400d351ef49e1b7d4f516ed0b0eb..f726c3839ab93cc81fee26bfeb821bead3533b5e 100644
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
@@ -108,6 +108,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - add exploded state
@@ -107,6 +107,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK);
return InteractionResult.SUCCESS;
} else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) {
+ if (!BedBlock.canSetSpawn(world)) return this.explodeBed(state, world, pos); // Paper - check explode first
if (!this.kickVillagerOutOfBed(world, pos)) {
player.displayClientMessage(Component.translatable("block.minecraft.bed.occupied"), true);
}
@@ -165,8 +166,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
@@ -163,8 +164,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
// CraftBukkit end
public static boolean canSetSpawn(Level world) {

Datei anzeigen

@ -51,7 +51,7 @@ index 37c23923ebd4dfd6405d3c19fa42609fc683a42e..7c039d79b6fba3358daaaf8894e05d94
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e9a70547324dabd97dc90820515a11d2b630a704..c1b5d9713cb301dc06b74d97dca4fd5562c539e2 100644
index 160ebf499b2f088a3fb1ca683e3d7b02acbd548f..c8627846dc213f2230327e37ac1114d5cd7447ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1267,10 +1267,10 @@ public class CraftEventFactory {

Datei anzeigen

@ -22,7 +22,7 @@ index 7d76cdc59984b156628273c8357485eb10046007..7180996027f70aef7afe32fb2adfce64
itemstack.consume(1, entityhuman);
return InteractionResult.sidedSuccess(world.isClientSide);
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 0a883564b9dda4fa0e6a7174a6e46b98af8be3e6..5ebd43bd4fa08df4531051fde606a9b2921692bf 100644
index acce1b72185d4687ef5a72dd4014d87149f4b092..0f0d35955827ffa8cdc7d947b316704a42242ad3 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -515,13 +515,7 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix spigot sound playing for BlockItem ItemStacks
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 5ebd43bd4fa08df4531051fde606a9b2921692bf..0d44469149ea1bd80bec6a45a104b63e41ac2d6b 100644
index 0f0d35955827ffa8cdc7d947b316704a42242ad3..f099e677041daf795ffee35d3a4659274fc3f3d9 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -566,7 +566,11 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add event for player editing sign
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 0d44469149ea1bd80bec6a45a104b63e41ac2d6b..b065b2997a0be453a9cba932bcba8320ce80c283 100644
index f099e677041daf795ffee35d3a4659274fc3f3d9..d7693f2551ee4c5c3be6d3e77b18b7ddfbd6e36c 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -545,7 +545,7 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -50,7 +50,7 @@ index 9507dbbb4b490149b9248c384be5adaccae40c41..5bbadc890a72f1cb22c6881ebcc163b0
for (int k = 0; k < 5; ++k) {
worldserver.sendParticles(ParticleTypes.SPLASH, (double) blockposition.getX() + worldserver.random.nextDouble(), (double) (blockposition.getY() + 1), (double) blockposition.getZ() + worldserver.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index c1b5d9713cb301dc06b74d97dca4fd5562c539e2..27bafd5349805171399dbd141f5c568ec35286f4 100644
index c8627846dc213f2230327e37ac1114d5cd7447ef..3679bc4573346666088995903a3418c359444532 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -2110,6 +2110,32 @@ public class CraftEventFactory {

Datei anzeigen

@ -7,7 +7,7 @@ For larger ranges, it's better to iterate over the player list
than the entity slices.
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index d575294924df6b970c5773a5cdd8b2a1a9cbce19..dd1fe8357ccf084880a7f3d4d9e499bde672c787 100644
index 62b9b5f508462dd2257094cb48ce6123e29cb64d..a6ffbbc1b5021564864e42c0756342352c2b8290 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -333,7 +333,22 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 27bafd5349805171399dbd141f5c568ec35286f4..5af62603415865068ca4b79a7e68d8eb813596b1 100644
index 3679bc4573346666088995903a3418c359444532..d3b85371b014e462b3bd53ec179214c17640ef72 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -735,7 +735,8 @@ public class CraftEventFactory {

Datei anzeigen

@ -17,7 +17,7 @@ index 5bbadc890a72f1cb22c6881ebcc163b0c06a367a..4fa838bf97ede6e1c893ba64f53aa7af
}
}
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index b065b2997a0be453a9cba932bcba8320ce80c283..f52e4ebd94a5b91689847be05b8e4bb02db97563 100644
index d7693f2551ee4c5c3be6d3e77b18b7ddfbd6e36c..f309bd640dfac68b9a1cf59bb52d315285b91c2c 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -445,6 +445,7 @@ public final class ItemStack implements DataComponentHolder {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix custom statistic criteria creation
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index c4e517ef6cf5cd4975846459cf66ebd4db66a805..6e19867f0c242a735801974a8b0332485f450017 100644
index 6ab39cc723f0874c28def182eaada05c11d36678..e47db705f078245a2be8afc15dd081919188626e 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -617,6 +617,12 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -18,7 +18,7 @@ index 7b4426ac0435d3f419d9ece29dc9eccdb8f99950..cef3a64b5e6c4d34ed079078420078a7
if (blockEvent.isCancelled()) {
// Let the client know the block still exists
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 5af62603415865068ca4b79a7e68d8eb813596b1..47a02b7786d284370d8019b07b8d85f895dc280a 100644
index d3b85371b014e462b3bd53ec179214c17640ef72..f883781f88fdc00a8c9a789b135569ac805b6860 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -650,13 +650,13 @@ public class CraftEventFactory {

Datei anzeigen

@ -79,7 +79,7 @@ index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f
if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen
player.containerMenu = container;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 47a02b7786d284370d8019b07b8d85f895dc280a..eefdb3da069d9615db7c663bcf8a72b78a0e6817 100644
index f883781f88fdc00a8c9a789b135569ac805b6860..da89b73b08b27ec979545e825efe15aec5cf3af2 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1384,10 +1384,21 @@ public class CraftEventFactory {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix UnsafeValues#loadAdvancement
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 6e19867f0c242a735801974a8b0332485f450017..bedd75d4bce73f317618da4cc22ef5bdce20a38f 100644
index e47db705f078245a2be8afc15dd081919188626e..c45e2e29cade6bb8fabc19c5818d5da64a9093c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -320,7 +320,27 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix CraftMetaItem#getAttributeModifier duplication check
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 796f7e5ce2661339081214369497318fb32d2743..f24f911bed23016e9e8d17c777481b7af45a5400 100644
index 0464c7b6cc6cb523fa833c870e4028c3f599ea65..72f60a1308d93eefe73ab8a5a509c08d3ddd1521 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1267,7 +1267,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1274,7 +1274,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
Preconditions.checkNotNull(modifier, "AttributeModifier cannot be null");
this.checkAttributeList();
for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) {

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen