Archiviert
13
0
Dieser Commit ist enthalten in:
Jake Potrebic 2024-04-23 19:46:06 -07:00
Ursprung 8244815161
Commit 309ebc13fc
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
33 geänderte Dateien mit 205 neuen und 207 gelöschten Zeilen

Datei anzeigen

@ -21,10 +21,10 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt
They had 'callq' (invoke) instead of 'mov' (get from memory) instructions.
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
index 64acf7d83d3419af603ad43172c35ed321a2d1c4..afb1e5ff7b1b6b42f81eaa7888a1ec3ded804ccb 100644
index ea4660fe600db94e97a5dd335135f76dd5951468..df4c9b275752ad97a4efe9380ae0d511ee760695 100644
--- a/src/main/java/net/minecraft/core/Vec3i.java
+++ b/src/main/java/net/minecraft/core/Vec3i.java
@@ -37,12 +37,12 @@ public class Vec3i implements Comparable<Vec3i> {
@@ -35,12 +35,12 @@ public class Vec3i implements Comparable<Vec3i> {
}
@Override
@ -39,7 +39,7 @@ index 64acf7d83d3419af603ad43172c35ed321a2d1c4..afb1e5ff7b1b6b42f81eaa7888a1ec3d
return (this.getY() + this.getZ() * 31) * 31 + this.getX();
}
@@ -55,15 +55,15 @@ public class Vec3i implements Comparable<Vec3i> {
@@ -53,15 +53,15 @@ public class Vec3i implements Comparable<Vec3i> {
}
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Option to prevent armor stands from doing entity lookups
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 1353bb583ec576345b7bfea5134c4b0d59811a07..1a3727bbd9d67c32846e7ad4bd4bc9001a4aa313 100644
index d33c49c4a4b87a5203f9b4592deff9389e6e870d..62d63883f6a9f4da099491f697b309d4194b6082 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -338,6 +338,7 @@ public class ArmorStand extends LivingEntity {
@@ -344,6 +344,7 @@ public class ArmorStand extends LivingEntity {
@Override
protected void pushEntities() {
@ -17,10 +17,10 @@ index 1353bb583ec576345b7bfea5134c4b0d59811a07..1a3727bbd9d67c32846e7ad4bd4bc900
Iterator iterator = list.iterator();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 232281b12fb1970fae82ce8fd3ffe1586d02bfb3..6308aeb2129b4d3c5f51759977548279d6073ab4 100644
index ce2957c8955b95865c07eb3f3d7d9fcca2438e5e..9e717a360dd50a2b4a5344011ae77811a3e182c1 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -768,6 +768,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -760,6 +760,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end - Prevent block entity and entity crashes
}
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Vanished players don't have rights
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index e432855ce79f69c0e91fa31e8f6c59a465b0d09e..4ebc38d0666d01c67c2728355fbbef296a0672e3 100644
index 5e9ef75a14a91f01a1ae5b3fb591d7258740a75d..516999dc425d23c570dabfe4f3c829650a6d205d 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -237,6 +237,15 @@ public abstract class Projectile extends Entity implements TraceableEntity {
@@ -276,6 +276,15 @@ public abstract class Projectile extends Entity implements TraceableEntity {
} else {
Entity entity1 = this.getOwner();
@ -25,10 +25,10 @@ index e432855ce79f69c0e91fa31e8f6c59a465b0d09e..4ebc38d0666d01c67c2728355fbbef29
}
}
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index a6638e626600e4304a973497a39e3fac52203b16..c19069f65a9ecbc9000ea4333417a2df4ace1007 100644
index 6ca74a5cf691ee92c84bd031e875f72440df6b32..cee3f1200af602b5dfd0b27d05eb01826c5bbb1d 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -197,7 +197,8 @@ public class BlockItem extends Item {
@@ -174,7 +174,8 @@ public class BlockItem extends Item {
Player entityhuman = context.getPlayer();
CollisionContext voxelshapecollision = entityhuman == null ? CollisionContext.empty() : CollisionContext.of(entityhuman);
// CraftBukkit start - store default return
@ -39,10 +39,10 @@ index a6638e626600e4304a973497a39e3fac52203b16..c19069f65a9ecbc9000ea4333417a2df
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 6308aeb2129b4d3c5f51759977548279d6073ab4..2eb80978ffc26c6250f3a96b73ee20bfea4ecd45 100644
index 9e717a360dd50a2b4a5344011ae77811a3e182c1..d050d72eb87a2d1b4723ab831dfef5e25c6a65b2 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -271,6 +271,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -265,6 +265,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
}
@ -89,10 +89,10 @@ index 6308aeb2129b4d3c5f51759977548279d6073ab4..2eb80978ffc26c6250f3a96b73ee20bf
public boolean isClientSide() {
return this.isClientSide;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 2456857cfcb3dd258781067cd7ddbe18d5f68309..5b2365fc9a9364f2df7e5078c9d88572c074e4e3 100644
index 63fec320871781d92f5ec552aac7fc08b2009f59..cecadd303f40a0e4a3e8315aa58226b6eb3ff7c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1301,6 +1301,14 @@ public class CraftEventFactory {
@@ -1296,6 +1296,14 @@ public class CraftEventFactory {
Projectile projectile = (Projectile) entity.getBukkitEntity();
org.bukkit.entity.Entity collided = position.getEntity().getBukkitEntity();
com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Allow disabling armor stand ticking
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 1a3727bbd9d67c32846e7ad4bd4bc9001a4aa313..0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe 100644
index 62d63883f6a9f4da099491f697b309d4194b6082..042968ff848da74be0c9fcf9bac3d0adfb135802 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -94,9 +94,16 @@ public class ArmorStand extends LivingEntity {
@@ -97,9 +97,16 @@ public class ArmorStand extends LivingEntity {
public Rotations leftLegPose;
public Rotations rightLegPose;
public boolean canMove = true; // Paper
@ -25,7 +25,7 @@ index 1a3727bbd9d67c32846e7ad4bd4bc9001a4aa313..0634b88a5bbfb549d5ec5931e19f674f
this.handItems = NonNullList.withSize(2, ItemStack.EMPTY);
this.armorItems = NonNullList.withSize(4, ItemStack.EMPTY);
this.headPose = ArmorStand.DEFAULT_HEAD_POSE;
@@ -191,6 +198,7 @@ public class ArmorStand extends LivingEntity {
@@ -202,6 +209,7 @@ public class ArmorStand extends LivingEntity {
this.onEquipItem(enumitemslot, (ItemStack) this.armorItems.set(enumitemslot.getIndex(), itemstack), itemstack, silent); // CraftBukkit
}
@ -33,7 +33,7 @@ index 1a3727bbd9d67c32846e7ad4bd4bc9001a4aa313..0634b88a5bbfb549d5ec5931e19f674f
}
@Override
@@ -241,6 +249,7 @@ public class ArmorStand extends LivingEntity {
@@ -244,6 +252,7 @@ public class ArmorStand extends LivingEntity {
}
nbt.put("Pose", this.writePose());
@ -41,7 +41,7 @@ index 1a3727bbd9d67c32846e7ad4bd4bc9001a4aa313..0634b88a5bbfb549d5ec5931e19f674f
}
@Override
@@ -272,6 +281,12 @@ public class ArmorStand extends LivingEntity {
@@ -278,6 +287,12 @@ public class ArmorStand extends LivingEntity {
this.setNoBasePlate(nbt.getBoolean("NoBasePlate"));
this.setMarker(nbt.getBoolean("Marker"));
this.noPhysics = !this.hasPhysics();
@ -51,10 +51,10 @@ index 1a3727bbd9d67c32846e7ad4bd4bc9001a4aa313..0634b88a5bbfb549d5ec5931e19f674f
+ this.canTickSetByAPI = true;
+ }
+ // Paper end - Allow ArmorStands not to tick
CompoundTag nbttagcompound1 = nbt.getCompound("Pose");
CompoundTag nbttagcompound2 = nbt.getCompound("Pose");
this.readPose(nbttagcompound1);
@@ -659,7 +674,29 @@ public class ArmorStand extends LivingEntity {
this.readPose(nbttagcompound2);
@@ -657,7 +672,29 @@ public class ArmorStand extends LivingEntity {
@Override
public void tick() {
@ -84,7 +84,7 @@ index 1a3727bbd9d67c32846e7ad4bd4bc9001a4aa313..0634b88a5bbfb549d5ec5931e19f674f
Rotations vector3f = (Rotations) this.entityData.get(ArmorStand.DATA_HEAD_POSE);
if (!this.headPose.equals(vector3f)) {
@@ -788,31 +825,37 @@ public class ArmorStand extends LivingEntity {
@@ -786,31 +823,37 @@ public class ArmorStand extends LivingEntity {
public void setHeadPose(Rotations angle) {
this.headPose = angle;
this.entityData.set(ArmorStand.DATA_HEAD_POSE, angle);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] SkeletonHorse Additions
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java
index 8f20239f3ef7ebe41fac8ee6e024c36dafec33c4..d00fb16ae3b94dfcb10fd1a7c1671595e2ff1855 100644
index f3a02925833733ae50d706ffc681dd05344a7687..69714e0558419b1577c95cf8e75c1d67177ccb89 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java
@@ -18,6 +18,7 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper;
@@ -20,6 +20,7 @@ import net.minecraft.world.item.enchantment.ItemEnchantments;
public class SkeletonTrapGoal extends Goal {
private final SkeletonHorse horse;
@ -16,7 +16,7 @@ index 8f20239f3ef7ebe41fac8ee6e024c36dafec33c4..d00fb16ae3b94dfcb10fd1a7c1671595
public SkeletonTrapGoal(SkeletonHorse skeletonHorse) {
this.horse = skeletonHorse;
@@ -25,12 +26,13 @@ public class SkeletonTrapGoal extends Goal {
@@ -27,12 +28,13 @@ public class SkeletonTrapGoal extends Goal {
@Override
public boolean canUse() {

Datei anzeigen

@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set.
Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 78f2159285e676b877f85df604889ddcf19e8923..f3195b37c314a1327752ece7ec33dfdae16f0bec 100644
index a58e865a047550cc4508d0515cc6f2fc639f9b3d..13e6fc9f42d63fdbd659462070dc7f0767fbb1d9 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -679,7 +679,7 @@ public final class CraftItemStack extends ItemStack {
@@ -681,7 +681,7 @@ public final class CraftItemStack extends ItemStack {
@Override
public boolean hasItemMeta() {
@ -24,10 +24,10 @@ index 78f2159285e676b877f85df604889ddcf19e8923..f3195b37c314a1327752ece7ec33dfda
static boolean hasItemMeta(net.minecraft.world.item.ItemStack item) {
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
index 652207b92ac20c1ba3d20939dc2bbee3c494bf5f..adb7c742e8fe3b8e0c2ecf63c627e7566285fd55 100644
index cf436c9e62a11b8c6cbf7638de0e5635c67459ac..7237e24686885c754c87e7eec53c6400fd0b47bf 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
@@ -107,6 +107,34 @@ public class ItemMetaTest extends AbstractTestingBase {
@@ -106,6 +106,34 @@ public class ItemMetaTest extends AbstractTestingBase {
assertThat(itemMeta.hasConflictingEnchant(null), is(false));
}

Datei anzeigen

@ -5,11 +5,11 @@ Subject: [PATCH] AnvilDamageEvent
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
index d829173d2fc9fc0e12c24d736f1ed44417b81612..878d3c3089635a515fa7f54c956159a1bb6ce29b 100644
index 37cc70f46d85cef1d678ab9df4fb1a73a57ed877..4c766b879f935298ffa4249e9ce4045601cedb20 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
@@ -108,6 +108,16 @@ public class AnvilMenu extends ItemCombinerMenu {
if (!player.getAbilities().instabuild && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
@@ -110,6 +110,16 @@ public class AnvilMenu extends ItemCombinerMenu {
if (!player.hasInfiniteMaterials() && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
BlockState iblockdata1 = AnvilBlock.damage(iblockdata);
+ // Paper start - AnvilDamageEvent

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add TNTPrimeEvent
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index 0d84f1fb53384a827d7418c322a32e3286f4081a..6d01175ea2092bc5f5ebb7aa066450bfec2443a1 100644
index 3e2f83e2c695b024bdec2c5e11ab38596730ed4a..789823dbaaf2e23942749145dbb64071539624aa 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -559,6 +559,11 @@ public class EnderDragon extends Mob implements Enemy {
@@ -557,6 +557,11 @@ public class EnderDragon extends Mob implements Enemy {
});
craftBlock.getNMS().spawnAfterBreak((ServerLevel) this.level(), blockposition, ItemStack.EMPTY, false);
}
@ -21,7 +21,7 @@ index 0d84f1fb53384a827d7418c322a32e3286f4081a..6d01175ea2092bc5f5ebb7aa066450bf
this.level().removeBlock(blockposition, false);
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
index 016c8b7762c2b4eacb95a455940db4684b34e03c..da9cd2da60186b94f3b8a259c13b20f20e50fccb 100644
index c7c4b04dede992991229b149b96ff6a81f499ae3..886b8d2284e3ae85184c842b24869029b9ee4ebe 100644
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
@@ -302,12 +302,19 @@ public class FireBlock extends BaseFireBlock {
@ -46,11 +46,11 @@ index 016c8b7762c2b4eacb95a455940db4684b34e03c..da9cd2da60186b94f3b8a259c13b20f2
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/TntBlock.java b/src/main/java/net/minecraft/world/level/block/TntBlock.java
index cc20c320cbb3420e5e302a94571bab374c8553c8..4edd2e7bb62df65d6da8c8a623cf03e7e947bf75 100644
index 21b83d4d5b58da22ba1fadb0ca376a0076f2e23c..58b8c3cc579a1d34af26c44d6a7413bd5cc9e4e7 100644
--- a/src/main/java/net/minecraft/world/level/block/TntBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TntBlock.java
@@ -49,6 +49,12 @@ public class TntBlock extends Block {
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
@@ -50,6 +50,12 @@ public class TntBlock extends Block {
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (!oldState.is(state.getBlock())) {
if (world.hasNeighborSignal(pos) && CraftEventFactory.callTNTPrimeEvent(world, pos, PrimeCause.REDSTONE, null, null)) { // CraftBukkit - TNTPrimeEvent
+ // Paper start - TNTPrimeEvent
@ -62,9 +62,9 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..4edd2e7bb62df65d6da8c8a623cf03e7
TntBlock.explode(world, pos);
world.removeBlock(pos, false);
}
@@ -59,6 +65,12 @@ public class TntBlock extends Block {
@@ -60,6 +66,12 @@ public class TntBlock extends Block {
@Override
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
if (world.hasNeighborSignal(pos) && CraftEventFactory.callTNTPrimeEvent(world, pos, PrimeCause.REDSTONE, null, sourcePos)) { // CraftBukkit - TNTPrimeEvent
+ // Paper start - TNTPrimeEvent
+ org.bukkit.block.Block tntBlock = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos);
@ -75,7 +75,7 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..4edd2e7bb62df65d6da8c8a623cf03e7
TntBlock.explode(world, pos);
world.removeBlock(pos, false);
}
@@ -77,6 +89,13 @@ public class TntBlock extends Block {
@@ -78,6 +90,13 @@ public class TntBlock extends Block {
@Override
public void wasExploded(Level world, BlockPos pos, Explosion explosion) {
if (!world.isClientSide) {
@ -89,8 +89,8 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..4edd2e7bb62df65d6da8c8a623cf03e7
PrimedTnt entitytntprimed = new PrimedTnt(world, (double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D, explosion.getIndirectSourceEntity());
int i = entitytntprimed.getFuse();
@@ -111,6 +130,12 @@ public class TntBlock extends Block {
return InteractionResult.CONSUME;
@@ -110,6 +129,12 @@ public class TntBlock extends Block {
return ItemInteractionResult.CONSUME;
}
// CraftBukkit end
+ // Paper start - TNTPrimeEvent
@ -101,8 +101,8 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..4edd2e7bb62df65d6da8c8a623cf03e7
+ // Paper end - TNTPrimeEvent
TntBlock.explode(world, pos, player);
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11);
Item item = itemstack.getItem();
@@ -142,6 +167,12 @@ public class TntBlock extends Block {
Item item = stack.getItem();
@@ -139,6 +164,12 @@ public class TntBlock extends Block {
return;
}
// CraftBukkit end

Datei anzeigen

@ -22,10 +22,10 @@ to take the burden of this into their own hand without having to rely on
plugins doing unsafe things.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index de6fff0e915c66123d0691840b180cf60dc8a95a..7663110df928ec88fc97e3b7d65671001db2d1bc 100644
index b9fb2472405c19afb9888720a9abd86687e9bf12..f49f412781a8f341eda02de323f7298d5f0b25ee 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -256,6 +256,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -266,6 +266,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private int ackBlockChangesUpTo = -1;
// CraftBukkit start - multithreaded fields
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
@ -33,7 +33,7 @@ index de6fff0e915c66123d0691840b180cf60dc8a95a..7663110df928ec88fc97e3b7d6567100
// CraftBukkit end
private int dropSpamTickCount;
private double firstGoodX;
@@ -373,6 +374,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -387,6 +388,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.keepConnectionAlive();
// CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
@ -41,7 +41,7 @@ index de6fff0e915c66123d0691840b180cf60dc8a95a..7663110df928ec88fc97e3b7d6567100
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
@@ -696,7 +698,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -722,7 +724,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async
// CraftBukkit start

Datei anzeigen

@ -8,10 +8,10 @@ Addresses two issues:
- Allay duplication cooldown is saved and exposed as a long, but loaded as an int
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
index 97524656b8af7b80aeb7845575c704585dade725..a9c30fb4cfe4ff7bb27d498218373c572031fab8 100644
index 105b07cb8efd6a4304c4cf6650affa46a7852941..adc3e6298a1946fdea029c82a9954fb5b6e24497 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
@@ -296,7 +296,7 @@ public class ExperienceOrb extends Entity {
@@ -302,7 +302,7 @@ public class ExperienceOrb extends Entity {
public void addAdditionalSaveData(CompoundTag nbt) {
nbt.putShort("Health", (short) this.health);
nbt.putShort("Age", (short) this.age);
@ -20,7 +20,7 @@ index 97524656b8af7b80aeb7845575c704585dade725..a9c30fb4cfe4ff7bb27d498218373c57
nbt.putInt("Count", this.count);
this.savePaperNBT(nbt); // Paper
}
@@ -305,7 +305,7 @@ public class ExperienceOrb extends Entity {
@@ -311,7 +311,7 @@ public class ExperienceOrb extends Entity {
public void readAdditionalSaveData(CompoundTag nbt) {
this.health = nbt.getShort("Health");
this.age = nbt.getShort("Age");
@ -30,10 +30,10 @@ index 97524656b8af7b80aeb7845575c704585dade725..a9c30fb4cfe4ff7bb27d498218373c57
this.loadPaperNBT(nbt); // Paper
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
index 41621adf597d76cad0a7098ac0da8ceb29b43ed7..5ad5f22e5aa26445e5eb229958e7bf356bdd460e 100644
index 296a25deae065425ef9384b7ec15d5aeb76dbd66..991e3274091c4e25eebc6debd44653e5b566eedb 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -509,7 +509,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
@@ -487,7 +487,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
});
}

Datei anzeigen

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 22 Nov 2016 00:40:42 -0500
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 2535cbf50087a4631c4d1027a61b173121d729bc..6f1ff953e6311ff859d3ddc5734d33146237992b 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 {
// CraftBukkit start
ItemStack itemstack = new ItemStack(holder, i, datacomponentpatch);
- if (!datacomponentpatch.isEmpty()) {
+ if (false && !datacomponentpatch.isEmpty()) { // Paper - This is no longer needed with raw NBT being handled in metadata
CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
}
return itemstack;
@@ -183,7 +183,7 @@ public final class ItemStack implements DataComponentHolder {
registryfriendlybytebuf.writeVarInt(itemstack.getCount());
// Spigot start - filter
itemstack = itemstack.copy();
- CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
+ // CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); // Paper - This is no longer with raw NBT being handled in metadata
// Spigot end
ITEM_STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.getItemHolder()); // CraftBukkit - decompile error
DataComponentPatch.STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.components.asPatch());

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 2a0e81a3ec0774ad98e2d74ac7672c167e28f38e..05b838f7008d5d031b18e161bbde7e72b8205b90 100644
index 46da628073e2bfb77b3deab623dba46228d92618..1c508d1f122d287cd8dc0a905de96436c343327a 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1425,6 +1425,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1441,6 +1441,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
@ -16,7 +16,7 @@ index 2a0e81a3ec0774ad98e2d74ac7672c167e28f38e..05b838f7008d5d031b18e161bbde7e72
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
@@ -1467,7 +1468,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1481,7 +1482,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.broadcastRemoved();
}
@ -26,10 +26,10 @@ index 2a0e81a3ec0774ad98e2d74ac7672c167e28f38e..05b838f7008d5d031b18e161bbde7e72
protected void tick() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 113dce44ce086272fe7f20a2007efadee142ff85..0811a2e87192b46c39f54c26ce0e56fc6e9d87e5 100644
index 75213d34740e512763a8eb4411ef2b48c6204434..ce89f04b74e579dedae05cfdf681827a92626f9a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1197,6 +1197,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1203,6 +1203,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit start
private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@ -43,10 +43,10 @@ index 113dce44ce086272fe7f20a2007efadee142ff85..0811a2e87192b46c39f54c26ce0e56fc
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 36f0a43cc301840406eab260b162295fe760f8bb..c46ad2013439f043145fb7fc67bbcd80728e3c16 100644
index c2dd3767fbeb7215c9b2703054c9068252828355..d39aec1b3233e91aa5b953396d876e7466a9a5bc 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -242,6 +242,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -245,6 +245,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
private CraftEntity bukkitEntity;

Datei anzeigen

@ -9,10 +9,10 @@ thread dumps at an interval until the point of crash.
This will help diagnose what was going on in that time before the crash.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 02df8d59ced48bfebfacbfab669e245539605ede..8196ecb2a7280a4f60a5fea18c484d6419953b48 100644
index 875591131576cb3760193651fac22698e1eb9099..23a5358a5fe4784e75b327741e6fcb174c04d287 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1092,6 +1092,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1104,6 +1104,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.status = this.buildServerStatus();
// Spigot start
@ -21,10 +21,10 @@ index 02df8d59ced48bfebfacbfab669e245539605ede..8196ecb2a7280a4f60a5fea18c484d64
// Paper start - further improve server tick loop
long tickSection = Util.getNanos();
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 8edf2f049aa077792bfb507384f4cf5bb716cb64..6db918db1984d298c57eb93f7cf38aa26f01a04c 100644
index 0ffa25a6e41cc56e78c79e0cee45e3b811794129..1b47e228ad7365b31d6ddd8c572d3bc5de90a591 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -198,6 +198,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -212,6 +212,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
// Paper end - initialize global and world-defaults configuration
@ -33,7 +33,7 @@ index 8edf2f049aa077792bfb507384f4cf5bb716cb64..6db918db1984d298c57eb93f7cf38aa2
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d25ee3ca530289c0deda45b01196ece98788e628..abdff07588cb06f8ec4f3f2172f7dce92fa8a979 100644
index 9d65bce391b00b78efed1e40a01fa2865c05e6fd..af9140513970fc5c3797a170eab02de40048543c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -927,6 +927,7 @@ public final class CraftServer implements Server {
@ -44,16 +44,16 @@ index d25ee3ca530289c0deda45b01196ece98788e628..abdff07588cb06f8ec4f3f2172f7dce9
this.reloadCount++;
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile());
@@ -1016,6 +1017,7 @@ public final class CraftServer implements Server {
this.enablePlugins(PluginLoadOrder.STARTUP);
@@ -1017,6 +1018,7 @@ public final class CraftServer implements Server {
this.enablePlugins(PluginLoadOrder.POSTWORLD);
this.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD));
if (io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper != null) io.papermc.paper.plugin.PluginInitializerManager.instance().pluginRemapper.pluginsEnabled(); // Paper - Remap plugins
+ org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload
}
@Override
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 9c5c19ab9dc14d844631f47a93f3349409efdf43..56dbc23f10d946a7ec992b08fd868f3ee5089068 100644
index 7cd1f375b9ad9e6d6f2d26661519f12be064a9d2..9572177323f29ea8315a3dfb943dfe10463f32ae 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -229,7 +229,7 @@ public class SpigotConfig
@ -66,7 +66,7 @@ index 9c5c19ab9dc14d844631f47a93f3349409efdf43..56dbc23f10d946a7ec992b08fd868f3e
public static boolean bungee;
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index ce17005f8c255eb3096736ef9f0d1de64b612d79..017c2eadbc5dfec155c21b5d8a80f0b1e380398e 100644
index 81ccbe2533e6fc5899d6c068e421e0d7f1351d34..ad282d34919716b75acd10426cd071da9d064a51 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -14,6 +14,10 @@ public class WatchdogThread extends Thread

Datei anzeigen

@ -23,10 +23,10 @@ Modified isEmpty to use the isEmpty() method instead of the slightly confusing s
The point of this is readability, but does have a side-benefit of a small microptimization
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 2dac6be5b320d7c12aa70fd09d7d218b8cd89287..7d81334b8bbfc04f1188de777b0cacd6f80131d3 100644
index 43fc4e945c6a3cd94522d667055ab3dd80f961f6..4dea09aa0f5f45d449ba12d8a9db3e0a3b708757 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -635,7 +635,7 @@ public abstract class PlayerList {
@@ -634,7 +634,7 @@ public abstract class PlayerList {
} else if (!this.isWhiteListed(gameprofile, event)) { // Paper - ProfileWhitelistVerifyEvent
//ichatmutablecomponent = Component.translatable("multiplayer.disconnect.not_whitelisted"); // Paper
//event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.whitelistMessage)); // Spigot // Paper - Adventure - moved to isWhitelisted
@ -36,7 +36,7 @@ index 2dac6be5b320d7c12aa70fd09d7d218b8cd89287..7d81334b8bbfc04f1188de777b0cacd6
ichatmutablecomponent = Component.translatable("multiplayer.disconnect.banned_ip.reason", ipbanentry.getReason());
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index 36d87cb87c1c31b649bf9ae39191553acfc2cb0f..7e133752ccb1ea7c0b4fa781feb1a88e2cfdcf6d 100644
index 7e81907bfdca225413e8191e37969990e6f4cf2c..c038da20b76c0b7b1c18471b20be01e849d29f3a 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -30,7 +30,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Use a Queue for Queueing Commands
Lists are bad as Queues mmmkay.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 6db918db1984d298c57eb93f7cf38aa26f01a04c..78775feb965d6eb98a1ff655ae44b9f0399ef9aa 100644
index 1b47e228ad7365b31d6ddd8c572d3bc5de90a591..bce5fc7337d4e29c3353600a35c999caaed1428e 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -69,7 +69,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -76,7 +76,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
static final Logger LOGGER = LogUtils.getLogger();
private static final int CONVERSION_RETRY_DELAY_MS = 5000;
private static final int CONVERSION_RETRIES = 2;
@ -18,7 +18,7 @@ index 6db918db1984d298c57eb93f7cf38aa26f01a04c..78775feb965d6eb98a1ff655ae44b9f0
@Nullable
private QueryThreadGs4 queryThreadGs4;
// private final RemoteControlCommandListener rconConsoleSource; // CraftBukkit - remove field
@@ -412,13 +412,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -434,13 +434,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
}
public void handleConsoleInput(String command, CommandSourceStack commandSource) {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Ability to get block entities from a chunk without snapshots
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index 70999e95116d50de1a7fecdd91bbad0bac2bf1d8..bfde7573acb6d84accfd3f7fee877bbfb3b0852f 100644
index 1d4587a97e86251982a9df832949a7093b216862..fc335e4e80553e8c6c915e7813e9610ac10649c2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -173,6 +173,13 @@ public class CraftChunk implements Chunk {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Optimize BlockPosition helper methods
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index ead823fa2a143acb05b33152ee1e5ee4b4936a20..4bc994bacdf1fbb7689d799d21a50b7903bf9e59 100644
index 2074d4327f0c356c220f3a6a9761439e76a15fc3..19fdd77d4830b7218b627fdf4ed755d8935c00aa 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -131,67 +131,84 @@ public class BlockPos extends Vec3i {
@@ -153,67 +153,84 @@ public class BlockPos extends Vec3i {
@Override
public BlockPos above() {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Slime Pathfinder Events
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bcb0d9b1a9 100644
index 136ec2413b6fe4680d7f2e903d04c9984b37f4c0..7062ef1cfd7d6279a4c6693cbdb80da49f23c542 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -116,6 +116,7 @@ public class Slime extends Mob implements Enemy {
@@ -115,6 +115,7 @@ public class Slime extends Mob implements Enemy {
@Override
public void addAdditionalSaveData(CompoundTag nbt) {
super.addAdditionalSaveData(nbt);
@ -16,7 +16,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
nbt.putInt("Size", this.getSize() - 1);
nbt.putBoolean("wasOnGround", this.wasOnGround);
}
@@ -124,6 +125,11 @@ public class Slime extends Mob implements Enemy {
@@ -123,6 +124,11 @@ public class Slime extends Mob implements Enemy {
public void readAdditionalSaveData(CompoundTag nbt) {
this.setSize(nbt.getInt("Size") + 1, false);
super.readAdditionalSaveData(nbt);
@ -28,7 +28,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
this.wasOnGround = nbt.getBoolean("wasOnGround");
}
@@ -479,7 +485,7 @@ public class Slime extends Mob implements Enemy {
@@ -475,7 +481,7 @@ public class Slime extends Mob implements Enemy {
@Override
public boolean canUse() {
@ -37,7 +37,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
}
@Override
@@ -518,7 +524,15 @@ public class Slime extends Mob implements Enemy {
@@ -512,7 +518,15 @@ public class Slime extends Mob implements Enemy {
public boolean canUse() {
LivingEntity entityliving = this.slime.getTarget();
@ -54,7 +54,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
}
@Override
@@ -531,7 +545,15 @@ public class Slime extends Mob implements Enemy {
@@ -525,7 +539,15 @@ public class Slime extends Mob implements Enemy {
public boolean canContinueToUse() {
LivingEntity entityliving = this.slime.getTarget();
@ -71,7 +71,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
}
@Override
@@ -556,6 +578,13 @@ public class Slime extends Mob implements Enemy {
@@ -548,6 +570,13 @@ public class Slime extends Mob implements Enemy {
}
}
@ -85,7 +85,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
}
private static class SlimeRandomDirectionGoal extends Goal {
@@ -571,7 +600,7 @@ public class Slime extends Mob implements Enemy {
@@ -563,7 +592,7 @@ public class Slime extends Mob implements Enemy {
@Override
public boolean canUse() {
@ -94,7 +94,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
}
@Override
@@ -579,6 +608,11 @@ public class Slime extends Mob implements Enemy {
@@ -571,6 +600,11 @@ public class Slime extends Mob implements Enemy {
if (--this.nextRandomizeTime <= 0) {
this.nextRandomizeTime = this.adjustedTickDelay(40 + this.slime.getRandom().nextInt(60));
this.chosenDegrees = (float) this.slime.getRandom().nextInt(360);
@ -106,7 +106,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
}
MoveControl controllermove = this.slime.getMoveControl();
@@ -603,7 +637,7 @@ public class Slime extends Mob implements Enemy {
@@ -593,7 +627,7 @@ public class Slime extends Mob implements Enemy {
@Override
public boolean canUse() {
@ -115,7 +115,7 @@ index d536df2c23f8cae6bf920a5304d91f10a9902251..00dcbcbf20995ab6aca508d7ffe703bc
}
@Override
@@ -618,4 +652,15 @@ public class Slime extends Mob implements Enemy {
@@ -606,4 +640,15 @@ public class Slime extends Mob implements Enemy {
}
}

Datei anzeigen

@ -5,12 +5,12 @@ Subject: [PATCH] Configurable speed for water flowing over lava
diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
index 82afefbbc3b9d3571792d66e6d4f9d687971aa66..9b3dcf1a4d4cece92a629506d341f6bfe79d13d0 100644
index 6d24989965e5215c1e256444a868633cf2772aa3..84623c632d8c2f0fa7ec939c711316d757117d23 100644
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
@@ -140,11 +140,31 @@ public class LiquidBlock extends Block implements BucketPickup {
@@ -138,11 +138,31 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) {
- world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava
@ -39,11 +39,11 @@ index 82afefbbc3b9d3571792d66e6d4f9d687971aa66..9b3dcf1a4d4cece92a629506d341f6bf
+ // Paper end - Configurable speed for water flowing over lava
+
@Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) {
@@ -157,7 +177,7 @@ public class LiquidBlock extends Block implements BucketPickup {
@@ -155,7 +175,7 @@ public class LiquidBlock extends Block implements BucketPickup {
@Override
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) {
- world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava

Datei anzeigen

@ -7,10 +7,10 @@ Avoids a hashmap lookup by cacheing a reference to the CraftBlockData
and cloning it when one is needed.
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf..6f60622f2dad5f82fb24505612e7e3a32722ab93 100644
index 08eb369f8cb4c35be17cef816a0d33295a1ae3e0..da8b97c590fb38f65dee2e8a881a2f7ad658b5e7 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -875,6 +875,14 @@ public abstract class BlockBehaviour implements FeatureElement {
@@ -807,6 +807,14 @@ public abstract class BlockBehaviour implements FeatureElement {
this.instrument = blockbase_info.instrument;
this.replaceable = blockbase_info.replaceable;
}
@ -26,10 +26,10 @@ index b6d3f9f9520e410526cfeabcdeb9720dbe30e4bf..6f60622f2dad5f82fb24505612e7e3a3
private boolean calculateSolid() {
if (((Block) this.owner).properties.forceSolidOn) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 85ea3d059efed939c56b612f3c8e2064a28c39e6..fce3fec5e1ff164b0596fdd6b3d7b5b0277253ef 100644
index d2ec2d11736a74f8d568e25e9b560605518af987..19fab0d8d8a6211782df1fd99b5d60681aecd2f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -570,7 +570,17 @@ public class CraftBlockData implements BlockData {
@@ -571,7 +571,17 @@ public class CraftBlockData implements BlockData {
return craft;
}

Datei anzeigen

@ -8,10 +8,10 @@ Use larger initial sizes to increase bucket capacity on the BiMap
BiMap.get was seen to be using a good bit of CPU time.
diff --git a/src/main/java/net/minecraft/core/MappedRegistry.java b/src/main/java/net/minecraft/core/MappedRegistry.java
index ffa0d08c0a2c8cb8f3f1c896b435acff02bdaed6..020f00b5aba1873310fb0e044bcc47140c405ebd 100644
index aac210f682303b85e207bb230decb1af62a1a25a..a35fe2b8ef35692fb7b5d520944d0c6ae53ac07e 100644
--- a/src/main/java/net/minecraft/core/MappedRegistry.java
+++ b/src/main/java/net/minecraft/core/MappedRegistry.java
@@ -36,11 +36,11 @@ public class MappedRegistry<T> implements WritableRegistry<T> {
@@ -35,11 +35,11 @@ public class MappedRegistry<T> implements WritableRegistry<T> {
private static final Logger LOGGER = LogUtils.getLogger();
final ResourceKey<? extends Registry<T>> key;
private final ObjectList<Holder.Reference<T>> byId = new ObjectArrayList<>(256);
@ -19,12 +19,12 @@ index ffa0d08c0a2c8cb8f3f1c896b435acff02bdaed6..020f00b5aba1873310fb0e044bcc4714
- private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>();
- private final Map<ResourceKey<T>, Holder.Reference<T>> byKey = new HashMap<>();
- private final Map<T, Holder.Reference<T>> byValue = new IdentityHashMap<>();
- private final Map<T, Lifecycle> lifecycles = new IdentityHashMap<>();
- private final Map<ResourceKey<T>, RegistrationInfo> registrationInfos = new IdentityHashMap<>();
+ private final Reference2IntMap<T> toId = Util.make(new Reference2IntOpenHashMap<>(2048), map -> map.defaultReturnValue(-1)); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<ResourceKey<T>, Holder.Reference<T>> byKey = new HashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<T, Holder.Reference<T>> byValue = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<T, Lifecycle> lifecycles = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
+ private final Map<ResourceKey<T>, RegistrationInfo> registrationInfos = new IdentityHashMap<>(2048); // Paper - Perf: Use bigger expected size to reduce collisions
private Lifecycle registryLifecycle;
private volatile Map<TagKey<T>, HolderSet.Named<T>> tags = new IdentityHashMap<>();
private boolean frozen;

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add PhantomPreSpawnEvent
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
index d19bf99d03bf505a1a277b49fba6ee4769802ef2..658393f451e46a93c5665fe3c580aa395ace68d1 100644
index ef6bbcb6fc9d37748c74b68966e12637efd00aba..4292a0fbab588a8cd58db36bc279f2991231aeec 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
@@ -172,6 +172,11 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -165,6 +165,11 @@ public class Phantom extends FlyingMob implements Enemy {
}
this.setPhantomSize(nbt.getInt("Size"));
@ -20,7 +20,7 @@ index d19bf99d03bf505a1a277b49fba6ee4769802ef2..658393f451e46a93c5665fe3c580aa39
}
@Override
@@ -181,6 +186,11 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -174,6 +179,11 @@ public class Phantom extends FlyingMob implements Enemy {
nbt.putInt("AY", this.anchorPoint.getY());
nbt.putInt("AZ", this.anchorPoint.getZ());
nbt.putInt("Size", this.getPhantomSize());
@ -32,26 +32,29 @@ index d19bf99d03bf505a1a277b49fba6ee4769802ef2..658393f451e46a93c5665fe3c580aa39
}
@Override
@@ -241,6 +251,14 @@ public class Phantom extends FlyingMob implements Enemy {
return -0.125F;
@@ -219,6 +229,17 @@ public class Phantom extends FlyingMob implements Enemy {
return entitysize.scale(1.0F + 0.15F * (float) i);
}
+ // Paper start
+ @Nullable
+ java.util.UUID spawningEntity;
+
+ @Nullable
+ public java.util.UUID getSpawningEntity() {
+ return spawningEntity;
+ return this.spawningEntity;
+ }
+ public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
+ // Paper end
+
private static enum AttackPhase {
CIRCLE, SWOOP;
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
index 61ba99d99cc4e7782450ee6aa8b6c87b1a42cb3a..5d84bd022714f9726131d2e37d648c444052af9b 100644
index 9d28e3855a9b150534ef8b6c89e186f5c4c47694..bb7f2d3ff7fc6f5cadb4ab24efb5a3a2f5bdc33f 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -70,9 +70,19 @@ public class PhantomSpawner implements CustomSpawner {
@@ -69,9 +69,19 @@ public class PhantomSpawner implements CustomSpawner {
int k = 1 + randomsource.nextInt(difficultydamagescaler.getDifficulty().getId() + 1);
for (int l = 0; l < k; ++l) {
@ -69,7 +72,7 @@ index 61ba99d99cc4e7782450ee6aa8b6c87b1a42cb3a..5d84bd022714f9726131d2e37d648c44
if (entityphantom != null) {
+ entityphantom.setSpawningEntity(entityplayer.getUUID()); // Paper - PhantomPreSpawnEvent
entityphantom.moveTo(blockposition1, 0.0F, 0.0F);
groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity, (CompoundTag) null);
groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity);
world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
index 0359c161448941f1b9fdac545a5c47a68f19b760..305a635b049741ac5e2670060c6818cb2c07e5ab 100644

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add More Creeper API
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
index 83b407e865e2ff4debb89c350727809601be1fa6..9657796d08f4a102d9d5ff7685f2a152d1a87fda 100644
index dd57da9dc663484c4266d9973aee927899292749..4b94e21d05d6deae75f0c2fb711e43a4c7d06f90 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -133,7 +133,7 @@ public class Creeper extends Monster implements PowerableMob {
@@ -134,7 +134,7 @@ public class Creeper extends Monster implements PowerableMob {
}
if (nbt.getBoolean("ignited")) {
@ -17,7 +17,7 @@ index 83b407e865e2ff4debb89c350727809601be1fa6..9657796d08f4a102d9d5ff7685f2a152
}
}
@@ -316,7 +316,18 @@ public class Creeper extends Monster implements PowerableMob {
@@ -314,7 +314,18 @@ public class Creeper extends Monster implements PowerableMob {
}
public void ignite() {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 3d189fd1a1ac17f1dee4af631f8ed59387c977d4..fd04c5c7e08b54de65ffaf58385dcc05ef22bba0 100644
index 59060c33f87db609510df111234b957b51badd87..4a7c418a497b98d5038794b6bbc38f5e0b7fedd7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -407,7 +407,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 88af8a11dfc3b645c5a2b5fb629a73fc1e2b2f80..c6c6fb195476e0d37b0007510044928ebe6e4572 100644
index 7d44d4563e39f279cf335f307a4d84d0758858ee..67ba23c66e253d3a96f6b08a5580387859652aa2 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3849,6 +3849,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3932,6 +3932,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
// Paper start - Make shield blocking delay configurable
@ -29,10 +29,10 @@ index 88af8a11dfc3b645c5a2b5fb629a73fc1e2b2f80..c6c6fb195476e0d37b0007510044928e
public int getShieldBlockingDelay() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0fe087cd6037b4dd694cc3c5c3eac8203ea6d519..8139ea88988e2e3551258b6686873753353ab9f8 100644
index bd5b535663935dc8f4a2a8f5c233c1c720400bd7..fa2cb4820698d4f0f317d7abd14216bdd54143a7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -201,6 +201,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -200,6 +200,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return blocks.get(0);
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d06d26133e00eb47b6ac950bb4efbf4ac6fe9da5..3482fef56307357a4d75d52a79c2fd9988bab22e 100644
index 87e3eeb126284eab6d3391ae11d3bf2a8edfcb61..b3f6e1277c7afc77ff34ac14d3d16d1501abe14e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2899,6 +2899,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2964,6 +2964,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.adventure$pointers;
}

Datei anzeigen

@ -19,10 +19,10 @@ public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sou
public net.minecraft.world.entity.LivingEntity getSoundVolume()F
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0b039c43bd3bd46f31477fc75585038270242de2..054057482d191d8e77bf4d179d51e32b5d9ca16e 100644
index e073b48ed6cbefc503216615f54d09b309217d80..c97410f580f31389987ef944fc410e44459a4693 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -248,6 +248,10 @@ public class ServerPlayer extends Player {
@@ -263,6 +263,10 @@ public class ServerPlayer extends Player {
private int containerCounter;
public boolean wonGame;
private int containerUpdateDelay; // Paper - Configurable container update tick rate
@ -32,8 +32,8 @@ index 0b039c43bd3bd46f31477fc75585038270242de2..054057482d191d8e77bf4d179d51e32b
+ // Paper end - cancellable death event
// CraftBukkit start
public String displayName;
@@ -810,7 +814,7 @@ public class ServerPlayer extends Player {
public CraftPlayer.TransferCookieConnection transferCookieConnection;
@@ -877,7 +881,7 @@ public class ServerPlayer extends Player {
@Override
public void die(DamageSource damageSource) {
@ -42,7 +42,7 @@ index 0b039c43bd3bd46f31477fc75585038270242de2..054057482d191d8e77bf4d179d51e32b
boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
// CraftBukkit start - fire PlayerDeathEvent
if (this.isRemoved()) {
@@ -838,6 +842,16 @@ public class ServerPlayer extends Player {
@@ -905,6 +909,16 @@ public class ServerPlayer extends Player {
String deathmessage = defaultMessage.getString();
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), keepInventory); // Paper - Adventure
@ -59,7 +59,7 @@ index 0b039c43bd3bd46f31477fc75585038270242de2..054057482d191d8e77bf4d179d51e32b
// SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) {
@@ -986,8 +1000,17 @@ public class ServerPlayer extends Player {
@@ -1053,8 +1067,17 @@ public class ServerPlayer extends Player {
}
}
}
@ -80,10 +80,10 @@ index 0b039c43bd3bd46f31477fc75585038270242de2..054057482d191d8e77bf4d179d51e32b
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2a8d25084 100644
index 67ba23c66e253d3a96f6b08a5580387859652aa2..a770d2bda45cee739a5371119018e6f6e4cbb2cb 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -260,6 +260,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -271,6 +271,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
public Set<UUID> collidableExemptions = new HashSet<>();
public boolean bukkitPickUpLoot;
public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
@ -91,14 +91,12 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
@Override
public float getBukkitYaw() {
@@ -1530,13 +1531,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1543,11 +1544,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.isDeadOrDying()) {
if (!this.checkTotemDeathProtection(source)) {
- SoundEvent soundeffect = this.getDeathSound();
-
- if (flag1 && soundeffect != null) {
- this.playSound(soundeffect, this.getSoundVolume(), this.getVoicePitch());
- if (flag1) {
- this.makeSound(this.getDeathSound());
- }
+ // Paper start - moved into CraftEventFactory event caller for cancellable death event
+ this.silentDeath = !flag1; // mark entity as dying silently
@ -109,7 +107,7 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
}
} else if (flag1) {
this.playHurtSound(source);
@@ -1688,6 +1688,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1706,6 +1708,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
Entity entity = damageSource.getEntity();
LivingEntity entityliving = this.getKillCredit();
@ -117,7 +115,7 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
if (this.deathScore >= 0 && entityliving != null) {
entityliving.awardKillScore(this, this.deathScore, damageSource);
}
@@ -1699,24 +1700,59 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1717,24 +1720,59 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!this.level().isClientSide && this.hasCustomName()) {
if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
}
@ -131,8 +129,7 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
if (world instanceof ServerLevel) {
ServerLevel worldserver = (ServerLevel) world;
+ // Paper - move below into if for onKill
- if (entity == null || entity.killedEntity(worldserver, this)) {
+
+ // Paper start
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(damageSource);
+ if (deathEvent == null || !deathEvent.isCancelled()) {
@ -155,7 +152,8 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
+ if (!this.level().isClientSide && this.hasCustomName()) {
+ if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
+ }
+
- if (entity == null || entity.killedEntity(worldserver, this)) {
+ this.getCombatTracker().recheckStatus();
+ if (entity != null) {
+ entity.killedEntity((ServerLevel) this.level(), this);
@ -182,7 +180,7 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
}
}
@@ -1724,7 +1760,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1742,7 +1780,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!this.level().isClientSide) {
boolean flag = false;
@ -191,7 +189,7 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
if (this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
BlockPos blockposition = this.blockPosition();
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
@@ -1753,7 +1789,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1771,7 +1809,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
}
@ -204,7 +202,7 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
Entity entity = source.getEntity();
int i;
@@ -1768,18 +1808,27 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1786,18 +1828,27 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.dropEquipment(); // CraftBukkit - from below
if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
this.dropFromLootTable(source, flag);
@ -234,10 +232,10 @@ index c6c6fb195476e0d37b0007510044928ebe6e4572..4b3d1c8452bd759db6fc8d3d9fcf98e2
// CraftBukkit start
public int getExpReward() {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 655dfa9113ca82dc56bc8f4b083ea049ee5b4bee..3e6706671b3dc06b376eaa9d6d463c6a098104d1 100644
index b740d931ad7ad81bf94afa62a9ae44a2fe9549d4..2b282ba23444110949508dac11a25fee4e472f5d 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1058,6 +1058,12 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1167,6 +1167,12 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
}
@ -250,7 +248,7 @@ index 655dfa9113ca82dc56bc8f4b083ea049ee5b4bee..3e6706671b3dc06b376eaa9d6d463c6a
@Override
protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
@@ -1066,6 +1072,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1175,6 +1181,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
for (int k = 0; k < j; ++k) {
EquipmentSlot enumitemslot = aenumitemslot[k];
@ -258,7 +256,7 @@ index 655dfa9113ca82dc56bc8f4b083ea049ee5b4bee..3e6706671b3dc06b376eaa9d6d463c6a
ItemStack itemstack = this.getItemBySlot(enumitemslot);
float f = this.getEquipmentDropChance(enumitemslot);
boolean flag1 = f > 1.0F;
@@ -1076,7 +1083,13 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1185,7 +1192,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
}
this.spawnAtLocation(itemstack);
@ -273,10 +271,10 @@ index 655dfa9113ca82dc56bc8f4b083ea049ee5b4bee..3e6706671b3dc06b376eaa9d6d463c6a
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
index 6376908df89af1eff3a948ca1faef5d4925f0c3b..4ac32078cb074a78a2bb83307013b849f8d59f23 100644
index d2dfccd1e31b2f050c9f480220cf17df71c687c3..82ced9f42dced65322a55579bb764fb4dc7c1b66 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
@@ -715,16 +715,38 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
@@ -704,16 +704,38 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
return this.getTrustedUUIDs().contains(uuid);
}
@ -317,12 +315,12 @@ index 6376908df89af1eff3a948ca1faef5d4925f0c3b..4ac32078cb074a78a2bb83307013b849
+ return deathEvent; // Paper - Cancellable death event
}
@Override
public static boolean isPathClear(Fox fox, LivingEntity chasedEntity) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
index e9137ea77a44eb8ded24a70f3a2b388d77379fa7..2b38ab1080d3693597e466f5517abbda9f1709f2 100644
index b93ea19186e9988b75fa55736df602fa7e5d1648..557d938b65af6b0e55571011bd1c50decbb64a3d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractChestedHorse.java
@@ -70,9 +70,17 @@ public abstract class AbstractChestedHorse extends AbstractHorse {
@@ -77,9 +77,17 @@ public abstract class AbstractChestedHorse extends AbstractHorse {
this.spawnAtLocation(Blocks.CHEST);
}
@ -341,10 +339,10 @@ index e9137ea77a44eb8ded24a70f3a2b388d77379fa7..2b38ab1080d3693597e466f5517abbda
@Override
public void addAdditionalSaveData(CompoundTag nbt) {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe..11555d1b771f93234098a3bc6a6eaacddeeeb4f6 100644
index 042968ff848da74be0c9fcf9bac3d0adfb135802..cb3729509e50fed64b17f16797825c1d21f7bf5b 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -493,8 +493,10 @@ public class ArmorStand extends LivingEntity {
@@ -499,8 +499,10 @@ public class ArmorStand extends LivingEntity {
}
// CraftBukkit end
if (source.is(DamageTypeTags.IS_EXPLOSION)) {
@ -357,7 +355,7 @@ index 0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe..11555d1b771f93234098a3bc6a6eaacd
return false;
} else if (source.is(DamageTypeTags.IGNITES_ARMOR_STANDS)) {
if (this.isOnFire()) {
@@ -537,9 +539,9 @@ public class ArmorStand extends LivingEntity {
@@ -543,9 +545,9 @@ public class ArmorStand extends LivingEntity {
this.gameEvent(GameEvent.ENTITY_DAMAGE, source.getEntity());
this.lastHit = i;
} else {
@ -369,7 +367,7 @@ index 0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe..11555d1b771f93234098a3bc6a6eaacd
}
return true;
@@ -591,8 +593,10 @@ public class ArmorStand extends LivingEntity {
@@ -597,8 +599,10 @@ public class ArmorStand extends LivingEntity {
f1 -= amount;
if (f1 <= 0.5F) {
@ -382,7 +380,7 @@ index 0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe..11555d1b771f93234098a3bc6a6eaacd
} else {
this.setHealth(f1);
this.gameEvent(GameEvent.ENTITY_DAMAGE, damageSource.getEntity());
@@ -600,7 +604,7 @@ public class ArmorStand extends LivingEntity {
@@ -606,15 +610,15 @@ public class ArmorStand extends LivingEntity {
}
@ -390,10 +388,7 @@ index 0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe..11555d1b771f93234098a3bc6a6eaacd
+ private org.bukkit.event.entity.EntityDeathEvent brokenByPlayer(DamageSource damageSource) { // Paper
ItemStack itemstack = new ItemStack(Items.ARMOR_STAND);
if (this.hasCustomName()) {
@@ -608,10 +612,10 @@ public class ArmorStand extends LivingEntity {
}
itemstack.set(DataComponents.CUSTOM_NAME, this.getCustomName());
this.drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack)); // CraftBukkit - add to drops
- this.brokenByAnything(damageSource);
+ return this.brokenByAnything(damageSource); // Paper
@ -404,7 +399,7 @@ index 0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe..11555d1b771f93234098a3bc6a6eaacd
this.playBrokenSound();
// this.dropAllDeathLoot(damagesource); // CraftBukkit - moved down
@@ -633,7 +637,7 @@ public class ArmorStand extends LivingEntity {
@@ -636,7 +640,7 @@ public class ArmorStand extends LivingEntity {
this.armorItems.set(i, ItemStack.EMPTY);
}
}
@ -413,7 +408,7 @@ index 0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe..11555d1b771f93234098a3bc6a6eaacd
}
@@ -760,7 +764,16 @@ public class ArmorStand extends LivingEntity {
@@ -758,7 +762,16 @@ public class ArmorStand extends LivingEntity {
@Override
public void kill() {
@ -432,10 +427,10 @@ index 0634b88a5bbfb549d5ec5931e19f674fb9ca4cbe..11555d1b771f93234098a3bc6a6eaacd
this.gameEvent(GameEvent.ENTITY_DIE);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3482fef56307357a4d75d52a79c2fd9988bab22e..29ede2405a645499e804a2f914a2563ef443f919 100644
index b3f6e1277c7afc77ff34ac14d3d16d1501abe14e..32bd55d8853cd1be12e910fc6626b96a6f3ea558 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2436,7 +2436,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2502,7 +2502,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void sendHealthUpdate() {
FoodData foodData = this.getHandle().getFoodData();
@ -452,10 +447,10 @@ index 3482fef56307357a4d75d52a79c2fd9988bab22e..29ede2405a645499e804a2f914a2563e
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 5b2365fc9a9364f2df7e5078c9d88572c074e4e3..449dab3d6e16b2b0fcc78c9e1b7173c822be9c53 100644
index cecadd303f40a0e4a3e8315aa58226b6eb3ff7c3..e2d74bf7e888b5161b210393e72c484058a3657b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -892,9 +892,16 @@ public class CraftEventFactory {
@@ -891,9 +891,16 @@ public class CraftEventFactory {
public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops) {
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward());
@ -472,7 +467,7 @@ index 5b2365fc9a9364f2df7e5078c9d88572c074e4e3..449dab3d6e16b2b0fcc78c9e1b7173c8
victim.expToDrop = event.getDroppedExp();
for (org.bukkit.inventory.ItemStack stack : event.getDrops()) {
@@ -911,8 +918,15 @@ public class CraftEventFactory {
@@ -910,8 +917,15 @@ public class CraftEventFactory {
PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage);
event.setKeepInventory(keepInventory);
event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel
@ -488,7 +483,7 @@ index 5b2365fc9a9364f2df7e5078c9d88572c074e4e3..449dab3d6e16b2b0fcc78c9e1b7173c8
victim.keepLevel = event.getKeepLevel();
victim.newLevel = event.getNewLevel();
@@ -929,6 +943,31 @@ public class CraftEventFactory {
@@ -928,6 +942,31 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -5,10 +5,10 @@ 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 9d34a7cd8361fd65d30537d4498c8e2a03d93bb1..0a3fec9b82a4d744f9046aebe30f80bb6e56c500 100644
index 6f1ff953e6311ff859d3ddc5734d33146237992b..86aae218fb760d12e254dcf252c9f78c0ba856d5 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -409,6 +409,7 @@ public final class ItemStack {
@@ -461,6 +461,7 @@ public final class ItemStack implements DataComponentHolder {
enuminteractionresult = InteractionResult.FAIL; // cancel placement
// PAIL: Remove this when MC-99075 fixed
placeEvent.getPlayer().updateInventory();
@ -17,10 +17,10 @@ index 9d34a7cd8361fd65d30537d4498c8e2a03d93bb1..0a3fec9b82a4d744f9046aebe30f80bb
world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710
for (BlockState blockstate : blocks) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
index d4f5af759bbb6208432ad7b5002af5455dc7958c..9b1243d96e0694c62fc9e82e9be540bce0d2b3ad 100644
index 9d6262e286a00f840d88d6eb6bfdb304467466e3..b88aa184cd06a0485146f58a5b61a56a50911209 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
@@ -237,7 +237,7 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
@@ -238,7 +238,7 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
// CraftBukkit start
@Override
public boolean onlyOpCanSetNbt() {

Datei anzeigen

@ -172,10 +172,10 @@ index f6419f3b345e9e21a05b315aa4669090d7da4194..d9d0fff9962131808d54cca20f209df5
public Path(List<Node> nodes, BlockPos target, boolean reachesTarget) {
this.nodes = nodes;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
index a75623fd1b2d36530c55c7a380e68b8dc7e58021..018884ced888fcd03d2fb17b3620f8e6125e67da 100644
index 58e690a91aea9ea294f8e4ec9861aa92bc6060a0..d597eea5d5c2f223e87bff06f292619657596f1f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
@@ -15,8 +15,11 @@ import org.bukkit.loot.LootTable;
@@ -13,8 +13,11 @@ import org.bukkit.loot.LootTable;
public abstract class CraftMob extends CraftLivingEntity implements Mob {
public CraftMob(CraftServer server, net.minecraft.world.entity.Mob entity) {
super(server, entity);
@ -187,7 +187,7 @@ index a75623fd1b2d36530c55c7a380e68b8dc7e58021..018884ced888fcd03d2fb17b3620f8e6
@Override
public void setTarget(LivingEntity target) {
Preconditions.checkState(!this.getHandle().generation, "Cannot set target during world generation");
@@ -57,6 +60,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
@@ -55,6 +58,14 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
return (net.minecraft.world.entity.Mob) this.entity;
}

Datei anzeigen

@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 22 Nov 2016 00:40:42 -0500
Subject: [PATCH] Remove unnecessary itemmeta handling
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index b9dd91927cb259789ad71b2241024c5fa2586d57..b863249ff7e13cf4939c8961601f0564c62fd661 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -649,7 +649,7 @@ public class FriendlyByteBuf extends ByteBuf {
if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) {
// Spigot start - filter
stack = stack.copy();
- CraftItemStack.setItemMeta(stack, CraftItemStack.getItemMeta(stack));
+ // CraftItemStack.setItemMeta(stack, CraftItemStack.getItemMeta(stack)); // Paper - This is no longer with raw NBT being handled in metadata
// Spigot end
nbttagcompound = stack.getTag();
}
@@ -670,7 +670,7 @@ public class FriendlyByteBuf extends ByteBuf {
itemstack.setTag(this.readNbt());
// CraftBukkit start
- if (itemstack.getTag() != null) {
+ if (false && itemstack.getTag() != null) { // Paper - This is no longer needed with raw NBT being handled in metadata
CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
}
// CraftBukkit end