13
0
geforkt von Mirrors/Paper

More more more more more more work

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-06-07 22:19:14 +02:00
Ursprung 7409d8fed7
Commit f51c531b94
42 geänderte Dateien mit 58 neuen und 57 gelöschten Zeilen

Datei anzeigen

@ -69,7 +69,7 @@ diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java --- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
private static WatchdogThread instance; private static WatchdogThread instance;
private long timeoutTime; private long timeoutTime;
private boolean restart; private boolean restart;
@ -80,7 +80,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private volatile long lastTick; private volatile long lastTick;
private volatile boolean stopping; private volatile boolean stopping;
@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
super( "Paper Watchdog Thread" ); super( "Paper Watchdog Thread" );
this.timeoutTime = timeoutTime; this.timeoutTime = timeoutTime;
this.restart = restart; this.restart = restart;
@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
private static long monotonicMillis() private static long monotonicMillis()
@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
while ( !this.stopping ) while ( !this.stopping )
{ {
// //
@ -110,7 +110,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
log.log( Level.SEVERE, "------------------------------" ); log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Paper bug." ); // Paper log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Paper bug." ); // Paper
log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" ); log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa @@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
} }
} }
// Paper end // Paper end
@ -122,7 +122,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end - Different message for short timeout + // Paper end - Different message for short timeout
log.log( Level.SEVERE, "------------------------------" ); log.log( Level.SEVERE, "------------------------------" );
log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log ); WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
log.log( Level.SEVERE, "------------------------------" ); log.log( Level.SEVERE, "------------------------------" );
// //

Datei anzeigen

@ -10,16 +10,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -0,0 +0,0 @@ public class EnderDragon extends Mob implements Enemy { @@ -0,0 +0,0 @@ public class EnderDragon extends Mob implements Enemy {
}); });
craftBlock.getNMS().spawnAfterBreak((ServerLevel) level, blockposition, ItemStack.EMPTY, false); craftBlock.getNMS().spawnAfterBreak((ServerLevel) this.level(), blockposition, ItemStack.EMPTY, false);
} }
+ // Paper start - TNTPrimeEvent + // Paper start - TNTPrimeEvent
+ org.bukkit.block.Block tntBlock = level.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + org.bukkit.block.Block tntBlock = 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
nmsBlock.wasExploded(level, blockposition, explosionSource); nmsBlock.wasExploded(this.level(), blockposition, 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java

Datei anzeigen

@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.player.setShiftKeyDown(true); this.player.setShiftKeyDown(true);
+ +
+ // Paper start - Hang on! + // Paper start - Hang on!
+ if (this.player.level.paperConfig().entities.behavior.parrotsAreUnaffectedByPlayerMovement) { + if (this.player.level().paperConfig().entities.behavior.parrotsAreUnaffectedByPlayerMovement) {
+ this.player.removeEntitiesOnShoulder(); + this.player.removeEntitiesOnShoulder();
+ } + }
+ // Paper end + // Paper end

Datei anzeigen

@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--this.chatSpamTickCount; --this.chatSpamTickCount;
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // 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 start - split and make configurable

Datei anzeigen

@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));
- this.setSprinting(false); - this.setSprinting(false);
+ // Paper start - Configuration option to disable automatic sprint interruption + // Paper start - Configuration option to disable automatic sprint interruption
+ if (!level.paperConfig().misc.disableSprintInterruptionOnAttack) { + if (!this.level().paperConfig().misc.disableSprintInterruptionOnAttack) {
+ this.setSprinting(false); + this.setSprinting(false);
+ } + }
+ // Paper end + // Paper end

Datei anzeigen

@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.flame.setParticle(ParticleTypes.DRAGON_BREATH); this.flame.setParticle(ParticleTypes.DRAGON_BREATH);
this.flame.addEffect(new MobEffectInstance(MobEffects.HARM)); this.flame.addEffect(new MobEffectInstance(MobEffects.HARM));
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFlameEvent((org.bukkit.entity.EnderDragon) this.dragon.getBukkitEntity(), (org.bukkit.entity.AreaEffectCloud) this.flame.getBukkitEntity()).callEvent()) { // Paper + if (new com.destroystokyo.paper.event.entity.EnderDragonFlameEvent((org.bukkit.entity.EnderDragon) this.dragon.getBukkitEntity(), (org.bukkit.entity.AreaEffectCloud) this.flame.getBukkitEntity()).callEvent()) { // Paper
this.dragon.level.addFreshEntity(this.flame); this.dragon.level().addFreshEntity(this.flame);
+ // Paper start + // Paper start
+ } else { + } else {
+ this.end(); + this.end();
@ -28,10 +28,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonStrafePlayerPhase.java
@@ -0,0 +0,0 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance { @@ -0,0 +0,0 @@ public class DragonStrafePlayerPhase extends AbstractDragonPhaseInstance {
DragonFireball dragonFireball = new DragonFireball(this.dragon.level, this.dragon, r, s, t); DragonFireball dragonFireball = new DragonFireball(this.dragon.level(), this.dragon, r, s, t);
dragonFireball.moveTo(o, p, q, 0.0F, 0.0F); dragonFireball.moveTo(o, p, q, 0.0F, 0.0F);
+ if (new com.destroystokyo.paper.event.entity.EnderDragonShootFireballEvent((org.bukkit.entity.EnderDragon) dragon.getBukkitEntity(), (org.bukkit.entity.DragonFireball) dragonFireball.getBukkitEntity()).callEvent()) // Paper + if (new com.destroystokyo.paper.event.entity.EnderDragonShootFireballEvent((org.bukkit.entity.EnderDragon) dragon.getBukkitEntity(), (org.bukkit.entity.DragonFireball) dragonFireball.getBukkitEntity()).callEvent()) // Paper
this.dragon.level.addFreshEntity(dragonFireball); this.dragon.level().addFreshEntity(dragonFireball);
+ else dragonFireball.discard(); // Paper + else dragonFireball.discard(); // Paper
this.fireballCharge = 0; this.fireballCharge = 0;
if (this.currentPath != null) { if (this.currentPath != null) {
@ -45,8 +45,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), list.stream().map(LivingEntity::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) areaEffectCloud.getBukkitEntity()).callEvent()) { // Paper + if (new com.destroystokyo.paper.event.entity.EnderDragonFireballHitEvent((org.bukkit.entity.DragonFireball) this.getBukkitEntity(), list.stream().map(LivingEntity::getBukkitLivingEntity).collect(java.util.stream.Collectors.toList()), (org.bukkit.entity.AreaEffectCloud) areaEffectCloud.getBukkitEntity()).callEvent()) { // Paper
this.level.levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1); this.level().levelEvent(2006, this.blockPosition(), this.isSilent() ? -1 : 1);
this.level.addFreshEntity(areaEffectCloud); this.level().addFreshEntity(areaEffectCloud);
+ } else areaEffectCloud.discard(); // Paper + } else areaEffectCloud.discard(); // Paper
this.discard(); this.discard();
} }

Datei anzeigen

@ -33,7 +33,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java --- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -0,0 +0,0 @@ public class Allay extends PathfinderMob implements InventoryCarrier { @@ -0,0 +0,0 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
}); });
} }

Datei anzeigen

@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end // CraftBukkit end
+ // Paper start - remove player from map on drop + // Paper start - remove player from map on drop
+ if (itemstack.getItem() == Items.FILLED_MAP) { + if (itemstack.getItem() == Items.FILLED_MAP) {
+ net.minecraft.world.level.saveddata.maps.MapItemSavedData worldmap = net.minecraft.world.item.MapItem.getSavedData(itemstack, this.level); + net.minecraft.world.level.saveddata.maps.MapItemSavedData worldmap = net.minecraft.world.item.MapItem.getSavedData(itemstack, this.level());
+ if (worldmap != null) { + if (worldmap != null) {
+ worldmap.tickCarriedBy(this, itemstack); + worldmap.tickCarriedBy(this, itemstack);
+ } + }

Datei anzeigen

@ -109,7 +109,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
entityliving.awardKillScore(this, this.deathScore, damageSource); entityliving.awardKillScore(this, this.deathScore, damageSource);
} }
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!this.level.isClientSide && this.hasCustomName()) { if (!this.level().isClientSide && this.hasCustomName()) {
if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
} }
+ */ // Paper - move down to make death event cancellable - this is the awardKillScore below + */ // Paper - move down to make death event cancellable - this is the awardKillScore below
@ -117,8 +117,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.dead = true; this.dead = true;
- this.getCombatTracker().recheckStatus(); - this.getCombatTracker().recheckStatus();
+ // Paper - moved into if below + // Paper - moved into if below
if (this.level instanceof ServerLevel) { Level world = this.level();
- if (entity == null || entity.wasKilled((ServerLevel) this.level, this)) {
if (world instanceof ServerLevel) {
ServerLevel worldserver = (ServerLevel) world;
+ // Paper - move below into if for onKill + // Paper - move below into if for onKill
+ +
+ // Paper start + // Paper start
@ -139,42 +141,42 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.isSleeping()) { + if (this.isSleeping()) {
+ this.stopSleeping(); + this.stopSleeping();
+ } + }
+
+ if (!this.level.isClientSide && this.hasCustomName()) { - if (entity == null || entity.killedEntity(worldserver, this)) {
+ if (!this.level().isClientSide && this.hasCustomName()) {
+ if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot + if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot
+ } + }
+ +
+ this.getCombatTracker().recheckStatus(); + this.getCombatTracker().recheckStatus();
+ if (entity != null) { + if (entity != null) {
+ entity.wasKilled((ServerLevel) this.level, this); + entity.wasKilled((ServerLevel) this.level(), this);
+ } + }
this.gameEvent(GameEvent.ENTITY_DIE); this.gameEvent(GameEvent.ENTITY_DIE);
- this.dropAllDeathLoot(damageSource); - this.dropAllDeathLoot(damageSource);
- this.createWitherRose(entityliving); - this.createWitherRose(entityliving);
+ } else {
+ this.dead = false;
+ this.setHealth((float) deathEvent.getReviveHealth());
} }
-
- this.level.broadcastEntityEvent(this, (byte) 3); - this.level().broadcastEntityEvent(this, (byte) 3);
+ // Paper end + // Paper end
+ this.createWitherRose(entityliving); + this.createWitherRose(entityliving);
} }
+ // Paper start
+ if (this.dead) { // Paper + if (this.dead) { // Paper
+ this.level.broadcastEntityEvent(this, (byte) 3); + this.level().broadcastEntityEvent(this, (byte) 3);
this.setPose(Pose.DYING); this.setPose(Pose.DYING);
+ } // Paper + }
+ // Paper end
} }
} }
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!this.level.isClientSide) { if (!this.level().isClientSide) {
boolean flag = false; boolean flag = false;
- if (adversary instanceof WitherBoss) { - if (adversary instanceof WitherBoss) {
+ if (this.dead && adversary instanceof WitherBoss) { // Paper + if (this.dead && adversary instanceof WitherBoss) { // Paper
if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { if (this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
BlockPos blockposition = this.blockPosition(); BlockPos blockposition = this.blockPosition();
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -192,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.dropEquipment(); // CraftBukkit - from below this.dropEquipment(); // CraftBukkit - from below
if (this.shouldDropLoot() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
this.dropFromLootTable(source, flag); this.dropFromLootTable(source, flag);
+ // Paper start + // Paper start
+ final boolean prev = this.clearEquipmentSlots; + final boolean prev = this.clearEquipmentSlots;

Datei anzeigen

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- 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
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
this.spawnParticlesOnBreak = blockbase_info.spawnParticlesOnBreak; this.replaceable = blockbase_info.replaceable;
this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper
} }
+ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time + // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time
@ -23,8 +23,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
// Paper start private boolean calculateSolid() {
protected boolean shapeExceedsCube = true; if (((Block) this.owner).properties.forceSolidOn) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java

Datei anzeigen

@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
protected void pushEntities() { protected void pushEntities() {
+ if (!level.paperConfig().entities.armorStands.doCollisionEntityLookups) return; // Paper + if (!this.level().paperConfig().entities.armorStands.doCollisionEntityLookups) return; // Paper
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox(), ArmorStand.RIDABLE_MINECARTS); List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox(), ArmorStand.RIDABLE_MINECARTS);
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
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

Datei anzeigen

@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ // Paper start - send SoundEffect to everyone who can see fromEntity + // Paper start - send SoundEffect to everyone who can see fromEntity
+ private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { + private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
+ fromEntity.level.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself + fromEntity.level().playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself
+ if (fromEntity instanceof ServerPlayer) { + if (fromEntity instanceof ServerPlayer) {
+ ((ServerPlayer) fromEntity).connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong())); + ((ServerPlayer) fromEntity).connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong()));
+ } + }

Datei anzeigen

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start + // Paper start
+ public Entity releaseLeftShoulderEntity() { + public Entity releaseLeftShoulderEntity() {
+ Entity entity = this.spawnEntityFromShoulder0(this.getShoulderEntityLeft()); + Entity entity = this.respawnEntityOnShoulder0(this.getShoulderEntityLeft());
+ if (entity != null) { + if (entity != null) {
+ this.setShoulderEntityLeft(new CompoundTag()); + this.setShoulderEntityLeft(new CompoundTag());
+ } + }
@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ public Entity releaseRightShoulderEntity() { + public Entity releaseRightShoulderEntity() {
+ Entity entity = this.spawnEntityFromShoulder0(this.getShoulderEntityRight()); + Entity entity = this.respawnEntityOnShoulder0(this.getShoulderEntityRight());
+ if (entity != null) { + if (entity != null) {
+ this.setShoulderEntityRight(new CompoundTag()); + this.setShoulderEntityRight(new CompoundTag());
+ } + }
@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
private boolean respawnEntityOnShoulder(CompoundTag nbttagcompound) { // CraftBukkit void->boolean private boolean respawnEntityOnShoulder(CompoundTag nbttagcompound) { // CraftBukkit void->boolean
- if (!this.level().isClientSide && !nbttagcompound.isEmpty()) { - if (!this.level().isClientSide && !nbttagcompound.isEmpty()) {
+ return this.spawnEntityFromShoulder0(nbttagcompound) != null; + return this.respawnEntityOnShoulder0(nbttagcompound) != null;
+ } + }
+ +
+ // Paper - return entity + // Paper - return entity

Datei anzeigen

@ -20,13 +20,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override @Override
public boolean canUse() { public boolean canUse() {
- return this.horse.level.hasNearbyAlivePlayerThatAffectsSpawning(this.horse.getX(), this.horse.getY(), this.horse.getZ(), 10.0D); // Paper - Affects Spawning API - return this.horse.level().hasNearbyAlivePlayerThatAffectsSpawning(this.horse.getX(), this.horse.getY(), this.horse.getZ(), 10.0D); // Paper - Affects Spawning API
+ return !(eligiblePlayers = this.horse.level.findNearbyBukkitPlayers(this.horse.getX(), this.horse.getY(), this.horse.getZ(), 10.0D, net.minecraft.world.entity.EntitySelector.PLAYER_AFFECTS_SPAWNING)).isEmpty(); // Paper - Affects Spawning API & SkeletonHorseTrapEvent + return !(eligiblePlayers = this.horse.level().findNearbyBukkitPlayers(this.horse.getX(), this.horse.getY(), this.horse.getZ(), 10.0D, net.minecraft.world.entity.EntitySelector.PLAYER_AFFECTS_SPAWNING)).isEmpty(); // Paper - Affects Spawning API & SkeletonHorseTrapEvent
} }
@Override @Override
public void tick() { public void tick() {
ServerLevel worldserver = (ServerLevel) this.horse.level; ServerLevel worldserver = (ServerLevel) this.horse.level();
+ if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.horse.getBukkitEntity(), eligiblePlayers).callEvent()) return; // Paper + if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.horse.getBukkitEntity(), eligiblePlayers).callEvent()) return; // Paper
DifficultyInstance difficultydamagescaler = worldserver.getCurrentDifficultyAt(this.horse.blockPosition()); DifficultyInstance difficultydamagescaler = worldserver.getCurrentDifficultyAt(this.horse.blockPosition());

Datei anzeigen

@ -102,8 +102,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@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 - add canWander
} }
@Override @Override

Datei anzeigen

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity; boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity;
+ flag2 = flag2 && !level.paperConfig().entities.behavior.disablePlayerCrits; // Paper + flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper
flag2 = flag2 && !this.isSprinting(); flag2 = flag2 && !this.isSprinting();
if (flag2) { if (flag2) {
f *= 1.5F; f *= 1.5F;

Datei anzeigen

@ -10,12 +10,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -0,0 +0,0 @@ dependencies { @@ -0,0 +0,0 @@ dependencies {
implementation("commons-lang:commons-lang:2.6") implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.41.2.2") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0")
runtimeOnly("com.mysql:mysql-connector-j:8.0.32") runtimeOnly("com.mysql:mysql-connector-j:8.0.33")
+ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper + runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.2")
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10")
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/resources/log4j2.xml --- a/src/main/resources/log4j2.xml

Datei anzeigen

@ -19,9 +19,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private QueryThreadGs4 queryThreadGs4; private QueryThreadGs4 queryThreadGs4;
public final RconConsoleSource rconConsoleSource; public final RconConsoleSource rconConsoleSource;
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
return; }
}
// Paper end - rewrite chunk system public void handleConsoleInput(String command, CommandSourceStack commandSource) {
- 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 - use proper queue
} }

Datei anzeigen

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public String toString() { public String toString() {
String s = this.level == null ? "~NULL~" : this.level.toString(); String s = this.level() == null ? "~NULL~" : this.level().toString();
- return this.removalReason != null ? String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f, removed=%s]", this.getClass().getSimpleName(), this.getName().getString(), this.id, s, this.getX(), this.getY(), this.getZ(), this.removalReason) : String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getName().getString(), this.id, s, this.getX(), this.getY(), this.getZ()); - return this.removalReason != null ? String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f, removed=%s]", this.getClass().getSimpleName(), this.getName().getString(), this.id, s, this.getX(), this.getY(), this.getZ(), this.removalReason) : String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getName().getString(), this.id, s, this.getX(), this.getY(), this.getZ());
+ return this.removalReason != null ? String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cpos=%s, tl=%d, v=%b, removed=%s]", this.getClass().getSimpleName(), this.getName().getString(), this.id, this.uuid, s, this.getX(), this.getY(), this.getZ(), this.chunkPosition(), this.tickCount, this.valid, this.removalReason) : String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cpos=%s, tl=%d, v=%b]", this.getClass().getSimpleName(), this.getName().getString(), this.id, this.uuid, s, this.getX(), this.getY(), this.getZ(), this.chunkPosition(), this.tickCount, this.valid); + return this.removalReason != null ? String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cpos=%s, tl=%d, v=%b, removed=%s]", this.getClass().getSimpleName(), this.getName().getString(), this.id, this.uuid, s, this.getX(), this.getY(), this.getZ(), this.chunkPosition(), this.tickCount, this.valid, this.removalReason) : String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cpos=%s, tl=%d, v=%b]", this.getClass().getSimpleName(), this.getName().getString(), this.id, this.uuid, s, this.getX(), this.getY(), this.getZ(), this.chunkPosition(), this.tickCount, this.valid);