2013-11-04 14:07:38 +01:00
|
|
|
package org.bukkit.craftbukkit;
|
|
|
|
|
|
|
|
import net.minecraft.server.Block;
|
2013-12-03 03:41:51 +01:00
|
|
|
import net.minecraft.server.World;
|
2013-11-04 14:07:38 +01:00
|
|
|
|
|
|
|
import org.bukkit.BlockChangeDelegate;
|
|
|
|
|
|
|
|
public class CraftBlockChangeDelegate {
|
|
|
|
private final BlockChangeDelegate delegate;
|
|
|
|
|
|
|
|
public CraftBlockChangeDelegate(BlockChangeDelegate delegate) {
|
|
|
|
this.delegate = delegate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public BlockChangeDelegate getDelegate() {
|
|
|
|
return delegate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Block getType(int x, int y, int z) {
|
|
|
|
return Block.e(this.delegate.getTypeId(x, y, z));
|
|
|
|
}
|
|
|
|
|
2013-12-03 03:41:51 +01:00
|
|
|
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);
|
|
|
|
}
|
2013-11-04 14:07:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isEmpty(int x, int y, int z) {
|
|
|
|
return delegate.isEmpty(x, y, z);
|
|
|
|
}
|
|
|
|
}
|