diff options
author | Emilia Kond <[email protected]> | 2023-06-13 01:00:12 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-12 15:00:12 -0700 |
commit | 2d09115b3a73b27a760dfe7debdbd88b279b29e2 (patch) | |
tree | f9dc39849e410c23536b4f94221b08d8337b13cd /patches/server/0795-Fix-falling-block-spawn-methods.patch | |
parent | 87dfff4cfabefe329d6b6f6b8e2985e4778bd8d3 (diff) | |
download | Paper-2d09115b3a73b27a760dfe7debdbd88b279b29e2.tar.gz Paper-2d09115b3a73b27a760dfe7debdbd88b279b29e2.zip |
Use net.kyori.ansi for console logging (#9313)
Uses the new ANSIComponentSerializer introduced in Adventure 4.14.0 to
serialize components when logging them via the ComponentLogger, or when
sending messages to the console.
This replaces the old solution which uses legacy jank and custom color
conversions, with a new library that handles the conversion and config
Diffstat (limited to 'patches/server/0795-Fix-falling-block-spawn-methods.patch')
-rw-r--r-- | patches/server/0795-Fix-falling-block-spawn-methods.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/patches/server/0795-Fix-falling-block-spawn-methods.patch b/patches/server/0795-Fix-falling-block-spawn-methods.patch new file mode 100644 index 0000000000..9d47ce782e --- /dev/null +++ b/patches/server/0795-Fix-falling-block-spawn-methods.patch @@ -0,0 +1,57 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke <[email protected]> +Date: Fri, 4 Mar 2022 20:35:19 +0100 +Subject: [PATCH] Fix falling block spawn methods + +Restores the API behavior from previous versions of the server +- Do not call API events +- Do not replace the existing block in the world + +== AT == +public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +index c738fb984ffd120e5adccdb5828833f180e72e80..5c8e905bbf56dd2af5b30d34371793c3f98801ab 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +@@ -599,7 +599,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor { + // Paper end + } else if (FallingBlock.class.isAssignableFrom(clazz)) { + BlockPos pos = BlockPos.containing(x, y, z); +- entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos)); ++ entity = new FallingBlockEntity(world, x, y, z, this.getHandle().getBlockState(pos)); // Paper + } else if (Projectile.class.isAssignableFrom(clazz)) { + 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 2b0ed0b70b01e1efd315ec13492a53ec728a9fec..3ccba43d0eaa4ad867a555a92dd41f5924fc8b44 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -1391,7 +1391,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { + Validate.notNull(material, "Material cannot be null"); + Validate.isTrue(material.isBlock(), "Material must be a block"); + +- FallingBlockEntity entity = FallingBlockEntity.fall(world, BlockPos.containing(location.getX(), location.getY(), location.getZ()), CraftMagicNumbers.getBlock(material).defaultBlockState(), SpawnReason.CUSTOM); ++ // Paper start - restore API behavior for spawning falling blocks ++ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), CraftMagicNumbers.getBlock(material).defaultBlockState()); // Paper ++ entity.time = 1; ++ ++ this.world.addFreshEntity(entity, SpawnReason.CUSTOM); ++ // Paper end + return (FallingBlock) entity.getBukkitEntity(); + } + +@@ -1400,7 +1405,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { + Validate.notNull(location, "Location cannot be null"); + Validate.notNull(data, "BlockData cannot be null"); + +- FallingBlockEntity entity = FallingBlockEntity.fall(world, BlockPos.containing(location.getX(), location.getY(), location.getZ()), ((CraftBlockData) data).getState(), SpawnReason.CUSTOM); ++ // Paper start - restore API behavior for spawning falling blocks ++ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), ((CraftBlockData) data).getState()); ++ entity.time = 1; ++ ++ this.world.addFreshEntity(entity, SpawnReason.CUSTOM); ++ // Paper end + return (FallingBlock) entity.getBukkitEntity(); + } + |