mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Updated Upstream (Bukkit/CraftBukkit) (#7776)
This commit is contained in:
@@ -3,6 +3,9 @@ From: Nassim Jahnke <nassim@njahnke.dev>
|
||||
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
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
@@ -25,17 +28,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
Validate.notNull(material, "Material cannot be null");
|
||||
Validate.isTrue(material.isBlock(), "Material must be a block");
|
||||
|
||||
- FallingBlockEntity entity = FallingBlockEntity.fall(world, new BlockPos(location.getX(), location.getY(), location.getZ()), CraftMagicNumbers.getBlock(material).defaultBlockState());
|
||||
- FallingBlockEntity entity = FallingBlockEntity.fall(world, new BlockPos(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;
|
||||
+ entity.time = 1;
|
||||
+
|
||||
+ this.world.addFreshEntity(entity, SpawnReason.CUSTOM);
|
||||
+ // Paper end
|
||||
return (FallingBlock) entity.getBukkitEntity();
|
||||
}
|
||||
|
||||
this.world.addFreshEntity(entity, SpawnReason.CUSTOM);
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
Validate.notNull(location, "Location cannot be null");
|
||||
Validate.notNull(data, "Material cannot be null");
|
||||
Validate.notNull(data, "BlockData cannot be null");
|
||||
|
||||
- FallingBlockEntity entity = FallingBlockEntity.fall(world, new BlockPos(location.getX(), location.getY(), location.getZ()), ((CraftBlockData) data).getState());
|
||||
+ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), ((CraftBlockData) data).getState()); // Paper
|
||||
entity.time = 1;
|
||||
- FallingBlockEntity entity = FallingBlockEntity.fall(world, new BlockPos(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();
|
||||
}
|
||||
|
||||
this.world.addFreshEntity(entity, SpawnReason.CUSTOM);
|
||||
|
Reference in New Issue
Block a user