Preserve source block in mushroom spread event. Fixes BUKKIT-3354
Dieser Commit ist enthalten in:
Ursprung
f10c986136
Commit
b82375a596
@ -48,6 +48,12 @@ public class BlockMushroom extends BlockFlower {
|
||||
j1 = j + random.nextInt(2) - random.nextInt(2);
|
||||
k1 = k + random.nextInt(3) - 1;
|
||||
|
||||
// CraftBukkit start - preserve source block coordinates
|
||||
int sourceX = i;
|
||||
int sourceY = j;
|
||||
int sourceZ = k;
|
||||
// CraftBukkit end
|
||||
|
||||
for (int l1 = 0; l1 < 4; ++l1) {
|
||||
if (world.isEmpty(i1, j1, k1) && this.d(world, i1, j1, k1)) {
|
||||
i = i1;
|
||||
@ -66,7 +72,7 @@ public class BlockMushroom extends BlockFlower {
|
||||
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
|
||||
blockState.setTypeId(this.id);
|
||||
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState);
|
||||
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(sourceX, sourceY, sourceZ), blockState);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren