diff --git a/src/main/java/net/minecraft/server/WorldGenerator.java b/src/main/java/net/minecraft/server/WorldGenerator.java index f79a0fbaef..94c225a8d4 100644 --- a/src/main/java/net/minecraft/server/WorldGenerator.java +++ b/src/main/java/net/minecraft/server/WorldGenerator.java @@ -20,23 +20,31 @@ public abstract class WorldGenerator { public void a(double d0, double d1, double d2) {} - // CraftBukkit - change signature - protected void setType(CraftBlockChangeDelegate world, int i, int j, int k, Block block) { + protected void setType(World world, int i, int j, int k, Block block) { this.setTypeAndData(world, i, j, k, block, 0); } - // CraftBukkit - change signature + // CraftBukkit start - Duplicate method to add support for CraftBlockChangeDelegate + protected void setType(CraftBlockChangeDelegate world, int i, int j, int k, Block block) { + this.setTypeAndData(world, i, j, k, block, 0); + } + // CraftBukkit end + + protected void setTypeAndData(World world, int i, int j, int k, Block block, int l) { + if (this.a) { + world.setTypeAndData(i, j, k, block, l, 3); + } else { + world.setTypeAndData(i, j, k, block, l, 2); + } + } + + // CraftBukkit start - Duplicate method to add support for CraftBlockChangeDelegate protected void setTypeAndData(CraftBlockChangeDelegate world, int i, int j, int k, Block block, int l) { if (this.a) { world.setTypeAndData(i, j, k, block, l, 3); } else { - // CraftBukkit start - Layering violation :( - if (world.getDelegate() instanceof World) { - ((World) world.getDelegate()).setTypeAndData(i, j, k, block, l, 2); - } else { - world.setTypeAndData(i, j, k, block, l, 2); - } - // CraftBukkit end + world.setTypeAndData(i, j, k, block, l, 2); } } + // CraftBukkit end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftBlockChangeDelegate.java b/src/main/java/org/bukkit/craftbukkit/CraftBlockChangeDelegate.java index 470828a222..5946e7d064 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftBlockChangeDelegate.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftBlockChangeDelegate.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit; import net.minecraft.server.Block; +import net.minecraft.server.World; import org.bukkit.BlockChangeDelegate; @@ -19,8 +20,13 @@ public class CraftBlockChangeDelegate { return Block.e(this.delegate.getTypeId(x, y, z)); } - public void setTypeAndData(int x, int y, int z, Block block, int data, int light) { - delegate.setRawTypeIdAndData(x, y, z, Block.b(block), data); + public void setTypeAndData(int x, int y, int z, Block block, int data, int updateFlag) { + // Layering violation :( + if (delegate instanceof World) { + ((World) delegate).setTypeAndData(x, y, z, block, data, 2); + } else { + delegate.setRawTypeIdAndData(x, y, z, Block.b(block), data); + } } public boolean isEmpty(int x, int y, int z) {