More more more more more more more more more more patches

This commit is contained in:
Nassim Jahnke 2022-06-08 15:12:28 +02:00
parent 2259098789
commit beab8a32c1
No known key found for this signature in database
GPG key ID: 6BE3B555EBC5982B
35 changed files with 143 additions and 168 deletions

View file

@ -5,11 +5,11 @@ Subject: [PATCH] Reset placed block on exception
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index 8175bb6331727440da2232998bdad068a1c47ae8..893d5bf448ddbccb30db0ee751c7f4a4e83634b9 100644
index 78cac63e5bd7c84f59b8e00ee40899be78e8cdb1..00d31df5ba7e147b4b969a89cfc2b5088a988169 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -78,6 +78,7 @@ public class BlockItem extends Item {
if (this instanceof WaterLilyBlockItem || this instanceof SolidBucketItem) {
if (this instanceof PlaceOnWaterBlockItem || this instanceof SolidBucketItem) {
blockstate = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(blockactioncontext1.getLevel(), blockactioncontext1.getClickedPos());
}
+ final org.bukkit.block.BlockState oldBlockstate = blockstate != null ? blockstate : org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(blockactioncontext1.getLevel(), blockactioncontext1.getClickedPos()); // Paper

View file

@ -26,23 +26,23 @@ index 100de7e366c4ea8ce158b0fc0258e4db0ee83249..b13d4dc311f25f9d3132697381e52beb
public int portalCreateRadius;
public boolean portalSearchVanillaDimensionScaling;
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 85edba5de3ce6c1fce8872855544863de84e7759..b6e78e8145ea78d532f22707c7525829c5778076 100644
index bdc6a7e6a9fcd467f653d53afd7ca2e33776fb06..e82bf53e1d31a5dd81713fe858d1e5d7b8f8c60d 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -325,7 +325,11 @@ public class Slime extends Mob implements Enemy {
@@ -320,7 +320,11 @@ public class Slime extends Mob implements Enemy {
public static boolean checkSlimeSpawnRules(EntityType<Slime> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
public static boolean checkSlimeSpawnRules(EntityType<Slime> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
if (world.getDifficulty() != Difficulty.PEACEFUL) {
- if (world.getBiome(pos).is(Biomes.SWAMP) && pos.getY() > 50 && pos.getY() < 70 && random.nextFloat() < 0.5F && random.nextFloat() < world.getMoonBrightness() && world.getMaxLocalRawBrightness(pos) <= random.nextInt(8)) {
- if (world.getBiome(pos).is(BiomeTags.ALLOWS_SURFACE_SLIME_SPAWNS) && pos.getY() > 50 && pos.getY() < 70 && random.nextFloat() < 0.5F && random.nextFloat() < world.getMoonBrightness() && world.getMaxLocalRawBrightness(pos) <= random.nextInt(8)) {
+ // Paper start - Replace rules for Height in Swamp Biome
+ final double maxHeightSwamp = world.getMinecraftWorld().paperConfig.slimeMaxSpawnHeightInSwamp;
+ final double minHeightSwamp = world.getMinecraftWorld().paperConfig.slimeMinSpawnHeightInSwamp;
+ if (world.getBiome(pos).is(Biomes.SWAMP) && pos.getY() > minHeightSwamp && pos.getY() < maxHeightSwamp && random.nextFloat() < 0.5F && random.nextFloat() < world.getMoonBrightness() && world.getMaxLocalRawBrightness(pos) <= random.nextInt(8)) {
+ // Paper end
+ // Paper end
return checkMobSpawnRules(type, world, spawnReason, pos, random);
}
@@ -336,7 +340,10 @@ public class Slime extends Mob implements Enemy {
@@ -331,7 +335,10 @@ public class Slime extends Mob implements Enemy {
ChunkPos chunkcoordintpair = new ChunkPos(pos);
boolean flag = world.getMinecraftWorld().paperConfig.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Added getHostname to AsyncPlayerPreLoginEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 7065aa4522431d08018fec8e591ba7c255398140..befcb501b4b1b6330bf3cd53e00e30b01efade6f 100644
index 221f32e034ccb57907f79bae4ecec324e9cdb14e..9311130b5401cda69c62b5b5c23718554b94ab84 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -395,7 +395,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
@@ -455,7 +455,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
// Paper start
com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile);

View file

@ -9,21 +9,21 @@ so this resets it after each call to
Zombie#getExperienceReward
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index f9b7877ce5f66cc58ff1111d0fa72081a03c4f4e..cd88413f30632307faba63572915656b6a8469f7 100644
index 4e348ea70ecc3836befcffcaa27c12a104f29c2a..7b01bd1409dcb64c097badbbd73110d40e712751 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -172,11 +172,16 @@ public class Zombie extends Monster {
@Override
protected int getExperienceReward(Player player) {
public int getExperienceReward() {
+ final int previousReward = this.xpReward; // Paper - store previous value to reset after calculating XP reward
if (this.isBaby()) {
this.xpReward = (int) ((double) this.xpReward * 2.5D);
}
- return super.getExperienceReward(player);
- return super.getExperienceReward();
+ // Paper start - only change the XP reward for the calculations in the super method
+ int reward = super.getExperienceReward(player);
+ int reward = super.getExperienceReward();
+ this.xpReward = previousReward;
+ return reward;
+ // Paper end

View file

@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <jahnke.nassim@gmail.com>
Date: Mon, 17 Jan 2022 19:47:19 +0100
Subject: [PATCH] Kick on main for illegal chars
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8b033cdd65402950e597efab7b2407f5baf4c3aa..56208159d46a25de26ab6ce4b65eae27c93297e7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2104,7 +2104,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
// CraftBukkit end
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.getMessage())) {
+ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
+ }); // Paper - push to main for event firing
} else {
if (this.tryHandleChat(packet.getMessage(), packet.getTimeStamp())) {
// CraftBukkit start
@@ -2120,7 +2122,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleChatCommand(ServerboundChatCommandPacket packet) {
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
+ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"));
+ }); // Paper - push to main for event firing
} else {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (this.tryHandleChat(packet.command(), packet.timeStamp())) {

View file

@ -25,18 +25,18 @@ index 82ea4fabd5732052a286d50bcff8bbcc2c4aa7d7..652bea6868a03a5315965f79c76172fb
public void write(FriendlyByteBuf buf) {
buf.writeLong(this.sectionPos.asLong());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0978be96a4ef26dc0a2e3cc1bb10931496502413..f8039c0e62b8fa8f0491edb296054299e7e28bdf 100644
index 1ad8ab6c9413e79385b2f796c960ea3184d72bdf..01ac24f0999c9829bffeb76c228779f80a571687 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -30,6 +30,7 @@ import javax.annotation.Nullable;
import net.minecraft.Util;
@@ -29,6 +29,7 @@ import java.util.logging.Logger;
import javax.annotation.Nullable;
import net.minecraft.advancements.AdvancementProgress;
import net.minecraft.core.BlockPos;
+import net.minecraft.core.SectionPos; // Paper
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.ChatType;
@@ -866,6 +867,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
import net.minecraft.network.chat.ChatSender;
@@ -863,6 +864,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet);
}

View file

@ -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
index 18294d7cdb4619bb128c626ef567622bae187c8d..ede2f5f00b59893cca354e5626938360347b0a36 100644
index 526c564ebbf44421af8595d14bbbadc0de02c081..fc03e5ddc126a57d4ca9f158b7d0f67401e1ca4b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -335,6 +335,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -356,6 +356,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
private org.bukkit.util.Vector origin;
@javax.annotation.Nullable
private UUID originWorld;
@ -16,7 +16,7 @@ index 18294d7cdb4619bb128c626ef567622bae187c8d..ede2f5f00b59893cca354e5626938360
public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector();
@@ -762,7 +763,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -784,7 +785,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.setRemainingFireTicks(this.remainingFireTicks - 1);
}
@ -25,7 +25,7 @@ index 18294d7cdb4619bb128c626ef567622bae187c8d..ede2f5f00b59893cca354e5626938360
this.setTicksFrozen(0);
this.level.levelEvent((Player) null, 1009, this.blockPosition, 1);
}
@@ -2163,6 +2164,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2211,6 +2212,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (fromNetherPortal) {
nbt.putBoolean("Paper.FromNetherPortal", true);
}
@ -35,7 +35,7 @@ index 18294d7cdb4619bb128c626ef567622bae187c8d..ede2f5f00b59893cca354e5626938360
// Paper end
return nbt;
} catch (Throwable throwable) {
@@ -2325,6 +2329,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2373,6 +2377,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (spawnReason == null) {
spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT;
}
@ -46,10 +46,10 @@ index 18294d7cdb4619bb128c626ef567622bae187c8d..ede2f5f00b59893cca354e5626938360
} 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
index 5ef73cf97df2949d308d4cc9213bfb173c15b4a5..c17b8c77b1a4d65afaefd9c4b32219d898882410 100644
index 7bd5c41c08d198c4278486a245872d2f31162627..f2ac92cdd718d351e0cea7fd1d05008a4b5734b7 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3319,7 +3319,7 @@ public abstract class LivingEntity extends Entity {
@@ -3351,7 +3351,7 @@ public abstract class LivingEntity extends Entity {
boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES);
int i;
@ -59,10 +59,10 @@ index 5ef73cf97df2949d308d4cc9213bfb173c15b4a5..c17b8c77b1a4d65afaefd9c4b32219d8
if (this.isInPowderSnow && this.canFreeze()) {
this.setTicksFrozen(Math.min(this.getTicksRequiredToFreeze(), i + 1));
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 0a998832afacb25cbaf39737d14aa33eab6967b7..a92755211e3d42934b5efaa3f201c6c19ab7d2b4 100644
index 4ab2b20529acb61baca3878281258ba0818b8479..5b92c2ca03baed38f7d41a73fae7dd23ce541d43 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -662,6 +662,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -673,6 +673,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return this.getHandle().isFullyFrozen();
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] More PotionEffectType API
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
index fdd8e353bcbd2faace59288810d1a5121f174b56..82a6702a2ddc35222f5a416364de8c397c85d5bb 100644
index a220102c6e981e4c7d03039340423f05b8c2aeb9..29830a30a886f88254a6d0e7c5245fa14f44bd09 100644
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
@@ -102,4 +102,46 @@ public class CraftPotionEffectType extends PotionEffectType {
@@ -104,4 +104,46 @@ public class CraftPotionEffectType extends PotionEffectType {
public Color getColor() {
return Color.fromRGB(this.handle.getColor());
}

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Use a CHM for StructureTemplate.Pallete cache
fixes a CME due to this collection being shared across threads
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
index 129ebb095c2280376a59b54920e5ff90cf1f465a..c5827e4d870a0bba483649d54cae23072eab2b18 100644
index f3fcd345178efd4917ef79cb141275a987f99e58..fcd6b2a438ffc2f039036a45ff88ba46017981f7 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
@@ -831,7 +831,7 @@ public class StructureTemplate {

View file

@ -123,10 +123,10 @@ index 0000000000000000000000000000000000000000..ed3d488c6581df5eac425d9cccb8e741
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b4133f8dde5edb75b8d2d1008c50db7810276913..d9bfdeba8eaa8ab750b5037ff3d3a82a445adc2d 100644
index ebf70b414c63cdb715d739c3333adbafc3bd01e7..4895f27be18157ae7fa6837cc970828554b9ced5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1988,6 +1988,13 @@ public final class CraftServer implements Server {
@@ -1970,6 +1970,13 @@ public final class CraftServer implements Server {
return console.console;
}
@ -162,7 +162,7 @@ index eaff8df6c8c12c64e005a68a02e2e35ed88f757c..1c638a4b1f2c841928d8b2a7ae43e4eb
if (this instanceof CraftBlockCommandSender) {
if (ServerCommandSender.blockPermInst == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
index 4aa1dc543950b5de64345b3403a6d0bc41c521df..4525fb3bc9b137bce3b59310a8aecca96d6ad5ba 100644
index 6df44aa60d2b41b95fe79ed4cf92a6d3369400ea..6035af2cf08353b3d3801220d8116d8611a0cd37 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
@@ -84,6 +84,11 @@ public final class VanillaCommandWrapper extends BukkitCommand {

View file

@ -5,28 +5,28 @@ Subject: [PATCH] Add config for stronghold seed
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
index d5930d8ced9566c5494bed3685cf2d536eef6d50..daff5a9dd98e791b3f1dc898a082ff3e08adc92e 100644
index 05c8b3f54ecb4221dcbf37574240401d93e14e7a..1af3570d080e8d2203434a52634e1eab86a7bf36 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -231,7 +231,13 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource {
int k = concentricringsstructureplacement.spread();
Random random = new Random();
@@ -236,7 +236,13 @@ public abstract class ChunkGenerator {
HolderSet<Biome> holderset = concentricringsstructureplacement.preferredBiomes();
RandomSource randomsource = RandomSource.create();
+ // Paper start
+ if (this.conf.strongholdSeed != null && this.structureSets.getResourceKey(holder).orElse(null) == net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS) {
+ random.setSeed(this.conf.strongholdSeed);
+ randomsource.setSeed(this.conf.strongholdSeed);
+ } else {
randomsource.setSeed(this instanceof FlatLevelSource ? 0L : randomstate.legacyLevelSeed());
+ }
+ // Paper end
random.setSeed(this.ringPlacementSeed);
+ } // Paper
double d0 = random.nextDouble() * 3.141592653589793D * 2.0D;
double d0 = randomsource.nextDouble() * 3.141592653589793D * 2.0D;
int l = 0;
int i1 = 0;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index b498b027b127996976a394e9a86cfc90f8a8ed3b..31a447e6e156b7b244b2ac69a9c03c09c7ed388c 100644
index 32f8a6aed0f69ad07ab5b42fee38a3471a59d426..b7d8363a96aa4527d84a43060d7e0b567a570a15 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -364,6 +364,7 @@ public class SpigotWorldConfig
@@ -352,6 +352,7 @@ public class SpigotWorldConfig
public int mansionSeed;
public int fossilSeed;
public int portalSeed;
@ -34,7 +34,7 @@ index b498b027b127996976a394e9a86cfc90f8a8ed3b..31a447e6e156b7b244b2ac69a9c03c09
private void initWorldGenSeeds()
{
this.villageSeed = this.getInt( "seed-village", 10387312 );
@@ -381,6 +382,10 @@ public class SpigotWorldConfig
@@ -369,6 +370,10 @@ public class SpigotWorldConfig
this.mansionSeed = this.getInt( "seed-mansion", 10387319 );
this.fossilSeed = this.getInt( "seed-fossil", 14357921 );
this.portalSeed = this.getInt( "seed-portal", 34222645 );

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Implement regenerateChunk
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 925907eff49e26cac48e895f44c55f80b9a6f81e..7414bb0ba5754b4e3be468d3986a2a979de7c983 100644
index 425e0940159e335f3919a6f623a56968864b8fc1..ee0ae10b555cf21e1e618bb3bc173c3be0e4ff2c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -133,6 +133,7 @@ import org.bukkit.util.Vector;

View file

@ -16,10 +16,10 @@ to the worker thread in the executor service, allowing the server to
catch and properly log the exception to the console.
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
index 8a0ced3f9b9099913ade4b71181aff6cafbc4ee6..21588ce5a408fed3454c317b56c05439ad3af27d 100644
index 5c92aa1cc1a7e7fd0b7a06ae9b21e734fab71c74..3825aa2c381a3ee77e05bea520ff5fb828733857 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
@@ -31,7 +31,7 @@ public class ServerboundChatPacket implements Packet<ServerGamePacketListener> {
@@ -45,7 +45,7 @@ public class ServerboundChatPacket implements Packet<ServerGamePacketListener> {
public void handle(final ServerGamePacketListener listener) {
if ( !this.message.startsWith("/") )
{

View file

@ -8,7 +8,7 @@ snow bucket didn't revert grass that became snowy because of the
placement.
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index 893d5bf448ddbccb30db0ee751c7f4a4e83634b9..8f3b9b8784f0d7b137a1ad87655ee8bad801b59d 100644
index 00d31df5ba7e147b4b969a89cfc2b5088a988169..62d6c5b7590ff4faef5d8c7a8be03155b7338480 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -115,6 +115,7 @@ public class BlockItem extends Item {
@ -20,10 +20,10 @@ index 893d5bf448ddbccb30db0ee751c7f4a4e83634b9..8f3b9b8784f0d7b137a1ad87655ee8ba
}
return InteractionResult.FAIL;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index a61a309bb921deba8b8022bc4e9fd04c2f8eba63..dc4639f905fb71435daf29c61f64621a3e2cc533 100644
index 1f28b9adeb234496f80416fd416a86a0e6437a36..acd80da6e249f83ccd96c3bd24c3b75d9084fc91 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -325,7 +325,7 @@ public final class ItemStack {
@@ -339,7 +339,7 @@ public final class ItemStack {
int oldCount = this.getCount();
ServerLevel world = (ServerLevel) itemactioncontext.getLevel();
@ -32,7 +32,7 @@ index a61a309bb921deba8b8022bc4e9fd04c2f8eba63..dc4639f905fb71435daf29c61f64621a
world.captureBlockStates = true;
// special case bonemeal
if (this.getItem() == Items.BONE_MEAL) {
@@ -379,7 +379,7 @@ public final class ItemStack {
@@ -393,7 +393,7 @@ public final class ItemStack {
world.capturedBlockStates.clear();
if (blocks.size() > 1) {
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit
Copies appropriate checks from CraftWorld#getSpawnLimit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d9bfdeba8eaa8ab750b5037ff3d3a82a445adc2d..fbd4ecab83955c3c56fa076da12b28399641bd50 100644
index 4895f27be18157ae7fa6837cc970828554b9ced5..1d9fc45d3fcf8a704f9bb286daa13ba027215f0a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2157,6 +2157,8 @@ public final class CraftServer implements Server {
@@ -2139,6 +2139,8 @@ public final class CraftServer implements Server {
@Override
public int getSpawnLimit(SpawnCategory spawnCategory) {
// Paper start

View file

@ -45,18 +45,10 @@ index 0000000000000000000000000000000000000000..cb78a3d4e21376ea24347187478525d5
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index fbd4ecab83955c3c56fa076da12b28399641bd50..2e0517aa65102af5c7aef08acbc25646b1a0afd8 100644
index 1d9fc45d3fcf8a704f9bb286daa13ba027215f0a..3795f867ff439a3bce293aa6ad3754a1e218e8a8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -97,6 +97,7 @@ import net.minecraft.world.level.biome.BiomeSource;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.world.level.dimension.LevelStem;
+import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
import net.minecraft.world.level.levelgen.PatrolSpawner;
import net.minecraft.world.level.levelgen.PhantomSpawner;
@@ -2563,6 +2564,15 @@ public final class CraftServer implements Server {
@@ -2545,6 +2545,15 @@ public final class CraftServer implements Server {
return (org.bukkit.Tag<T>) new CraftEntityTag(Registry.ENTITY_TYPE, entityTagKey);
}
}
@ -72,14 +64,14 @@ index fbd4ecab83955c3c56fa076da12b28399641bd50..2e0517aa65102af5c7aef08acbc25646
default -> throw new IllegalArgumentException();
}
@@ -2595,6 +2605,13 @@ public final class CraftServer implements Server {
@@ -2577,6 +2586,13 @@ public final class CraftServer implements Server {
Registry<EntityType<?>> entityTags = Registry.ENTITY_TYPE;
return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList());
}
+ // Paper start
+ case org.bukkit.Tag.REGISTRY_GAME_EVENTS -> {
+ Preconditions.checkArgument(clazz == org.bukkit.GameEvent.class);
+ Registry<GameEvent> gameEvents = Registry.GAME_EVENT;
+ Registry<net.minecraft.world.level.gameevent.GameEvent> gameEvents = Registry.GAME_EVENT;
+ return gameEvents.getTags().map(pair -> (org.bukkit.Tag<T>) new io.papermc.paper.CraftGameEventTag(gameEvents, pair.getFirst())).collect(ImmutableList.toImmutableList());
+ // Paper end
+ }

View file

@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether,
for example.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 01aefce226ae82d707b38b0d56d2580d411a3c9a..c2c1242bcf26c73b3520c797e77c3c2d430dfac7 100644
index 718b477b2f53a3b2decb4c045ece12ab75aee23d..47966d87c525067f0bc3d587cdf869d89cf5710c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1354,6 +1354,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1312,6 +1312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
return true;
} else {
@ -20,7 +20,7 @@ index 01aefce226ae82d707b38b0d56d2580d411a3c9a..c2c1242bcf26c73b3520c797e77c3c2d
if (this.haveTime()) {
Iterator iterator = this.getAllLevels().iterator();
@@ -1361,12 +1362,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1319,12 +1320,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerLevel worldserver = (ServerLevel) iterator.next();
if (worldserver.getChunkSource().pollTask()) {

View file

@ -15,7 +15,7 @@ will be more effective, since more time will be allocated
to actually processing chunk tasks vs the ticket level updates.
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
index 3542b8b347b9a142c53f300251a05a11e421c36f..2c5cf08e16669d5be8ba7d6e3f9282c74f9ea295 100644
index b22c771ca35466574d5a73f2da3fc8762cb29487..b243de50a44099f619b2c704e51badb9b22b74b6 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -38,6 +38,7 @@ import net.minecraft.world.level.chunk.ChunkStatus;
@ -33,8 +33,8 @@ index 3542b8b347b9a142c53f300251a05a11e421c36f..2c5cf08e16669d5be8ba7d6e3f9282c7
- private final DistanceManager.ChunkTicketTracker ticketTracker = new DistanceManager.ChunkTicketTracker();
+ //private final DistanceManager.ChunkTicketTracker ticketTracker = new DistanceManager.ChunkTicketTracker(); // Paper - replace ticket level propagator
public static final int MOB_SPAWN_RANGE = 8; // private final ChunkMapDistance.b f = new ChunkMapDistance.b(8); // Paper - no longer used
//private final TickingTracker tickingTicketsTracker = new TickingTracker(); // Paper - no longer used
//private final DistanceManager.PlayerTicketTracker playerTicketManager = new DistanceManager.PlayerTicketTracker(33); // Paper - no longer used
private final TickingTracker tickingTicketsTracker = new TickingTracker();
private final DistanceManager.PlayerTicketTracker playerTicketManager = new DistanceManager.PlayerTicketTracker(33);
@@ -83,6 +84,46 @@ public abstract class DistanceManager {
this.chunkMap = chunkMap; // Paper
}
@ -98,9 +98,9 @@ index 3542b8b347b9a142c53f300251a05a11e421c36f..2c5cf08e16669d5be8ba7d6e3f9282c7
+ protected long ticketLevelUpdateCount; // Paper - replace ticket level propagator
public boolean runAllUpdates(ChunkMap chunkStorage) {
//this.f.a(); // Paper - no longer used
//this.tickingTicketsTracker.runAllUpdates(); // Paper - no longer used
this.tickingTicketsTracker.runAllUpdates();
org.spigotmc.AsyncCatcher.catchOp("DistanceManagerTick"); // Paper
//this.playerTicketManager.runAllUpdates(); // Paper - no longer used
this.playerTicketManager.runAllUpdates();
- int i = Integer.MAX_VALUE - this.ticketTracker.runDistanceUpdates(Integer.MAX_VALUE);
- boolean flag = i != 0;
+ boolean flag = this.ticketLevelPropagator.propagateUpdates(); // Paper - replace ticket level propagator

View file

@ -5,21 +5,25 @@ Subject: [PATCH] Configurable sculk sensor listener range
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
index 2b1e61dacaf4338d7584dea197c7439251951d81..16506b950bbe12f28cf0217b6131128723019e54 100644
index b7b70a77615dde3f22a9153e17ec2d8edbdcdc7a..579a96d2d6c99d6587ea182f52b6df918f595f17 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
@@ -26,12 +26,15 @@ public class SculkSensorBlockEntity extends BlockEntity implements VibrationList
public void load(CompoundTag nbt) {
super.load(nbt);
this.lastVibrationFrequency = nbt.getInt("last_vibration_frequency");
@@ -36,9 +36,11 @@ public class SculkSensorBlockEntity extends BlockEntity implements VibrationList
this.listener = listener;
});
}
+ if (nbt.contains(PAPER_LISTENER_RANGE_NBT_KEY)) this.listener.listenerRange = nbt.getInt(PAPER_LISTENER_RANGE_NBT_KEY); // Paper
}
+ private static final String PAPER_LISTENER_RANGE_NBT_KEY = "Paper.ListenerRange"; // Paper
@Override
protected void saveAdditional(CompoundTag nbt) {
super.saveAdditional(nbt);
nbt.putInt("last_vibration_frequency", this.lastVibrationFrequency);
@@ -46,6 +48,7 @@ public class SculkSensorBlockEntity extends BlockEntity implements VibrationList
VibrationListener.codec(this).encodeStart(NbtOps.INSTANCE, this.listener).resultOrPartial(LOGGER::error).ifPresent((listenerNbt) -> {
nbt.put("listener", listenerNbt);
});
+ if (this.listener.listenerRange != ((SculkSensorBlock) net.minecraft.world.level.block.Blocks.SCULK_SENSOR).getListenerRange()) nbt.putInt(PAPER_LISTENER_RANGE_NBT_KEY, this.listener.listenerRange); // Paper - only save if it's different from the default
}

View file

@ -4,19 +4,6 @@ Date: Sat, 16 Oct 2021 22:57:31 -0700
Subject: [PATCH] Add missing block data mins and maxes
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftLeaves.java
index 5b0da54982fc0879005fd1db104284eb3318bee8..3c5a2de56724bc784f619f3087140c72a42dc57b 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftLeaves.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/type/CraftLeaves.java
@@ -3,7 +3,7 @@ package org.bukkit.craftbukkit.block.data.type;
import org.bukkit.block.data.type.Leaves;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
-public class CraftLeaves extends CraftBlockData implements Leaves {
+public abstract class CraftLeaves extends CraftBlockData implements Leaves { // Paper - make abstract (not used anyways)
private static final net.minecraft.world.level.block.state.properties.IntegerProperty DISTANCE = getInteger("distance");
private static final net.minecraft.world.level.block.state.properties.BooleanProperty PERSISTENT = getBoolean("persistent");
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCandle.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCandle.java
index 83f86725c00f0e175cb46c7e27705ca777f413ba..24d16825c10edfed6d22e8e37ddb9fd804b716c4 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCandle.java
@ -34,22 +21,6 @@ index 83f86725c00f0e175cb46c7e27705ca777f413ba..24d16825c10edfed6d22e8e37ddb9fd8
// org.bukkit.craftbukkit.block.data.CraftLightable
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCauldron.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCauldron.java
index e17a85182555b7b50b4b1e42af871462699dba06..ef90de836888caa0a56c9c34c15bcd0d6c2d16a8 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCauldron.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftCauldron.java
@@ -31,4 +31,11 @@ public final class CraftCauldron extends org.bukkit.craftbukkit.block.data.Craft
public int getMaximumLevel() {
return getMax(CraftCauldron.LEVEL);
}
+
+ // Paper start
+ @Override
+ public int getMinimumLevel() {
+ return getMin(CraftCauldron.LEVEL);
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java
index 780b6a29592571f4a730a858734256f69519cca7..ef97e77b25562a8aed35d68d42ced4825d43a29d 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftComposter.java
@ -99,12 +70,12 @@ index 0d08c81dd8582ef4f259f0e0db88e1b85d79f2a1..5b96ec73bf7bd4d90ce77cfe8ffec825
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLeaves.java b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLeaves.java
index c4ac30e38bf786c491e0e1d47a9003f2b8e1d985..709812fd312f9eddfada21d3836eca6a696183fd 100644
index 2775bcc7d61806764a121d45621a8928f5e301e7..8cb0f9bf8a2e264e089a0278d5fb4b157844f6e4 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLeaves.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/impl/CraftLeaves.java
@@ -37,4 +37,16 @@ public final class CraftLeaves extends org.bukkit.craftbukkit.block.data.CraftBl
public void setDistance(int distance) {
set(CraftLeaves.DISTANCE, distance);
@@ -51,4 +51,16 @@ public final class CraftLeaves extends org.bukkit.craftbukkit.block.data.CraftBl
public void setWaterlogged(boolean waterlogged) {
set(CraftLeaves.WATERLOGGED, waterlogged);
}
+
+ // Paper start

View file

@ -10,12 +10,12 @@ just looking at the LevelStem key, look at the DimensionType key which
is one level below that. Defaults to off to keep vanilla behavior.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 66d360b2c4ae9e380ec6c452a263c04bd3aef4ff..1ac6cf51f2682d5eb14fe19646e79f6617d492dd 100644
index 8fff289a02234cbe5e808fe6e736788a2ed1e5c2..72e17ac76e5f3ac1283bec2133f76bc197353dd6 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -683,4 +683,9 @@ public class PaperConfig {
globalMaxConcurrentChunkLoads = getDouble("settings.chunk-loading.global-max-concurrent-loads", 500.0);
playerMaxChunkLoadRate = getDouble("settings.chunk-loading.player-max-chunk-load-rate", -1.0);
@@ -642,4 +642,9 @@ public class PaperConfig {
private static void timeCommandAffectsAllWorlds() {
timeCommandAffectsAllWorlds = getBoolean("settings.time-command-affects-all-worlds", timeCommandAffectsAllWorlds);
}
+
+ public static boolean useDimensionTypeForCustomSpawners;
@ -24,22 +24,22 @@ index 66d360b2c4ae9e380ec6c452a263c04bd3aef4ff..1ac6cf51f2682d5eb14fe19646e79f66
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c2c1242bcf26c73b3520c797e77c3c2d430dfac7..443fb9cdce8bf542ca6216aa65c3e48c66dde654 100644
index 47966d87c525067f0bc3d587cdf869d89cf5710c..dc585e962033c991f323d41a8a34e791a7cebe80 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -617,7 +617,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -585,7 +585,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.commandStorage = new CommandStorage(worldpersistentdata);
} else {
ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11);
- world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, holder, worldloadlistener, chunkgenerator, flag, j, ImmutableList.of(), true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
- world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, ImmutableList.of(), true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
+ // Paper start - option to use the dimension_type to check if spawners should be added. I imagine mojang will add some datapack-y way of managing this in the future.
+ final List<CustomSpawner> spawners;
+ if (com.destroystokyo.paper.PaperConfig.useDimensionTypeForCustomSpawners && this.registryHolder.registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY).getResourceKey(holder.value()).orElseThrow() == DimensionType.OVERWORLD_LOCATION) {
+ if (com.destroystokyo.paper.PaperConfig.useDimensionTypeForCustomSpawners && this.registryHolder.registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY).getResourceKey(worlddimension.typeHolder().value()).orElseThrow() == net.minecraft.world.level.dimension.BuiltinDimensionTypes.OVERWORLD) {
+ spawners = list;
+ } else {
+ spawners = Collections.emptyList();
+ }
+ world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, holder, worldloadlistener, chunkgenerator, flag, j, spawners, true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
+ world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, spawners, true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
+ // Paper end
}

View file

@ -7,10 +7,10 @@ Some parts of legacy conversion will need the overworld
to get the legacy structure data storage
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 443fb9cdce8bf542ca6216aa65c3e48c66dde654..e4461fb3485391ec0a9d902d5b896bb95e7512b5 100644
index dc585e962033c991f323d41a8a34e791a7cebe80..5bc41ec40452a81659d80edb3e28a8a7415434b2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -629,9 +629,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -597,9 +597,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
@ -23,10 +23,10 @@ index 443fb9cdce8bf542ca6216aa65c3e48c66dde654..e4461fb3485391ec0a9d902d5b896bb9
if (worlddata.getCustomBossEvents() != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2e0517aa65102af5c7aef08acbc25646b1a0afd8..810986cc3b349a66c02f2a682daac8b4422917ae 100644
index 3795f867ff439a3bce293aa6ad3754a1e218e8a8..93aa05cf65b4f31804b9b33081f181999be2a986 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1255,10 +1255,11 @@ public final class CraftServer implements Server {
@@ -1231,10 +1231,11 @@ public final class CraftServer implements Server {
return null;
}

View file

@ -13,20 +13,18 @@ This is caused by the fact that setPacketCoordinates isn't called on paintings w
on the client for some reason. This causes it to be relatively teleported to the world origin (0,0,0).
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index fe29bf349b987d633b185b9d44d221053fa2cc83..f91e1a876ad4c46a7c92cead18947a941b4d9e68 100644
index a482cc1c4d7eab531cd3f5cf42f7d3a43470ef6b..3eb947e16684965b861a07591f18db838e7c874b 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -164,13 +164,14 @@ public class ServerEntity {
}
// CraftBukkit end
@@ -152,11 +152,12 @@ public class ServerEntity {
boolean flag2 = flag1 || this.tickCount % 60 == 0;
boolean flag3 = Math.abs(i - this.yRotp) >= 1 || Math.abs(j - this.xRotp) >= 1;
- if (this.tickCount > 0 || this.entity instanceof AbstractArrow) {
+ if (!(this.entity instanceof net.minecraft.world.entity.decoration.HangingEntity) || this.tickCount > 0 || this.entity instanceof AbstractArrow) { // Paper - Always update position
// Paper start - remove allocation of Vec3D here
long k = ClientboundMoveEntityPacket.entityToPacket(vec3d_dx);
long l = ClientboundMoveEntityPacket.entityToPacket(vec3d_dy);
long i1 = ClientboundMoveEntityPacket.entityToPacket(vec3d_dz);
// Paper end - remove allocation of Vec3D here
long k = this.positionCodec.encodeX(vec3d);
long l = this.positionCodec.encodeY(vec3d);
long i1 = this.positionCodec.encodeZ(vec3d);
boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
+ if (this.entity instanceof net.minecraft.world.entity.decoration.Painting) {flag4 = true;} // Paper - Always send exact position for paintings

View file

@ -24,10 +24,10 @@ index 0000000000000000000000000000000000000000..6b0bed550763f34e18c9e92f9a47ec0c
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e4461fb3485391ec0a9d902d5b896bb95e7512b5..b079677723ff65f64adec044e7d89656ecc49e4d 100644
index 5bc41ec40452a81659d80edb3e28a8a7415434b2..33953cc7afc2616577b768a23a7d4ce0230cf480 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2055,6 +2055,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2021,6 +2021,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository));
this.resources.managers.updateRegistryTags(this.registryAccess());
io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
@ -151,10 +151,10 @@ index eee96f87f68d9146b1d19d5923d073fb5c39d507..5d86895f93cadcf0b123263c2a6f718f
addContainer(Items.POTION);
addContainer(Items.SPLASH_POTION);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
index 287205bce7f655f9a6b815f40d349c3db4c1e788..5c0f1488c8a8100cd39a03adeccded9984722249 100644
index 3d688e334c7287f41460bd866bfd1155e8bb55d2..55006724ccec9f3de828ec18693728e9741ff65f 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
@@ -336,7 +336,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
@@ -335,7 +335,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
@Override
public boolean canPlaceItem(int slot, ItemStack stack) {
@ -164,10 +164,10 @@ index 287205bce7f655f9a6b815f40d349c3db4c1e788..5c0f1488c8a8100cd39a03adeccded99
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 810986cc3b349a66c02f2a682daac8b4422917ae..6333688c49b8c9dd2476634ad3968b468b3d5147 100644
index 93aa05cf65b4f31804b9b33081f181999be2a986..1b4fcbbbbb9b006814bd4a43f1c0001b59c759ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -285,6 +285,7 @@ public final class CraftServer implements Server {
@@ -279,6 +279,7 @@ public final class CraftServer implements Server {
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
public static Exception excessiveVelEx; // Paper - Velocity warnings
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
@ -175,7 +175,7 @@ index 810986cc3b349a66c02f2a682daac8b4422917ae..6333688c49b8c9dd2476634ad3968b46
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
@@ -311,7 +312,7 @@ public final class CraftServer implements Server {
@@ -305,7 +306,7 @@ public final class CraftServer implements Server {
Enchantments.SHARPNESS.getClass();
org.bukkit.enchantments.Enchantment.stopAcceptingRegistrations();
@ -184,7 +184,7 @@ index 810986cc3b349a66c02f2a682daac8b4422917ae..6333688c49b8c9dd2476634ad3968b46
MobEffects.BLINDNESS.getClass();
PotionEffectType.stopAcceptingRegistrations();
// Ugly hack :(
@@ -2877,5 +2878,10 @@ public final class CraftServer implements Server {
@@ -2858,5 +2859,10 @@ public final class CraftServer implements Server {
return datapackManager;
}

View file

@ -18,7 +18,7 @@ index 89cb1ec575c0f58e9934d98b056621348dbbe27a..cdd474e9b0363641839a66d3e61fec46
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 5b05ef93a02e8a8525cf1558273d0f8963407862..88abd2d3a9626501b1800ee754b98c6c29c75fb9 100644
index 8d0de7b529a9dc946b6b56e83238dcacb4496906..377b018aa60b5efdae0e55960670748d6ec68191 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -201,7 +201,7 @@ public final class CraftMagicNumbers implements UnsafeValues {

View file

@ -10,7 +10,7 @@ so we do not need that. The client only needs the chunk it is currently in to
be loaded to close the loading screen, so we just send an empty one.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 3ffb0ae65ed530464462ec3b8cdb2db43c4d1b69..2a8c3082d07244f8f00d644e01e875b81264324d 100644
index 6951b8e320dcea2c2ce4271ed03a20c729ff503b..9110288a30c02e69eb5978f433fd7098ae7a955a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -422,6 +422,13 @@ public abstract class PlayerList {

View file

@ -8,10 +8,10 @@ Restores the API behavior from previous versions of the server
- Do not replace the existing block in the world
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index e996ffb6fd952208b1dabba8b470fd42f004919d..6e827ed6212915b187e4c610acf6c34037c9c994 100644
index d1fca0e3227b5f37c11367548be362f5a49b6a71..5628940cd3c3566c5db2beda506d4f20b6e3cbae 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -549,7 +549,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@@ -566,7 +566,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
// Paper end
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
BlockPos pos = new BlockPos(x, y, z);
@ -21,7 +21,7 @@ index e996ffb6fd952208b1dabba8b470fd42f004919d..6e827ed6212915b187e4c610acf6c340
if (Snowball.class.isAssignableFrom(clazz)) {
entity = new net.minecraft.world.entity.projectile.Snowball(world, x, y, z);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 1a07887345f46582949090b685dae507aaba84f4..f5a6250350a5f0b6236c1fe0f149b1190de34880 100644
index ee0ae10b555cf21e1e618bb3bc173c3be0e4ff2c..105869020cd5b056b984c57f7196e9256e07b83e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1411,7 +1411,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <jahnke.nassim@gmail.com>
Date: Mon, 17 Jan 2022 19:47:19 +0100
Subject: [PATCH] Kick on main for illegal chars
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1a15711e657c93965c2839dc130b7c53d86482b0..b42d4224d7f5c5de7e9fa8d6278af10f84d81245 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2081,7 +2081,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
+ this.server.scheduleOnMain(() -> { // Paper - push to main for event firing
this.disconnect(new TranslatableComponent("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
+ }); // Paper - push to main for event firing
return;
}
}