[ci skip] Add more patch identifying comments, cleanup

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-01-21 17:39:05 +01:00
Ursprung e9e0bc168d
Commit d9df6bc5e6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
110 geänderte Dateien mit 502 neuen und 617 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@ 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 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 e8620ad6be2dda7fe288f884c4ae88a924be4a62..01a2c6c3ee4e1500b6ee9986943f84dbe8663860 100644 index e8620ad6be2dda7fe288f884c4ae88a924be4a62..75f08dcce4ac923678bf8c1f25ca02b0efbab7c2 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/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 { @@ -237,6 +237,15 @@ public abstract class Projectile extends Entity implements TraceableEntity {
@ -20,12 +20,12 @@ index e8620ad6be2dda7fe288f884c4ae88a924be4a62..01a2c6c3ee4e1500b6ee9986943f84db
+ return false; + return false;
+ } + }
+ } + }
+ // Paper end + // Paper end - Cancel hit for vanished players
return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity); return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity);
} }
} }
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index a6638e626600e4304a973497a39e3fac52203b16..e68b7a1b03783e4f9de24c5ae8773fc359bd2d37 100644 index a6638e626600e4304a973497a39e3fac52203b16..c19069f65a9ecbc9000ea4333417a2df4ace1007 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java --- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/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 { @@ -197,7 +197,8 @@ public class BlockItem extends Item {
@ -33,20 +33,20 @@ index a6638e626600e4304a973497a39e3fac52203b16..e68b7a1b03783e4f9de24c5ae8773fc3
CollisionContext voxelshapecollision = entityhuman == null ? CollisionContext.empty() : CollisionContext.of(entityhuman); CollisionContext voxelshapecollision = entityhuman == null ? CollisionContext.empty() : CollisionContext.of(entityhuman);
// CraftBukkit start - store default return // CraftBukkit start - store default return
- boolean defaultReturn = (!this.mustSurvive() || state.canSurvive(context.getLevel(), context.getClickedPos())) && context.getLevel().isUnobstructed(state, context.getClickedPos(), voxelshapecollision); - boolean defaultReturn = (!this.mustSurvive() || state.canSurvive(context.getLevel(), context.getClickedPos())) && context.getLevel().isUnobstructed(state, context.getClickedPos(), voxelshapecollision);
+ Level world = context.getLevel(); // Paper + Level world = context.getLevel(); // Paper - Cancel hit for vanished players
+ boolean defaultReturn = (!this.mustSurvive() || state.canSurvive(context.getLevel(), context.getClickedPos())) && world.checkEntityCollision(state, entityhuman, voxelshapecollision, context.getClickedPos(), true); // Paper + boolean defaultReturn = (!this.mustSurvive() || state.canSurvive(context.getLevel(), context.getClickedPos())) && world.checkEntityCollision(state, entityhuman, voxelshapecollision, context.getClickedPos(), true); // Paper - Cancel hit for vanished players
org.bukkit.entity.Player player = (context.getPlayer() instanceof ServerPlayer) ? (org.bukkit.entity.Player) context.getPlayer().getBukkitEntity() : null; org.bukkit.entity.Player player = (context.getPlayer() instanceof ServerPlayer) ? (org.bukkit.entity.Player) context.getPlayer().getBukkitEntity() : null;
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn); 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 diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 4751f83571688cf1e0aa669accc813942d85c60c..4fb29ca40e1caba3f205afc13fb4d7a95fd81ce6 100644 index 4fead0be6e8b754d0bafa1a988207fb8829b9180..30c69940c331f12dfe732052fcd917ea9231362f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -276,6 +276,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -276,6 +276,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
} }
+ // Paper start + // Paper start - Cancel hit for vanished players
+ // ret true if no collision + // ret true if no collision
+ public final boolean checkEntityCollision(BlockState data, Entity source, net.minecraft.world.phys.shapes.CollisionContext voxelshapedcollision, + public final boolean checkEntityCollision(BlockState data, Entity source, net.minecraft.world.phys.shapes.CollisionContext voxelshapedcollision,
+ BlockPos position, boolean checkCanSee) { + BlockPos position, boolean checkCanSee) {
@ -84,12 +84,12 @@ index 4751f83571688cf1e0aa669accc813942d85c60c..4fb29ca40e1caba3f205afc13fb4d7a9
+ +
+ return true; + return true;
+ } + }
+ // Paper end + // Paper end - Cancel hit for vanished players
@Override @Override
public boolean isClientSide() { public boolean isClientSide() {
return this.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 diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 49b6b109eec1220b8d669adc435baf5636cba9cd..c5736eb070209d0ecad1007e4c4c633c4615be83 100644 index 0b847125f67e19e6f0bdc6d0f2fcc8c5ad720fe9..712c92120d2d4b8188b47141e6f0252ad57e66d8 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1368,6 +1368,14 @@ public class CraftEventFactory { @@ -1368,6 +1368,14 @@ public class CraftEventFactory {

Datei anzeigen

@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc> From: kashike <kashike@vq.lc>
Date: Wed, 15 Aug 2018 01:26:09 -0700 Date: Wed, 15 Aug 2018 01:26:09 -0700
Subject: [PATCH] Allow disabling armour stand ticking 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 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 aff1b2195d2f187739394886d4c0bdbf0cb306b4..948ba97e318506dad96e59121297b5bf8340d2e6 100644 index aff1b2195d2f187739394886d4c0bdbf0cb306b4..5ed648502268e9c4564b5a4984b68b499aeffeb9 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -93,9 +93,16 @@ public class ArmorStand extends LivingEntity { @@ -93,9 +93,16 @@ public class ArmorStand extends LivingEntity {
@ -17,11 +17,11 @@ index aff1b2195d2f187739394886d4c0bdbf0cb306b4..948ba97e318506dad96e59121297b5bf
+ public boolean canTickSetByAPI = false; + public boolean canTickSetByAPI = false;
+ private boolean noTickPoseDirty = false; + private boolean noTickPoseDirty = false;
+ private boolean noTickEquipmentDirty = false; + private boolean noTickEquipmentDirty = false;
+ // Paper end + // Paper end - Allow ArmorStands not to tick
public ArmorStand(EntityType<? extends ArmorStand> type, Level world) { public ArmorStand(EntityType<? extends ArmorStand> type, Level world) {
super(type, world); super(type, world);
+ if (world != null) this.canTick = world.paperConfig().entities.armorStands.tick; // Paper - armour stand ticking + if (world != null) this.canTick = world.paperConfig().entities.armorStands.tick; // Paper - Allow ArmorStands not to tick
this.handItems = NonNullList.withSize(2, ItemStack.EMPTY); this.handItems = NonNullList.withSize(2, ItemStack.EMPTY);
this.armorItems = NonNullList.withSize(4, ItemStack.EMPTY); this.armorItems = NonNullList.withSize(4, ItemStack.EMPTY);
this.headPose = ArmorStand.DEFAULT_HEAD_POSE; this.headPose = ArmorStand.DEFAULT_HEAD_POSE;
@ -29,7 +29,7 @@ index aff1b2195d2f187739394886d4c0bdbf0cb306b4..948ba97e318506dad96e59121297b5bf
this.onEquipItem(enumitemslot, (ItemStack) this.armorItems.set(enumitemslot.getIndex(), itemstack), itemstack, silent); // CraftBukkit this.onEquipItem(enumitemslot, (ItemStack) this.armorItems.set(enumitemslot.getIndex(), itemstack), itemstack, silent); // CraftBukkit
} }
+ this.noTickEquipmentDirty = true; // Paper - Allow equipment to be updated even when tick disabled + this.noTickEquipmentDirty = true; // Paper - Allow ArmorStands not to tick; Still update equipment
} }
@Override @Override
@ -37,7 +37,7 @@ index aff1b2195d2f187739394886d4c0bdbf0cb306b4..948ba97e318506dad96e59121297b5bf
} }
nbt.put("Pose", this.writePose()); nbt.put("Pose", this.writePose());
+ if (this.canTickSetByAPI) nbt.putBoolean("Paper.CanTickOverride", this.canTick); // Paper - persist no tick setting + if (this.canTickSetByAPI) nbt.putBoolean("Paper.CanTickOverride", this.canTick); // Paper - Allow ArmorStands not to tick
} }
@Override @Override
@ -45,12 +45,12 @@ index aff1b2195d2f187739394886d4c0bdbf0cb306b4..948ba97e318506dad96e59121297b5bf
this.setNoBasePlate(nbt.getBoolean("NoBasePlate")); this.setNoBasePlate(nbt.getBoolean("NoBasePlate"));
this.setMarker(nbt.getBoolean("Marker")); this.setMarker(nbt.getBoolean("Marker"));
this.noPhysics = !this.hasPhysics(); this.noPhysics = !this.hasPhysics();
+ // Paper start - persist no tick + // Paper start - Allow ArmorStands not to tick
+ if (nbt.contains("Paper.CanTickOverride")) { + if (nbt.contains("Paper.CanTickOverride")) {
+ this.canTick = nbt.getBoolean("Paper.CanTickOverride"); + this.canTick = nbt.getBoolean("Paper.CanTickOverride");
+ this.canTickSetByAPI = true; + this.canTickSetByAPI = true;
+ } + }
+ // Paper end + // Paper end - Allow ArmorStands not to tick
CompoundTag nbttagcompound1 = nbt.getCompound("Pose"); CompoundTag nbttagcompound1 = nbt.getCompound("Pose");
this.readPose(nbttagcompound1); this.readPose(nbttagcompound1);
@ -58,7 +58,7 @@ index aff1b2195d2f187739394886d4c0bdbf0cb306b4..948ba97e318506dad96e59121297b5bf
@Override @Override
public void tick() { public void tick() {
+ // Paper start + // Paper start - Allow ArmorStands not to tick
+ if (!this.canTick) { + if (!this.canTick) {
+ if (this.noTickPoseDirty) { + if (this.noTickPoseDirty) {
+ this.noTickPoseDirty = false; + this.noTickPoseDirty = false;
@ -72,15 +72,15 @@ index aff1b2195d2f187739394886d4c0bdbf0cb306b4..948ba97e318506dad96e59121297b5bf
+ +
+ return; + return;
+ } + }
+ // Paper end + // Paper end - Allow ArmorStands not to tick
+ +
super.tick(); super.tick();
+ // Paper start - Split into separate method + // Paper start - Allow ArmorStands not to tick
+ updatePose(); + updatePose();
+ } + }
+ +
+ public void updatePose() { + public void updatePose() {
+ // Paper end + // Paper end - Allow ArmorStands not to tick
Rotations vector3f = (Rotations) this.entityData.get(ArmorStand.DATA_HEAD_POSE); Rotations vector3f = (Rotations) this.entityData.get(ArmorStand.DATA_HEAD_POSE);
if (!this.headPose.equals(vector3f)) { if (!this.headPose.equals(vector3f)) {

Datei anzeigen

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: willies952002 <admin@domnian.com> From: willies952002 <admin@domnian.com>
Date: Thu, 26 Jul 2018 02:25:46 -0400 Date: Thu, 26 Jul 2018 02:25:46 -0400
Subject: [PATCH] Implement Expanded ArmorStand API Subject: [PATCH] Expand ArmorStand API
Adds the following: Adds the following:
- Add proper methods for getting and setting items in both hands. Deprecates old methods - Add proper methods for getting and setting items in both hands. Deprecates old methods

Datei anzeigen

@ -5,14 +5,14 @@ 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 diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
index d829173d2fc9fc0e12c24d736f1ed44417b81612..e97953e3dad164862d7e2f86bd86a6eff5b80ae2 100644 index d829173d2fc9fc0e12c24d736f1ed44417b81612..878d3c3089635a515fa7f54c956159a1bb6ce29b 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/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 { @@ -108,6 +108,16 @@ public class AnvilMenu extends ItemCombinerMenu {
if (!player.getAbilities().instabuild && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) { if (!player.getAbilities().instabuild && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
BlockState iblockdata1 = AnvilBlock.damage(iblockdata); BlockState iblockdata1 = AnvilBlock.damage(iblockdata);
+ // Paper start + // Paper start - AnvilDamageEvent
+ com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null); + com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null);
+ if (!event.callEvent()) { + if (!event.callEvent()) {
+ return; + return;
@ -21,7 +21,7 @@ index d829173d2fc9fc0e12c24d736f1ed44417b81612..e97953e3dad164862d7e2f86bd86a6ef
+ } else { + } else {
+ iblockdata1 = ((org.bukkit.craftbukkit.block.data.CraftBlockData) event.getDamageState().getMaterial().createBlockData()).getState().setValue(AnvilBlock.FACING, iblockdata.getValue(AnvilBlock.FACING)); + iblockdata1 = ((org.bukkit.craftbukkit.block.data.CraftBlockData) event.getDamageState().getMaterial().createBlockData()).getState().setValue(AnvilBlock.FACING, iblockdata.getValue(AnvilBlock.FACING));
+ } + }
+ // Paper end + // Paper end - AnvilDamageEvent
if (iblockdata1 == null) { if (iblockdata1 == null) {
world.removeBlock(blockposition, false); world.removeBlock(blockposition, false);
world.levelEvent(1029, blockposition, 0); world.levelEvent(1029, blockposition, 0);

Datei anzeigen

@ -5,7 +5,7 @@ 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 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 d4832067f87491b8273b7957ce3eec1ad3ba9830..c00d4b8e39ef90bb06098bee290203502bd4225b 100644 index de27517e13ecb15865aaa83257eaffb41c3eecfc..29683f0236163e5630d771d9409be0c23574a467 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -558,6 +558,11 @@ public class EnderDragon extends Mob implements Enemy { @@ -558,6 +558,11 @@ public class EnderDragon extends Mob implements Enemy {
@ -14,14 +14,14 @@ index d4832067f87491b8273b7957ce3eec1ad3ba9830..c00d4b8e39ef90bb06098bee29020350
} }
+ // Paper start - TNTPrimeEvent + // Paper start - TNTPrimeEvent
+ org.bukkit.block.Block tntBlock = this.level().getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + org.bukkit.block.Block tntBlock = this.level().getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ if(!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getIndirectSourceEntity().getBukkitEntity()).callEvent()) + if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getIndirectSourceEntity().getBukkitEntity()).callEvent())
+ continue; + continue;
+ // Paper end + // Paper end - TNTPrimeEvent
nmsBlock.wasExploded(this.level(), blockposition, this.explosionSource); nmsBlock.wasExploded(this.level(), blockposition, this.explosionSource);
this.level().removeBlock(blockposition, false); 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 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..80e90bae3c05bbaf978a66629d9c4132c22efd1a 100644 index 016c8b7762c2b4eacb95a455940db4684b34e03c..c214a8a72c3fa27eaadc458b10a610e0de7937ec 100644
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
+++ b/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 { @@ -302,12 +302,19 @@ public class FireBlock extends BaseFireBlock {
@ -29,7 +29,7 @@ index 016c8b7762c2b4eacb95a455940db4684b34e03c..80e90bae3c05bbaf978a66629d9c4132
world.setBlock(blockposition, this.getStateWithAge(world, blockposition, l), 3); world.setBlock(blockposition, this.getStateWithAge(world, blockposition, l), 3);
} else { } else {
- world.removeBlock(blockposition, false); - world.removeBlock(blockposition, false);
+ if(iblockdata.getBlock() != Blocks.TNT) world.removeBlock(blockposition, false); // Paper - TNTPrimeEvent - We might be cancelling it below, move the setAir down + if(iblockdata.getBlock() != Blocks.TNT) world.removeBlock(blockposition, false); // Paper - TNTPrimeEvent; We might be cancelling it below, move the setAir down
} }
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
@ -41,12 +41,12 @@ index 016c8b7762c2b4eacb95a455940db4684b34e03c..80e90bae3c05bbaf978a66629d9c4132
+ return; + return;
+ } + }
+ world.removeBlock(blockposition, false); + world.removeBlock(blockposition, false);
+ // Paper end + // Paper end - TNTPrimeEvent
TntBlock.explode(world, blockposition); TntBlock.explode(world, blockposition);
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/block/TntBlock.java b/src/main/java/net/minecraft/world/level/block/TntBlock.java 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..443a8a8e2f0791a1455193cb125e1560f5d1edab 100644 index cc20c320cbb3420e5e302a94571bab374c8553c8..ab53b42eec6eb57b373487e50066967042d6eb40 100644
--- a/src/main/java/net/minecraft/world/level/block/TntBlock.java --- a/src/main/java/net/minecraft/world/level/block/TntBlock.java
+++ b/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 { @@ -49,6 +49,12 @@ public class TntBlock extends Block {
@ -58,7 +58,7 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..443a8a8e2f0791a1455193cb125e1560
+ if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.REDSTONE, null).callEvent()) { + if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.REDSTONE, null).callEvent()) {
+ return; + return;
+ } + }
+ // Paper end + // Paper end - TNTPrimeEvent
TntBlock.explode(world, pos); TntBlock.explode(world, pos);
world.removeBlock(pos, false); world.removeBlock(pos, false);
} }
@ -71,7 +71,7 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..443a8a8e2f0791a1455193cb125e1560
+ if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.REDSTONE, null).callEvent()) { + if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.REDSTONE, null).callEvent()) {
+ return; + return;
+ } + }
+ // Paper end + // Paper end - TNTPrimeEvent
TntBlock.explode(world, pos); TntBlock.explode(world, pos);
world.removeBlock(pos, false); world.removeBlock(pos, false);
} }
@ -85,7 +85,7 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..443a8a8e2f0791a1455193cb125e1560
+ if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, source).callEvent()) { + if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, source).callEvent()) {
+ return; + return;
+ } + }
+ // Paper end + // Paper end - TNTPrimeEvent
PrimedTnt entitytntprimed = new PrimedTnt(world, (double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D, explosion.getIndirectSourceEntity()); PrimedTnt entitytntprimed = new PrimedTnt(world, (double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D, explosion.getIndirectSourceEntity());
int i = entitytntprimed.getFuse(); int i = entitytntprimed.getFuse();
@ -98,7 +98,7 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..443a8a8e2f0791a1455193cb125e1560
+ if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.ITEM, player.getBukkitEntity()).callEvent()) { + if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.ITEM, player.getBukkitEntity()).callEvent()) {
+ return InteractionResult.FAIL; + return InteractionResult.FAIL;
+ } + }
+ // Paper end + // Paper end - TNTPrimeEvent
TntBlock.explode(world, pos, player); TntBlock.explode(world, pos, player);
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11); world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11);
Item item = itemstack.getItem(); Item item = itemstack.getItem();
@ -111,7 +111,7 @@ index cc20c320cbb3420e5e302a94571bab374c8553c8..443a8a8e2f0791a1455193cb125e1560
+ if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.PROJECTILE, projectile.getBukkitEntity()).callEvent()) { + if (!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.PROJECTILE, projectile.getBukkitEntity()).callEvent()) {
+ return; + return;
+ } + }
+ // Paper end + // Paper end - TNTPrimeEvent
TntBlock.explode(world, blockposition, entity instanceof LivingEntity ? (LivingEntity) entity : null); TntBlock.explode(world, blockposition, entity instanceof LivingEntity ? (LivingEntity) entity : null);
world.removeBlock(blockposition, false); world.removeBlock(blockposition, false);
} }

Datei anzeigen

@ -22,7 +22,7 @@ to take the burden of this into their own hand without having to rely on
plugins doing unsafe things. 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 diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1e6c704279fe91530a23d17a151d28aa3fb9126e..ea7eb7be6abfcfc3c70eba42cf31cc2030747428 100644 index e6b4111ba32906d1b3705b8a2cc06a07956e2891..3cb5bd145a4a719943e9fe4bc40ff7420abdd46d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -257,6 +257,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -257,6 +257,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -37,7 +37,7 @@ index 1e6c704279fe91530a23d17a151d28aa3fb9126e..ea7eb7be6abfcfc3c70eba42cf31cc20
this.keepConnectionAlive(); this.keepConnectionAlive();
// CraftBukkit start // CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
+ if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable + if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - configurable tab spam limits
/* Use thread-safe field access instead /* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) { if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount; --this.chatSpamTickCount;
@ -46,7 +46,7 @@ index 1e6c704279fe91530a23d17a151d28aa3fb9126e..ea7eb7be6abfcfc3c70eba42cf31cc20
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
// CraftBukkit start // CraftBukkit start
- if (this.chatSpamTickCount.addAndGet(1) > 500 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { - if (this.chatSpamTickCount.addAndGet(1) > 500 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
+ if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable + if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper - configurable tab spam limits
server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper
return; return;
} }

Datei anzeigen

@ -3,9 +3,6 @@ From: Aikar <aikar@aikar.co>
Date: Sat, 21 Jul 2018 08:25:40 -0400 Date: Sat, 21 Jul 2018 08:25:40 -0400
Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
Add -Ddebug.entities=true to your JVM flags to gain more information
1.17: Needs to be reworked for new entity storage system
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index c9e3e104cd051a38e367653dc6c4f969665fc250..45ee0cd242271883412284625230822d9c8a5452 100644 index c9e3e104cd051a38e367653dc6c4f969665fc250..45ee0cd242271883412284625230822d9c8a5452 100644
@ -29,101 +26,50 @@ index c9e3e104cd051a38e367653dc6c4f969665fc250..45ee0cd242271883412284625230822d
protected void tick() { 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 diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 536f1380ae3387ac4d062fe2f8b934a8d49905fb..1e10d55962a7221e197723eb42434be052a7661a 100644 index 536f1380ae3387ac4d062fe2f8b934a8d49905fb..5538e810ef0a68f00043d4e750eb735300d50664 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -222,6 +222,9 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1436,6 +1436,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper
+ public static Throwable getAddToWorldStackTrace(Entity entity) {
+ return new Throwable(entity + " Added to world at " + new java.util.Date());
+ }
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false);
@@ -1436,7 +1439,28 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit start // CraftBukkit start
private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
+ // Paper start + // Paper start - extra debug info
+ if (entity.valid) { + if (entity.valid) {
+ MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); + MinecraftServer.LOGGER.error("Attempted Double World add on {}", entity, new Throwable());
+
+ if (DEBUG_ENTITIES) {
+ Throwable thr = entity.addedToWorldStack;
+ if (thr == null) {
+ MinecraftServer.LOGGER.error("Double add entity has no add stacktrace");
+ } else {
+ MinecraftServer.LOGGER.error("Double add stacktrace: ", thr);
+ }
+ }
+ return true; + return true;
+ } + }
+ // Paper end + // Paper end - extra debug info
if (entity.isRemoved()) { if (entity.isRemoved()) {
+ // Paper start
+ if (DEBUG_ENTITIES) {
+ new Throwable("Tried to add entity " + entity + " but it was marked as removed already").printStackTrace(); // CraftBukkit
+ getAddToWorldStackTrace(entity).printStackTrace();
+ }
+ // Paper end
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false; return false;
} else {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index bebbbf9a0bca8ab94dd269d19ebf55622a3c2ef8..6d04954493680bc4fbad67ff2e43411f970f78f5 100644 index bebbbf9a0bca8ab94dd269d19ebf55622a3c2ef8..a906fda4d5d92054f5c0cea4a8167cdb29287cc3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -241,6 +241,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -241,6 +241,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
private CraftEntity bukkitEntity; private CraftEntity bukkitEntity;
+ public @org.jetbrains.annotations.Nullable net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper + public @org.jetbrains.annotations.Nullable net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper
+ public @Nullable Throwable addedToWorldStack; // Paper - entity debug
public CraftEntity getBukkitEntity() { public CraftEntity getBukkitEntity() {
if (this.bukkitEntity == null) { if (this.bukkitEntity == null) {
this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this); this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 71c2f082091f452cfc74557cd599cf7f080b889b..14c963d507173dae6015a0c81e3a690768012bed 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -153,6 +153,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean pvpMode;
public boolean keepSpawnInMemory = true;
public org.bukkit.generator.ChunkGenerator generator;
+ public static final boolean DEBUG_ENTITIES = Boolean.getBoolean("debug.entities"); // Paper
public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710
public boolean captureBlockStates = false;
diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
index 21a2800db22f287b9c6a8290326fdf3b94ae94b1..d45d832232be5017dde53816191c2b1830a0da32 100644 index 21a2800db22f287b9c6a8290326fdf3b94ae94b1..2e561ac90a8c91ea13cfc18d09f8e0abbcff9385 100644
--- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java --- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
+++ b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java +++ b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
@@ -34,6 +34,26 @@ public class EntityLookup<T extends EntityAccess> { @@ -34,6 +34,14 @@ public class EntityLookup<T extends EntityAccess> {
UUID uUID = entity.getUUID(); UUID uUID = entity.getUUID();
if (this.byUuid.containsKey(uUID)) { if (this.byUuid.containsKey(uUID)) {
LOGGER.warn("Duplicate entity UUID {}: {}", uUID, entity); LOGGER.warn("Duplicate entity UUID {}: {}", uUID, entity);
+ // Paper start - extra debug info + // Paper start - extra debug info
+ if (entity instanceof net.minecraft.world.entity.Entity entityCast) { + if (entity instanceof net.minecraft.world.entity.Entity) {
+ if (net.minecraft.server.level.ServerLevel.DEBUG_ENTITIES) { + final T old = this.byUuid.get(entity.getUUID());
+ entityCast.addedToWorldStack = net.minecraft.server.level.ServerLevel.getAddToWorldStackTrace(entityCast); + if (old instanceof net.minecraft.world.entity.Entity oldCast && oldCast.getId() != entity.getId() && oldCast.valid) {
+ } + LOGGER.error("Overwrote an existing entity {} with {}", oldCast, entity);
+
+ T old = this.byUuid.get(entity.getUUID());
+ if (old instanceof net.minecraft.world.entity.Entity oldCast && old != null && oldCast.getId() != entity.getId() && oldCast.valid) {
+ LOGGER.error("Overwrote an existing entity " + oldCast + " with " + entity);
+ if (net.minecraft.server.level.ServerLevel.DEBUG_ENTITIES) {
+ if (oldCast.addedToWorldStack != null) {
+ oldCast.addedToWorldStack.printStackTrace();
+ } else {
+ LOGGER.error("Oddly, the old entity was not added to the world in the normal way. Plugins?");
+ }
+ entityCast.addedToWorldStack.printStackTrace();
+ } + }
+ } + }
+ } + // Paper end - extra debug info
+ // Paper end
} else { } else {
this.byUuid.put(uUID, entity); this.byUuid.put(uUID, entity);
this.byId.put(entity.getId(), entity); this.byId.put(entity.getId(), entity);

Datei anzeigen

@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash.
This will help diagnose what was going on in that time before the 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 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b3666442b906c59aca50c230c3a6c8f2878a5bee..1a9faaecf50f3a17561c77cb262074c741ebfcc0 100644 index 7f68ffdb88c0c4b9d91f699d088cd81e62e94620..85beb9c7a02f7f561716d017f40ae24ad49a61a3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1075,6 +1075,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1075,6 +1075,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -21,7 +21,7 @@ index b3666442b906c59aca50c230c3a6c8f2878a5bee..1a9faaecf50f3a17561c77cb262074c7
long tickSection = Util.getNanos(), curTime, tickCount = 1; // Paper long tickSection = Util.getNanos(), curTime, tickCount = 1; // Paper
while (this.running) { while (this.running) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 07c736fd35afb7f90d41d14a726ac476b0b6a2c0..39a637f4fdbdc41a37873a92a9464020c25d57cf 100644 index 99d247ff2c03c568e8d909d2fb2014f67a4c2c4e..1de3b2fc41e2fe2d27ebe9f93810b4503cec89cb 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/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 @@ -198,6 +198,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -33,7 +33,7 @@ index 07c736fd35afb7f90d41d14a726ac476b0b6a2c0..39a637f4fdbdc41a37873a92a9464020
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now 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 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index debef627dda7b974e59c5656dbb3703d7d88b2e3..3eb6b2fa930ffe39bfb3b58e50f9f97cd5daad0a 100644 index 625d2e04b3e48f5884ec36210d27639504fe0a1d..f90361a27c067d0d8a92fd6af930a0d453b4c2a7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -915,6 +915,7 @@ public final class CraftServer implements Server { @@ -915,6 +915,7 @@ public final class CraftServer implements Server {
@ -53,7 +53,7 @@ index debef627dda7b974e59c5656dbb3703d7d88b2e3..3eb6b2fa930ffe39bfb3b58e50f9f97c
@Override @Override
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 99c82b9c82770df22a043d1927a1ad820e95d724..1eafb92fdf3c6ddce5f5f847bd9034287e2d4b84 100644 index 9c5c19ab9dc14d844631f47a93f3349409efdf43..56dbc23f10d946a7ec992b08fd868f3ee5089068 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -229,7 +229,7 @@ public class SpigotConfig @@ -229,7 +229,7 @@ public class SpigotConfig

Datei anzeigen

@ -23,7 +23,7 @@ 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 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 diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 5607616c933556de00bfb4218ba75ee477bb2201..27bfddd847175717697fb589b820ec5a81e08578 100644 index 49e3252d6af633d69bdf05ce71dc2a1b3d24f05a..6a3961350030e63b27512261402f675c3cd78485 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -634,7 +634,7 @@ public abstract class PlayerList { @@ -634,7 +634,7 @@ public abstract class PlayerList {
@ -36,7 +36,7 @@ index 5607616c933556de00bfb4218ba75ee477bb2201..27bfddd847175717697fb589b820ec5a
ichatmutablecomponent = Component.translatable("multiplayer.disconnect.banned_ip.reason", ipbanentry.getReason()); 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 diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index 4d6f5e627d386f9ca2d7653b0f485c82a13557f5..665120a62525f56912263a3e1b6f12f6c3e15dec 100644 index 4d6f5e627d386f9ca2d7653b0f485c82a13557f5..35f973cc2c0989256fa21abaf0327c2f36dbe4c9 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java --- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java +++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -31,7 +31,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> { @@ -31,7 +31,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
@ -44,69 +44,61 @@ index 4d6f5e627d386f9ca2d7653b0f485c82a13557f5..665120a62525f56912263a3e1b6f12f6
private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting().create(); private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting().create();
private final File file; private final File file;
- private final Map<String, V> map = Maps.newHashMap(); - private final Map<String, V> map = Maps.newHashMap();
+ private final Map<String, V> map = Maps.newConcurrentMap(); // Paper - replace HashMap is ConcurrentHashMap + private final Map<String, V> map = Maps.newConcurrentMap(); // Paper - Use ConcurrentHashMap in JsonList
public StoredUserList(File file) { public StoredUserList(File file) {
this.file = file; this.file = file;
@@ -54,8 +54,13 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> { @@ -54,8 +54,11 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
@Nullable @Nullable
public V get(K key) { public V get(K key) {
- this.removeExpired(); - this.removeExpired();
- return (V) this.map.get(this.getKeyForUser(key)); // CraftBukkit - fix decompile error - return (V) this.map.get(this.getKeyForUser(key)); // CraftBukkit - fix decompile error
+ // Paper start + // Paper start - Use ConcurrentHashMap in JsonList
+ // this.g();
+ // return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error
+ return (V) this.map.computeIfPresent(this.getKeyForUser(key), (k, v) -> { + return (V) this.map.computeIfPresent(this.getKeyForUser(key), (k, v) -> {
+ return v.hasExpired() ? null : v; + return v.hasExpired() ? null : v;
+ }); + });
+ // Paper end + // Paper end - Use ConcurrentHashMap in JsonList
} }
public void remove(K key) { public void remove(K key) {
@@ -78,7 +83,8 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> { @@ -78,7 +81,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
} }
public boolean isEmpty() { public boolean isEmpty() {
- return this.map.size() < 1; - return this.map.size() < 1;
+ // return this.d.size() < 1; // Paper + return this.map.isEmpty(); // Paper - Use ConcurrentHashMap in JsonList
+ return this.map.isEmpty(); // Paper - readability is the goal. As an aside, isEmpty() uses only sumCount() and a comparison. size() uses sumCount(), casts, and boolean logic
} }
protected String getKeyForUser(K profile) { protected String getKeyForUser(K profile) {
@@ -90,14 +96,14 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> { @@ -90,25 +93,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
} }
private void removeExpired() { private void removeExpired() {
- List<K> list = Lists.newArrayList(); - List<K> list = Lists.newArrayList();
- Iterator iterator = this.map.values().iterator(); - Iterator iterator = this.map.values().iterator();
+ /*List<K> list = Lists.newArrayList(); -
+ Iterator iterator = this.d.values().iterator(); - while (iterator.hasNext()) {
- V v0 = (V) iterator.next(); // CraftBukkit - decompile error
while (iterator.hasNext()) { -
V v0 = (V) iterator.next(); // CraftBukkit - decompile error - if (v0.hasExpired()) {
if (v0.hasExpired()) {
- list.add(v0.getUser()); - list.add(v0.getUser());
+ list.add(v0.getKey()); - }
} - }
} -
- iterator = list.iterator();
@@ -106,9 +112,11 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> { -
while (iterator.hasNext()) { - while (iterator.hasNext()) {
K k0 = (K) iterator.next(); // CraftBukkit - decompile error - K k0 = (K) iterator.next(); // CraftBukkit - decompile error
-
- this.map.remove(this.getKeyForUser(k0)); - this.map.remove(this.getKeyForUser(k0));
- } - }
+ this.d.remove(this.a(k0)); -
+ }*/ + this.map.values().removeIf(StoredUserEntry::hasExpired); // Paper - Use ConcurrentHashMap in JsonList
+ this.map.values().removeIf(StoredUserEntry::hasExpired);
+ // Paper end
} }
protected abstract StoredUserEntry<K> createEntry(JsonObject json); protected abstract StoredUserEntry<K> createEntry(JsonObject json);
@@ -118,6 +126,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> { @@ -118,6 +103,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
} }
public void save() throws IOException { public void save() throws IOException {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Use a Queue for Queueing Commands
Lists are bad as Queues mmmkay. 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 diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index adae2d7f9ced8ce6d2e15aafb8b53ef85e79b6d1..90b261b23f6731f60a7d4f412a6bf4c6c6aa7095 100644 index 1de3b2fc41e2fe2d27ebe9f93810b4503cec89cb..907129b7ca0bb2b356502c84b86518e843cecfa2 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/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 @@ -69,7 +69,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -14,7 +14,7 @@ index adae2d7f9ced8ce6d2e15aafb8b53ef85e79b6d1..90b261b23f6731f60a7d4f412a6bf4c6
private static final int CONVERSION_RETRY_DELAY_MS = 5000; private static final int CONVERSION_RETRY_DELAY_MS = 5000;
private static final int CONVERSION_RETRIES = 2; private static final int CONVERSION_RETRIES = 2;
- private final List<ConsoleInput> consoleInput = Collections.synchronizedList(Lists.newArrayList()); - private final List<ConsoleInput> consoleInput = Collections.synchronizedList(Lists.newArrayList());
+ private final java.util.Queue<ConsoleInput> serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); // Paper - use a proper queuemmands + private final java.util.Queue<ConsoleInput> serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); // Paper - Perf: use a proper queue
@Nullable @Nullable
private QueryThreadGs4 queryThreadGs4; private QueryThreadGs4 queryThreadGs4;
// private final RemoteControlCommandListener rconConsoleSource; // CraftBukkit - remove field // private final RemoteControlCommandListener rconConsoleSource; // CraftBukkit - remove field
@ -23,17 +23,17 @@ index adae2d7f9ced8ce6d2e15aafb8b53ef85e79b6d1..90b261b23f6731f60a7d4f412a6bf4c6
} }
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
- this.consoleInput.add(new ConsoleInput(command, commandSource)); - this.consoleInput.add(new ConsoleInput(command, commandSource));
+ this.serverCommandQueue.add(new ConsoleInput(command, commandSource)); // Paper - use proper queue + this.serverCommandQueue.add(new ConsoleInput(command, commandSource)); // Paper - Perf: use proper queue
} }
public void handleConsoleInputs() { public void handleConsoleInputs() {
MinecraftTimings.serverCommandTimer.startTiming(); // Spigot MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
- while (!this.consoleInput.isEmpty()) { - while (!this.consoleInput.isEmpty()) {
- ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0); - ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0);
+ // Paper start - use proper queue + // Paper start - Perf: use proper queue
+ ConsoleInput servercommand; + ConsoleInput servercommand;
+ while ((servercommand = this.serverCommandQueue.poll()) != null) { + while ((servercommand = this.serverCommandQueue.poll()) != null) {
+ // Paper end + // Paper end - Perf: use proper queue
// CraftBukkit start - ServerCommand for preprocessing // CraftBukkit start - ServerCommand for preprocessing
ServerCommandEvent event = new ServerCommandEvent(this.console, servercommand.msg); ServerCommandEvent event = new ServerCommandEvent(this.console, servercommand.msg);

Datei anzeigen

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Wed, 15 Aug 2018 01:16:34 -0400 Date: Wed, 15 Aug 2018 01:16:34 -0400
Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots 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 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java

Datei anzeigen

@ -3,10 +3,9 @@ From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Wed, 15 Aug 2018 12:05:12 -0700 Date: Wed, 15 Aug 2018 12:05:12 -0700
Subject: [PATCH] Optimize BlockPosition helper methods Subject: [PATCH] Optimize BlockPosition helper methods
Resolves #1338
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index 2bb5e51f71cbf66819d198505aa4a5ecffd246c6..ef5f897164136767e9c6dd61b76c2a1dedd4f350 100644 index 2bb5e51f71cbf66819d198505aa4a5ecffd246c6..3b3d81886d50ee6510ff366e11817a578c645089 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java --- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -132,67 +132,84 @@ public class BlockPos extends Vec3i { @@ -132,67 +132,84 @@ public class BlockPos extends Vec3i {
@ -14,78 +13,78 @@ index 2bb5e51f71cbf66819d198505aa4a5ecffd246c6..ef5f897164136767e9c6dd61b76c2a1d
@Override @Override
public BlockPos above() { public BlockPos above() {
- return this.relative(Direction.UP); - return this.relative(Direction.UP);
+ return new BlockPos(this.getX(), this.getY() + 1, this.getZ()); // Paper - Optimize BlockPosition + return new BlockPos(this.getX(), this.getY() + 1, this.getZ()); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos above(int distance) { public BlockPos above(int distance) {
- return this.relative(Direction.UP, distance); - return this.relative(Direction.UP, distance);
+ return distance == 0 ? this : new BlockPos(this.getX(), this.getY() + distance, this.getZ()); // Paper - Optimize BlockPosition + return distance == 0 ? this : new BlockPos(this.getX(), this.getY() + distance, this.getZ()); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos below() { public BlockPos below() {
- return this.relative(Direction.DOWN); - return this.relative(Direction.DOWN);
+ return new BlockPos(this.getX(), this.getY() - 1, this.getZ()); // Paper - Optimize BlockPosition + return new BlockPos(this.getX(), this.getY() - 1, this.getZ()); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos below(int i) { public BlockPos below(int i) {
- return this.relative(Direction.DOWN, i); - return this.relative(Direction.DOWN, i);
+ return i == 0 ? this : new BlockPos(this.getX(), this.getY() - i, this.getZ()); // Paper - Optimize BlockPosition + return i == 0 ? this : new BlockPos(this.getX(), this.getY() - i, this.getZ()); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos north() { public BlockPos north() {
- return this.relative(Direction.NORTH); - return this.relative(Direction.NORTH);
+ return new BlockPos(this.getX(), this.getY(), this.getZ() - 1); // Paper - Optimize BlockPosition + return new BlockPos(this.getX(), this.getY(), this.getZ() - 1); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos north(int distance) { public BlockPos north(int distance) {
- return this.relative(Direction.NORTH, distance); - return this.relative(Direction.NORTH, distance);
+ return distance == 0 ? this : new BlockPos(this.getX(), this.getY(), this.getZ() - distance); // Paper - Optimize BlockPosition + return distance == 0 ? this : new BlockPos(this.getX(), this.getY(), this.getZ() - distance); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos south() { public BlockPos south() {
- return this.relative(Direction.SOUTH); - return this.relative(Direction.SOUTH);
+ return new BlockPos(this.getX(), this.getY(), this.getZ() + 1); // Paper - Optimize BlockPosition + return new BlockPos(this.getX(), this.getY(), this.getZ() + 1); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos south(int distance) { public BlockPos south(int distance) {
- return this.relative(Direction.SOUTH, distance); - return this.relative(Direction.SOUTH, distance);
+ return distance == 0 ? this : new BlockPos(this.getX(), this.getY(), this.getZ() + distance); // Paper - Optimize BlockPosition + return distance == 0 ? this : new BlockPos(this.getX(), this.getY(), this.getZ() + distance); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos west() { public BlockPos west() {
- return this.relative(Direction.WEST); - return this.relative(Direction.WEST);
+ return new BlockPos(this.getX() - 1, this.getY(), this.getZ()); // Paper - Optimize BlockPosition + return new BlockPos(this.getX() - 1, this.getY(), this.getZ()); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos west(int distance) { public BlockPos west(int distance) {
- return this.relative(Direction.WEST, distance); - return this.relative(Direction.WEST, distance);
+ return distance == 0 ? this : new BlockPos(this.getX() - distance, this.getY(), this.getZ()); // Paper - Optimize BlockPosition + return distance == 0 ? this : new BlockPos(this.getX() - distance, this.getY(), this.getZ()); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos east() { public BlockPos east() {
- return this.relative(Direction.EAST); - return this.relative(Direction.EAST);
+ return new BlockPos(this.getX() + 1, this.getY(), this.getZ()); // Paper - Optimize BlockPosition + return new BlockPos(this.getX() + 1, this.getY(), this.getZ()); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos east(int distance) { public BlockPos east(int distance) {
- return this.relative(Direction.EAST, distance); - return this.relative(Direction.EAST, distance);
+ return distance == 0 ? this : new BlockPos(this.getX() + distance, this.getY(), this.getZ()); // Paper - Optimize BlockPosition + return distance == 0 ? this : new BlockPos(this.getX() + distance, this.getY(), this.getZ()); // Paper - Perf: Optimize BlockPosition
} }
@Override @Override
public BlockPos relative(Direction direction) { public BlockPos relative(Direction direction) {
+ // Paper start - Optimize BlockPosition + // Paper start - Perf: Optimize BlockPosition
+ switch(direction) { + switch(direction) {
+ case UP: + case UP:
+ return new BlockPos(this.getX(), this.getY() + 1, this.getZ()); + return new BlockPos(this.getX(), this.getY() + 1, this.getZ());
@ -102,7 +101,7 @@ index 2bb5e51f71cbf66819d198505aa4a5ecffd246c6..ef5f897164136767e9c6dd61b76c2a1d
+ default: + default:
return new BlockPos(this.getX() + direction.getStepX(), this.getY() + direction.getStepY(), this.getZ() + direction.getStepZ()); return new BlockPos(this.getX() + direction.getStepX(), this.getY() + direction.getStepY(), this.getZ() + direction.getStepZ());
+ } + }
+ // Paper end + // Paper end - Perf: Optimize BlockPosition
} }
@Override @Override

Datei anzeigen

@ -5,7 +5,7 @@ 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 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 ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f486161051741d 100644 index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..ca3bf718336ef02d379c0ec670f62fafb1600153 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -115,6 +115,7 @@ public class Slime extends Mob implements Enemy { @@ -115,6 +115,7 @@ public class Slime extends Mob implements Enemy {
@ -20,7 +20,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
public void readAdditionalSaveData(CompoundTag nbt) { public void readAdditionalSaveData(CompoundTag nbt) {
this.setSize(nbt.getInt("Size") + 1, false); this.setSize(nbt.getInt("Size") + 1, false);
super.readAdditionalSaveData(nbt); super.readAdditionalSaveData(nbt);
+ // Paper start - check exists before loading or this will be loaded as false + // Paper start
+ if (nbt.contains("Paper.canWander")) { + if (nbt.contains("Paper.canWander")) {
+ this.canWander = nbt.getBoolean("Paper.canWander"); + this.canWander = nbt.getBoolean("Paper.canWander");
+ } + }
@ -33,7 +33,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
@Override @Override
public boolean canUse() { public boolean canUse() {
- return (this.slime.isInWater() || this.slime.isInLava()) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl; - return (this.slime.isInWater() || this.slime.isInLava()) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl;
+ return (this.slime.isInWater() || this.slime.isInLava()) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeSwimEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity()).callEvent(); // Paper + return (this.slime.isInWater() || this.slime.isInLava()) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeSwimEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity()).callEvent(); // Paper - Slime pathfinder events
} }
@Override @Override
@ -42,7 +42,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
LivingEntity entityliving = this.slime.getTarget(); LivingEntity entityliving = this.slime.getTarget();
- return entityliving == null ? false : (!this.slime.canAttack(entityliving) ? false : this.slime.getMoveControl() instanceof Slime.SlimeMoveControl); - return entityliving == null ? false : (!this.slime.canAttack(entityliving) ? false : this.slime.getMoveControl() instanceof Slime.SlimeMoveControl);
+ // Paper start + // Paper start - Slime pathfinder events
+ if (entityliving == null || !entityliving.isAlive()) { + if (entityliving == null || !entityliving.isAlive()) {
+ return false; + return false;
+ } + }
@ -50,7 +50,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
+ return false; + return false;
+ } + }
+ return this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeTargetLivingEntityEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity()).callEvent(); + return this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeTargetLivingEntityEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity()).callEvent();
+ // Paper end + // Paper end - Slime pathfinder events
} }
@Override @Override
@ -59,7 +59,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
LivingEntity entityliving = this.slime.getTarget(); LivingEntity entityliving = this.slime.getTarget();
- return entityliving == null ? false : (!this.slime.canAttack(entityliving) ? false : --this.growTiredTimer > 0); - return entityliving == null ? false : (!this.slime.canAttack(entityliving) ? false : --this.growTiredTimer > 0);
+ // Paper start + // Paper start - Slime pathfinder events
+ if (entityliving == null || !entityliving.isAlive()) { + if (entityliving == null || !entityliving.isAlive()) {
+ return false; + return false;
+ } + }
@ -67,7 +67,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
+ return false; + return false;
+ } + }
+ return --this.growTiredTimer > 0 && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeTargetLivingEntityEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity()).callEvent(); + return --this.growTiredTimer > 0 && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeTargetLivingEntityEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity()).callEvent();
+ // Paper end + // Paper end - Slime pathfinder events
} }
@Override @Override
@ -76,12 +76,12 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
} }
+ +
+ // Paper start - clear timer and target when goal resets + // Paper start - Slime pathfinder events; clear timer and target when goal resets
+ public void stop() { + public void stop() {
+ this.growTiredTimer = 0; + this.growTiredTimer = 0;
+ this.slime.setTarget(null); + this.slime.setTarget(null);
+ } + }
+ // Paper end + // Paper end - Slime pathfinder events
} }
private static class SlimeRandomDirectionGoal extends Goal { private static class SlimeRandomDirectionGoal extends Goal {
@ -90,7 +90,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
@Override @Override
public boolean canUse() { public boolean canUse() {
- return this.slime.getTarget() == null && (this.slime.onGround() || this.slime.isInWater() || this.slime.isInLava() || this.slime.hasEffect(MobEffects.LEVITATION)) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl; - return this.slime.getTarget() == null && (this.slime.onGround() || this.slime.isInWater() || this.slime.isInLava() || this.slime.hasEffect(MobEffects.LEVITATION)) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl;
+ return this.slime.getTarget() == null && (this.slime.onGround() || this.slime.isInWater() || this.slime.isInLava() || this.slime.hasEffect(MobEffects.LEVITATION)) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander; // Paper - add canWander + return this.slime.getTarget() == null && (this.slime.onGround() || this.slime.isInWater() || this.slime.isInLava() || this.slime.hasEffect(MobEffects.LEVITATION)) && this.slime.getMoveControl() instanceof Slime.SlimeMoveControl && this.slime.canWander; // Paper - Slime pathfinder events
} }
@Override @Override
@ -98,11 +98,11 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
if (--this.nextRandomizeTime <= 0) { if (--this.nextRandomizeTime <= 0) {
this.nextRandomizeTime = this.adjustedTickDelay(40 + this.slime.getRandom().nextInt(60)); this.nextRandomizeTime = this.adjustedTickDelay(40 + this.slime.getRandom().nextInt(60));
this.chosenDegrees = (float) this.slime.getRandom().nextInt(360); this.chosenDegrees = (float) this.slime.getRandom().nextInt(360);
+ // Paper start + // Paper start - Slime pathfinder events
+ com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent event = new com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), this.chosenDegrees); + com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent event = new com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity(), this.chosenDegrees);
+ if (!this.slime.canWander || !event.callEvent()) return; + if (!this.slime.canWander || !event.callEvent()) return;
+ this.chosenDegrees = event.getNewYaw(); + this.chosenDegrees = event.getNewYaw();
+ // Paper end + // Paper end - Slime pathfinder events
} }
MoveControl controllermove = this.slime.getMoveControl(); MoveControl controllermove = this.slime.getMoveControl();
@ -111,7 +111,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
@Override @Override
public boolean canUse() { public boolean canUse() {
- return !this.slime.isPassenger(); - return !this.slime.isPassenger();
+ return !this.slime.isPassenger() && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeWanderEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity()).callEvent(); // Paper + return !this.slime.isPassenger() && this.slime.canWander && new com.destroystokyo.paper.event.entity.SlimeWanderEvent((org.bukkit.entity.Slime) this.slime.getBukkitEntity()).callEvent(); // Paper - Slime pathfinder events
} }
@Override @Override
@ -120,7 +120,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
} }
} }
+ +
+ // Paper start + // Paper start - Slime pathfinder events
+ private boolean canWander = true; + private boolean canWander = true;
+ public boolean canWander() { + public boolean canWander() {
+ return canWander; + return canWander;
@ -129,7 +129,7 @@ index ef382b08ff8e7f24500aed6752c76e6ffc3f0729..fa014c04cc51a55345a1c50098f48616
+ public void setWander(boolean canWander) { + public void setWander(boolean canWander) {
+ this.canWander = canWander; + this.canWander = canWander;
+ } + }
+ // Paper end + // Paper end - Slime pathfinder events
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
index 3d991d9d9388108ec6d137950913209d61d132e7..3d9b7c0e128ea05bec5600c774e9685998b71cac 100644 index 3d991d9d9388108ec6d137950913209d61d132e7..3d9b7c0e128ea05bec5600c774e9685998b71cac 100644

Datei anzeigen

@ -5,7 +5,7 @@ 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 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..2bd097203f1e92d3fc343f91dc37220e09dd5066 100644 index 82afefbbc3b9d3571792d66e6d4f9d687971aa66..9b3dcf1a4d4cece92a629506d341f6bfe79d13d0 100644
--- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java --- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java
+++ b/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 { @@ -140,11 +140,31 @@ public class LiquidBlock extends Block implements BucketPickup {
@ -13,12 +13,12 @@ index 82afefbbc3b9d3571792d66e6d4f9d687971aa66..2bd097203f1e92d3fc343f91dc37220e
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) { if (this.shouldSpreadLiquid(world, pos, state)) {
- world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world)); - world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper + world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava
} }
} }
+ // Paper start - Get flow speed. Throttle if its water and flowing adjacent to lava + // Paper start - Configurable speed for water flowing over lava
+ public int getFlowSpeed(Level world, BlockPos blockposition) { + public int getFlowSpeed(Level world, BlockPos blockposition) {
+ if (net.minecraft.core.registries.BuiltInRegistries.FLUID.wrapAsHolder(this.fluid).is(FluidTags.WATER)) { + if (net.minecraft.core.registries.BuiltInRegistries.FLUID.wrapAsHolder(this.fluid).is(FluidTags.WATER)) {
+ if ( + if (
@ -36,7 +36,7 @@ index 82afefbbc3b9d3571792d66e6d4f9d687971aa66..2bd097203f1e92d3fc343f91dc37220e
+ final FluidState fluidState = world.getFluidIfLoaded(blockPos); + final FluidState fluidState = world.getFluidIfLoaded(blockPos);
+ return fluidState != null && fluidState.is(FluidTags.LAVA); + return fluidState != null && fluidState.is(FluidTags.LAVA);
+ } + }
+ // Paper end + // Paper end - Configurable speed for water flowing over lava
+ +
@Override @Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
@ -46,7 +46,7 @@ index 82afefbbc3b9d3571792d66e6d4f9d687971aa66..2bd097203f1e92d3fc343f91dc37220e
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) { public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
if (this.shouldSpreadLiquid(world, pos, state)) { if (this.shouldSpreadLiquid(world, pos, state)) {
- world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world)); - world.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world));
+ world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper + world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava
} }
} }

Datei anzeigen

@ -7,21 +7,21 @@ Avoids a hashmap lookup by cacheing a reference to the CraftBlockData
and cloning it when one is needed. 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 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 a009fca54665cbc3f11cad776256fbf1fbbb18c7..2c7d025b2af3a66772c3f394620483045fb80242 100644 index a009fca54665cbc3f11cad776256fbf1fbbb18c7..7e4264f87a0f81db71d49dbede32a1bad87f7ca8 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -876,6 +876,14 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -876,6 +876,14 @@ public abstract class BlockBehaviour implements FeatureElement {
this.replaceable = blockbase_info.replaceable; this.replaceable = blockbase_info.replaceable;
this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper this.conditionallyFullOpaque = this.canOcclude & this.useShapeForLightOcclusion; // Paper
} }
+ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time + // Paper start - Perf: impl cached craft block data, lazy load to fix issue with loading at the wrong time
+ private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; + private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData;
+ +
+ public org.bukkit.craftbukkit.block.data.CraftBlockData createCraftBlockData() { + public org.bukkit.craftbukkit.block.data.CraftBlockData createCraftBlockData() {
+ if (cachedCraftBlockData == null) cachedCraftBlockData = org.bukkit.craftbukkit.block.data.CraftBlockData.createData(asState()); + if (cachedCraftBlockData == null) cachedCraftBlockData = org.bukkit.craftbukkit.block.data.CraftBlockData.createData(asState());
+ return (org.bukkit.craftbukkit.block.data.CraftBlockData) cachedCraftBlockData.clone(); + return (org.bukkit.craftbukkit.block.data.CraftBlockData) cachedCraftBlockData.clone();
+ } + }
+ // Paper end + // Paper end - Perf: impl cached craft block data, lazy load to fix issue with loading at the wrong time
private boolean calculateSolid() { private boolean calculateSolid() {
if (((Block) this.owner).properties.forceSolidOn) { if (((Block) this.owner).properties.forceSolidOn) {

Datei anzeigen

@ -8,7 +8,7 @@ Use larger initial sizes to increase bucket capacity on the BiMap
BiMap.get was seen to be using a good bit of CPU time. 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 diff --git a/src/main/java/net/minecraft/core/MappedRegistry.java b/src/main/java/net/minecraft/core/MappedRegistry.java
index 33990e4f9b5e7e3d8080c80f639b81b7f798c859..742af4feb3986ca7d8f5ed136b556a41cbe0722f 100644 index 33990e4f9b5e7e3d8080c80f639b81b7f798c859..b2d22bb25499756fe393cf562f8a4eda0649c26d 100644
--- a/src/main/java/net/minecraft/core/MappedRegistry.java --- a/src/main/java/net/minecraft/core/MappedRegistry.java
+++ b/src/main/java/net/minecraft/core/MappedRegistry.java +++ b/src/main/java/net/minecraft/core/MappedRegistry.java
@@ -35,13 +35,13 @@ public class MappedRegistry<T> implements WritableRegistry<T> { @@ -35,13 +35,13 @@ public class MappedRegistry<T> implements WritableRegistry<T> {
@ -16,17 +16,17 @@ index 33990e4f9b5e7e3d8080c80f639b81b7f798c859..742af4feb3986ca7d8f5ed136b556a41
final ResourceKey<? extends Registry<T>> key; final ResourceKey<? extends Registry<T>> key;
private final ObjectList<Holder.Reference<T>> byId = new ObjectArrayList<>(256); private final ObjectList<Holder.Reference<T>> byId = new ObjectArrayList<>(256);
- private final Reference2IntMap<T> toId = Util.make(new Reference2IntOpenHashMap<>(), (map) -> { - private final Reference2IntMap<T> toId = Util.make(new Reference2IntOpenHashMap<>(), (map) -> {
+ private final Reference2IntMap<T> toId = Util.make(new Reference2IntOpenHashMap<>(2048), (map) -> { // Paper - use bigger expected size to reduce collisions + private final Reference2IntMap<T> toId = Util.make(new Reference2IntOpenHashMap<>(2048), (map) -> { // Paper - Perf: Use bigger expected size to reduce collisions
map.defaultReturnValue(-1); map.defaultReturnValue(-1);
}); });
- private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>(); - private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>();
- private final Map<ResourceKey<T>, Holder.Reference<T>> byKey = 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, Holder.Reference<T>> byValue = new IdentityHashMap<>();
- private final Map<T, Lifecycle> lifecycles = new IdentityHashMap<>(); - private final Map<T, Lifecycle> lifecycles = new IdentityHashMap<>();
+ private final Map<ResourceLocation, Holder.Reference<T>> byLocation = new HashMap<>(2048); // Paper - 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 - 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 - 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 - 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 Lifecycle registryLifecycle; private Lifecycle registryLifecycle;
private volatile Map<TagKey<T>, HolderSet.Named<T>> tags = new IdentityHashMap<>(); private volatile Map<TagKey<T>, HolderSet.Named<T>> tags = new IdentityHashMap<>();
private boolean frozen; private boolean frozen;

Datei anzeigen

@ -48,14 +48,14 @@ index d19bf99d03bf505a1a277b49fba6ee4769802ef2..658393f451e46a93c5665fe3c580aa39
CIRCLE, SWOOP; 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 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..94ee9c399f59e0198b4d9bc2a4255e8b821bcd36 100644 index 61ba99d99cc4e7782450ee6aa8b6c87b1a42cb3a..5d84bd022714f9726131d2e37d648c444052af9b 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java --- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/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 { @@ -70,9 +70,19 @@ public class PhantomSpawner implements CustomSpawner {
int k = 1 + randomsource.nextInt(difficultydamagescaler.getDifficulty().getId() + 1); int k = 1 + randomsource.nextInt(difficultydamagescaler.getDifficulty().getId() + 1);
for (int l = 0; l < k; ++l) { for (int l = 0; l < k; ++l) {
+ // Paper start + // Paper start - PhantomPreSpawnEvent
+ com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent event = new com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent(io.papermc.paper.util.MCUtil.toLocation(world, blockposition1), entityplayer.getBukkitEntity(), org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); + com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent event = new com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent(io.papermc.paper.util.MCUtil.toLocation(world, blockposition1), entityplayer.getBukkitEntity(), org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL);
+ if (!event.callEvent()) { + if (!event.callEvent()) {
+ if (event.shouldAbortSpawn()) { + if (event.shouldAbortSpawn()) {
@ -63,11 +63,11 @@ index 61ba99d99cc4e7782450ee6aa8b6c87b1a42cb3a..94ee9c399f59e0198b4d9bc2a4255e8b
+ } + }
+ continue; + continue;
+ } + }
+ // Paper end + // Paper end - PhantomPreSpawnEvent
Phantom entityphantom = (Phantom) EntityType.PHANTOM.create(world); Phantom entityphantom = (Phantom) EntityType.PHANTOM.create(world);
if (entityphantom != null) { if (entityphantom != null) {
+ entityphantom.setSpawningEntity(entityplayer.getUUID()); // Paper + entityphantom.setSpawningEntity(entityplayer.getUUID()); // Paper - PhantomPreSpawnEvent
entityphantom.moveTo(blockposition1, 0.0F, 0.0F); 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, (CompoundTag) null);
world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit

Datei anzeigen

@ -5,7 +5,7 @@ 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 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 17ce05e7f9d2615be28a095ef6d3126885df8771..7fe90ebc8eced53f72c7f935e40745075f02421b 100644 index d85095117d7837e75640f0e447242b45e24cf00e..51ab33d805028fb739ff9fa1a22a010e70777c1e 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java --- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java +++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -132,7 +132,7 @@ public class Creeper extends Monster implements PowerableMob { @@ -132,7 +132,7 @@ public class Creeper extends Monster implements PowerableMob {
@ -22,7 +22,7 @@ index 17ce05e7f9d2615be28a095ef6d3126885df8771..7fe90ebc8eced53f72c7f935e4074507
public void ignite() { public void ignite() {
- this.entityData.set(Creeper.DATA_IS_IGNITED, true); - this.entityData.set(Creeper.DATA_IS_IGNITED, true);
+ // Paper start + // Paper start - CreeperIgniteEvent
+ setIgnited(true); + setIgnited(true);
+ } + }
+ +
@ -33,7 +33,7 @@ index 17ce05e7f9d2615be28a095ef6d3126885df8771..7fe90ebc8eced53f72c7f935e4074507
+ this.entityData.set(Creeper.DATA_IS_IGNITED, event.isIgnited()); + this.entityData.set(Creeper.DATA_IS_IGNITED, event.isIgnited());
+ } + }
+ } + }
+ // Paper end + // Paper end - CreeperIgniteEvent
} }
public boolean canDropMobsSkull() { public boolean canDropMobsSkull() {

Datei anzeigen

@ -20,10 +20,10 @@ this is going to be the best soultion all around.
Improvements/suggestions welcome! Improvements/suggestions welcome!
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6d04954493680bc4fbad67ff2e43411f970f78f5..1793fbd803bfdb5d43d83d15b238d70da06b8780 100644 index a906fda4d5d92054f5c0cea4a8167cdb29287cc3..6f37e4fbadb287d9c099d1cc535c941aaabe1d54 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2606,11 +2606,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2605,11 +2605,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
public void removeVehicle() { public void removeVehicle() {
@ -41,7 +41,7 @@ index 6d04954493680bc4fbad67ff2e43411f970f78f5..1793fbd803bfdb5d43d83d15b238d70d
} }
} }
@@ -2641,7 +2646,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2640,7 +2645,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
} }
@ -53,7 +53,7 @@ index 6d04954493680bc4fbad67ff2e43411f970f78f5..1793fbd803bfdb5d43d83d15b238d70d
if (entity.getVehicle() == this) { if (entity.getVehicle() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else { } else {
@@ -2651,7 +2659,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2650,7 +2658,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
VehicleExitEvent event = new VehicleExitEvent( VehicleExitEvent event = new VehicleExitEvent(
(Vehicle) this.getBukkitEntity(), (Vehicle) this.getBukkitEntity(),
@ -62,7 +62,7 @@ index 6d04954493680bc4fbad67ff2e43411f970f78f5..1793fbd803bfdb5d43d83d15b238d70d
); );
// Suppress during worldgen // Suppress during worldgen
if (this.valid) { if (this.valid) {
@@ -2664,7 +2672,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2663,7 +2671,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
} }

Datei anzeigen

@ -11,7 +11,7 @@ floating in the air.
This can replace many uses of BlockPhysicsEvent This can replace many uses of BlockPhysicsEvent
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 14c963d507173dae6015a0c81e3a690768012bed..a683908b18114cad6100e3d5c8eb5a8dfd33163a 100644 index 71c2f082091f452cfc74557cd599cf7f080b889b..5d6f45f7ff8f310bf78417aa9bcf8f106a1d80c6 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -31,6 +31,7 @@ import net.minecraft.nbt.CompoundTag; @@ -31,6 +31,7 @@ import net.minecraft.nbt.CompoundTag;
@ -22,7 +22,7 @@ index 14c963d507173dae6015a0c81e3a690768012bed..a683908b18114cad6100e3d5c8eb5a8d
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.FullChunkStatus; import net.minecraft.server.level.FullChunkStatus;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
@@ -669,9 +670,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -668,9 +669,26 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return false; return false;
} else { } else {
FluidState fluid = this.getFluidState(pos); FluidState fluid = this.getFluidState(pos);

Datei anzeigen

@ -22,19 +22,19 @@ index 2eddeb8d5239bbfeefbf4d3bd363f1ad083299b6..e2b44b8ddb8afc6e1f7dddadb434c226
}); });
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 1e10d55962a7221e197723eb42434be052a7661a..cf2ae848a3860a5a27723047b02bde3aa8255d62 100644 index 5538e810ef0a68f00043d4e750eb735300d50664..8e3acfcdfac1cd67456acfbede2260b8f186df70 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1454,6 +1454,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1442,6 +1442,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
return true; return true;
} }
// Paper end // Paper end - extra debug info
+ if (entity.spawnReason == null) entity.spawnReason = spawnReason; // Paper - Entity#getEntitySpawnReason + if (entity.spawnReason == null) entity.spawnReason = spawnReason; // Paper - Entity#getEntitySpawnReason
if (entity.isRemoved()) { if (entity.isRemoved()) {
// Paper start // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
if (DEBUG_ENTITIES) { return false;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index c9dbc32561ddd39b40ed42d8cc6550a904ac158e..63d793ee00b14a12d0dbad15bee579a330f1eb07 100644 index 8ca59ff8fee55358ec6f9a480a27b45859dccfaf..dd9b5fbd23a951b1e4b3cbf3ae0763b1f8462e2e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -223,6 +223,11 @@ public abstract class PlayerList { @@ -223,6 +223,11 @@ public abstract class PlayerList {
@ -59,7 +59,7 @@ index c9dbc32561ddd39b40ed42d8cc6550a904ac158e..63d793ee00b14a12d0dbad15bee579a3
}); });
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e44d983e7b44225bdd7395488d2b246761e8e02a..748bc33b9812791ffe4b811c405b45d07c18cdcd 100644 index 6f37e4fbadb287d9c099d1cc535c941aaabe1d54..eb353e7814544c11dbae8d12958cc26200e549a3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -237,6 +237,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -237,6 +237,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@ -70,7 +70,7 @@ index e44d983e7b44225bdd7395488d2b246761e8e02a..748bc33b9812791ffe4b811c405b45d0
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
private CraftEntity bukkitEntity; private CraftEntity bukkitEntity;
@@ -2214,6 +2215,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2213,6 +2214,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
} }
@ -80,7 +80,7 @@ index e44d983e7b44225bdd7395488d2b246761e8e02a..748bc33b9812791ffe4b811c405b45d0
// Save entity's from mob spawner status // Save entity's from mob spawner status
if (spawnedViaMobSpawner) { if (spawnedViaMobSpawner) {
nbttagcompound.putBoolean("Paper.FromMobSpawner", true); nbttagcompound.putBoolean("Paper.FromMobSpawner", true);
@@ -2360,6 +2364,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2359,6 +2363,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status

Datei anzeigen

@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to
just do a get call since the value can never be null. just do a get call since the value can never be null.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index b10c93cbcf264a3e13d48f30a2c09ae5568a510e..c8b2399c55c8ea4fcb953202c0ea74d95b47c359 100644 index 5d6f45f7ff8f310bf78417aa9bcf8f106a1d80c6..44290a845d15bfdd8ea87ff77e9016ece835d087 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -998,9 +998,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -997,9 +997,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@Nullable @Nullable
public BlockEntity getBlockEntity(BlockPos blockposition, boolean validate) { public BlockEntity getBlockEntity(BlockPos blockposition, boolean validate) {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world
This lets you disable it for some worlds and lower it for others. This lets you disable it for some worlds and lower it for others.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f317b9fdb2bfbae9babd64d4801f190042fc1867..1d069e33f64463e96199fa336336ffc44e3ed10e 100644 index cef1554db34a1d917fa5c7bbccfe22efd93bebfd..f92e4d6cfae684b5c8df6424d63a574cb17ef6b7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -768,30 +768,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -768,30 +768,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -62,10 +62,10 @@ index f317b9fdb2bfbae9babd64d4801f190042fc1867..1d069e33f64463e96199fa336336ffc4
// this.updateMobSpawningFlags(); // this.updateMobSpawningFlags();
worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals()); worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals());
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 43424a9d8e985f4965b4d101f7fee398e3d1f52c..e8d54a421bb743844c031a4e43965e5873f79995 100644 index 8e3acfcdfac1cd67456acfbede2260b8f186df70..3e649c0b56de4b7e63c877ea14721fd5e70b51d3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1897,12 +1897,84 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1879,12 +1879,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
return ((MapIndex) this.getServer().overworld().getDataStorage().computeIfAbsent(MapIndex.factory(), "idcounts")).getFreeAuxValueForMap(); return ((MapIndex) this.getServer().overworld().getDataStorage().computeIfAbsent(MapIndex.factory(), "idcounts")).getFreeAuxValueForMap();
} }

Datei anzeigen

@ -32,31 +32,8 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
It is recommended you regenerate the entities, as these were legit entities, and deserve your love. It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
diff --git a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
index cbeaadaecf816070b3a37938c8e683180939afc4..95e5073a68e4dd38b70e8268daf2160922c3a12f 100644
--- a/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
+++ b/src/main/java/io/papermc/paper/chunk/system/ChunkSystem.java
@@ -74,7 +74,17 @@ public final class ChunkSystem {
}
public static void onEntityPreAdd(final ServerLevel level, final Entity entity) {
-
+ // Paper start - duplicate uuid resolving
+ if (net.minecraft.server.level.ChunkMap.checkDupeUUID(level, entity)) {
+ return;
+ }
+ if (net.minecraft.world.level.Level.DEBUG_ENTITIES && ((Entity) entity).level().paperConfig().entities.spawning.duplicateUuid.mode != io.papermc.paper.configuration.WorldConfiguration.Entities.Spawning.DuplicateUUID.DuplicateUUIDMode.NOTHING) {
+ if (((Entity) entity).addedToWorldStack != null) {
+ ((Entity) entity).addedToWorldStack.printStackTrace();
+ }
+ net.minecraft.server.level.ServerLevel.getAddToWorldStackTrace((Entity) entity).printStackTrace();
+ }
+ // Paper end - duplicate uuid resolving
}
public static void onChunkHolderCreate(final ServerLevel level, final ChunkHolder holder) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 56f52d4b9c1af6a04d464640ed06b841a47b4cd9..5b2e4a2c1ae99b4c1ee5e1daaca7ca79a87d3ad1 100644 index 56f52d4b9c1af6a04d464640ed06b841a47b4cd9..87edc78afea997db8935432b2c452aec6638fb06 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -533,6 +533,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -533,6 +533,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -67,7 +44,7 @@ index 56f52d4b9c1af6a04d464640ed06b841a47b4cd9..5b2e4a2c1ae99b4c1ee5e1daaca7ca79
return !needsRemoval; return !needsRemoval;
}), position); // Paper - rewrite chunk system }), position); // Paper - rewrite chunk system
// CraftBukkit end // CraftBukkit end
@@ -544,6 +545,49 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -544,6 +545,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
throw new UnsupportedOperationException(); // Paper - rewrite chunk system throw new UnsupportedOperationException(); // Paper - rewrite chunk system
} }
@ -90,24 +67,20 @@ index 56f52d4b9c1af6a04d464640ed06b841a47b4cd9..5b2e4a2c1ae99b4c1ee5e1daaca7ca79
+ && Objects.equals(other.getEncodeId(), entity.getEncodeId()) + && Objects.equals(other.getEncodeId(), entity.getEncodeId())
+ && entity.getBukkitEntity().getLocation().distance(other.getBukkitEntity().getLocation()) < level.paperConfig().entities.spawning.duplicateUuid.safeRegenDeleteRange + && entity.getBukkitEntity().getLocation().distance(other.getBukkitEntity().getLocation()) < level.paperConfig().entities.spawning.duplicateUuid.safeRegenDeleteRange
+ ) { + ) {
+ if (ServerLevel.DEBUG_ENTITIES) LOGGER.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", deleted entity " + entity + " because it was near the duplicate and likely an actual duplicate. See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
+ entity.discard(); + entity.discard();
+ return true; + return true;
+ } + }
+ if (other != null && !other.isRemoved()) { + if (!other.isRemoved()) {
+ switch (mode) { + switch (mode) {
+ case SAFE_REGEN: { + case SAFE_REGEN: {
+ entity.setUUID(java.util.UUID.randomUUID()); + entity.setUUID(java.util.UUID.randomUUID());
+ if (ServerLevel.DEBUG_ENTITIES) LOGGER.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", regenerated UUID for " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
+ break; + break;
+ } + }
+ case DELETE: { + case DELETE: {
+ if (ServerLevel.DEBUG_ENTITIES) LOGGER.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", deleted entity " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
+ entity.discard(); + entity.discard();
+ return true; + return true;
+ } + }
+ default: + default:
+ if (ServerLevel.DEBUG_ENTITIES) LOGGER.warn("[DUPE-UUID] Duplicate UUID found used by " + other + ", doing nothing to " + entity + ". See https://github.com/PaperMC/Paper/issues/1223 for discussion on what this is about.");
+ break; + break;
+ } + }
+ } + }

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Optimise EntityGetter#getPlayerByUUID
Use the PlayerList map instead of iterating over all players Use the PlayerList map instead of iterating over all players
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 978f0f20c3aceb1c6f967c2bec3d010e344aad0c..854030f910c6e789cbc9f19aab76437f35bf7668 100644 index 3e649c0b56de4b7e63c877ea14721fd5e70b51d3..43ccc65c87e9c535057dd959c5a130dcf71d7d28 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -558,6 +558,15 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -555,6 +555,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
}); });
} }

Datei anzeigen

@ -18,7 +18,7 @@ public net.minecraft.world.entity.Entity isInsidePortal
public net.minecraft.world.entity.LivingEntity jumping public net.minecraft.world.entity.LivingEntity jumping
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 1b3df2f8e83b6bff4bbe8d37836072be2b2e6084..0ed44bc939b256a4b91eb24812e4de10a9af01b7 100644 index 43ccc65c87e9c535057dd959c5a130dcf71d7d28..dd034a7d7754c88b77731175f373e8c090e4a706 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2,7 +2,6 @@ package net.minecraft.server.level; @@ -2,7 +2,6 @@ package net.minecraft.server.level;
@ -29,7 +29,7 @@ index 1b3df2f8e83b6bff4bbe8d37836072be2b2e6084..0ed44bc939b256a4b91eb24812e4de10
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.DataFixer;
import com.mojang.datafixers.util.Pair; import com.mojang.datafixers.util.Pair;
@@ -1211,17 +1210,17 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1208,17 +1207,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
++TimingHistory.entityTicks; // Paper - timings ++TimingHistory.entityTicks; // Paper - timings
// Spigot start // Spigot start
co.aikar.timings.Timing timer; // Paper co.aikar.timings.Timing timer; // Paper
@ -51,7 +51,7 @@ index 1b3df2f8e83b6bff4bbe8d37836072be2b2e6084..0ed44bc939b256a4b91eb24812e4de10
try { try {
// Paper end - timings // Paper end - timings
entity.setOldPosAndRot(); entity.setOldPosAndRot();
@@ -1232,9 +1231,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1229,9 +1228,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); return BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString();
}); });
gameprofilerfiller.incrementCounter("tickNonPassenger"); gameprofilerfiller.incrementCounter("tickNonPassenger");
@ -65,7 +65,7 @@ index 1b3df2f8e83b6bff4bbe8d37836072be2b2e6084..0ed44bc939b256a4b91eb24812e4de10
Iterator iterator = entity.getPassengers().iterator(); Iterator iterator = entity.getPassengers().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -1242,13 +1245,18 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1239,13 +1242,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1); this.tickPassenger(entity, entity1);
} }
@ -85,7 +85,7 @@ index 1b3df2f8e83b6bff4bbe8d37836072be2b2e6084..0ed44bc939b256a4b91eb24812e4de10
passenger.setOldPosAndRot(); passenger.setOldPosAndRot();
++passenger.tickCount; ++passenger.tickCount;
ProfilerFiller gameprofilerfiller = this.getProfiler(); ProfilerFiller gameprofilerfiller = this.getProfiler();
@@ -1257,8 +1265,17 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1254,8 +1262,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString(); return BuiltInRegistries.ENTITY_TYPE.getKey(passenger.getType()).toString();
}); });
gameprofilerfiller.incrementCounter("tickPassenger"); gameprofilerfiller.incrementCounter("tickPassenger");
@ -103,7 +103,7 @@ index 1b3df2f8e83b6bff4bbe8d37836072be2b2e6084..0ed44bc939b256a4b91eb24812e4de10
gameprofilerfiller.pop(); gameprofilerfiller.pop();
Iterator iterator = passenger.getPassengers().iterator(); Iterator iterator = passenger.getPassengers().iterator();
@@ -1268,6 +1285,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1265,6 +1282,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(passenger, entity2); this.tickPassenger(passenger, entity2);
} }
@ -112,10 +112,10 @@ index 1b3df2f8e83b6bff4bbe8d37836072be2b2e6084..0ed44bc939b256a4b91eb24812e4de10
} else { } else {
passenger.stopRiding(); passenger.stopRiding();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 14e2077aba3b2fcf347f7184a53ca8dda943322b..3c0725ca02f6ab9adde307aab864d856dc6e42e1 100644 index eb353e7814544c11dbae8d12958cc26200e549a3..9e028513eb3809100d7292e3327051cb27f4d07a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -397,6 +397,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -396,6 +396,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public void inactiveTick() { } public void inactiveTick() { }
// Spigot end // Spigot end
// Paper start // Paper start
@ -124,7 +124,7 @@ index 14e2077aba3b2fcf347f7184a53ca8dda943322b..3c0725ca02f6ab9adde307aab864d856
protected int numCollisions = 0; // Paper protected int numCollisions = 0; // Paper
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
@javax.annotation.Nullable @javax.annotation.Nullable
@@ -969,6 +971,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -968,6 +970,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} else { } else {
this.wasOnFire = this.isOnFire(); this.wasOnFire = this.isOnFire();
if (movementType == MoverType.PISTON) { if (movementType == MoverType.PISTON) {
@ -133,7 +133,7 @@ index 14e2077aba3b2fcf347f7184a53ca8dda943322b..3c0725ca02f6ab9adde307aab864d856
movement = this.limitPistonMovement(movement); movement = this.limitPistonMovement(movement);
if (movement.equals(Vec3.ZERO)) { if (movement.equals(Vec3.ZERO)) {
return; return;
@@ -981,6 +985,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -980,6 +984,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.stuckSpeedMultiplier = Vec3.ZERO; this.stuckSpeedMultiplier = Vec3.ZERO;
this.setDeltaMovement(Vec3.ZERO); this.setDeltaMovement(Vec3.ZERO);
} }
@ -340,10 +340,10 @@ index b149e8bcac034bb3fc118a9adcb0de45e18ed5e9..fc35cfc9d045f3e5b6a50af1d0ba83b6
+ +
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 5ce8c8b13dd380f483406af5356d347b60868606..ec35b05aeae0fb8e413653fd6495067f06144556 100644 index 44290a845d15bfdd8ea87ff77e9016ece835d087..9a327f44e9dca303265906d6da379907344435f3 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -163,6 +163,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -162,6 +162,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>(); public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>();
public List<ItemEntity> captureDrops; public List<ItemEntity> captureDrops;
public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>(); public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();

Datei anzeigen

@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 1b84c29605fb141ad286f6ae67a726d0a5088d32..2130f15d92bab1d4e35a92a681ac34cd9c929ea9 100644 index 87edc78afea997db8935432b2c452aec6638fb06..279cb641b795b6f4ced545c3a09b61fde69c47d6 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1264,6 +1264,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1260,6 +1260,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
int j = entity.getType().clientTrackingRange() * 16; int j = entity.getType().clientTrackingRange() * 16;

Datei anzeigen

@ -13,10 +13,10 @@ Quickly loading the exact world spawn chunk before searching the
heightmap resolves the issue without having to load all spawn chunks. heightmap resolves the issue without having to load all spawn chunks.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 26a611b8d75513690811fbbd15dc37e6f4a50dd4..f052c3eb14d5f50fb82889b011387991d5e4aac7 100644 index 9e028513eb3809100d7292e3327051cb27f4d07a..96e0abe60d108dd61db79790962dd7b782830b57 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3411,6 +3411,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3410,6 +3410,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (flag1) { if (flag1) {
blockposition1 = ServerLevel.END_SPAWN_POINT; blockposition1 = ServerLevel.END_SPAWN_POINT;
} else { } else {

Datei anzeigen

@ -1104,10 +1104,10 @@ index 90ec22d35edb2874417bbea590e0d3c37ad93d64..fc230d835f9aa526a4b179d36d921f0f
public ClientboundLevelChunkWithLightPacket(FriendlyByteBuf buf) { public ClientboundLevelChunkWithLightPacket(FriendlyByteBuf buf) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 0ed44bc939b256a4b91eb24812e4de10a9af01b7..8eff58898faea024787e56cf98c8498c46db16d4 100644 index dd034a7d7754c88b77731175f373e8c090e4a706..acb35d2df83ff2381f21611de358d50caee53f69 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -572,7 +572,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -569,7 +569,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error // Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
@ -1117,7 +1117,7 @@ index 0ed44bc939b256a4b91eb24812e4de10a9af01b7..8eff58898faea024787e56cf98c8498c
this.convertable = convertable_conversionsession; this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 79020edc9fac79e8b186d0f57f956d2189d3dc8e..b7e6d8441e8444c36919c126a8adeaeed02df08c 100644 index 32327f639b3cc10444ad122fb3405174e32c4f01..3629f164f05cc2d33c76bb21cfe4598539aa08e0 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -49,7 +49,7 @@ import org.bukkit.event.player.PlayerInteractEvent; @@ -49,7 +49,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
@ -1155,10 +1155,10 @@ index 5de5209e04d631bd6a50e28e8d3abebf148252c1..19b3f4fa7678a038bf25efc2a8b46dda
DebugPackets.sendPoiPacketsForChunk(world, chunkPos); DebugPackets.sendPoiPacketsForChunk(world, chunkPos);
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 322f2ef70273d52bf6daced17aec09f7d34c9200..a58df7552766abb0c923402bfa40e5d72d972e83 100644 index f016d991b132775bacc961557f7e5ff78f2b52d1..473a14272e3c63e24a25fe1522aba9c0af829a2e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -178,6 +178,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -177,6 +177,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
// Paper end - add paper world config // Paper end - add paper world config
@ -1166,7 +1166,7 @@ index 322f2ef70273d52bf6daced17aec09f7d34c9200..a58df7552766abb0c923402bfa40e5d7
public final co.aikar.timings.WorldTimingsHandler timings; // Paper public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPos lastPhysicsProblem; // Spigot public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter entityLimiter;
@@ -196,7 +197,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -195,7 +196,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey(); public abstract ResourceKey<LevelStem> getTypeKey();
@ -1175,15 +1175,15 @@ index 322f2ef70273d52bf6daced17aec09f7d34c9200..a58df7552766abb0c923402bfa40e5d7
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
this.generator = gen; this.generator = gen;
@@ -282,6 +283,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -281,6 +282,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
+ this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray + this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
} }
// Paper start // Paper start - Cancel hit for vanished players
@@ -547,6 +549,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -546,6 +548,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit end // CraftBukkit end
BlockState iblockdata1 = chunk.setBlockState(pos, state, (flags & 64) != 0, (flags & 1024) == 0); // CraftBukkit custom NO_PLACE flag BlockState iblockdata1 = chunk.setBlockState(pos, state, (flags & 64) != 0, (flags & 1024) == 0); // CraftBukkit custom NO_PLACE flag

Datei anzeigen

@ -312,10 +312,10 @@ index 70f15e3af9e954483ab116500f84a9ee17f67ce4..56fe3f4edd15239533a1ae9287e86528
chunkproviderserver_b.managedBlock(completablefuture::isDone); chunkproviderserver_b.managedBlock(completablefuture::isDone);
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - async chunk debug // Paper - rewrite chunk system io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - async chunk debug // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 6d6ad6a33f3f8e4b8bc39fea00506daf7b31275c..63437e0cd8ad76e05a3ae40de673d8ff6cae00c6 100644 index acb35d2df83ff2381f21611de358d50caee53f69..dbc13b7eccea5c97bcc6aa1ba0bd807aa34d6805 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -651,6 +651,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -648,6 +648,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.entityLookup = new io.papermc.paper.chunk.system.entity.EntityLookup(this, new EntityCallbacks()); // Paper - rewrite chunk system this.entityLookup = new io.papermc.paper.chunk.system.entity.EntityLookup(this, new EntityCallbacks()); // Paper - rewrite chunk system
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 21eac12dcc3571e647b07b313015d809cb0fbcea..d1a256a0a27ebfd91497840334c94dfe1a40c980 100644 index 96e0abe60d108dd61db79790962dd7b782830b57..a5defe250dcc0ca7aa907fe9a6b373d73d893be8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -399,6 +399,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -398,6 +398,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// Paper start // Paper start
public long activatedImmunityTick = Integer.MIN_VALUE; // Paper public long activatedImmunityTick = Integer.MIN_VALUE; // Paper
public boolean isTemporarilyActive = false; // Paper public boolean isTemporarilyActive = false; // Paper
@ -16,7 +16,7 @@ index 21eac12dcc3571e647b07b313015d809cb0fbcea..d1a256a0a27ebfd91497840334c94dfe
protected int numCollisions = 0; // Paper protected int numCollisions = 0; // Paper
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
@javax.annotation.Nullable @javax.annotation.Nullable
@@ -2233,6 +2234,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2232,6 +2233,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (spawnedViaMobSpawner) { if (spawnedViaMobSpawner) {
nbttagcompound.putBoolean("Paper.FromMobSpawner", true); nbttagcompound.putBoolean("Paper.FromMobSpawner", true);
} }
@ -26,7 +26,7 @@ index 21eac12dcc3571e647b07b313015d809cb0fbcea..d1a256a0a27ebfd91497840334c94dfe
// Paper end // Paper end
return nbttagcompound; return nbttagcompound;
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -2375,6 +2379,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2374,6 +2378,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status

Datei anzeigen

@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing. Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 1f9efff4ddccf2569fdfe42e6cbc92792643d0ea..3b7a82761682e29fb42f683b232c789c522b632e 100644 index 19f1432ae1405eee0ee56dec151e7d602816a943..37e6b841b3c3d8720a1947065d4fada8c25ec2cf 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -993,6 +993,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -989,6 +989,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void addEntity(Entity entity) { public void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
@ -25,10 +25,10 @@ index 1f9efff4ddccf2569fdfe42e6cbc92792643d0ea..3b7a82761682e29fb42f683b232c789c
EntityType<?> entitytypes = entity.getType(); EntityType<?> entitytypes = entity.getType();
int i = entitytypes.clientTrackingRange() * 16; int i = entitytypes.clientTrackingRange() * 16;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 63437e0cd8ad76e05a3ae40de673d8ff6cae00c6..46101e6bef0f81968cb194303e19e437a3417733 100644 index dbc13b7eccea5c97bcc6aa1ba0bd807aa34d6805..a3669b4d5833003c98bcf62da89560452565a451 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2514,7 +2514,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2496,7 +2496,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTrackingStart(Entity entity) { public void onTrackingStart(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
@ -37,7 +37,7 @@ index 63437e0cd8ad76e05a3ae40de673d8ff6cae00c6..46101e6bef0f81968cb194303e19e437
if (entity instanceof ServerPlayer) { if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity; ServerPlayer entityplayer = (ServerPlayer) entity;
@@ -2549,6 +2549,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2531,6 +2531,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.updateDynamicGameEventListener(DynamicGameEventListener::add);
entity.inWorld = true; // CraftBukkit - Mark entity as in world entity.inWorld = true; // CraftBukkit - Mark entity as in world
entity.valid = true; // CraftBukkit entity.valid = true; // CraftBukkit

Datei anzeigen

@ -71,7 +71,7 @@ index a9a0248b1bd1ac454064e977b61f9b7d80962ff8..059b1a0bf048af6a28c322f35da3d3cb
cause = cause.getCause(); cause = cause.getCause();
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ce113cc2bc52c1135799190a22e0be21744b58cc..9a25d351df1141e9218d37c0f90e2d67f9c8c3ef 100644 index 5cb0f93bc7d4495e65674c22de2ebd8854c696fe..570c163e4a56206d1cf259ee1ffcb6f865f72b1c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -297,7 +297,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -297,7 +297,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -231,7 +231,7 @@ index ce113cc2bc52c1135799190a22e0be21744b58cc..9a25d351df1141e9218d37c0f90e2d67
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 5f4f993243f19f1e88b7f2bc5e40a6b2125fd819..c9cca6ba3500791485bf19155156c38c24f1c761 100644 index 3779e02083fb41e93248aed27a9214be88167e5a..0e2978b6e4f03932c4ebdf1309d20454b9130132 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -269,7 +269,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -269,7 +269,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -263,7 +263,7 @@ index 5f4f993243f19f1e88b7f2bc5e40a6b2125fd819..c9cca6ba3500791485bf19155156c38c
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 03f8e1775e05293665f995b6c3ee52ed11447e79..8c9dcd895f73765327ac00d7cc706b6ae8b9d81f 100644 index 5f81d6f61a3f887613aa10d905eb8ee8f3d843ba..06232d823c099cb1d827491a5cccc435ecae8ffe 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -532,7 +532,7 @@ public abstract class PlayerList { @@ -532,7 +532,7 @@ public abstract class PlayerList {
@ -288,10 +288,10 @@ index f5829ae484d93b547a5437b85a9621346384a11b..83701fbfaa56a232593ee8f11a3afb89
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 8782c443d6288cb1cadc181e7f2923cbcd3061d2..1bb5867bb2e99be1696c89ec47cd3aa0d655fdfb 100644 index a1982464d25dae5638f02375422a44204b47b9b3..b25c632c8b797c30e90beaf3cedbc13acc2103bb 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -913,6 +913,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -912,6 +912,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try { try {
tickConsumer.accept(entity); tickConsumer.accept(entity);
} catch (Throwable throwable) { } catch (Throwable throwable) {
@ -300,7 +300,7 @@ index 8782c443d6288cb1cadc181e7f2923cbcd3061d2..1bb5867bb2e99be1696c89ec47cd3aa0
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable); MinecraftServer.LOGGER.error(msg, throwable);
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 3acef646275aa05100e13e149bc5ff6d1ccbbea8..45ecda3b67025881a145d40a5291c34e5a1f9590 100644 index 796aa86e12cf9062b3467a3678c895af5ad626fe..4891073602609fc2709715460e0675a7cc2a4cdd 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1176,6 +1176,7 @@ public class LevelChunk extends ChunkAccess { @@ -1176,6 +1176,7 @@ public class LevelChunk extends ChunkAccess {
@ -312,7 +312,7 @@ index 3acef646275aa05100e13e149bc5ff6d1ccbbea8..45ecda3b67025881a145d40a5291c34e
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index fdce27bbd60897e7584db627b5f9ff32c930cd78..fa9c17c49a17b8325a7510316de89e3ff3b6f1cf 100644 index 5030b865c84d84ed5be9f4987a7f0a829b8ea1e5..78e007b15699fc83a3fcc2e2767209387444f0e5 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -179,6 +179,36 @@ public class Main { @@ -179,6 +179,36 @@ public class Main {

Datei anzeigen

@ -31,10 +31,10 @@ delays anymore.
public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V public net.minecraft.server.level.ChunkMap addEntity(Lnet/minecraft/world/entity/Entity;)V
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3b7a82761682e29fb42f683b232c789c522b632e..cafc332e5828e53999210b06980c4bdb09d5cedb 100644 index 37e6b841b3c3d8720a1947065d4fada8c25ec2cf..2785619ed6d04e06a25bfbb2a7fbd99f81c1f858 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1000,6 +1000,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -996,6 +996,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return; return;
} }
// Paper end - ignore and warn about illegal addEntity calls instead of crashing server // Paper end - ignore and warn about illegal addEntity calls instead of crashing server
@ -43,7 +43,7 @@ index 3b7a82761682e29fb42f683b232c789c522b632e..cafc332e5828e53999210b06980c4bdb
EntityType<?> entitytypes = entity.getType(); EntityType<?> entitytypes = entity.getType();
int i = entitytypes.clientTrackingRange() * 16; int i = entitytypes.clientTrackingRange() * 16;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index cb137fe3aaa14fd4862baa0444bc62d818cf9509..32b41d88af7565665a19663227475d984cbfd7b2 100644 index 3221fad96b077a31f6e22277c08e8a20c65afd7a..6ca90fdf844ee6aa1957e17a75a4c070de0381f2 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -271,6 +271,7 @@ public class ServerPlayer extends Player { @@ -271,6 +271,7 @@ public class ServerPlayer extends Player {
@ -55,7 +55,7 @@ index cb137fe3aaa14fd4862baa0444bc62d818cf9509..32b41d88af7565665a19663227475d98
// CraftBukkit end // CraftBukkit end
public boolean isRealPlayer; // Paper public boolean isRealPlayer; // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 077ae008b817d38082a068f4bbd76181510403bf..ffdd5b7417bb748ee5e8ad4d126bf3489c5d32ed 100644 index 06232d823c099cb1d827491a5cccc435ecae8ffe..9ad0a672f3a14c1e36a9f2275fa3e8d2131d543f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -295,6 +295,12 @@ public abstract class PlayerList { @@ -295,6 +295,12 @@ public abstract class PlayerList {

Datei anzeigen

@ -10,7 +10,7 @@ Co-authored-by: Wyatt Childers <wchilders@nearce.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 85b0c15e8600b2b62db24c22dfab4680b08ca492..e0aed65461c75b28799a87a0ef266707ce63ca17 100644 index 9ad0a672f3a14c1e36a9f2275fa3e8d2131d543f..82101511142c266c4374da10ab2561f4412300db 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -194,7 +194,7 @@ public abstract class PlayerList { @@ -194,7 +194,7 @@ public abstract class PlayerList {
@ -87,10 +87,10 @@ index 85b0c15e8600b2b62db24c22dfab4680b08ca492..e0aed65461c75b28799a87a0ef266707
} }
// Paper end - Entity#getEntitySpawnReason // Paper end - Entity#getEntitySpawnReason
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1e9819ea185b98a73992bde8c40150d4747ed436..2374500ba0518415b7c680bc2ac05222761493ba 100644 index bf8ea784c032469c1b88a0cdc954d6e2de5bb3ec..7746d7fb7177885d97d95f065782ee23aa1dfe56 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2337,27 +2337,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2336,27 +2336,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
// CraftBukkit end // CraftBukkit end

Datei anzeigen

@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed. same item twice because the source was destroyed.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 85371495d4f11e339a0211145c0303976515ef8f..14be6f3a591fded3ff8690241061a7a07d2a89a6 100644 index 7746d7fb7177885d97d95f065782ee23aa1dfe56..5698555fe780ba96f190f67aa116940efdd993e2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2467,11 +2467,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2466,11 +2466,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} else { } else {
// CraftBukkit start - Capture drops for death event // CraftBukkit start - Capture drops for death event
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) { if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
@ -34,7 +34,7 @@ index 85371495d4f11e339a0211145c0303976515ef8f..14be6f3a591fded3ff8690241061a7a0
entityitem.setDefaultPickUpDelay(); entityitem.setDefaultPickUpDelay();
// CraftBukkit start // CraftBukkit start
@@ -3271,6 +3272,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3270,6 +3271,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Nullable @Nullable
public Entity teleportTo(ServerLevel worldserver, Vec3 location) { public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
// CraftBukkit end // CraftBukkit end
@ -47,7 +47,7 @@ index 85371495d4f11e339a0211145c0303976515ef8f..14be6f3a591fded3ff8690241061a7a0
if (this.level() instanceof ServerLevel && !this.isRemoved()) { if (this.level() instanceof ServerLevel && !this.isRemoved()) {
this.level().getProfiler().push("changeDimension"); this.level().getProfiler().push("changeDimension");
// CraftBukkit start // CraftBukkit start
@@ -3297,6 +3304,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3296,6 +3303,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// CraftBukkit end // CraftBukkit end
this.level().getProfiler().popPush("reloading"); this.level().getProfiler().popPush("reloading");
@ -59,7 +59,7 @@ index 85371495d4f11e339a0211145c0303976515ef8f..14be6f3a591fded3ff8690241061a7a0
Entity entity = this.getType().create(worldserver); Entity entity = this.getType().create(worldserver);
if (entity != null) { if (entity != null) {
@@ -3314,10 +3326,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3313,10 +3325,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// CraftBukkit start - Forward the CraftEntity to the new entity // CraftBukkit start - Forward the CraftEntity to the new entity
this.getBukkitEntity().setHandle(entity); this.getBukkitEntity().setHandle(entity);
entity.bukkitEntity = this.getBukkitEntity(); entity.bukkitEntity = this.getBukkitEntity();
@ -70,7 +70,7 @@ index 85371495d4f11e339a0211145c0303976515ef8f..14be6f3a591fded3ff8690241061a7a0
// CraftBukkit end // CraftBukkit end
} }
@@ -3436,7 +3444,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3435,7 +3443,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
public boolean canChangeDimensions() { public boolean canChangeDimensions() {
@ -80,7 +80,7 @@ index 85371495d4f11e339a0211145c0303976515ef8f..14be6f3a591fded3ff8690241061a7a0
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index da68b02c6c66a205254d755e4ab5f379cbe9a666..28ea07dc7796f7fc12d5f11aed22eb35ee60c9b5 100644 index 4948a7d78ef1e96f325368430068576ce0b990ad..d4bf6c909939c23586acaa7338141aac880217b0 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1705,9 +1705,9 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1705,9 +1705,9 @@ public abstract class LivingEntity extends Entity implements Attackable {

Datei anzeigen

@ -495,7 +495,7 @@ index 52eb3176437113f9a0ff85d10ce5c2415e1b5570..b54ddd0ba0b001fbcb1838a838ca4890
} }
} }
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 93d3f29b08c79479c27d3f39e6c799c705e69902..38650109c1d2683a27da5788dc6013d8d0db26ad 100644 index c66fc75fb88c4f0a4273d69009a4e6defb0b29e9..b99dbe3878df8f67a6920195088c00a01289a79f 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -75,13 +75,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -75,13 +75,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@ -525,7 +525,7 @@ index 93d3f29b08c79479c27d3f39e6c799c705e69902..38650109c1d2683a27da5788dc6013d8
protected void channelRead0(ChannelHandlerContext channelhandlercontext, Packet<?> packet) { protected void channelRead0(ChannelHandlerContext channelhandlercontext, Packet<?> packet) {
diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java diff --git a/src/main/java/net/minecraft/network/PacketEncoder.java b/src/main/java/net/minecraft/network/PacketEncoder.java
index 2907536f8f9b4b9dccb96f8b4f19d75fa3c5b864..b5b228e67284baad3639b283595427a819bb1a44 100644 index 61f05f34ca33837c643f2915e753ec3935a38314..85b8be8ffac0fb40e9cae0528271ed41473811c8 100644
--- a/src/main/java/net/minecraft/network/PacketEncoder.java --- a/src/main/java/net/minecraft/network/PacketEncoder.java
+++ b/src/main/java/net/minecraft/network/PacketEncoder.java +++ b/src/main/java/net/minecraft/network/PacketEncoder.java
@@ -47,7 +47,14 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> { @@ -47,7 +47,14 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
@ -545,7 +545,7 @@ index 2907536f8f9b4b9dccb96f8b4f19d75fa3c5b864..b5b228e67284baad3639b283595427a8
throw new SkipPacketException(var13); throw new SkipPacketException(var13);
} }
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index c9cca6ba3500791485bf19155156c38c24f1c761..684e9e9d78f0d410176fa8b9c9d0fbfda6a156dc 100644 index 0e2978b6e4f03932c4ebdf1309d20454b9130132..ab84c4b098184370c8b63cbae687116a7b077cf5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -194,6 +194,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -194,6 +194,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -556,30 +556,6 @@ index c9cca6ba3500791485bf19155156c38c24f1c761..684e9e9d78f0d410176fa8b9c9d0fbfd
// Paper start - initialize global and world-defaults configuration // Paper start - initialize global and world-defaults configuration
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess()); this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 46101e6bef0f81968cb194303e19e437a3417733..1bab7d1c76a087e5bd22d7adbee5e065e8e2241e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -222,7 +222,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper
public static Throwable getAddToWorldStackTrace(Entity entity) {
- return new Throwable(entity + " Added to world at " + new java.util.Date());
+ final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date());
+ io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr);
+ return thr;
}
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
@@ -1492,7 +1494,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity.isRemoved()) {
// Paper start
if (DEBUG_ENTITIES) {
- new Throwable("Tried to add entity " + entity + " but it was marked as removed already").printStackTrace(); // CraftBukkit
+ io.papermc.paper.util.TraceUtil.dumpTraceForThread("Tried to add entity " + entity + " but it was marked as removed already"); // CraftBukkit
getAddToWorldStackTrace(entity).printStackTrace();
}
// Paper end
diff --git a/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
index d130f843975236018df4fa2ccc3ca6aaca7a06b8..76f31845fe50200d09e5ab6a6c08da00444414ad 100644 index d130f843975236018df4fa2ccc3ca6aaca7a06b8..76f31845fe50200d09e5ab6a6c08da00444414ad 100644
--- a/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java
@ -633,7 +609,7 @@ index 14bd0b94ece3f826f822b4900c7250ebdc27d937..59eb65e207ff0206b0dfad6f2dcffe78
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 45ecda3b67025881a145d40a5291c34e5a1f9590..27e8ee4507460b1cc72de692b41562b9f4f13929 100644 index 4891073602609fc2709715460e0675a7cc2a4cdd..d85ed706703e50f76df8db414827ccd41a5985d9 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -599,7 +599,7 @@ public class LevelChunk extends ChunkAccess { @@ -599,7 +599,7 @@ public class LevelChunk extends ChunkAccess {

Datei anzeigen

@ -25,10 +25,10 @@ index b1fdfae75aeea78ca77987e40242bf498447bc08..cf81854facadaf3c1f860bcaaf69db46
if (!this.level.isInWorldBounds(blockposition)) { if (!this.level.isInWorldBounds(blockposition)) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 1bb5867bb2e99be1696c89ec47cd3aa0d655fdfb..6941a14b37d4637a1414c4a6c9380a5d7a72711d 100644 index b25c632c8b797c30e90beaf3cedbc13acc2103bb..286890f5a42cd2cade28ab0c5b9cdd48b6a33d37 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -521,6 +521,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -520,6 +520,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) { public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
// CraftBukkit start - tree generation // CraftBukkit start - tree generation
if (this.captureTreeGeneration) { if (this.captureTreeGeneration) {
@ -106,7 +106,7 @@ index b3732a6246a2b011e36c5c35fa2ac7749e75db16..e4a3c937950b26e81b89d6ddcf3d6c27
world.playSound((Player) null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F); world.playSound((Player) null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F);
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 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 2c7d025b2af3a66772c3f394620483045fb80242..0475c153ac1ba73a56bae35820d1d2a31e771865 100644 index 7e4264f87a0f81db71d49dbede32a1bad87f7ca8..2d1062d2b0412180cc08765ecf9b0a071983c06a 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -182,7 +182,7 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -182,7 +182,7 @@ public abstract class BlockBehaviour implements FeatureElement {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Use distance map to optimise entity tracker
Use the distance map to find candidate players for tracking. Use the distance map to find candidate players for tracking.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 2db3236bc9d676c86b0af38bd4bfaf9d3332c250..07abd089e5091d292d4542bbe0fbb416a111bf8e 100644 index 2785619ed6d04e06a25bfbb2a7fbd99f81c1f858..bdda124f6cc89b8a7ed198fdf095aee5f3f24ce3 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -146,6 +146,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -146,6 +146,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -124,7 +124,7 @@ index 2db3236bc9d676c86b0af38bd4bfaf9d3332c250..07abd089e5091d292d4542bbe0fbb416
} }
// Paper start // Paper start
@@ -929,17 +1009,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -925,17 +1005,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
public void move(ServerPlayer player) { public void move(ServerPlayer player) {
@ -143,7 +143,7 @@ index 2db3236bc9d676c86b0af38bd4bfaf9d3332c250..07abd089e5091d292d4542bbe0fbb416
SectionPos sectionposition = player.getLastSectionPos(); SectionPos sectionposition = player.getLastSectionPos();
SectionPos sectionposition1 = SectionPos.of((EntityAccess) player); SectionPos sectionposition1 = SectionPos.of((EntityAccess) player);
@@ -1016,7 +1086,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1012,7 +1082,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
@ -152,7 +152,7 @@ index 2db3236bc9d676c86b0af38bd4bfaf9d3332c250..07abd089e5091d292d4542bbe0fbb416
if (entity instanceof ServerPlayer) { if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity; ServerPlayer entityplayer = (ServerPlayer) entity;
@@ -1060,9 +1130,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1056,9 +1126,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = null; // Paper - We're no longer tracked entity.tracker = null; // Paper - We're no longer tracked
} }
@ -192,7 +192,7 @@ index 2db3236bc9d676c86b0af38bd4bfaf9d3332c250..07abd089e5091d292d4542bbe0fbb416
List<ServerPlayer> list = Lists.newArrayList(); List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players(); List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator(); ObjectIterator objectiterator = this.entityMap.values().iterator();
@@ -1212,6 +1310,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1208,6 +1306,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lastSectionPos = SectionPos.of((EntityAccess) entity); this.lastSectionPos = SectionPos.of((EntityAccess) entity);
} }
@ -236,7 +236,7 @@ index 2db3236bc9d676c86b0af38bd4bfaf9d3332c250..07abd089e5091d292d4542bbe0fbb416
return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false; return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false;
} }
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 88632cf1baea828f6442ac37b8c13a3356445fe3..a1d990aa2e79af9e1ff078892cdb38a382f21da7 100644 index 5698555fe780ba96f190f67aa116940efdd993e2..02d7282e5d5e1c1334fed55a86bc4c9837e9341f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -56,6 +56,7 @@ import net.minecraft.network.syncher.EntityDataSerializers; @@ -56,6 +56,7 @@ import net.minecraft.network.syncher.EntityDataSerializers;
@ -247,7 +247,7 @@ index 88632cf1baea828f6442ac37b8c13a3356445fe3..a1d990aa2e79af9e1ff078892cdb38a3
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
@@ -488,6 +489,38 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -487,6 +488,38 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public boolean updatingSectionStatus = false; public boolean updatingSectionStatus = false;
// Paper end // Paper end

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Ensure Entity position and AABB are never invalid
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2b3b6b7cda65434c903582a99e42e71762daccf8..44ff63b89056eb2f944ead71d74d17d1fd5351b2 100644 index 02d7282e5d5e1c1334fed55a86bc4c9837e9341f..8209a273b0f4b07195fa20c5be6c80384eb582c2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -728,8 +728,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -727,8 +727,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
public void setPos(double x, double y, double z) { public void setPos(double x, double y, double z) {
@ -20,7 +20,7 @@ index 2b3b6b7cda65434c903582a99e42e71762daccf8..44ff63b89056eb2f944ead71d74d17d1
} }
protected AABB makeBoundingBox() { protected AABB makeBoundingBox() {
@@ -4241,7 +4241,29 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4240,7 +4240,29 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale); return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
} }
@ -50,7 +50,7 @@ index 2b3b6b7cda65434c903582a99e42e71762daccf8..44ff63b89056eb2f944ead71d74d17d1
// Paper start - rewrite chunk system // Paper start - rewrite chunk system
if (this.updatingSectionStatus) { if (this.updatingSectionStatus) {
LOGGER.error("Refusing to update position for entity " + this + " to position " + new Vec3(x, y, z) + " since it is processing a section status update", new Throwable()); LOGGER.error("Refusing to update position for entity " + this + " to position " + new Vec3(x, y, z) + " since it is processing a section status update", new Throwable());
@@ -4265,6 +4287,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4264,6 +4286,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.levelCallback.onMove(); this.levelCallback.onMove();
} }

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] incremental chunk and player saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6ffb81f09e7422adeb29f0651a9d3b6e7f6860d3..2ebfa60a2b0175a9cb107648652c9150d9f93732 100644 index 229f5c1d651d903e1c641e67661004a4ee010417..08e3f07c4547f8fa7b571ecef7436ba1fbee578a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -901,7 +901,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -901,7 +901,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -56,7 +56,7 @@ index 6ffb81f09e7422adeb29f0651a9d3b6e7f6860d3..2ebfa60a2b0175a9cb107648652c9150
// Paper start - move executeAll() into full server tick timing // Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 974b4970be214ca36a801d39932abcc751e540a5..c7a8078e4bb4df5ad2345125d49c6b40611da539 100644 index 56fe3f4edd15239533a1ae9287e86528b3296bdc..a35957eef3f6ab2dcfebc01eaa9bea1b249599e2 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -450,6 +450,15 @@ public class ServerChunkCache extends ChunkSource { @@ -450,6 +450,15 @@ public class ServerChunkCache extends ChunkSource {
@ -76,10 +76,10 @@ index 974b4970be214ca36a801d39932abcc751e540a5..c7a8078e4bb4df5ad2345125d49c6b40
public void close() throws IOException { public void close() throws IOException {
// CraftBukkit start // CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 51379dc93af2eaa3294179debe067d62627b60e1..b0d5eca878e391fa29dd81947b6e79b113122ab3 100644 index a3669b4d5833003c98bcf62da89560452565a451..28128e432c3d0a312f9a757c54c9a707c51bc210 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1306,6 +1306,37 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1301,6 +1301,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos); return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
} }
@ -118,7 +118,7 @@ index 51379dc93af2eaa3294179debe067d62627b60e1..b0d5eca878e391fa29dd81947b6e79b1
// Paper start - rewrite chunk system - add close param // Paper start - rewrite chunk system - add close param
this.save(progressListener, flush, savingDisabled, false); this.save(progressListener, flush, savingDisabled, false);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index da445644b1f2de9f80e8198a8ed150103627187b..6d083f49ba3700ff3bc222e594b6d9545dd4edba 100644 index d3193e318f233bdfd9788e96011ab6d07354c0e2..ddded87b125c6584f4112fa6b55f3e03c634dfe3 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -190,6 +190,7 @@ import org.bukkit.inventory.MainHand; @@ -190,6 +190,7 @@ import org.bukkit.inventory.MainHand;
@ -130,7 +130,7 @@ index da445644b1f2de9f80e8198a8ed150103627187b..6d083f49ba3700ff3bc222e594b6d954
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
private static final int FLY_STAT_RECORDING_SPEED = 25; private static final int FLY_STAT_RECORDING_SPEED = 25;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 5c5d1e387ea00a17db99b3ef1f68eede01b09789..38ff44cdcf9720d916de228f02d579b5e37bc45a 100644 index 82101511142c266c4374da10ab2561f4412300db..1a7ff072171f7b8f983f813a090fee07a45f62ef 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -552,6 +552,7 @@ public abstract class PlayerList { @@ -552,6 +552,7 @@ public abstract class PlayerList {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 135dc03be7e81306dacaf7d10359ea10529d8303..4b7c3b71a15a3e223ea1e8366be31130bc5e5504 100644 index 28128e432c3d0a312f9a757c54c9a707c51bc210..27977796215779f6412e618c4b439d756a5bef98 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2034,9 +2034,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2014,9 +2014,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void setDefaultSpawnPos(BlockPos pos, float angle) { public void setDefaultSpawnPos(BlockPos pos, float angle) {
// Paper start - Configurable Keep Spawn Loaded range per world // Paper start - Configurable Keep Spawn Loaded range per world
BlockPos prevSpawn = this.getSharedSpawnPos(); BlockPos prevSpawn = this.getSharedSpawnPos();

Datei anzeigen

@ -9,7 +9,7 @@ as this is how Vanilla teleports entities.
Cancel any pending motion when teleported. Cancel any pending motion when teleported.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 101871664077577c5cbe159d5d1a31b0e30ec68d..0a2f711b7feba83b39c042df71b3dc6546601ed8 100644 index be5ae2ddc28edb2b0316d57bfa49c37fb502220a..3f43a90d6aa774bf6def858289606054236e229b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -657,7 +657,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -657,7 +657,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -31,7 +31,7 @@ index 101871664077577c5cbe159d5d1a31b0e30ec68d..0a2f711b7feba83b39c042df71b3dc65
} }
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e1ce61dcadf325633ed809eef92fc07bac4cbf05..e8ef81a7224ed134e3042534c96f13a0d4bf7035 100644 index 8209a273b0f4b07195fa20c5be6c80384eb582c2..fa40fff50ae07a0a040b50c0c04d4d7a2bf46b8d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -162,6 +162,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -162,6 +162,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@ -42,7 +42,7 @@ index e1ce61dcadf325633ed809eef92fc07bac4cbf05..e8ef81a7224ed134e3042534c96f13a0
static boolean isLevelAtLeast(CompoundTag tag, int level) { static boolean isLevelAtLeast(CompoundTag tag, int level) {
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
} }
@@ -1871,6 +1872,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1870,6 +1871,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
public void moveTo(double x, double y, double z, float yaw, float pitch) { public void moveTo(double x, double y, double z, float yaw, float pitch) {
@ -57,7 +57,7 @@ index e1ce61dcadf325633ed809eef92fc07bac4cbf05..e8ef81a7224ed134e3042534c96f13a0
this.setYRot(yaw); this.setYRot(yaw);
this.setXRot(pitch); this.setXRot(pitch);
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 0578ac12d92f9af0b0113587db9351b4a41bedd5..76486e2045739d3e8706194f4d71f5108d055780 100644 index f4e1a540243d1f699dd2ef407707af27517d9360..b90c1e4e03f85dbfa7134bffd8da59330cea1e28 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -169,6 +169,7 @@ public abstract class BaseSpawner { @@ -169,6 +169,7 @@ public abstract class BaseSpawner {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 307f2d8adae141cfb7f5fd3c08e68863ce3ed75f..897c149c38fc17a7af4d922ff6eecc08d43cd366 100644 index 27977796215779f6412e618c4b439d756a5bef98..1db813af2f6e1bce404fc24f31a18de3e0717247 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1532,6 +1532,12 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1512,6 +1512,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false; return false;
} else { } else {
@ -23,7 +23,7 @@ index 307f2d8adae141cfb7f5fd3c08e68863ce3ed75f..897c149c38fc17a7af4d922ff6eecc08
if (spawnReason != null && !CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { if (spawnReason != null && !CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
return false; return false;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index a9ede0d719e866655ab48fb5d0263c7d1bdcff60..49d29e4b3395d2ebea1ed13338f26c7cfbaa5f72 100644 index 5b951937511126d58665c5e2baf18186a7a8d325..60c18af9253607bc51ecb9d23c23e652a9ba36e9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -431,10 +431,12 @@ public class ServerPlayerGameMode { @@ -431,10 +431,12 @@ public class ServerPlayerGameMode {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 961cd2886ca2fdafdeb958ee714e3d436bd7f330..b56ee5c771d1316e05eba29a8e9d3e9d4468b83c 100644 index fa40fff50ae07a0a040b50c0c04d4d7a2bf46b8d..f2a1719f18913dca5a6985537c5181af6c8e2bfe 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4508,4 +4508,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4507,4 +4507,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
void accept(Entity entity, double x, double y, double z); void accept(Entity entity, double x, double y, double z);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b56ee5c771d1316e05eba29a8e9d3e9d4468b83c..f8acf77f5157cdee4e40d03b571a830aa726ba70 100644 index f2a1719f18913dca5a6985537c5181af6c8e2bfe..79a1f55dcdb3186b4ab3e628ac652abf362a8cab 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4513,5 +4513,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4512,5 +4512,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public static int nextEntityId() { public static int nextEntityId() {
return ENTITY_COUNTER.incrementAndGet(); return ENTITY_COUNTER.incrementAndGet();
} }

Datei anzeigen

@ -10,10 +10,10 @@ In general, look at making this logic more robust (i.e properly handling
cases where a captured entry is overriden) - but for now this will do. cases where a captured entry is overriden) - but for now this will do.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index a7fca2d662e013809fef088213cf0275b596629d..0aebd1d8555b6aab24c11cd543e24eb1a6d6cb6f 100644 index 286890f5a42cd2cade28ab0c5b9cdd48b6a33d37..4de1b09f4aa43ebefbae20014ec044bdd95bd191 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -160,7 +160,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -159,7 +159,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean captureBlockStates = false; public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false; public boolean captureTreeGeneration = false;
public Map<BlockPos, org.bukkit.craftbukkit.block.CraftBlockState> capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper public Map<BlockPos, org.bukkit.craftbukkit.block.CraftBlockState> capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index af49c7e0531ef73646d74c9770fea302a8b8fea3..1471bfcb0a7b193866cfa7ee0e14e7b044755e88 100644 index 79a1f55dcdb3186b4ab3e628ac652abf362a8cab..d5d006756270025e16c1ab75062ece9b8ae384b1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2064,6 +2064,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2063,6 +2063,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
public boolean isPushable() { public boolean isPushable() {
@ -44,7 +44,7 @@ index c9c7833755af3c7bef1d40f2ca425cbec59efa68..75cdddbfbbc4c0c521194dde27ba5f5d
} else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
return false; return false;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index a3fd295ce44bce34c7f0a364abc27b70e546a383..428a5e8c4a4fb9e00402dd6164cebeec008e192e 100644 index 87b010d5b0ce405e64092638108e4d64ad15339b..0568dd1a885f06f7fd85419a8ec7429c7fec8aba 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3426,7 +3426,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3426,7 +3426,7 @@ public abstract class LivingEntity extends Entity implements Attackable {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 6e1bfe5342e23a0dd97dfbc06a43bf77dfab23cc..4bf01aff2716a26e3db7d3778ef3f9e1e529dc74 100644 index 56aa8de4bdfbf7a26d9838b2a557458ce40b9d01..f6413041358cf52e51efeaac88d13030258fa678 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -258,6 +258,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -258,6 +258,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -19,7 +19,7 @@ index 6e1bfe5342e23a0dd97dfbc06a43bf77dfab23cc..4bf01aff2716a26e3db7d3778ef3f9e1
@@ -377,6 +378,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -377,6 +378,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// CraftBukkit start // CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - configurable tab spam limits
+ if (recipeSpamPackets.get() > 0) recipeSpamPackets.getAndDecrement(); // Paper - auto recipe limit + if (recipeSpamPackets.get() > 0) recipeSpamPackets.getAndDecrement(); // Paper - auto recipe limit
/* Use thread-safe field access instead /* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) { if (this.chatSpamTickCount > 0) {

Datei anzeigen

@ -28,10 +28,10 @@ index 05ac41e136da43284fb24a6b698ebd36318278fb..3c4ac79c094dc2fff7de94150a34b7bf
public Vec3 decode(long x, long y, long z) { public Vec3 decode(long x, long y, long z) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index dc957fce9f6b5709d6f74fa66a99235d8933d8cc..17152781725a6cf0e1ce5da8374fb3a74cb84351 100644 index d5d006756270025e16c1ab75062ece9b8ae384b1..c81f7a4637dd5c83c5527b1052fb58a6055e5b09 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4284,6 +4284,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4283,6 +4283,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return; return;
} }
// Paper end - rewrite chunk system // Paper end - rewrite chunk system

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Remove stale POIs
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 902f3a7ae5ba9c15b634bb2f214be7d85c6d5a00..7b76cba12680d7a8720c597b3a98b08ee5313f63 100644 index 1db813af2f6e1bce404fc24f31a18de3e0717247..a45b7a9c3e12236ba5103d4281c9b73997698a0d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2103,6 +2103,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2083,6 +2083,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
}); });
optional1.ifPresent((holder) -> { optional1.ifPresent((holder) -> {
this.getServer().execute(() -> { this.getServer().execute(() -> {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Collision option for requiring a player participant
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3a8572ded5c9bdf621a8c16123707da9ceb70d54..1249e086d022a68e1d27a7731c0aff92f1457e43 100644 index c81f7a4637dd5c83c5527b1052fb58a6055e5b09..df23dd16ecca29a569f89ddf7d755ab88557ab50 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1934,6 +1934,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1933,6 +1933,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public void push(Entity entity) { public void push(Entity entity) {
if (!this.isPassengerOfSameVehicle(entity)) { if (!this.isPassengerOfSameVehicle(entity)) {
if (!entity.noPhysics && !this.noPhysics) { if (!entity.noPhysics && !this.noPhysics) {
@ -17,7 +17,7 @@ index 3a8572ded5c9bdf621a8c16123707da9ceb70d54..1249e086d022a68e1d27a7731c0aff92
double d1 = entity.getZ() - this.getZ(); double d1 = entity.getZ() - this.getZ();
double d2 = Mth.absMax(d0, d1); double d2 = Mth.absMax(d0, d1);
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
index 82ffd50017dc234a9718db551fca0e73a6deded0..71361cc7339483936b18d2e0e938669bf08d68d2 100644 index be16ab6da56d2aa2a21ee378cfc44dbb14e108b3..9a6b6120c248a57d9dc86ca215146f6de980bd0d 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -792,6 +792,7 @@ public abstract class AbstractMinecart extends VehicleEntity { @@ -792,6 +792,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
@ -29,7 +29,7 @@ index 82ffd50017dc234a9718db551fca0e73a6deded0..71361cc7339483936b18d2e0e938669b
// CraftBukkit start // CraftBukkit start
VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity());
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
index 6b0ec9da5a368775924f5b97c74acc5bfd609fa1..8a1cd9227d6f889dd8036ec593ee48862966af75 100644 index 0178eb918179b12d7d8eb56cd72e5bfc34cfdbaf..1ced6d60a74fac028804b3c2d938e89af4706823 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java --- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
@@ -207,6 +207,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> { @@ -207,6 +207,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityMoveEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8d3b3524a939d483aa4d451a8ca0fed3a9c87d26..37a5775a96a894a5419f01886fba471f0c62aba0 100644 index 563dc53b10389f106f310d9c9ecfe33f7e701553..b0e0c955e9b5c92d4a8e8d55149d5e8123011420 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1584,6 +1584,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1584,6 +1584,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -17,19 +17,19 @@ index 8d3b3524a939d483aa4d451a8ca0fed3a9c87d26..37a5775a96a894a5419f01886fba471f
this.profiler.push(() -> { this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location(); return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 7b76cba12680d7a8720c597b3a98b08ee5313f63..9f39445a78bfea25a12278b4410a44caf3cf929e 100644 index a45b7a9c3e12236ba5103d4281c9b73997698a0d..b7d227015abeaed324b6b28a7ff51f07c68e704c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable; public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid; public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper public boolean hasPhysicsEvent = true; // Paper
+ public boolean hasEntityMoveEvent = false; // Paper - Add EntityMoveEvent + public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
public static Throwable getAddToWorldStackTrace(Entity entity) {
final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date()); @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr); return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 7d72477cdeaa8238da1291c0a902d090463b95c8..1681b63e49cb4f84b1caf0e1b02db19ede08ba13 100644 index 0568dd1a885f06f7fd85419a8ec7429c7fec8aba..37c348d5b31f806b418a29dc4f8eb0fa1c7d1a4c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3361,6 +3361,20 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3361,6 +3361,20 @@ public abstract class LivingEntity extends Entity implements Attackable {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9f39445a78bfea25a12278b4410a44caf3cf929e..da32aad077fb36cc17f420cc445530eec173e110 100644 index b7d227015abeaed324b6b28a7ff51f07c68e704c..d6e8950af45578375b988158d98554c7d2f4f0a9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1677,6 +1677,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1657,6 +1657,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
this.getChunkSource().blockChanged(pos); this.getChunkSource().blockChanged(pos);
@ -16,7 +16,7 @@ index 9f39445a78bfea25a12278b4410a44caf3cf929e..da32aad077fb36cc17f420cc445530ee
VoxelShape voxelshape = oldState.getCollisionShape(this, pos); VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
VoxelShape voxelshape1 = newState.getCollisionShape(this, pos); VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
@@ -1718,6 +1719,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1698,6 +1699,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
} }

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Add a "should burn in sunlight" API for Phantoms and
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index 6be9e8d693bbb084791d7b30a1891ddb803d6b02..9af5a4b46dcec727c7c862332759ffbe3ebd87b5 100644 index 117d466e1b4f545f6fd5006c3822c5586db96032..40664cc7e3665432a2ab5e552802c3fc3edbdb22 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -98,9 +98,15 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -98,9 +98,15 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
@ -48,7 +48,7 @@ index 6be9e8d693bbb084791d7b30a1891ddb803d6b02..9af5a4b46dcec727c7c862332759ffbe
@Override @Override
public void setItemSlot(EquipmentSlot slot, ItemStack stack) { public void setItemSlot(EquipmentSlot slot, ItemStack stack) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java 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 a40852acf5d175cc3a06bc17fb021c76f0c11a28..bb52085d706293fa86df16a1b8e76d17a90ea9e9 100644 index ea980c2fdf01988ba25bffc7f8963d775101bee1..187037c43ebb5b245ffa4b50163d443490668744 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
@@ -145,7 +145,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -145,7 +145,7 @@ public class Phantom extends FlyingMob implements Enemy {
@ -78,11 +78,10 @@ index a40852acf5d175cc3a06bc17fb021c76f0c11a28..bb52085d706293fa86df16a1b8e76d17
// Paper end // Paper end
} }
@@ -258,6 +262,10 @@ public class Phantom extends FlyingMob implements Enemy { @@ -258,6 +262,9 @@ public class Phantom extends FlyingMob implements Enemy {
return spawningEntity; return spawningEntity;
} }
public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
+
+ private boolean shouldBurnInDay = true; + private boolean shouldBurnInDay = true;
+ public boolean shouldBurnInDay() { return shouldBurnInDay; } + public boolean shouldBurnInDay() { return shouldBurnInDay; }
+ public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } + public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; }

Datei anzeigen

@ -247,7 +247,7 @@ index 0000000000000000000000000000000000000000..513833c2ea23df5b079d157bc5cb89d5
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index bea88fee71f0233839ea240cb8fcfb70228e986e..7b996a1c24e66d87c95b9f075248eb1d72ad0476 100644 index 1cad3585ca122a465572b16d4ecbb7231e87c7de..b0a0909fa9501dfacfbe70dc4118062d1154bd15 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -385,6 +385,15 @@ public class Main { @@ -385,6 +385,15 @@ public class Main {
@ -267,7 +267,7 @@ index bea88fee71f0233839ea240cb8fcfb70228e986e..7b996a1c24e66d87c95b9f075248eb1d
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache); WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fbfe5d18a004225396f2d33084fb5073af2d9731..7bfd8307555a9447d4c546a8945341806041cc32 100644 index d99217292a094713287cd597c9d7c01f04b9c7c7..748a5d8add76d4533fae2647c6e2439f518ac211 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -586,11 +586,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -586,11 +586,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -298,10 +298,10 @@ index fbfe5d18a004225396f2d33084fb5073af2d9731..7bfd8307555a9447d4c546a894534180
if (dimensionKey == LevelStem.OVERWORLD) { if (dimensionKey == LevelStem.OVERWORLD) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 3588ad0b5e8510a00b1a65c73defec39ee7fb108..761d01c993b60a11c749e172c3ee3067c055b582 100644 index 4de1b09f4aa43ebefbae20014ec044bdd95bd191..a19d4d091c738daf80ed9b7c95d149c84180ba9e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -187,6 +187,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -186,6 +186,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
@ -318,7 +318,7 @@ index 3588ad0b5e8510a00b1a65c73defec39ee7fb108..761d01c993b60a11c749e172c3ee3067
return this.world; return this.world;
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index deed4d50e0e4d810647a0745ef328c20dfe51093..9fa07295bf73317a4c2bbbbaf1918393c891f09a 100644 index 8563383d45f89ee01dd5df13af5bd0cf1b3d7b01..9e30b47ece5549c30f487e5542ae65d5faaa8c39 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -60,6 +60,29 @@ public class RegionFileStorage implements AutoCloseable { @@ -60,6 +60,29 @@ public class RegionFileStorage implements AutoCloseable {
@ -352,7 +352,7 @@ index deed4d50e0e4d810647a0745ef328c20dfe51093..9fa07295bf73317a4c2bbbbaf1918393
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ())); return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 565beb65968b3f7e187f3e5b59aa08e9ac34f2a0..b28212bbf7678d73282d160bfeb0d246e93a8492 100644 index 05868e37b03ac912ac902b105f3956f9351b1209..08d43545262e2be74566c270f3dd2c600b773616 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1251,9 +1251,7 @@ public final class CraftServer implements Server { @@ -1251,9 +1251,7 @@ public final class CraftServer implements Server {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a3288d3cd160978e8bab4ca34d1fe6dbee042e28..b858ee2fc8c03c52a6b6d703b1f770b3c496b2a8 100644 index d6e8950af45578375b988158d98554c7d2f4f0a9..52fb8c8bb41b90c8c6f30551858fd496956cd41c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -672,8 +672,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -667,8 +667,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setClearWeatherTime(clearDuration); this.serverLevelData.setClearWeatherTime(clearDuration);
this.serverLevelData.setRainTime(rainDuration); this.serverLevelData.setRainTime(rainDuration);
this.serverLevelData.setThunderTime(rainDuration); this.serverLevelData.setThunderTime(rainDuration);
@ -19,7 +19,7 @@ index a3288d3cd160978e8bab4ca34d1fe6dbee042e28..b858ee2fc8c03c52a6b6d703b1f770b3
} }
@Override @Override
@@ -1109,8 +1109,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1104,8 +1104,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setThunderTime(j); this.serverLevelData.setThunderTime(j);
this.serverLevelData.setRainTime(k); this.serverLevelData.setRainTime(k);
this.serverLevelData.setClearWeatherTime(i); this.serverLevelData.setClearWeatherTime(i);
@ -30,7 +30,7 @@ index a3288d3cd160978e8bab4ca34d1fe6dbee042e28..b858ee2fc8c03c52a6b6d703b1f770b3
} }
this.oThunderLevel = this.thunderLevel; this.oThunderLevel = this.thunderLevel;
@@ -1177,14 +1177,14 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1172,14 +1172,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
@VisibleForTesting @VisibleForTesting
public void resetWeatherCycle() { public void resetWeatherCycle() {
// CraftBukkit start // CraftBukkit start
@ -95,7 +95,7 @@ index f5ac36fa54f3d3b39de103c95abb9ca3adfe8dda..59ba982dc96ce47e47399514e8f74d2b
if (weather.isCancelled()) { if (weather.isCancelled()) {
return; return;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 43d3c45cd7a178a4ca30e4c0c7fb1e7e21cd89f1..c0d02f7d714f7116b34b5a735b5520cf3a5a4587 100644 index d240d9f5b558146c2de293a258914fd543975ca2..4ade6ad05a864e8065eb37a707dfbec392abd096 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1243,7 +1243,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -1243,7 +1243,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

Datei anzeigen

@ -48,7 +48,7 @@ index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..ba12919c3f9aec34a9e64993b143ae92
public boolean shouldDisconnect() { public boolean shouldDisconnect() {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5e279fb7e3b902905532cb10dce4df336ee52e67..b72dc50201601203eabfc7866e5843c496b54de7 100644 index 748a5d8add76d4533fae2647c6e2439f518ac211..bd176eb76afec5873e6f903ef66b0e6df3e6a02f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2236,7 +2236,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2236,7 +2236,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -209,7 +209,7 @@ index 825b8f541fe3f5e4cb53f465232c19398b8e66ab..3049377685ee4fe75f0c4b68eab39a91
if (this.cserver.getServer().isRunning()) { if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dff0603ca577a04992ef2bff4b73ad87d66eee84..69f3278b55d6e3778aa9bad6be10870964db5bf9 100644 index f6fea364fb32a337c322d2514d2c2436cb4e01c5..0c9707f8484f67ef7e70e55cb53550240b32b713 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -342,7 +342,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -342,7 +342,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -260,7 +260,7 @@ index dff0603ca577a04992ef2bff4b73ad87d66eee84..69f3278b55d6e3778aa9bad6be108709
@@ -722,7 +722,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -722,7 +722,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
// CraftBukkit start // CraftBukkit start
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper - configurable tab spam limits
- server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper - server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause + server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
return; return;

Datei anzeigen

@ -11,10 +11,10 @@ Move the tick logic into the post tick, where portaling was
designed to happen in the first place. designed to happen in the first place.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b3f33d74bf86943dd7ce05ce44541ae3e6db2fef..72f50fe74695e32167d414c1c9ee38deb95afb79 100644 index df23dd16ecca29a569f89ddf7d755ab88557ab50..6c3cbfa88a0d8e48fadb85dd52d2678567243ee8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -492,6 +492,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -491,6 +491,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// Paper end // Paper end
// Paper start - optimise entity tracking // Paper start - optimise entity tracking
final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this); final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this);
@ -51,7 +51,7 @@ index b3f33d74bf86943dd7ce05ce44541ae3e6db2fef..72f50fe74695e32167d414c1c9ee38de
public boolean isLegacyTrackingEntity = false; public boolean isLegacyTrackingEntity = false;
@@ -2879,6 +2909,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2878,6 +2908,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
this.processPortalCooldown(); this.processPortalCooldown();

Datei anzeigen

@ -8,11 +8,11 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case). load in that case).
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b858ee2fc8c03c52a6b6d703b1f770b3c496b2a8..45d5e5bd1ed37c4a3a658b27dc8571344580b65b 100644 index 52fb8c8bb41b90c8c6f30551858fd496956cd41c..9eb5d6623c10ad88ca0deb7bd92a0cc085aa78b7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -229,7 +229,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -224,7 +224,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
- return this.chunkSource.getChunk(x, z, false); - return this.chunkSource.getChunk(x, z, false);
@ -21,10 +21,10 @@ index b858ee2fc8c03c52a6b6d703b1f770b3c496b2a8..45d5e5bd1ed37c4a3a658b27dc857134
@Override @Override
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 761d01c993b60a11c749e172c3ee3067c055b582..2069cad866a3fd2ed5512fa8fc6dc2ef8bc9758e 100644 index a19d4d091c738daf80ed9b7c95d149c84180ba9e..4b0bba18ba997f9dc3f0bd6e67af3538106891dc 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -204,6 +204,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -203,6 +203,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return (CraftServer) Bukkit.getServer(); return (CraftServer) Bukkit.getServer();
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Optimize indirect passenger iteration
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e6142fc4ac6fe6149f6094124223cdebd56e7b76..2b34c7bc49fff37b6e0a603b6670103fe959fe2a 100644 index 6c3cbfa88a0d8e48fadb85dd52d2678567243ee8..c24baad4eabcb538a3b30970364632a28a80e06b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3924,20 +3924,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3923,20 +3923,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
private Stream<Entity> getIndirectPassengersStream() { private Stream<Entity> getIndirectPassengersStream() {
@ -43,7 +43,7 @@ index e6142fc4ac6fe6149f6094124223cdebd56e7b76..2b34c7bc49fff37b6e0a603b6670103f
return () -> { return () -> {
return this.getIndirectPassengersStream().iterator(); return this.getIndirectPassengersStream().iterator();
}; };
@@ -3960,6 +3974,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3959,6 +3973,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
public boolean hasExactlyOnePlayerPassenger() { public boolean hasExactlyOnePlayerPassenger() {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add back EntityPortalExitEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 8b84de55028a9c4d65fe5ae99b808f0d84ce6799..019d3494bb4d01172b33cc9022a7db9e0f603f8d 100644 index c24baad4eabcb538a3b30970364632a28a80e06b..a151f56038ab605116bf576a24e7baf10cc414e8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3373,6 +3373,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3372,6 +3372,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} else { } else {
// CraftBukkit start // CraftBukkit start
worldserver = shapedetectorshape.world; worldserver = shapedetectorshape.world;
@ -37,7 +37,7 @@ index 8b84de55028a9c4d65fe5ae99b808f0d84ce6799..019d3494bb4d01172b33cc9022a7db9e
if (worldserver == this.level) { if (worldserver == this.level) {
// SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in // SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in
this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot); this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot);
@@ -3392,8 +3414,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3391,8 +3413,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (entity != null) { if (entity != null) {
entity.restoreFrom(this); entity.restoreFrom(this);

Datei anzeigen

@ -7,10 +7,10 @@ Subject: [PATCH] Add methods to find targets for lightning strikes
public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional; public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 45d5e5bd1ed37c4a3a658b27dc8571344580b65b..c8e8d8c8c49b28cbaed3072a211a79aacd5f0c34 100644 index 9eb5d6623c10ad88ca0deb7bd92a0cc085aa78b7..249e7cfbb877a0a625ccde306994442669e257e7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -998,6 +998,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -993,6 +993,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
protected BlockPos findLightningTargetAround(BlockPos pos) { protected BlockPos findLightningTargetAround(BlockPos pos) {
@ -22,7 +22,7 @@ index 45d5e5bd1ed37c4a3a658b27dc8571344580b65b..c8e8d8c8c49b28cbaed3072a211a79aa
BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos); BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos);
Optional<BlockPos> optional = this.findLightningRod(blockposition1); Optional<BlockPos> optional = this.findLightningRod(blockposition1);
@@ -1012,6 +1017,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1007,6 +1012,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!list.isEmpty()) { if (!list.isEmpty()) {
return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition(); return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition();
} else { } else {
@ -31,7 +31,7 @@ index 45d5e5bd1ed37c4a3a658b27dc8571344580b65b..c8e8d8c8c49b28cbaed3072a211a79aa
blockposition1 = blockposition1.above(2); blockposition1 = blockposition1.above(2);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index d6b402d0bae4d16932e059f1da59ac4523d974b8..ca0af0011159834919c8e071ceac051a0e600b84 100644 index dbd39858661773fcfb8e22fc984525b9de133c9f..9d80c0c312990a3eb6cc9819eb926157df98cc9c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -701,6 +701,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -701,6 +701,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {

Datei anzeigen

@ -7,10 +7,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 019d3494bb4d01172b33cc9022a7db9e0f603f8d..82db53692f3fc38625d63f9371f2d842159c454c 100644 index a151f56038ab605116bf576a24e7baf10cc414e8..42eb530571c9f7854888e7f3f6a63ef10dba1b4e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2159,6 +2159,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2158,6 +2158,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
} }
@ -47,7 +47,7 @@ index a6492b6a9f66d8bcda8928fadf0a5920ff7f0dab..71845027ba1b755ead76cf75d011547d
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 580b6c134743c35d9eb1d98a2d038d1c8f10054c..4a5af85ebb573950c0c65d3a5f25b586173d16dd 100644 index df57a3be211017e2ba7bd28571adaea59d0be969..fd1ec07ada04de98d0a4f1ca4c93ec53771f88d7 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -483,6 +483,29 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -483,6 +483,29 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -9,10 +9,10 @@ chunk through it. This should also be OK from a leak prevention/
state desync POV because the TE is getting unloaded anyways. state desync POV because the TE is getting unloaded anyways.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c8e8d8c8c49b28cbaed3072a211a79aacd5f0c34..6b4b505ae0c6f95309243aaa149967b2d728fa87 100644 index 249e7cfbb877a0a625ccde306994442669e257e7..2b4afc35c9e57977972fe0ddab0ae753f13d8828 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1578,9 +1578,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1558,9 +1558,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start // Spigot Start
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) { for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
if (tileentity instanceof net.minecraft.world.Container) { if (tileentity instanceof net.minecraft.world.Container) {
@ -28,7 +28,7 @@ index c8e8d8c8c49b28cbaed3072a211a79aacd5f0c34..6b4b505ae0c6f95309243aaa149967b2
} }
// Spigot End // Spigot End
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 36e01f491565e70601464d957143c21aba17dfa1..ca66a8ebb4ae2d3ee9cf88412bbb20d5f812d050 100644 index 09ee06b89f2bda0245c2858ffc19a5893494d24a..f01965be7ae893de26dbf0d57887cd66e71418f6 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1630,6 +1630,18 @@ public class ServerPlayer extends Player { @@ -1630,6 +1630,18 @@ public class ServerPlayer extends Player {
@ -51,7 +51,7 @@ index 36e01f491565e70601464d957143c21aba17dfa1..ca66a8ebb4ae2d3ee9cf88412bbb20d5
@Override @Override
public void doCloseContainer() { 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 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 e90bfeca52d74d147616773640517995d98e19bc..c21b6e9b013c31342e1a47500f5262ddfb7cd6d0 100644 index 09e1790f3370f723d8da83097bec433c68eec87d..b90db32be29b198376e696506e1c3ea4cd67c301 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -508,6 +508,11 @@ public abstract class Player extends LivingEntity { @@ -508,6 +508,11 @@ public abstract class Player extends LivingEntity {

Datei anzeigen

@ -10,10 +10,10 @@ chunks did get inlined, but the standard CPS.getChunkAt
method was not inlined. method was not inlined.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 2069cad866a3fd2ed5512fa8fc6dc2ef8bc9758e..7718db906ed1b97f1b55a891c2ea3b59ac1307fb 100644 index 4b0bba18ba997f9dc3f0bd6e67af3538106891dc..87edfd96ec2ae00971711b46304134b89e6572a0 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -458,6 +458,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -457,6 +457,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@Override @Override
public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline public final LevelChunk getChunk(int chunkX, int chunkZ) { // Paper - final to help inline

Datei anzeigen

@ -19,7 +19,7 @@ index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..46449728f69ee7d4f78470f8da23c055
private MinecraftTimings() {} private MinecraftTimings() {}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 970dafebf8143ab6de44bfffdeff2475685f99fa..0b0e415adafb5f614259291c1c501fa1b85ddb14 100644 index bd176eb76afec5873e6f903ef66b0e6df3e6a02f..ec48aea4e352e8ee3ad8cda8ce8ec33daf49dae8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1341,8 +1341,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1341,8 +1341,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -103,7 +103,7 @@ index 970dafebf8143ab6de44bfffdeff2475685f99fa..0b0e415adafb5f614259291c1c501fa1
} else { } else {
if (this.tickRateManager.isSprinting() || this.haveTime()) { if (this.tickRateManager.isSprinting() || this.haveTime()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 63fad53a9184d7ab97f143b7d85ae9ef2ca9f8bc..1483007b79e18107e41037c279e048f04f666d1d 100644 index a35957eef3f6ab2dcfebc01eaa9bea1b249599e2..32129fdd5b2542a0acb828fb843fa4e44533946c 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -566,6 +566,7 @@ public class ServerChunkCache extends ChunkSource { @@ -566,6 +566,7 @@ public class ServerChunkCache extends ChunkSource {
@ -123,7 +123,7 @@ index 63fad53a9184d7ab97f143b7d85ae9ef2ca9f8bc..1483007b79e18107e41037c279e048f0
} }
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 6b4b505ae0c6f95309243aaa149967b2d728fa87..2c2d731aaeb7a633ce647ba49a5f2962e01b4c8f 100644 index 2b4afc35c9e57977972fe0ddab0ae753f13d8828..0280f81406eb248d41673d2e3ae1a317357b32cd 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -216,6 +216,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -216,6 +216,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -134,7 +134,7 @@ index 6b4b505ae0c6f95309243aaa149967b2d728fa87..2c2d731aaeb7a633ce647ba49a5f2962
// CraftBukkit start // CraftBukkit start
public final LevelStorageSource.LevelStorageAccess convertable; public final LevelStorageSource.LevelStorageAccess convertable;
@@ -1210,6 +1211,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1205,6 +1206,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (fluid1.is(fluid)) { if (fluid1.is(fluid)) {
fluid1.tick(this, pos); fluid1.tick(this, pos);
} }
@ -142,7 +142,7 @@ index 6b4b505ae0c6f95309243aaa149967b2d728fa87..2c2d731aaeb7a633ce647ba49a5f2962
} }
@@ -1219,6 +1221,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1214,6 +1216,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (iblockdata.is(block)) { if (iblockdata.is(block)) {
iblockdata.tick(this, pos, this.random); iblockdata.tick(this, pos, this.random);
} }
@ -151,10 +151,10 @@ index 6b4b505ae0c6f95309243aaa149967b2d728fa87..2c2d731aaeb7a633ce647ba49a5f2962
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 7718db906ed1b97f1b55a891c2ea3b59ac1307fb..9489fa61ca43d5d0f1a3c6e23bf1f9c3a1795063 100644 index 87edfd96ec2ae00971711b46304134b89e6572a0..817e9df60e6524625780683b4260d4f8b62e00b3 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -927,6 +927,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -926,6 +926,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot end // Spigot end
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) { } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
tickingblockentity.tick(); tickingblockentity.tick();
@ -166,7 +166,7 @@ index 7718db906ed1b97f1b55a891c2ea3b59ac1307fb..9489fa61ca43d5d0f1a3c6e23bf1f9c3
} }
} }
this.blockEntityTickers.removeAll(toRemove); this.blockEntityTickers.removeAll(toRemove);
@@ -941,6 +946,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -940,6 +945,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public <T extends Entity> void guardEntityTick(Consumer<T> tickConsumer, T entity) { public <T extends Entity> void guardEntityTick(Consumer<T> tickConsumer, T entity) {
try { try {
tickConsumer.accept(entity); tickConsumer.accept(entity);

Datei anzeigen

@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap. better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 07abd089e5091d292d4542bbe0fbb416a111bf8e..534493aaddced9200e1618d5eabf2b176a1f35b6 100644 index bdda124f6cc89b8a7ed198fdf095aee5f3f24ce3..f761d600bb5d995a25ffbbe5469625508de1f8bc 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1301,7 +1301,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1297,7 +1297,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity; final Entity entity;
private final int range; private final int range;
SectionPos lastSectionPos; SectionPos lastSectionPos;

Datei anzeigen

@ -90,10 +90,10 @@ index 0000000000000000000000000000000000000000..7d93652c1abbb6aee6eb7c26cf35d4d0
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 2c2d731aaeb7a633ce647ba49a5f2962e01b4c8f..bff754626913969c6946757cee968c02281f59b3 100644 index 0280f81406eb248d41673d2e3ae1a317357b32cd..bc887fd2788f1c56ed3b8a10ad15cfc23f065138 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -860,6 +860,10 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -855,6 +855,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
entityplayer.stopSleepInBed(false, false); entityplayer.stopSleepInBed(false, false);
}); });
} }
@ -104,7 +104,7 @@ index 2c2d731aaeb7a633ce647ba49a5f2962e01b4c8f..bff754626913969c6946757cee968c02
public void tickChunk(LevelChunk chunk, int randomTickSpeed) { public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
ChunkPos chunkcoordintpair = chunk.getPos(); ChunkPos chunkcoordintpair = chunk.getPos();
@@ -869,8 +873,10 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -864,8 +868,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
ProfilerFiller gameprofilerfiller = this.getProfiler(); ProfilerFiller gameprofilerfiller = this.getProfiler();
gameprofilerfiller.push("thunder"); gameprofilerfiller.push("thunder");
@ -116,7 +116,7 @@ index 2c2d731aaeb7a633ce647ba49a5f2962e01b4c8f..bff754626913969c6946757cee968c02
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
@@ -902,7 +908,10 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -897,7 +903,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper if (!this.paperConfig().environment.disableIceAndSnow) { // Paper
for (int l = 0; l < randomTickSpeed; ++l) { for (int l = 0; l < randomTickSpeed; ++l) {
if (this.random.nextInt(48) == 0) { if (this.random.nextInt(48) == 0) {
@ -128,7 +128,7 @@ index 2c2d731aaeb7a633ce647ba49a5f2962e01b4c8f..bff754626913969c6946757cee968c02
} }
} }
} // Paper } // Paper
@@ -910,36 +919,37 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -905,36 +914,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.popPush("tickBlocks"); gameprofilerfiller.popPush("tickBlocks");
timings.chunkTicksBlocks.startTiming(); // Paper timings.chunkTicksBlocks.startTiming(); // Paper
if (randomTickSpeed > 0) { if (randomTickSpeed > 0) {
@ -190,7 +190,7 @@ index 2c2d731aaeb7a633ce647ba49a5f2962e01b4c8f..bff754626913969c6946757cee968c02
timings.chunkTicksBlocks.stopTiming(); // Paper timings.chunkTicksBlocks.stopTiming(); // Paper
gameprofilerfiller.pop(); gameprofilerfiller.pop();
@@ -947,17 +957,25 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -942,17 +952,25 @@ public class ServerLevel extends Level implements WorldGenLevel {
@VisibleForTesting @VisibleForTesting
public void tickPrecipitation(BlockPos pos) { public void tickPrecipitation(BlockPos pos) {
@ -220,7 +220,7 @@ index 2c2d731aaeb7a633ce647ba49a5f2962e01b4c8f..bff754626913969c6946757cee968c02
if (i > 0 && biomebase.shouldSnow(this, blockposition1)) { if (i > 0 && biomebase.shouldSnow(this, blockposition1)) {
BlockState iblockdata = this.getBlockState(blockposition1); BlockState iblockdata = this.getBlockState(blockposition1);
@@ -975,12 +993,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -970,12 +988,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
} }
@ -311,7 +311,7 @@ index f0f764f36fb92c64ab2dc8a0a50c3f48321c3c9a..311625277a26c9c187025a1036978229
public void getAll(IntConsumer action) { public void getAll(IntConsumer action) {
for(int i = 0; i < this.size; ++i) { for(int i = 0; i < this.size; ++i) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
index 722e323d2ae3f4ac8aa3197fed79f7d926d5ccfa..f8c1dfc8e121a406955348a1ec00c264d73e73f7 100644 index 6bbcdd34fb89ea5774e825de8f9a588552716fc2..2a3f1d14a4b24a3219d191b4f2e97ed7b061e006 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
@@ -87,7 +87,7 @@ public class Turtle extends Animal { @@ -87,7 +87,7 @@ public class Turtle extends Animal {
@ -324,10 +324,10 @@ index 722e323d2ae3f4ac8aa3197fed79f7d926d5ccfa..f8c1dfc8e121a406955348a1ec00c264
public BlockPos getHomePos() { public BlockPos getHomePos() {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 9489fa61ca43d5d0f1a3c6e23bf1f9c3a1795063..fb86d06e8e420410e3cf9d918abd3369fa2f033e 100644 index 817e9df60e6524625780683b4260d4f8b62e00b3..bf2376c484bfec238c4fe2a1298cf3f8ff824b38 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1398,10 +1398,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1397,10 +1397,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract RecipeManager getRecipeManager(); public abstract RecipeManager getRecipeManager();
public BlockPos getBlockRandomPos(int x, int y, int z, int l) { public BlockPos getBlockRandomPos(int x, int y, int z, int l) {
@ -348,7 +348,7 @@ index 9489fa61ca43d5d0f1a3c6e23bf1f9c3a1795063..fb86d06e8e420410e3cf9d918abd3369
public boolean noSave() { public boolean noSave() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index b8fee4f8a0cfe32b9ef7f3f3cf818cbaec0d3fca..12edaf88cca54540c617239ac31b2263dfa0ecd7 100644 index 3efd0a462306fbd02a506a3f952d609645b1f874..4a781375a4a18011259edcb4e24550748a05dfa0 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -25,6 +25,7 @@ public class LevelChunkSection { @@ -25,6 +25,7 @@ public class LevelChunkSection {

Datei anzeigen

@ -7,7 +7,7 @@ Subject: [PATCH] Detail more information in watchdog dumps
- Dump player name, player uuid, position, and world for packet handling - Dump player name, player uuid, position, and world for packet handling
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 872ad936dd86b510f24676fe565eb547b35bcb5e..20cd5c5d197d92f7127aadad063c4aabfc4863a6 100644 index 28adc086f7bc1b6f403e65c5db51b267c90f2f37..5d73043dc9847ae195cef804fa0b0f4bf6db06f2 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -521,7 +521,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -521,7 +521,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@ -76,10 +76,10 @@ index 7de24c39b460e43d27839b3821e67213508ece81..7297bca9224c12d7ace0e1967340d994
}); });
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD; throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index dcbcb1df7a8c1e5f78b8f202e4207afc1054a414..ec2a8656148b7ccdf519ce6d13494d22dadc0789 100644 index bc887fd2788f1c56ed3b8a10ad15cfc23f065138..28e6af9e265c1d8328e8e80ec7e519e244caf297 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1244,7 +1244,26 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1239,7 +1239,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
@ -106,7 +106,7 @@ index dcbcb1df7a8c1e5f78b8f202e4207afc1054a414..ec2a8656148b7ccdf519ce6d13494d22
++TimingHistory.entityTicks; // Paper - timings ++TimingHistory.entityTicks; // Paper - timings
// Spigot start // Spigot start
co.aikar.timings.Timing timer; // Paper co.aikar.timings.Timing timer; // Paper
@@ -1284,7 +1303,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1279,7 +1298,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1); this.tickPassenger(entity, entity1);
} }
// } finally { timer.stopTiming(); } // Paper - timings - move up // } finally { timer.stopTiming(); } // Paper - timings - move up
@ -122,10 +122,10 @@ index dcbcb1df7a8c1e5f78b8f202e4207afc1054a414..ec2a8656148b7ccdf519ce6d13494d22
private void tickPassenger(Entity vehicle, Entity passenger) { private void tickPassenger(Entity vehicle, Entity passenger) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b9d70f71b2b03190e329d1f843b54ac4c73543ab..054825419c98351af15309ecfa007fd7e1ee1bea 100644 index 42eb530571c9f7854888e7f3f6a63ef10dba1b4e..5682ec12d9a54979022978421dd8875a90ed9682 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1031,7 +1031,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1030,7 +1030,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.onGround; return this.onGround;
} }
@ -168,7 +168,7 @@ index b9d70f71b2b03190e329d1f843b54ac4c73543ab..054825419c98351af15309ecfa007fd7
if (this.noPhysics) { if (this.noPhysics) {
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
} else { } else {
@@ -1201,6 +1236,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1200,6 +1235,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.level().getProfiler().pop(); this.level().getProfiler().pop();
} }
} }
@ -182,7 +182,7 @@ index b9d70f71b2b03190e329d1f843b54ac4c73543ab..054825419c98351af15309ecfa007fd7
} }
private boolean isStateClimbable(BlockState state) { private boolean isStateClimbable(BlockState state) {
@@ -4270,7 +4312,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4269,7 +4311,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
public void setDeltaMovement(Vec3 velocity) { public void setDeltaMovement(Vec3 velocity) {
@ -192,7 +192,7 @@ index b9d70f71b2b03190e329d1f843b54ac4c73543ab..054825419c98351af15309ecfa007fd7
} }
public void addDeltaMovement(Vec3 velocity) { public void addDeltaMovement(Vec3 velocity) {
@@ -4373,7 +4417,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4372,7 +4416,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
// Paper end - Fix MC-4 // Paper end - Fix MC-4
if (this.position.x != x || this.position.y != y || this.position.z != z) { if (this.position.x != x || this.position.y != y || this.position.z != z) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b4711272fb36b631d4426ee5b5e29fb6f11e3d1d..15224b31e926ab16b1ef8f2ebdca4dba20637789 100644 index 28e6af9e265c1d8328e8e80ec7e519e244caf297..4f48e7ee15f381e0bcf71fc4c7d37daf2dd4f7fd 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2696,6 +2696,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2676,6 +2676,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end // Spigot end
// Spigot Start // Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message

Datei anzeigen

@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw.
This issue only applies to players. This issue only applies to players.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 873ae06dc0b5de6cc69e2e8a24a882ca90ee8663..cee005823020adaef519267630030e8d31b5b994 100644 index 5682ec12d9a54979022978421dd8875a90ed9682..a6fc204fce8f44d772ff0f438c6d62850b0e224f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1918,6 +1918,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1917,6 +1917,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F); this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
this.yRotO = this.getYRot(); this.yRotO = this.getYRot();
this.xRotO = this.getXRot(); this.xRotO = this.getXRot();
@ -19,7 +19,7 @@ index 873ae06dc0b5de6cc69e2e8a24a882ca90ee8663..cee005823020adaef519267630030e8d
} }
public void absMoveTo(double x, double y, double z) { public void absMoveTo(double x, double y, double z) {
@@ -1956,6 +1957,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1955,6 +1956,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.setXRot(pitch); this.setXRot(pitch);
this.setOldPosAndRot(); this.setOldPosAndRot();
this.reapplyPosition(); this.reapplyPosition();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cee005823020adaef519267630030e8d31b5b994..3086ded2c65b2d623a50401fb0a1612d073da450 100644 index a6fc204fce8f44d772ff0f438c6d62850b0e224f..78034cef7c7555eb4f772a618662a8ef9d0b7083 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -794,7 +794,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -793,7 +793,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// CraftBukkit start // CraftBukkit start
public void postTick() { public void postTick() {
// No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle

Datei anzeigen

@ -2214,10 +2214,10 @@ index 1f14b904807d4b593b608c8dc7a97bd8c320eceb..0da976438be3de7b82e8b1e3ce06d01c
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
} }
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 71ea121661874c11147bea0f9a4a147583f312fc..b6146726e767fa0401da3d7f5bbbf95b7c7a17d9 100644 index 78034cef7c7555eb4f772a618662a8ef9d0b7083..515c948cce0066cfd6e292afd65ceefc320ed553 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1217,9 +1217,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1216,9 +1216,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
float f = this.getBlockSpeedFactor(); float f = this.getBlockSpeedFactor();
this.setDeltaMovement(this.getDeltaMovement().multiply((double) f, 1.0D, (double) f)); this.setDeltaMovement(this.getDeltaMovement().multiply((double) f, 1.0D, (double) f));
@ -2265,7 +2265,7 @@ index 71ea121661874c11147bea0f9a4a147583f312fc..b6146726e767fa0401da3d7f5bbbf95b
if (this.remainingFireTicks <= 0) { if (this.remainingFireTicks <= 0) {
this.setRemainingFireTicks(-this.getFireImmuneTicks()); this.setRemainingFireTicks(-this.getFireImmuneTicks());
} }
@@ -1399,32 +1434,82 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1398,32 +1433,82 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
private Vec3 collide(Vec3 movement) { private Vec3 collide(Vec3 movement) {
@ -2364,7 +2364,7 @@ index 71ea121661874c11147bea0f9a4a147583f312fc..b6146726e767fa0401da3d7f5bbbf95b
} }
public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List<VoxelShape> collisions) { public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List<VoxelShape> collisions) {
@@ -2629,11 +2714,70 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2628,11 +2713,70 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
float f = this.dimensions.width * 0.8F; float f = this.dimensions.width * 0.8F;
AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f); AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f);
@ -2440,7 +2440,7 @@ index 71ea121661874c11147bea0f9a4a147583f312fc..b6146726e767fa0401da3d7f5bbbf95b
} }
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java 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 e29d1801f15c4c5680b683783e97a7aae3da753e..1e42372f038757b48990643aa2f118be415e0463 100644 index 5bda9612cbc7c233ad0195cb4e943de063130d00..81b54fd9f867666d688068d39344c7e19ed639c3 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -353,7 +353,7 @@ public class ArmorStand extends LivingEntity { @@ -353,7 +353,7 @@ public class ArmorStand extends LivingEntity {
@ -2600,10 +2600,10 @@ index a25497eec004add7408a63b1a0f09e3fa443b324..9f892de55ab03367daed4c30cc44c9dd
// Paper start // Paper start
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 2d2ef8455ea650baa1db74135c9321d97d10d12e..b023626467fc1f507d979653098bf30b18bd47c3 100644 index 38ad089c87bcc3f81998142e49edae4f4fad8ba9..8c363306b5dac302ab3c26a245aa4a768b304ed4 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -300,6 +300,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -299,6 +299,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
@ -2613,11 +2613,11 @@ index 2d2ef8455ea650baa1db74135c9321d97d10d12e..b023626467fc1f507d979653098bf30b
+ // Paper end - optimise collisions + // Paper end - optimise collisions
} }
// Paper start // Paper start - Cancel hit for vanished players
@@ -341,6 +345,370 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -340,6 +344,370 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return true; return true;
} }
// Paper end // Paper end - Cancel hit for vanished players
+ // Paper start - optimise collisions + // Paper start - optimise collisions
+ public final int minSection; + public final int minSection;
+ public final int maxSection; + public final int maxSection;
@ -2985,7 +2985,7 @@ index 2d2ef8455ea650baa1db74135c9321d97d10d12e..b023626467fc1f507d979653098bf30b
@Override @Override
public boolean isClientSide() { public boolean isClientSide() {
return this.isClientSide; return this.isClientSide;
@@ -961,7 +1329,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -960,7 +1328,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@Override @Override
public boolean noCollision(@Nullable Entity entity, AABB box) { public boolean noCollision(@Nullable Entity entity, AABB box) {
if (entity instanceof net.minecraft.world.entity.decoration.ArmorStand && !entity.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return false; if (entity instanceof net.minecraft.world.entity.decoration.ArmorStand && !entity.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return false;
@ -3018,7 +3018,7 @@ index af62781cc96354c87aa63d4f03f9e25b81959081..6c4fd56956982eee743b4dea4e8b9258
public boolean propagatesSkylightDown(BlockState state, BlockGetter world, BlockPos pos) { public boolean propagatesSkylightDown(BlockState state, BlockGetter world, BlockPos pos) {
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 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 10e8532ed21895f98808c86fa2ae5a2e41d3965f..5b5a472e446e21f46e5f92c3e1fd79498a1aa4a6 100644 index d1d00b9a078ee1f5a6c5dd51c2f0409d12c85c26..100c2629f2746fc00435f60998dba70135637ef7 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -882,6 +882,10 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -882,6 +882,10 @@ public abstract class BlockBehaviour implements FeatureElement {
@ -3030,7 +3030,7 @@ index 10e8532ed21895f98808c86fa2ae5a2e41d3965f..5b5a472e446e21f46e5f92c3e1fd7949
+ this.id2 = it.unimi.dsi.fastutil.HashCommon.murmurHash3(it.unimi.dsi.fastutil.HashCommon.murmurHash3(ID_GENERATOR.getAndIncrement() + RANDOM_OFFSET) + RANDOM_OFFSET); + this.id2 = it.unimi.dsi.fastutil.HashCommon.murmurHash3(it.unimi.dsi.fastutil.HashCommon.murmurHash3(ID_GENERATOR.getAndIncrement() + RANDOM_OFFSET) + RANDOM_OFFSET);
+ // Paper end - optimise collisions + // Paper end - optimise collisions
} }
// Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time // Paper start - Perf: impl cached craft block data, lazy load to fix issue with loading at the wrong time
private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData;
@@ -930,6 +934,52 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -930,6 +934,52 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.conditionallyFullOpaque; return this.conditionallyFullOpaque;

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Forward CraftEntity in teleport command
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 5be92231bf62285f29dcf32b2ef65baaf5755804..a5820d750e88918ef819be0d0896e31b628ab302 100644 index 515c948cce0066cfd6e292afd65ceefc320ed553..11e57b335150fcf9030e23a060f2608d97e09eb1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3531,6 +3531,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3530,6 +3530,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
public void restoreFrom(Entity original) { public void restoreFrom(Entity original) {
@ -22,7 +22,7 @@ index 5be92231bf62285f29dcf32b2ef65baaf5755804..a5820d750e88918ef819be0d0896e31b
CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag()); CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag());
nbttagcompound.remove("Dimension"); nbttagcompound.remove("Dimension");
@@ -3621,10 +3628,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3620,10 +3627,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
} }
// CraftBukkit end // CraftBukkit end

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Freeze Tick Lock API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f3cb6eac54b245ff6cbe3a1659ac9b7a1b0856a0..276c7dd6af228f404cec7aeb58dad10f2a23a18b 100644 index 11e57b335150fcf9030e23a060f2608d97e09eb1..811479660f7e6148b5448d3342a862aff36ec673 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -409,6 +409,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -408,6 +408,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
private org.bukkit.util.Vector origin; private org.bukkit.util.Vector origin;
@javax.annotation.Nullable @javax.annotation.Nullable
private UUID originWorld; private UUID originWorld;
@ -16,7 +16,7 @@ index f3cb6eac54b245ff6cbe3a1659ac9b7a1b0856a0..276c7dd6af228f404cec7aeb58dad10f
public void setOrigin(@javax.annotation.Nonnull Location location) { public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector(); this.origin = location.toVector();
@@ -840,7 +841,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -839,7 +840,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.setRemainingFireTicks(this.remainingFireTicks - 1); this.setRemainingFireTicks(this.remainingFireTicks - 1);
} }
@ -25,7 +25,7 @@ index f3cb6eac54b245ff6cbe3a1659ac9b7a1b0856a0..276c7dd6af228f404cec7aeb58dad10f
this.setTicksFrozen(0); this.setTicksFrozen(0);
this.level().levelEvent((Player) null, 1009, this.blockPosition, 1); this.level().levelEvent((Player) null, 1009, this.blockPosition, 1);
} }
@@ -2454,6 +2455,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2453,6 +2454,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (fromNetherPortal) { if (fromNetherPortal) {
nbttagcompound.putBoolean("Paper.FromNetherPortal", true); nbttagcompound.putBoolean("Paper.FromNetherPortal", true);
} }
@ -35,7 +35,7 @@ index f3cb6eac54b245ff6cbe3a1659ac9b7a1b0856a0..276c7dd6af228f404cec7aeb58dad10f
// Paper end // Paper end
return nbttagcompound; return nbttagcompound;
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -2598,6 +2602,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2597,6 +2601,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (spawnReason == null) { if (spawnReason == null) {
spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT;
} }
@ -46,7 +46,7 @@ index f3cb6eac54b245ff6cbe3a1659ac9b7a1b0856a0..276c7dd6af228f404cec7aeb58dad10f
} catch (Throwable throwable) { } catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 95442c5e5abfd916a1b0add6381a8f57b36125e7..13b4a2eae01ee51546e6e5e3c4093e5389971d7d 100644 index abfb7dbd03f79bad00a3b713717987e12743c6f0..3de76ca462d65e18a5d60dab367e09b48bc5d5a7 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3452,7 +3452,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3452,7 +3452,7 @@ public abstract class LivingEntity extends Entity implements Attackable {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity
Bad plugins doing this would cause some obvious problems... Bad plugins doing this would cause some obvious problems...
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e61cb14e9451b242c8324d81b462e80832ef73aa..837c5be7ba4caf8ad36262b15b8f5b644fb861db 100644 index 811479660f7e6148b5448d3342a862aff36ec673..f5cd50592244394c4186380a372a34733aa04c49 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2847,7 +2847,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2846,7 +2846,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
public boolean startRiding(Entity entity, boolean force) { public boolean startRiding(Entity entity, boolean force) {

Datei anzeigen

@ -23,10 +23,10 @@ index ff99336e0b8131ae161cfa5c4fc83c6905e3dbc8..5e5a018433414af76eaa1e781f61612d
} }
}); });
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 15224b31e926ab16b1ef8f2ebdca4dba20637789..cb2f5d727971c809bcb3eea0db04de4fa91459fb 100644 index 4f48e7ee15f381e0bcf71fc4c7d37daf2dd4f7fd..6b798d81eeb226ce078dc867277ba80cb22c9d7d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2605,6 +2605,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2585,6 +2585,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
public void onTickingStart(Entity entity) { public void onTickingStart(Entity entity) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent entity loading causing async lookups
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 837c5be7ba4caf8ad36262b15b8f5b644fb861db..2804758ce72c943fa47c1ead685032c9501a0ea9 100644 index f5cd50592244394c4186380a372a34733aa04c49..125699e0d9c4e239e32a86376a059b28c2982713 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -803,6 +803,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -802,6 +802,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public void baseTick() { public void baseTick() {
this.level().getProfiler().push("entityBaseTick"); this.level().getProfiler().push("entityBaseTick");

Datei anzeigen

@ -2008,18 +2008,18 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index cd20322f88c2952b451b226c4c5c3f41879d0305..092be422770ceb11446b99f6e2d746d1c9ce4f88 100644 index 6b798d81eeb226ce078dc867277ba80cb22c9d7d..5c9083246fb7f49b9091ba7467d55b6dc7cd18f1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -223,6 +223,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -223,6 +223,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final UUID uuid; public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper public boolean hasPhysicsEvent = true; // Paper
public boolean hasEntityMoveEvent = false; // Paper - Add EntityMoveEvent public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
+ private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current) + private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current)
public static Throwable getAddToWorldStackTrace(Entity entity) {
final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date()); @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr); return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately
@@ -2594,6 +2595,13 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2574,6 +2575,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
return crashreportsystemdetails; return crashreportsystemdetails;
} }
@ -2034,10 +2034,10 @@ index cd20322f88c2952b451b226c4c5c3f41879d0305..092be422770ceb11446b99f6e2d746d1
EntityCallbacks() {} EntityCallbacks() {}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 0c2654986b9a5c7f210ba387851997ecec1ebb00..a03dedf6fb845e9435b5171046bb6cd5dda94b71 100644 index 8c363306b5dac302ab3c26a245aa4a768b304ed4..8ad909802a107ff670e839915071a7d116099e1c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1885,4 +1885,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1884,4 +1884,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
} }
// Paper end - respect global sound events gamerule // Paper end - respect global sound events gamerule

Datei anzeigen

@ -7,10 +7,10 @@ The previous solution caused a bunch of bandaid fixes inorder to resolve edge ca
Just simply prevent them from being added to the world instead. Just simply prevent them from being added to the world instead.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 17f753ac54e73f3644d71c3ef5cbdfb850f5766c..1089c0ad619784d25b1384db2f09eebb53fa4536 100644 index 5c9083246fb7f49b9091ba7467d55b6dc7cd18f1..b82dc3d8558d18692769f7b9ee835a4eb4dd8253 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1587,6 +1587,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1567,6 +1567,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false; return false;
} else { } else {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add various missing EntityDropItemEvent calls
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2804758ce72c943fa47c1ead685032c9501a0ea9..071fc07228253d55edaf17950db80bb25001f7f8 100644 index 125699e0d9c4e239e32a86376a059b28c2982713..b9a1a7edb9f9aea0fa53cc3edfbc4522949f4093 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2699,6 +2699,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -2698,6 +2698,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe
entityitem.setDefaultPickUpDelay(); entityitem.setDefaultPickUpDelay();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityPortalReadyEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 071fc07228253d55edaf17950db80bb25001f7f8..0d427f0a70c8d85762fededfe920418d66636ebb 100644 index b9a1a7edb9f9aea0fa53cc3edfbc4522949f4093..fc0f58560a53a783b9fabceee227bed3908bae89 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3099,6 +3099,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3098,6 +3098,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit
this.level().getProfiler().push("portal"); this.level().getProfiler().push("portal");
this.portalTime = i; this.portalTime = i;
@ -22,7 +22,7 @@ index 071fc07228253d55edaf17950db80bb25001f7f8..0d427f0a70c8d85762fededfe920418d
this.setPortalCooldown(); this.setPortalCooldown();
// CraftBukkit start // CraftBukkit start
if (this instanceof ServerPlayer) { if (this instanceof ServerPlayer) {
@@ -3106,6 +3113,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3105,6 +3112,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} else { } else {
this.changeDimension(worldserver1); this.changeDimension(worldserver1);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Warn on plugins accessing faraway chunks
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index a03dedf6fb845e9435b5171046bb6cd5dda94b71..2b0ee0cbc6d204de31027aef9621ac6c026cb22f 100644 index 8ad909802a107ff670e839915071a7d116099e1c..6a8e9a81b700caf87046580cc019efb2dbd07188 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -813,7 +813,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -812,7 +812,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
private static boolean isInWorldBoundsHorizontal(BlockPos pos) { private static boolean isInWorldBoundsHorizontal(BlockPos pos) {
@ -18,7 +18,7 @@ index a03dedf6fb845e9435b5171046bb6cd5dda94b71..2b0ee0cbc6d204de31027aef9621ac6c
private static boolean isOutsideSpawnableHeight(int y) { private static boolean isOutsideSpawnableHeight(int y) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 19f91e08664c996b540447a46cc79e89c8e55023..cd2b1a0441d478f50a4d45159e506628dafaa9fc 100644 index bbcd28de0c05d56d7ed973c0e3ee455e976cdd18..9196e803b2cde66e288cb443639ad8750fef722c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -312,9 +312,24 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -312,9 +312,24 @@ public class CraftWorld extends CraftRegionAccessor implements World {

Datei anzeigen

@ -113,10 +113,10 @@ index 6cd6d69a20e95e344fc18ab67dc300824537a59b..2e2a7c2cf3081187da817479a9da3eb1
} }
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index b303603178a9de5f14bede9e601f80cfb44ecc91..bf78917f1e356dc3b7d7bcedffab282978a35917 100644 index f761d600bb5d995a25ffbbe5469625508de1f8bc..7fa3066575fd8e762dcf5de59a333e15044226e8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -898,7 +898,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -894,7 +894,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
// Paper end - Cache chunk status on disk // Paper end - Cache chunk status on disk
@ -126,10 +126,10 @@ index b303603178a9de5f14bede9e601f80cfb44ecc91..bf78917f1e356dc3b7d7bcedffab2829
return this.anyPlayerCloseEnoughForSpawning(pos, false); return this.anyPlayerCloseEnoughForSpawning(pos, false);
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 43d14fac84b932c0a5a94dd6b01c22c1a289b8c2..f594998de4ff40b56d039bc48721f6b53f0a1ec0 100644 index b82dc3d8558d18692769f7b9ee835a4eb4dd8253..bd37a2cb4c700566c72ada303138482f90d10742 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1032,7 +1032,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1027,7 +1027,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} else { } else {
AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D); AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D);
List<LivingEntity> list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> { List<LivingEntity> list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> {
@ -139,7 +139,7 @@ index 43d14fac84b932c0a5a94dd6b01c22c1a289b8c2..f594998de4ff40b56d039bc48721f6b5
if (!list.isEmpty()) { if (!list.isEmpty()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index aad7e1d9e17a0daa8697c13d1ef8cf7331cdf001..142094dcdfd9ba1c4cb77107d17f4c6b28888e7e 100644 index 1f5d86e6411fffddf70308f3fd3cb25275db1710..7a46b820c4f9354d2d07e9721bac25df3f043aa5 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -468,14 +468,14 @@ public class ServerPlayer extends Player { @@ -468,14 +468,14 @@ public class ServerPlayer extends Player {
@ -160,7 +160,7 @@ index aad7e1d9e17a0daa8697c13d1ef8cf7331cdf001..142094dcdfd9ba1c4cb77107d17f4c6b
while (!world.noCollision(this, this.getBoundingBox(), true) && this.getY() < (double) (world.getMaxBuildHeight() - 1)) { // Paper - make sure this loads chunks, we default to NOT loading now while (!world.noCollision(this, this.getBoundingBox(), true) && this.getY() < (double) (world.getMaxBuildHeight() - 1)) { // Paper - make sure this loads chunks, we default to NOT loading now
this.setPos(this.getX(), this.getY() + 1.0D, this.getZ()); this.setPos(this.getX(), this.getY() + 1.0D, this.getZ());
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index aad371a281486631151388ee2348ffaa2a465bc5..8b339ad425d4021b859126d763adf393cb0e86c5 100644 index fc19c68c19d443be654a5600f633d3a77f7069c1..9503511b28888e98ed65befdb95d03685ae9e5e1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -92,7 +92,7 @@ public class ServerPlayerGameMode { @@ -92,7 +92,7 @@ public class ServerPlayerGameMode {
@ -173,7 +173,7 @@ index aad371a281486631151388ee2348ffaa2a465bc5..8b339ad425d4021b859126d763adf393
this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit
this.level.updateSleepingPlayerList(); this.level.updateSleepingPlayerList();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b1f13c4d8de125a56b76bc85ccced039ac3c4785..b8213713b54e0bfaa0ddca41ec76f6840c0e1d20 100644 index e1498e3c81fc3ed9e871fea3db5cfcccf45cac04..9822d70191512b263435a3761c683b6be4c7acf1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -711,8 +711,10 @@ public abstract class PlayerList { @@ -711,8 +711,10 @@ public abstract class PlayerList {
@ -452,7 +452,7 @@ index 333cc37e4f3ca3ea95191dcaafda6be59ef79b96..91071fa934222c9246547c788e3e6cb1
return; return;
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index 0813e7510c43ed6916e83635f2be6d39ce2feb5b..137ee0271f1d7adbf3c463b96e9c4627fd5ca74b 100644 index c7ba7ac1a3869e4db1ef6b0350b3cab7f31a94c4..d7beeac4a8e4a16221809663a5aa03389a759742 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -675,13 +675,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -675,13 +675,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Remove unnecessary onTrackingStart during navigation warning
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4ffb462f051744d5f7f7b4cf0c49f5d1533d1d53..9eacc0c96d96f026dcc75479606567a47c7bb008 100644 index bd37a2cb4c700566c72ada303138482f90d10742..ec27d7e7248d8bf9e81db8a22923ff3af49324bb 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2641,7 +2641,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2621,7 +2621,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Mob) { if (entity instanceof Mob) {
Mob entityinsentient = (Mob) entity; Mob entityinsentient = (Mob) entity;
@ -17,7 +17,7 @@ index 4ffb462f051744d5f7f7b4cf0c49f5d1533d1d53..9eacc0c96d96f026dcc75479606567a4
String s = "onTrackingStart called during navigation iteration"; String s = "onTrackingStart called during navigation iteration";
Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration")); Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration"));
@@ -2727,7 +2727,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2707,7 +2707,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Mob) { if (entity instanceof Mob) {
Mob entityinsentient = (Mob) entity; Mob entityinsentient = (Mob) entity;

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Fix EntityCombustEvent cancellation cant fully prevent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0d427f0a70c8d85762fededfe920418d66636ebb..0c1cb3d5892b81b9f8a1894e429bc237c877298d 100644 index fc0f58560a53a783b9fabceee227bed3908bae89..aa634b67ee3a0c473f5e6f6cb6adb0306350ce1c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3378,6 +3378,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3377,6 +3377,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
pluginManager.callEvent(entityCombustEvent); pluginManager.callEvent(entityCombustEvent);
if (!entityCombustEvent.isCancelled()) { if (!entityCombustEvent.isCancelled()) {
this.setSecondsOnFire(entityCombustEvent.getDuration(), false); this.setSecondsOnFire(entityCombustEvent.getDuration(), false);
@ -21,7 +21,7 @@ index 0d427f0a70c8d85762fededfe920418d66636ebb..0c1cb3d5892b81b9f8a1894e429bc237
// CraftBukkit end // CraftBukkit end
} }
diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
index 450f87ea7f4c5ef3b26a3c75bc7c8bd08a982075..cd076da69e89d843d06ab5be854e8dce122ecb1d 100644 index 118403953629b405b9db78de1bf684b31289c499..e9ec8a8969651ea6760bf01c622c66efa7f6e7e5 100644
--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java --- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
@@ -134,6 +134,10 @@ public abstract class BaseFireBlock extends Block { @@ -134,6 +134,10 @@ public abstract class BaseFireBlock extends Block {

Datei anzeigen

@ -7,10 +7,10 @@ Makes certain entities check all players when searching for a player
instead of just checking players in their world. instead of just checking players in their world.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9eacc0c96d96f026dcc75479606567a47c7bb008..8c919616acbe571710bd8bb39eef4355b6d3d2b3 100644 index ec27d7e7248d8bf9e81db8a22923ff3af49324bb..3c1a3a757cec89058ae9300be6902d3fe9342d25 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2764,4 +2764,12 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2744,4 +2744,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::move); entity.updateDynamicGameEventListener(DynamicGameEventListener::move);
} }
} }
@ -24,7 +24,7 @@ index 9eacc0c96d96f026dcc75479606567a47c7bb008..8c919616acbe571710bd8bb39eef4355
+ // Paper end - check global player list where appropriate + // Paper end - check global player list where appropriate
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index a027d4b0769b7ee549dc25aac4a232fb1943e443..c726af466c1156a3b2c1ee18d1ac1b4613ee2431 100644 index 7e0882411d7be80a432c05f2e1a8a192c36ccf63..7ca74c68ee81a46b5c71a454c754fd4e6ffae4bb 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3678,7 +3678,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3678,7 +3678,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -66,7 +66,7 @@ index 9f892de55ab03367daed4c30cc44c9dd8adc29ed..a3d15f30eaab29d85cb6b3d693df9980
+ // Paper end - check global player list where appropriate + // Paper end - check global player list where appropriate
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
index ee11a52e82091911aa3a196bcc1f7ab829626cef..f35939f3ef42591cfa8ed7de7599695b9d9d0067 100644 index e143f42e71ac774d49b75e6d85591aa1189ee210..c27b97e9f097c824de7c785b4cc9e0a503259b08 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
@@ -100,6 +100,13 @@ public class SculkShriekerBlockEntity extends BlockEntity implements GameEventLi @@ -100,6 +100,13 @@ public class SculkShriekerBlockEntity extends BlockEntity implements GameEventLi

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Player Entity Tracking Events
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index bf78917f1e356dc3b7d7bcedffab282978a35917..6420a6c16a8c3f0f45649834fe40e1939d1fead7 100644 index 7fa3066575fd8e762dcf5de59a333e15044226e8..6ccd2a5a334c846850a9d064210f2d7f1d311470 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1409,7 +1409,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1405,7 +1405,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end // CraftBukkit end
if (flag) { if (flag) {
if (this.seenBy.add(player.connection)) { if (this.seenBy.add(player.connection)) {
@ -21,10 +21,10 @@ index bf78917f1e356dc3b7d7bcedffab282978a35917..6420a6c16a8c3f0f45649834fe40e193
} else if (this.seenBy.remove(player.connection)) { } else if (this.seenBy.remove(player.connection)) {
this.serverEntity.removePairing(player); this.serverEntity.removePairing(player);
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 98f7248920a25930ac813e22bbd816294f06d057..6e1c088a234ff4c93ea790c46f1e1f015fc24bec 100644 index aa634b67ee3a0c473f5e6f6cb6adb0306350ce1c..df3bdb116ead1596c6f93d6e9eb45711fb9b5eb5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4105,7 +4105,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4104,7 +4104,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public void startSeenByPlayer(ServerPlayer player) {} public void startSeenByPlayer(ServerPlayer player) {}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Improve PortalEvents
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6e1c088a234ff4c93ea790c46f1e1f015fc24bec..805f438e4b7a03393424c2ba11bf1f7fc4822f52 100644 index df3bdb116ead1596c6f93d6e9eb45711fb9b5eb5..4c8369e968df8b2a809f9c6c2db6cc185104a385 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3763,7 +3763,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3762,7 +3762,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
Location enter = bukkitEntity.getLocation(); Location enter = bukkitEntity.getLocation();
Location exit = CraftLocation.toBukkit(exitPosition, exitWorldServer.getWorld()); Location exit = CraftLocation.toBukkit(exitPosition, exitWorldServer.getWorld());

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Expose pre-collision moving velocity to
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 30e831bc4409260047016279aa5f36d2ad2934b4..b295895b2b1f8b3fbf7d97712e14b1447350a0ff 100644 index 4c8369e968df8b2a809f9c6c2db6cc185104a385..cd28a4ca35d6fe29c51f19be6cc43795c91c0454 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1162,7 +1162,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1161,7 +1161,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
if (!bl.getType().isAir()) { if (!bl.getType().isAir()) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Update the flag when a captured block state is outdated
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 2b0ee0cbc6d204de31027aef9621ac6c026cb22f..6f828ff4c54c2ddd4cc03c0e368afda2521e24dd 100644 index 6a8e9a81b700caf87046580cc019efb2dbd07188..2afa2d7b5978cc8474228ff45b66d0d3fac7728a 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -923,6 +923,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -922,6 +922,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags); blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
this.capturedBlockStates.put(pos.immutable(), blockstate); this.capturedBlockStates.put(pos.immutable(), blockstate);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent GameEvents being fired from unloaded chunks
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 8c919616acbe571710bd8bb39eef4355b6d3d2b3..df40ffecfa6d34aa3cdffbbec03e049a271364ab 100644 index 3c1a3a757cec89058ae9300be6902d3fe9342d25..e8dc785913f5fd1238a73c2384d2abef0e9d2e4b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1724,6 +1724,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1704,6 +1704,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override @Override
public void gameEvent(GameEvent event, Vec3 emitterPos, GameEvent.Context emitter) { public void gameEvent(GameEvent event, Vec3 emitterPos, GameEvent.Context emitter) {

Datei anzeigen

@ -14,10 +14,10 @@ clearing the owner.
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b295895b2b1f8b3fbf7d97712e14b1447350a0ff..5c21f26109910c0783afd32953a035144d19ec94 100644 index cd28a4ca35d6fe29c51f19be6cc43795c91c0454..b8205779022e56a0af10b02b52be77e035da1a6b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -386,6 +386,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -385,6 +385,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public boolean inWorld = false; public boolean inWorld = false;
public boolean generation; public boolean generation;
public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir() public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()

Datei anzeigen

@ -9,7 +9,7 @@ Fix several issues when a player interact with a block:
* poi can desync when the BlockPhysicsEvent is cancelled * poi can desync when the BlockPhysicsEvent is cancelled
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index daf093518f1daf598c858cfaf48357255a1fb0cf..c06e4b0683f0f125b79a4afce7daf909530d7bbf 100644 index 1ac739c92031e80c35e1af4417e6358346079580..8c54b92b65b3d379e14a11370b09d45351ab22e1 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java --- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -130,7 +130,7 @@ public class BlockItem extends Item { @@ -130,7 +130,7 @@ public class BlockItem extends Item {
@ -22,7 +22,7 @@ index daf093518f1daf598c858cfaf48357255a1fb0cf..c06e4b0683f0f125b79a4afce7daf909
if ((entityhuman == null || !entityhuman.getAbilities().instabuild) && itemstack != ItemStack.EMPTY) { // CraftBukkit if ((entityhuman == null || !entityhuman.getAbilities().instabuild) && itemstack != ItemStack.EMPTY) { // CraftBukkit
itemstack.shrink(1); itemstack.shrink(1);
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 63cd9cd79217a9bcedb6647e6f61d9bccc28d9f0..6070711b9825612fbc485d840ed3ed80cf912493 100644 index 71d93daa527ae34b83138394fa79289c403a33d8..94cb7625c451df53de60783535ce0d58b37e35bf 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -493,13 +493,7 @@ public final class ItemStack { @@ -493,13 +493,7 @@ public final class ItemStack {
@ -41,10 +41,10 @@ index 63cd9cd79217a9bcedb6647e6f61d9bccc28d9f0..6070711b9825612fbc485d840ed3ed80
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 6f828ff4c54c2ddd4cc03c0e368afda2521e24dd..a57b7e85f068c3131c6fc41cd8e79dec2f053748 100644 index 2afa2d7b5978cc8474228ff45b66d0d3fac7728a..92e823a123129694a9db5f54659f8d14abebf9b1 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1038,17 +1038,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1037,17 +1037,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start // CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld(); CraftWorld world = ((ServerLevel) this).getWorld();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Don't load chunks for supporting block checks
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 5c21f26109910c0783afd32953a035144d19ec94..d08ce34e1d1ce4ac239f6b7ecf0579ab130fa976 100644 index b8205779022e56a0af10b02b52be77e035da1a6b..3633138b67a3b92a4d7792bbc4387632015fcc3b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1362,7 +1362,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -1361,7 +1361,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
} }
protected BlockPos getOnPos(float offset) { protected BlockPos getOnPos(float offset) {

Datei anzeigen

@ -1148,7 +1148,7 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index addb4133295739ea19e0e770e040698411399944..5caa39b529c6c0798d91e8e8468b40988f6fb987 100644 index afc23f859188a6cda27a683babd551c250a748ef..174f3dab7c7f02dd09d02dc8b4e69190284c3f48 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1629,6 +1629,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1629,6 +1629,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -1173,7 +1173,7 @@ index addb4133295739ea19e0e770e040698411399944..5caa39b529c6c0798d91e8e8468b4098
this.profiler.push("commandFunctions"); this.profiler.push("commandFunctions");
MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 09397946cb9fa82e20772ea981bdadbc6a5c93c7..7c02d16a859f1cf1b24a01099af4ee29f5621e00 100644 index 1a4c1a27a213f32e3b6566b86698ece0180f588b..a3202ca171f3489bfa2a3d6bab5e7150f7add386 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -649,6 +649,7 @@ public abstract class PlayerList { @@ -649,6 +649,7 @@ public abstract class PlayerList {
@ -1185,11 +1185,11 @@ index 09397946cb9fa82e20772ea981bdadbc6a5c93c7..7c02d16a859f1cf1b24a01099af4ee29
this.players.remove(entityplayer); this.players.remove(entityplayer);
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a5a57d1be35e911e26a9f10ee413db34f3637086..e29794df5b84649a710e8181c6a550105d6800e9 100644 index 3633138b67a3b92a4d7792bbc4387632015fcc3b..955eaf4b542e0674ee419d93820689d65082ae80 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -249,11 +249,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -248,11 +248,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public @Nullable Throwable addedToWorldStack; // Paper - entity debug public @org.jetbrains.annotations.Nullable net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper
public CraftEntity getBukkitEntity() { public CraftEntity getBukkitEntity() {
if (this.bukkitEntity == null) { if (this.bukkitEntity == null) {
- this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this); - this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this);
@ -1213,7 +1213,7 @@ index a5a57d1be35e911e26a9f10ee413db34f3637086..e29794df5b84649a710e8181c6a55010
@Override @Override
public CommandSender getBukkitSender(CommandSourceStack wrapper) { public CommandSender getBukkitSender(CommandSourceStack wrapper) {
return this.getBukkitEntity(); return this.getBukkitEntity();
@@ -4734,6 +4746,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4733,6 +4745,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return; return;
} }
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
@ -1221,7 +1221,7 @@ index a5a57d1be35e911e26a9f10ee413db34f3637086..e29794df5b84649a710e8181c6a55010
if (this.removalReason == null) { if (this.removalReason == null) {
this.removalReason = reason; this.removalReason = reason;
} }
@@ -4744,12 +4757,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -4743,12 +4756,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload) if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload)
this.levelCallback.onRemove(reason); this.levelCallback.onRemove(reason);

Datei anzeigen

@ -17,7 +17,7 @@ index ad9eb752a2676c6acdba601b63a5fd1611316267..738f6348c14b0f6942f90d15b082e16d
} }
} }
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 064b86c80e12af1e1e7f9b28484f51e9a3474e82..dc6a1a1fb78d25834f3f97c5ce3b13567c718ca0 100644 index 5756ab17e721d5886ed669a0527e18769b8e1b8b..a33f22f03c54abed5fc24022a8b5f4af007e4597 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -422,6 +422,7 @@ public final class ItemStack { @@ -422,6 +422,7 @@ public final class ItemStack {
@ -29,10 +29,10 @@ index 064b86c80e12af1e1e7f9b28484f51e9a3474e82..dc6a1a1fb78d25834f3f97c5ce3b1356
} }
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index a57b7e85f068c3131c6fc41cd8e79dec2f053748..ca48664d3e7a9efcac8a0e1fa23f71034d74e2d6 100644 index 92e823a123129694a9db5f54659f8d14abebf9b1..e6631ccf71dec785ab8decbf037e8bd622a7a613 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1898,4 +1898,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1897,4 +1897,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return null; return null;
} }
// Paper end - optimize redstone (Alternate Current) // Paper end - optimize redstone (Alternate Current)

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate
Options to configure entity tracking by Y coordinate, also for each entity category. Options to configure entity tracking by Y coordinate, also for each entity category.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 34edd2032abb9e444d7b67672dc72335216dbe82..6e51837a99bb69240f82a061f2c808f78a8346a6 100644 index 28ad811401cd46ec17fbec27b7e1111ead1d45e7..c7d78fb217869204157606db8d6d73af0126a68f 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1419,6 +1419,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1415,6 +1415,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z; double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
double d2 = d0 * d0; double d2 = d0 * d0;
boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z); boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Expand Pose API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index c59494078ee587c8dd89e7943db85863868ae15f..f0e40ea053ca7b6749b443b2733271f71755329b 100644 index 955eaf4b542e0674ee419d93820689d65082ae80..39b1fe633a301d8cf948e5d63c2cf8a26a4b8854 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -423,6 +423,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -422,6 +422,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@javax.annotation.Nullable @javax.annotation.Nullable
private UUID originWorld; private UUID originWorld;
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
@ -16,7 +16,7 @@ index c59494078ee587c8dd89e7943db85863868ae15f..f0e40ea053ca7b6749b443b2733271f7
public void setOrigin(@javax.annotation.Nonnull Location location) { public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector(); this.origin = location.toVector();
@@ -707,6 +708,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -706,6 +707,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public void onClientRemoval() {} public void onClientRemoval() {}
public void setPose(net.minecraft.world.entity.Pose pose) { public void setPose(net.minecraft.world.entity.Pose pose) {
@ -25,7 +25,7 @@ index c59494078ee587c8dd89e7943db85863868ae15f..f0e40ea053ca7b6749b443b2733271f7
if (pose == this.getPose()) { if (pose == this.getPose()) {
return; return;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 875f6380a03f030a45f63dbb3e1a2a3bbcbb9b6f..ed49b04d3918e46cd0769838b81cd0fae0d4e43a 100644 index 7abc465b815ed645e84fa6fdd8eda7f4ba87b104..03908ccb1bcd88b68fcec48c581677cb0a484508 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -896,6 +896,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -896,6 +896,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

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