got gas ore gen working

This commit is contained in:
Robert 2013-11-22 16:59:14 -05:00
parent ec59a3d8b5
commit 15fd2fdb30
2 changed files with 5 additions and 26 deletions

View file

@ -87,34 +87,18 @@ public class BlockGasOre extends Block implements IGasBlock
}
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
{
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityGasBlock)
{
FluidStack fluid = ((TileEntityGasBlock) entity).getFluidStack();
entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Gas Stack: " + (fluid != null ? fluid.getFluid().getName() : "null")));
}
return true;
}
/* IFluidBlock */
@Override
public FluidStack drain(World world, int x, int y, int z, boolean doDrain)
{
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity instanceof TileEntityGasBlock)
{
FluidStack fluid = ((TileEntityGasBlock) entity).getFluidStack();
int meta = world.getBlockMetadata(x, y, z);
FluidStack fluid = new FluidStack(EnumGas.NATURAL_GAS.getGas(), volumePerMeta[meta]);
if (doDrain || fluid == null)
{
world.setBlockToAir(x, y, z);
}
return fluid;
}
return null;
}
@Override
public boolean canDrain(World world, int x, int y, int z)

View file

@ -107,7 +107,6 @@ public class GasOreGenerator implements IWorldGenerator
Block block = Block.blocksList[blockid];
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (block == null || block.isAirBlock(world, x, y, z) || block.canBeReplacedByLeaves(world, x, y, z) || blockid == this.replaceID))
{
System.out.println("Generated a gas at " + x + "x " + y + "y " + z + "z ");
world.setBlock(x, y, z, CoreRecipeLoader.blockGas.blockID, 10 + world.rand.nextInt(5), 2);
}
}
@ -122,10 +121,6 @@ public class GasOreGenerator implements IWorldGenerator
public boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator)
{
if (chunkGenerator instanceof ChunkProviderGenerate)
{
return false;
}
if (chunkGenerator instanceof ChunkProviderHell)
{
return false;