Direct all BlockPlaceEvents to a singular location. Fixes BUKKIT-3438
By having a single function to process BlockPlacement logic, we make it so that there is consistent behavior throughout all BlockPlace events. This should allow for easier troubleshooting and less diffs in source. This also fixes BUKKIT-3463 by including the correct coordinates that were clicked to the event.
This commit is contained in:
@@ -23,6 +23,7 @@ public class BlockMushroom extends BlockFlower {
|
||||
}
|
||||
|
||||
public void b(World world, int i, int j, int k, Random random) {
|
||||
final int sourceX = i, sourceY = j, sourceZ = k; // CraftBukkit
|
||||
if (random.nextInt(25) == 0) {
|
||||
byte b0 = 4;
|
||||
int l = 5;
|
||||
@@ -48,12 +49,6 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user