fixed setBlock calls to null

This commit is contained in:
SpaceToad 2014-02-09 19:55:54 +01:00
parent c516cc5862
commit 976b6733da
7 changed files with 14 additions and 13 deletions

View file

@ -141,7 +141,7 @@ public class BlockMarker extends BlockContainer {
int meta = world.getBlockMetadata(x, y, z);
if (!canPlaceBlockOnSide(world, x, y, z, meta)) {
dropBlockAsItem(world, x, y, z, 0, 0);
world.setBlock(x, y, z, null);
world.setBlockToAir(x, y, z);
}
}

View file

@ -189,7 +189,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
path = ((TilePathMarker) tile).getPath();
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);
}

View file

@ -404,13 +404,13 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
for (TileWrapper m : o.vect.clone()) {
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);
}
}
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);
}

View file

@ -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) {

View file

@ -14,6 +14,7 @@ import java.util.Map;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
@ -31,26 +32,26 @@ public class BucketHandler {
@SubscribeEvent
public void onBucketFill(FillBucketEvent event) {
ItemStack result = fillCustomBucket(event.world, event.target);
if (result == null)
if (result == null) {
return;
}
event.result = result;
event.setResult(Result.ALLOW);
}
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
Item bucket = Item.getItemFromBlock(block);
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);
} else
} else {
return null;
}
}
}

View file

@ -330,7 +330,7 @@ public class OilPopulate {
return;
}
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++) {

View file

@ -47,7 +47,7 @@ public class BlockFrame extends Block implements IFramePipeConnection {
int meta = world.getBlockMetadata(i, j, k);
if (meta == 1 && random.nextInt(10) > 5) {
world.setBlock(i, j, k, null);
world.setBlockToAir(i, j, k);
}
}