fixed setBlock calls to null
This commit is contained in:
parent
c516cc5862
commit
976b6733da
7 changed files with 14 additions and 13 deletions
|
@ -141,7 +141,7 @@ public class BlockMarker extends BlockContainer {
|
||||||
int meta = world.getBlockMetadata(x, y, z);
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
if (!canPlaceBlockOnSide(world, x, y, z, meta)) {
|
if (!canPlaceBlockOnSide(world, x, y, z, meta)) {
|
||||||
dropBlockAsItem(world, x, y, z, 0, 0);
|
dropBlockAsItem(world, x, y, z, 0, 0);
|
||||||
world.setBlock(x, y, z, null);
|
world.setBlockToAir(x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
||||||
path = ((TilePathMarker) tile).getPath();
|
path = ((TilePathMarker) tile).getPath();
|
||||||
|
|
||||||
for (BlockIndex b : path) {
|
for (BlockIndex b : path) {
|
||||||
worldObj.setBlock(b.x, b.y, b.z, null);
|
worldObj.setBlockToAir(b.x, b.y, b.z);
|
||||||
|
|
||||||
BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(worldObj, b.x, b.y, b.z, 0, 0);
|
BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(worldObj, b.x, b.y, b.z, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -404,13 +404,13 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
|
||||||
|
|
||||||
for (TileWrapper m : o.vect.clone()) {
|
for (TileWrapper m : o.vect.clone()) {
|
||||||
if (m.isSet()) {
|
if (m.isSet()) {
|
||||||
worldObj.setBlock(m.x, m.y, m.z, null);
|
worldObj.setBlockToAir(m.x, m.y, m.z);
|
||||||
|
|
||||||
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, m.x, m.y, m.z, 0, 0);
|
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, m.x, m.y, m.z, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
worldObj.setBlock(o.vectO.x, o.vectO.y, o.vectO.z, null);
|
worldObj.setBlockToAir(o.vectO.x, o.vectO.y, o.vectO.z);
|
||||||
|
|
||||||
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, 0, 0);
|
BuildCraftBuilders.markerBlock.dropBlockAsItem(worldObj, o.vectO.x, o.vectO.y, o.vectO.z, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class BlockUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
world.setBlock(x, y, z, null);
|
world.setBlockToAir(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAnObstructingBlock(Block block, World world, int x, int y, int z) {
|
public static boolean isAnObstructingBlock(Block block, World world, int x, int y, int z) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
@ -31,26 +32,26 @@ public class BucketHandler {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onBucketFill(FillBucketEvent event) {
|
public void onBucketFill(FillBucketEvent event) {
|
||||||
|
|
||||||
ItemStack result = fillCustomBucket(event.world, event.target);
|
ItemStack result = fillCustomBucket(event.world, event.target);
|
||||||
|
|
||||||
if (result == null)
|
if (result == null) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
event.result = result;
|
event.result = result;
|
||||||
event.setResult(Result.ALLOW);
|
event.setResult(Result.ALLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
|
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
|
||||||
|
|
||||||
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||||
|
|
||||||
Item bucket = Item.getItemFromBlock(block);
|
Item bucket = Item.getItemFromBlock(block);
|
||||||
|
|
||||||
if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
|
if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
|
||||||
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, null);
|
world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
|
||||||
return new ItemStack(bucket);
|
return new ItemStack(bucket);
|
||||||
} else
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,7 +330,7 @@ public class OilPopulate {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!world.isAirBlock(x, y + 1, z)) {
|
if (!world.isAirBlock(x, y + 1, z)) {
|
||||||
world.setBlock(x, y + 1, z, null, 0, update);
|
world.setBlock(x, y + 1, z, Blocks.air, 0, update);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int d = 1; d <= depth - 1; d++) {
|
for (int d = 1; d <= depth - 1; d++) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class BlockFrame extends Block implements IFramePipeConnection {
|
||||||
|
|
||||||
int meta = world.getBlockMetadata(i, j, k);
|
int meta = world.getBlockMetadata(i, j, k);
|
||||||
if (meta == 1 && random.nextInt(10) > 5) {
|
if (meta == 1 && random.nextInt(10) > 5) {
|
||||||
world.setBlock(i, j, k, null);
|
world.setBlockToAir(i, j, k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue