got gas ore gen working
This commit is contained in:
parent
ec59a3d8b5
commit
15fd2fdb30
2 changed files with 5 additions and 26 deletions
|
@ -87,33 +87,17 @@ 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)
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
FluidStack fluid = new FluidStack(EnumGas.NATURAL_GAS.getGas(), volumePerMeta[meta]);
|
||||
if (doDrain || fluid == null)
|
||||
{
|
||||
FluidStack fluid = ((TileEntityGasBlock) entity).getFluidStack();
|
||||
if (doDrain || fluid == null)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
return fluid;
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
return null;
|
||||
return fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue