fracking
@ -435,6 +435,8 @@ public class ModBlocks {
|
||||
public static Block frozen_grass;
|
||||
public static Block frozen_log;
|
||||
public static Block frozen_planks;
|
||||
public static Block dirt_dead;
|
||||
public static Block dirt_oily;
|
||||
|
||||
public static Block fallout;
|
||||
public static Block foam_layer;
|
||||
@ -853,7 +855,6 @@ public class ModBlocks {
|
||||
public static Block oil_pipe;
|
||||
public static final int guiID_machine_well = 40;
|
||||
public static Block machine_pumpjack;
|
||||
public static final int guiID_machine_pumpjack = 51;
|
||||
public static Block machine_fracking_tower;
|
||||
|
||||
public static Block machine_flare;
|
||||
@ -1587,6 +1588,9 @@ public class ModBlocks {
|
||||
fallout = new BlockFallout(Material.snow).addRadiation(ItemHazard.fo * ItemHazard.powder * 2).toBlock().setBlockName("fallout").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":ash");
|
||||
foam_layer = new BlockLayering(Material.snow).setBlockName("foam_layer").setStepSound(Block.soundTypeSnow).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":foam");
|
||||
sand_boron_layer = new BlockLayering(Material.sand).setBlockName("sand_boron_layer").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":sand_boron");
|
||||
|
||||
dirt_dead = new BlockGeneric(Material.ground).setBlockName("dirt_dead").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":dirt_dead");
|
||||
dirt_oily = new BlockGeneric(Material.ground).setBlockName("dirt_oily").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_oily");
|
||||
|
||||
sellafield_slaked = new BlockGeneric(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked");
|
||||
sellafield_0 = new BlockHazard(Material.rock).addRadiation(0.5F).toBlock().setBlockName("sellafield_0").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0");
|
||||
@ -1963,9 +1967,9 @@ public class ModBlocks {
|
||||
boat = new DecoBlock(Material.iron).setBlockName("boat").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":boat");
|
||||
bomber = new DecoBlock(Material.iron).setBlockName("bomber").setStepSound(Block.soundTypeMetal).setHardness(10.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
|
||||
machine_well = new MachineOilWell().setBlockName("machine_well").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_well");
|
||||
machine_pumpjack = new MachinePumpjack(Material.iron).setBlockName("machine_pumpjack").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_pumpjack");
|
||||
machine_fracking_tower = new MachineFrackingTower().setBlockName("machine_fracking_tower").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_well = new MachineOilWell().setBlockName("machine_well").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_well");
|
||||
machine_pumpjack = new MachinePumpjack().setBlockName("machine_pumpjack").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_pumpjack");
|
||||
machine_fracking_tower = new MachineFrackingTower().setBlockName("machine_fracking_tower").setHardness(5.0F).setResistance(60.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_pipe");
|
||||
machine_flare = new MachineGasFlare(Material.iron).setBlockName("machine_flare").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_flare");
|
||||
machine_refinery = new MachineRefinery(Material.iron).setBlockName("machine_refinery").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_refinery");
|
||||
@ -2094,8 +2098,8 @@ public class ModBlocks {
|
||||
dummy_block_centrifuge = new DummyBlockCentrifuge(Material.iron).setBlockName("dummy_block_centrifuge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_cyclotron = new DummyBlockCyclotron(Material.iron).setBlockName("dummy_block_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_port_cyclotron = new DummyBlockCyclotron(Material.iron).setBlockName("dummy_port_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_block_well = new DummyBlockWell(Material.iron).setBlockName("dummy_block_well").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_well = new DummyBlockWell(Material.iron).setBlockName("dummy_port_well").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_well = new BlockGeneric(Material.iron).setBlockName("dummy_block_well").setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_well = new BlockGeneric(Material.iron).setBlockName("dummy_port_well").setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_flare = new DummyBlockFlare(Material.iron).setBlockName("dummy_block_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
dummy_port_flare = new DummyBlockFlare(Material.iron).setBlockName("dummy_port_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
dummy_block_drill = new DummyBlockDrill(Material.iron).setBlockName("dummy_block_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
@ -2108,8 +2112,8 @@ public class ModBlocks {
|
||||
dummy_port_fluidtank = new DummyBlockFluidTank(Material.iron).setBlockName("dummy_port_fluidtank").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_refinery = new DummyBlockRefinery(Material.iron).setBlockName("dummy_block_refinery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_port_refinery = new DummyBlockRefinery(Material.iron).setBlockName("dummy_port_refinery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_block_pumpjack = new DummyBlockPumpjack(Material.iron).setBlockName("dummy_block_pumpjack").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_port_pumpjack = new DummyBlockPumpjack(Material.iron).setBlockName("dummy_port_pumpjack").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_block_pumpjack = new BlockGeneric(Material.iron).setBlockName("dummy_block_pumpjack").setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_port_pumpjack = new BlockGeneric(Material.iron).setBlockName("dummy_port_pumpjack").setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_block_turbofan = new DummyBlockTurbofan(Material.iron).setBlockName("dummy_block_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_turbofan = new DummyBlockTurbofan(Material.iron).setBlockName("dummy_port_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_block_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
@ -2531,7 +2535,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(mush_block, mush_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(mush_block_stem, mush_block_stem.getUnlocalizedName());
|
||||
|
||||
//Nuclear Waste
|
||||
//Waste
|
||||
GameRegistry.registerBlock(waste_earth, waste_earth.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(waste_mycelium, waste_mycelium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(waste_trinitite, waste_trinitite.getUnlocalizedName());
|
||||
@ -2542,6 +2546,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(frozen_dirt, frozen_dirt.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(frozen_log, frozen_log.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(frozen_planks, frozen_planks.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dirt_dead, dirt_dead.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dirt_oily, dirt_oily.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fallout, ItemBlockHazard.class, fallout.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(foam_layer, foam_layer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sand_boron_layer, sand_boron_layer.getUnlocalizedName());
|
||||
@ -2856,6 +2862,7 @@ public class ModBlocks {
|
||||
//GameRegistry.registerBlock(machine_deuterium, machine_deuterium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_well, machine_well.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_pumpjack, machine_pumpjack.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_fracking_tower, machine_fracking_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_flare, machine_flare.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_refinery, machine_refinery.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_fraction_tower, machine_fraction_tower.getUnlocalizedName());
|
||||
|
||||
@ -19,7 +19,7 @@ public class BlockBedrockOre extends Block implements IDrillInteraction {
|
||||
|
||||
@Override
|
||||
public boolean canBreak(World world, int x, int y, int z, int meta, IMiningDrill drill) {
|
||||
return false;
|
||||
return drill.getDrillRating() > 70;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -68,7 +68,7 @@ public class BlockCluster extends Block implements IDrillInteraction {
|
||||
|
||||
@Override
|
||||
public boolean canBreak(World world, int x, int y, int z, int meta, IMiningDrill drill) {
|
||||
return drill.getDrillRating() <= 70 && world.rand.nextFloat() < 0.05;
|
||||
return drill.getDrillRating() > 70 || world.rand.nextFloat() < 0.05;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,106 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IDummy;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyBlockPumpjack extends BlockContainer implements IDummy {
|
||||
|
||||
public static boolean safeBreak = false;
|
||||
|
||||
public DummyBlockPumpjack(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityDummy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i)
|
||||
{
|
||||
if(!safeBreak) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
//world.getBlock(a, b, c).breakBlock(world, a, b, c, block, i);
|
||||
if(!world.isRemote)
|
||||
world.func_147480_a(a, b, c, true);
|
||||
}
|
||||
}
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_pumpjack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
TileEntityMachinePumpjack entity = (TileEntityMachinePumpjack) world.getTileEntity(a, b, c);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_pumpjack, world, a, b, c);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,105 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IDummy;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyBlockWell extends BlockContainer implements IDummy {
|
||||
|
||||
public static boolean safeBreak = false;
|
||||
|
||||
public DummyBlockWell(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityDummy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int i)
|
||||
{
|
||||
if(!safeBreak) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
//world.getBlock(a, b, c).breakBlock(world, a, b, c, block, i);
|
||||
if(!world.isRemote)
|
||||
world.func_147480_a(a, b, c, true);
|
||||
}
|
||||
}
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_well);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
TileEntityMachineOilWell entity = (TileEntityMachineOilWell) world.getTileEntity(a, b, c);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_well, world, a, b, c);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,18 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineFrackingTower;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineFrackingTower extends BlockDummyable {
|
||||
|
||||
@ -14,17 +21,60 @@ public class MachineFrackingTower extends BlockDummyable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineFrackingTower();
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityMachineFrackingTower();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {1, 0, 0, 0, 0, 0};
|
||||
return new int[] {3, 0, 0, 0, 0, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
return super.checkRequirement(world, x, y, z, dir, o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, getDimensions(), this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 2, z, new int[] {1, 0, 3, 3, 3, 3}, this, dir);
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x - 2, y + 2, z - 2, new int[] {-1, 2, 0, 1, 0, 1}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 2, y + 2, z + 3, new int[] {-1, 2, 0, 1, 0, 1}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 3, y + 2, z - 2, new int[] {-1, 2, 0, 1, 0, 1}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 3, y + 2, z + 3, new int[] {-1, 2, 0, 1, 0, 1}, this, ForgeDirection.NORTH);
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {10, -4, 2, 2, 2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {24, -9, 1, 1, 1, 1}, this, dir);
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 15, z, new int[] {1, 0, 1, 1, -2, 3}, this, ForgeDirection.WEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_well, world, pos[0], pos[1], pos[2]);
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,297 +1,80 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachinePumpjack extends BlockContainer implements IMultiblock {
|
||||
public class MachinePumpjack extends BlockDummyable {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private Random rand;
|
||||
private static boolean keepInventory;
|
||||
public MachinePumpjack() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
public MachinePumpjack(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityMachinePumpjack();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {3, 0, 0, 0, 0, 6};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
return super.checkRequirement(world, x, y, z, dir, o) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -1, 1, -2, 4}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 1, -1, -1, 5}, x, y, z, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
MultiblockHandlerXR.fillSpace(world, x + rot.offsetX * 3, y, z + rot.offsetZ * 3, new int[] {0, 0, -1, 1, 1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + rot.offsetX * 3, y, z + rot.offsetZ * 3, new int[] {0, 0, 1, -1, 2, 2}, this, dir);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX * 3 + 1, y, z + rot.offsetZ * 3 + 1);
|
||||
this.makeExtra(world, x + rot.offsetX * 3 + 1, y, z + rot.offsetZ * 3 - 1);
|
||||
this.makeExtra(world, x + rot.offsetX * 3 - 1, y, z + rot.offsetZ * 3 + 1);
|
||||
this.makeExtra(world, x + rot.offsetX * 3 - 1, y, z + rot.offsetZ * 3 - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_pumpjack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachinePumpjack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
TileEntityMachinePumpjack tileentityfurnace = (TileEntityMachinePumpjack)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if (i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.pumpjackDimensionEast)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.pumpjackDimensionEast, ModBlocks.dummy_block_pumpjack);
|
||||
|
||||
//
|
||||
DummyBlockPumpjack.safeBreak = true;
|
||||
world.setBlock(x - 2, y, z + 1, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te = world.getTileEntity(x - 2, y, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 2, y, z - 1, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te2 = world.getTileEntity(x - 2, y, z - 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 3, y, z + 1, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te3 = world.getTileEntity(x - 3, y, z + 1);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 3, y, z - 1, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te4 = world.getTileEntity(x - 3, y, z - 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockPumpjack.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.pumpjackDimensionSouth)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.pumpjackDimensionSouth, ModBlocks.dummy_block_pumpjack);
|
||||
|
||||
//
|
||||
DummyBlockPumpjack.safeBreak = true;
|
||||
world.setBlock(x + 1, y, z - 2, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te = world.getTileEntity(x + 1, y, z - 2);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z - 2, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y, z - 2);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z - 3, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te3 = world.getTileEntity(x + 1, y, z - 3);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z - 3, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y, z - 3);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockPumpjack.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.pumpjackDimensionWest)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.pumpjackDimensionWest, ModBlocks.dummy_block_pumpjack);
|
||||
|
||||
//
|
||||
DummyBlockPumpjack.safeBreak = true;
|
||||
world.setBlock(x + 2, y, z + 1, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te = world.getTileEntity(x + 2, y, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 2, y, z - 1, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te2 = world.getTileEntity(x + 2, y, z - 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 3, y, z + 1, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te3 = world.getTileEntity(x + 3, y, z + 1);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 3, y, z - 1, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te4 = world.getTileEntity(x + 3, y, z - 1);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockPumpjack.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.pumpjackDimensionNorth)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.pumpjackDimensionNorth, ModBlocks.dummy_block_pumpjack);
|
||||
|
||||
//
|
||||
DummyBlockPumpjack.safeBreak = true;
|
||||
world.setBlock(x + 1, y, z + 2, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te = world.getTileEntity(x + 1, y, z + 2);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z + 2, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y, z + 2);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x + 1, y, z + 3, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te3 = world.getTileEntity(x + 1, y, z + 3);
|
||||
if(te3 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te3;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z + 3, ModBlocks.dummy_port_pumpjack);
|
||||
TileEntity te4 = world.getTileEntity(x - 1, y, z + 3);
|
||||
if(te4 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te4;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockPumpjack.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_well, world, pos[0], pos[1], pos[2]);
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -139,6 +139,9 @@ public class MineralRecipes {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_pu238be, 1), new Object[] { "nuggetPlutonium238", "nuggetPlutonium238", "nuggetPlutonium238", ModItems.nugget_beryllium, ModItems.nugget_beryllium, ModItems.nugget_beryllium }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_ra226be, 1), new Object[] { "nuggetRadium226", "nuggetRadium226", "nuggetRadium226", ModItems.nugget_beryllium, ModItems.nugget_beryllium, ModItems.nugget_beryllium }));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_bismuth, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetUranium", "nuggetPlutonium241", ModItems.nugget_bismuth }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_pu241, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetUranium235", "nuggetPlutonium240", "nuggetPlutonium241" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_zfb_am_mix, 1), new Object[] { "nuggetZirconium", "nuggetZirconium", "nuggetZirconium", "nuggetPlutonium241", "nuggetPlutonium241", "nuggetAmericiumRG" }));
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_uranium, 9), new Object[] { ModItems.billet_u235, ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_u238 });
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ingot_uranium, 1), new Object[] { "nuggetUranium235", "nuggetUranium238", "nuggetUranium238", "nuggetUranium238", "nuggetUranium238", "nuggetUranium238", "nuggetUranium238", "nuggetUranium238", "nuggetUranium238" }));
|
||||
|
||||
@ -189,6 +189,9 @@ public class RodRecipes {
|
||||
addRBMKRod(ModItems.billet_schrabidium_fuel, ModItems.rbmk_fuel_mes);
|
||||
addRBMKRod(ModItems.billet_hes, ModItems.rbmk_fuel_hes);
|
||||
addRBMKRod(ModItems.billet_balefire_gold, ModItems.rbmk_fuel_balefire_gold);
|
||||
addRBMKRod(ModItems.billet_zfb_bismuth, ModItems.rbmk_fuel_zfb_bismuth);
|
||||
addRBMKRod(ModItems.billet_zfb_pu241, ModItems.rbmk_fuel_zfb_pu241);
|
||||
addRBMKRod(ModItems.billet_zfb_am_mix, ModItems.rbmk_fuel_zfb_am_mix);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.rbmk_fuel_drx, 1), new Object[] { ModItems.rbmk_fuel_balefire, ModItems.particle_digamma });
|
||||
|
||||
//Water rods
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -46,12 +47,19 @@ public class EntityWaterSplash extends EntityThrowable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition p_70184_1_)
|
||||
{
|
||||
if(this.ticksExisted > 5) {
|
||||
worldObj.spawnParticle("splash", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition p_70184_1_) {
|
||||
if(this.ticksExisted > 5) {
|
||||
worldObj.spawnParticle("splash", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean writeToNBTOptional(NBTTagCompound nbt) {
|
||||
return false;
|
||||
}
|
||||
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
super.readEntityFromNBT(nbt);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,8 +197,8 @@ public class HbmLivingProps implements IExtendedEntityProperties {
|
||||
getData(entity).blacklung = blacklung;
|
||||
|
||||
if(blacklung >= maxBlacklung) {
|
||||
getData(entity).asbestos = 0;
|
||||
entity.attackEntityFrom(ModDamageSource.asbestos, 1000);
|
||||
getData(entity).blacklung = 0;
|
||||
entity.attackEntityFrom(ModDamageSource.blacklung, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -14,8 +14,10 @@ public class FuelHandler implements IFuelHandler {
|
||||
|
||||
if(fuel.getItem().equals(ModItems.solid_fuel))
|
||||
return 3200;
|
||||
if(fuel.getItem().equals(ModItems.biomass_compressed))
|
||||
if(fuel.getItem().equals(ModItems.biomass))
|
||||
return 800;
|
||||
if(fuel.getItem().equals(ModItems.biomass_compressed))
|
||||
return 2400;
|
||||
if(fuel.getItem().equals(ModItems.powder_coal))
|
||||
return 1600;
|
||||
if(fuel.getItem().equals(ModItems.scrap))
|
||||
|
||||
@ -10,9 +10,8 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.bomb.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineGasFlare;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityOilDrillBase;
|
||||
import com.hbm.tileentity.machine.rbmk.*;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
|
||||
@ -309,8 +308,8 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_well: {
|
||||
if(entity instanceof TileEntityMachineOilWell) {
|
||||
return new ContainerMachineOilWell(player.inventory, (TileEntityMachineOilWell) entity);
|
||||
if(entity instanceof TileEntityOilDrillBase) {
|
||||
return new ContainerMachineOilWell(player.inventory, (TileEntityOilDrillBase) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -357,13 +356,6 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_pumpjack: {
|
||||
if(entity instanceof TileEntityMachinePumpjack) {
|
||||
return new ContainerMachinePumpjack(player.inventory, (TileEntityMachinePumpjack) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_turbofan: {
|
||||
if(entity instanceof TileEntityMachineTurbofan) {
|
||||
return new ContainerMachineTurbofan(player.inventory, (TileEntityMachineTurbofan) entity);
|
||||
@ -1151,8 +1143,8 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_well: {
|
||||
if(entity instanceof TileEntityMachineOilWell) {
|
||||
return new GUIMachineOilWell(player.inventory, (TileEntityMachineOilWell) entity);
|
||||
if(entity instanceof TileEntityOilDrillBase) {
|
||||
return new GUIMachineOilWell(player.inventory, (TileEntityOilDrillBase) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -1199,13 +1191,6 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_pumpjack: {
|
||||
if(entity instanceof TileEntityMachinePumpjack) {
|
||||
return new GUIMachinePumpjack(player.inventory, (TileEntityMachinePumpjack) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_turbofan: {
|
||||
if(entity instanceof TileEntityMachineTurbofan) {
|
||||
return new GUIMachineTurbofan(player.inventory, (TileEntityMachineTurbofan) entity);
|
||||
|
||||
@ -234,6 +234,21 @@ public class HazardRegistry {
|
||||
registerRBMKRod(rbmk_fuel_meu, uf * rod_rbmk, uf * rod_rbmk * 100);
|
||||
registerRBMKRod(rbmk_fuel_heu233, u233 * rod_rbmk, u233 * rod_rbmk * 100);
|
||||
registerRBMKRod(rbmk_fuel_heu235, u235 * rod_rbmk, u235 * rod_rbmk * 100);
|
||||
registerRBMKRod(rbmk_fuel_thmeu, thf * rod_rbmk, u233 * rod_rbmk * 10);
|
||||
registerRBMKRod(rbmk_fuel_lep, puf * rod_rbmk, puf * rod_rbmk * 100);
|
||||
registerRBMKRod(rbmk_fuel_mep, purg * rod_rbmk, purg * rod_rbmk * 100);
|
||||
registerRBMKRod(rbmk_fuel_hep239, pu239 * rod_rbmk, pu239 * rod_rbmk * 100);
|
||||
registerRBMKRod(rbmk_fuel_hep241, pu241 * rod_rbmk, pu241 * rod_rbmk * 100);
|
||||
|
||||
registerRBMKPellet(rbmk_pellet_ueu, u * billet, u * billet * 100);
|
||||
registerRBMKPellet(rbmk_pellet_meu, uf * billet, uf * billet * 100);
|
||||
registerRBMKPellet(rbmk_pellet_heu233, u233 * billet, u233 * billet * 100);
|
||||
registerRBMKPellet(rbmk_pellet_heu235, u235 * billet, u235 * billet * 100);
|
||||
registerRBMKPellet(rbmk_pellet_thmeu, thf * billet, u233 * billet * 10);
|
||||
registerRBMKPellet(rbmk_pellet_lep, puf * billet, puf * billet * 100);
|
||||
registerRBMKPellet(rbmk_pellet_mep, purg * billet, purg * billet * 100);
|
||||
registerRBMKPellet(rbmk_pellet_hep239, pu239 * billet, pu239 * billet * 100);
|
||||
registerRBMKPellet(rbmk_pellet_hep241, pu241 * billet, pu241 * billet * 100);
|
||||
|
||||
//TODO
|
||||
}
|
||||
@ -259,9 +274,13 @@ public class HazardRegistry {
|
||||
HazardSystem.register(quad, new HazardData().addEntry(RADIATION, base * rod_quad).addEntry(extra, base2 * rod_quad));
|
||||
}
|
||||
|
||||
private static void registerRBMKPellet(Item rod, float base, float dep) { registerRBMKPellet(rod, base, dep, 0F); }
|
||||
private static void registerRBMKPellet(Item rod, float base, float dep, float blinding) {
|
||||
private static void registerRBMKPellet(Item pellet, float base, float dep) { registerRBMKPellet(pellet, base, dep, 0F); }
|
||||
private static void registerRBMKPellet(Item pellet, float base, float dep, float blinding) {
|
||||
|
||||
HazardData data = new HazardData();
|
||||
data.addEntry(new HazardEntry(RADIATION, base).addMod(new HazardModifierRBMKRadiation(dep)));
|
||||
if(blinding > 0) data.addEntry(new HazardEntry(BLINDING, blinding));
|
||||
HazardSystem.register(pellet, data);
|
||||
}
|
||||
|
||||
private static void registerRBMKRod(Item rod, float base, float dep) { registerRBMK(rod, base, dep, true, 0F); }
|
||||
|
||||
@ -43,6 +43,7 @@ public class FluidContainerRegistry {
|
||||
FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_kerosene), new ItemStack(ModItems.canister_empty), FluidType.KEROSENE, 1000));
|
||||
FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_biofuel), new ItemStack(ModItems.canister_empty), FluidType.BIOFUEL, 1000));
|
||||
FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_gasoline), new ItemStack(ModItems.canister_empty), FluidType.GASOLINE, 1000));
|
||||
FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_fracksol), new ItemStack(ModItems.canister_empty), FluidType.FRACKSOL, 1000));
|
||||
FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.canister_NITAN), new ItemStack(ModItems.canister_empty), FluidType.NITAN, 1000));
|
||||
FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.gas_full), new ItemStack(ModItems.gas_empty), FluidType.GAS, 1000));
|
||||
FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(ModItems.gas_petroleum), new ItemStack(ModItems.gas_empty), FluidType.PETROLEUM, 1000));
|
||||
|
||||
@ -169,21 +169,21 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("stairWoodPink", pink_stairs);
|
||||
|
||||
OreDictionary.registerOre("dyeRed", cinnebar);
|
||||
OreDictionary.registerOre("dye", cinnebar);
|
||||
//OreDictionary.registerOre("dye", cinnebar);
|
||||
OreDictionary.registerOre("dyeYellow", sulfur);
|
||||
OreDictionary.registerOre("dye", sulfur);
|
||||
//OreDictionary.registerOre("dye", sulfur);
|
||||
OreDictionary.registerOre("dyeBlack", powder_coal);
|
||||
OreDictionary.registerOre("dye", powder_coal);
|
||||
//OreDictionary.registerOre("dye", powder_coal);
|
||||
OreDictionary.registerOre("dyeBrown", powder_lignite);
|
||||
OreDictionary.registerOre("dye", powder_lignite);
|
||||
//OreDictionary.registerOre("dye", powder_lignite);
|
||||
OreDictionary.registerOre("dyeLightGray", powder_titanium);
|
||||
OreDictionary.registerOre("dye", powder_titanium);
|
||||
//OreDictionary.registerOre("dye", powder_titanium);
|
||||
OreDictionary.registerOre("dyeWhite", fluorite);
|
||||
OreDictionary.registerOre("dye", fluorite);
|
||||
//OreDictionary.registerOre("dye", fluorite);
|
||||
OreDictionary.registerOre("dyeBlue", powder_lapis);
|
||||
OreDictionary.registerOre("dye", powder_lapis);
|
||||
//OreDictionary.registerOre("dye", powder_lapis);
|
||||
OreDictionary.registerOre("dyeBlack", oil_tar);
|
||||
OreDictionary.registerOre("dye", oil_tar);
|
||||
//OreDictionary.registerOre("dye", oil_tar);
|
||||
|
||||
OreDictionary.registerOre("blockGlass", glass_boron);
|
||||
OreDictionary.registerOre("blockGlass", glass_lead);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityOilDrillBase;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -24,9 +25,13 @@ public class ContainerMachineOilWell extends Container {
|
||||
// Canister Output
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 80, 53));
|
||||
// Gas Input
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 134, 17));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 125, 17));
|
||||
// Gas Output
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 134, 53));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 125, 53));
|
||||
//Upgrades
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 152, 17));
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 152, 35));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 152, 53));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
@ -53,9 +58,12 @@ public class ContainerMachineOilWell extends Container {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(var5, 0, 2, false)) {
|
||||
if(!this.mergeItemStack(var5, 3, 4, false))
|
||||
if(!this.mergeItemStack(var5, 5, 6, false))
|
||||
|
||||
if(var5.getItem() instanceof ItemMachineUpgrade) {
|
||||
if(!this.mergeItemStack(var5, 5, 8, true)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
|
||||
@ -1,133 +0,0 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachinePumpjack extends Container {
|
||||
|
||||
private TileEntityMachinePumpjack testNuke;
|
||||
private int warning;
|
||||
private int warning2;
|
||||
|
||||
public ContainerMachinePumpjack(InventoryPlayer invPlayer, TileEntityMachinePumpjack tedf) {
|
||||
warning = 0;
|
||||
warning2 = 0;
|
||||
|
||||
testNuke = tedf;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 44, 54));
|
||||
//Canister Input
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 134, 18));
|
||||
//Canister Output
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 134, 54));
|
||||
//Gas Input
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 134, 72));
|
||||
//Gas Output
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 4, 134, 108));
|
||||
//Chip
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 8, 90));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.testNuke.warning);
|
||||
crafting.sendProgressBarUpdate(this, 2, this.testNuke.warning2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||
{
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack())
|
||||
{
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 <= 5) {
|
||||
if (!this.mergeItemStack(var5, 6, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(var5, 0, 2, false))
|
||||
{
|
||||
if (!this.mergeItemStack(var5, 3, 4, false))
|
||||
if (!this.mergeItemStack(var5, 5, 6, false))
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return testNuke.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
if(this.warning != this.testNuke.warning)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.testNuke.warning);
|
||||
}
|
||||
if(this.warning2 != this.testNuke.warning2)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 2, this.testNuke.warning2);
|
||||
}
|
||||
}
|
||||
|
||||
this.warning = this.testNuke.warning;
|
||||
this.warning2 = this.testNuke.warning2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 1)
|
||||
{
|
||||
testNuke.warning = j;
|
||||
}
|
||||
if(i == 2)
|
||||
{
|
||||
testNuke.warning2 = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerMachineOilWell;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityOilDrillBase;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -31,7 +30,12 @@ public class GUIMachineOilWell extends GuiInfoContainer {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
derrick.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 69 - 52, 16, 52);
|
||||
derrick.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 116, guiTop + 69 - 52, 16, 52);
|
||||
derrick.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 107, guiTop + 69 - 52, 16, 52);
|
||||
|
||||
if(derrick.tanks.length >= 3) {
|
||||
derrick.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 40, guiTop + 37, 6, 32);
|
||||
}
|
||||
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 17, 16, 34, derrick.power, derrick.getMaxPower());
|
||||
}
|
||||
|
||||
@ -65,6 +69,11 @@ public class GUIMachineOilWell extends GuiInfoContainer {
|
||||
derrick.tanks[0].renderTank(this, guiLeft + 62, guiTop + 69, derrick.tanks[0].getTankType().textureX() * FluidTank.x, derrick.tanks[0].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(derrick.tanks[1].getSheet());
|
||||
derrick.tanks[1].renderTank(this, guiLeft + 116, guiTop + 69, derrick.tanks[1].getTankType().textureX() * FluidTank.x, derrick.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
derrick.tanks[1].renderTank(this, guiLeft + 107, guiTop + 69, derrick.tanks[1].getTankType().textureX() * FluidTank.x, derrick.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
|
||||
if(derrick.tanks.length > 2) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(derrick.tanks[2].getSheet());
|
||||
derrick.tanks[2].renderTank(this, guiLeft + 40, guiTop + 69, derrick.tanks[2].getTankType().textureX() * FluidTank.x, derrick.tanks[2].getTankType().textureY() * FluidTank.y, 6, 32);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerMachinePumpjack;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachinePumpjack extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_well_large.png");
|
||||
private TileEntityMachinePumpjack derrick;
|
||||
|
||||
public GUIMachinePumpjack(InventoryPlayer invPlayer, TileEntityMachinePumpjack tedf) {
|
||||
super(new ContainerMachinePumpjack(invPlayer, tedf));
|
||||
derrick = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
derrick.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 70 - 52, 34, 52);
|
||||
derrick.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 124 - 52, 34, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 70 - 52, 16, 52, derrick.power, derrick.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
String name = this.derrick.hasCustomInventoryName() ? this.derrick.getInventoryName() : I18n.format(this.derrick.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int i = (int)derrick.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 70 - i, 176, 52 - i, 16, i);
|
||||
|
||||
int k = derrick.warning;
|
||||
if(k == 2)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 18, 176, 52, 16, 16);
|
||||
if(k == 1)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 18, 192, 52, 16, 16);
|
||||
|
||||
int l = derrick.warning2;
|
||||
if(l == 1)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 90, 208, 52, 16, 16);
|
||||
if(l == 2)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 90, 224, 52, 16, 16);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(derrick.tanks[0].getSheet());
|
||||
derrick.tanks[0].renderTank(this, guiLeft + 80, guiTop + 70, derrick.tanks[0].getTankType().textureX() * FluidTank.x, derrick.tanks[0].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
derrick.tanks[0].renderTank(this, guiLeft + 96, guiTop + 70, derrick.tanks[0].getTankType().textureX() * FluidTank.x, derrick.tanks[0].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
derrick.tanks[0].renderTank(this, guiLeft + 112, guiTop + 70, derrick.tanks[0].getTankType().textureX() * FluidTank.x, derrick.tanks[0].getTankType().textureY() * FluidTank.y, 2, 52);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(derrick.tanks[1].getSheet());
|
||||
derrick.tanks[1].renderTank(this, guiLeft + 80, guiTop + 124, derrick.tanks[1].getTankType().textureX() * FluidTank.x, derrick.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
derrick.tanks[1].renderTank(this, guiLeft + 96, guiTop + 124, derrick.tanks[1].getTankType().textureX() * FluidTank.x, derrick.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
derrick.tanks[1].renderTank(this, guiLeft + 112, guiTop + 124, derrick.tanks[1].getTankType().textureX() * FluidTank.x, derrick.tanks[1].getTankType().textureY() * FluidTank.y, 2, 52);
|
||||
}
|
||||
}
|
||||
@ -314,6 +314,46 @@ public class SILEXRecipes {
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) );
|
||||
|
||||
// ZFB BI //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i), new SILEXRecipe(600, 100)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 50 - i * 10))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 - i * 10))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 50 + i * 20))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) );
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i + 5), new SILEXRecipe(600, 100)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 50 - i * 10))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 - i * 10))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 50 + i * 20))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) );
|
||||
|
||||
// ZFB PU-241 //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i), new SILEXRecipe(600, 100)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 50 - i * 10))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 50 - i * 10))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 + i * 20))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) );
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i + 5), new SILEXRecipe(600, 100)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 50 - i * 10))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 50 - i * 10))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 + i * 20))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) );
|
||||
|
||||
// ZFB RG-AM //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i), new SILEXRecipe(600, 100)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 100 - i * 20))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am_mix), 50 + i * 20))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) );
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i + 5), new SILEXRecipe(600, 100)
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 100 - i * 20))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am_mix), 50 + i * 20))
|
||||
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) );
|
||||
}
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100)
|
||||
|
||||
@ -786,6 +786,7 @@ public class ModItems {
|
||||
public static Item canister_napalm;
|
||||
public static Item canister_gasoline;
|
||||
public static Item canister_NITAN;
|
||||
public static Item canister_fracksol;
|
||||
|
||||
public static Item canister_heavyoil;
|
||||
public static Item canister_bitumen;
|
||||
@ -3148,6 +3149,7 @@ public class ModItems {
|
||||
canister_petroil = new ItemCustomLore().setUnlocalizedName("canister_petroil").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_petroil");
|
||||
canister_napalm = new ItemCustomLore().setUnlocalizedName("canister_napalm").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_napalm");
|
||||
canister_gasoline = new ItemCustomLore().setUnlocalizedName("canister_gasoline").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_gasoline");
|
||||
canister_fracksol = new ItemCustomLore().setUnlocalizedName("canister_fracksol").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_fracksol");
|
||||
canister_NITAN = new ItemCustomLore().setUnlocalizedName("canister_NITAN").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_superfuel");
|
||||
canister_heavyoil = new ItemCustomLore().setUnlocalizedName("canister_heavyoil").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_heavyoil");
|
||||
canister_bitumen = new ItemCustomLore().setUnlocalizedName("canister_bitumen").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_bitumen");
|
||||
@ -6079,6 +6081,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(canister_biofuel, canister_biofuel.getUnlocalizedName());
|
||||
GameRegistry.registerItem(canister_napalm, canister_napalm.getUnlocalizedName());
|
||||
GameRegistry.registerItem(canister_gasoline, canister_gasoline.getUnlocalizedName());
|
||||
GameRegistry.registerItem(canister_fracksol, canister_fracksol.getUnlocalizedName());
|
||||
GameRegistry.registerItem(canister_NITAN, canister_NITAN.getUnlocalizedName());
|
||||
|
||||
//Gas Tanks
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.render.model.ModelM65;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
@ -59,7 +60,18 @@ public class ItemModGasmask extends ItemArmorMod implements IGasMask {
|
||||
|
||||
@Override
|
||||
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
||||
|
||||
int i = 0;
|
||||
|
||||
ItemStack filter = ArmorUtil.getGasMaskFilter(stack);
|
||||
|
||||
if(filter != null) {
|
||||
i = filter.getItemDamage() / filter.getMaxDamage();
|
||||
}
|
||||
|
||||
list.add(EnumChatFormatting.GREEN + " " + stack.getDisplayName() + " (gas protection)");
|
||||
|
||||
ArmorUtil.addGasMaskTooltip(stack, MainRegistry.proxy.me(), list, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -41,6 +41,8 @@ public class ItemMachineUpgrade extends Item {
|
||||
list.add("Delay -" + (25 * this.tier) + "% / Consumption +" + (300 * this.tier) + "HE/t");
|
||||
list.add(EnumChatFormatting.RED + "Chemical Plant:");
|
||||
list.add("Delay -" + (25 * this.tier) + "% / Consumption +" + (300 * this.tier) + "HE/t");
|
||||
list.add(EnumChatFormatting.RED + "Oil Wells:");
|
||||
list.add("Delay -" + (25 * this.tier) + "% / Consumption +" + (25 * this.tier) + "%");
|
||||
list.add(EnumChatFormatting.RED + "Crystallizer:");
|
||||
list.add("Delay -" + (20 * this.tier) + "% / Consumption +" + (1000 * this.tier) + "HE/t");
|
||||
list.add(EnumChatFormatting.RED + "Cyclotron:");
|
||||
@ -67,6 +69,8 @@ public class ItemMachineUpgrade extends Item {
|
||||
list.add("Consumption -" + (30 * this.tier) + "HE/t / Delay +" + (5 * this.tier) + "%");
|
||||
list.add(EnumChatFormatting.RED + "Chemical Plant:");
|
||||
list.add("Consumption -" + (30 * this.tier) + "HE/t / Delay +" + (5 * this.tier) + "%");
|
||||
list.add(EnumChatFormatting.RED + "Oil Wells:");
|
||||
list.add("Consumption -" + (25 * this.tier) + "% / Delay +" + (10 * this.tier) + "%");
|
||||
list.add(EnumChatFormatting.RED + "Cyclotron:");
|
||||
list.add("Consumption -" + (100 * this.tier) + "kHE/t");
|
||||
list.add(EnumChatFormatting.RED + "Maxwell:");
|
||||
@ -94,6 +98,8 @@ public class ItemMachineUpgrade extends Item {
|
||||
list.add("Production x2 / Consumption x2.5");
|
||||
list.add(EnumChatFormatting.RED + "Maxwell:");
|
||||
list.add("Afterburn +3s");
|
||||
list.add(EnumChatFormatting.RED + "Oil Wells:");
|
||||
list.add("Burn 10mB of gas for 50HE/t");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_afterburn_2) {
|
||||
@ -101,6 +107,8 @@ public class ItemMachineUpgrade extends Item {
|
||||
list.add("Production x3 / Consumption x5");
|
||||
list.add(EnumChatFormatting.RED + "Maxwell:");
|
||||
list.add("Afterburn +6s");
|
||||
list.add(EnumChatFormatting.RED + "Oil Wells:");
|
||||
list.add("Burn 20mB of gas for 100HE/t");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_afterburn_3) {
|
||||
@ -108,6 +116,8 @@ public class ItemMachineUpgrade extends Item {
|
||||
list.add("Production x4 / Consumption x7.5");
|
||||
list.add(EnumChatFormatting.RED + "Maxwell:");
|
||||
list.add("Afterburn +9s");
|
||||
list.add(EnumChatFormatting.RED + "Oil Wells:");
|
||||
list.add("Burn 30mB of gas for 150HE/t");
|
||||
}
|
||||
|
||||
if(this == ModItems.upgrade_radius) {
|
||||
|
||||
@ -34,6 +34,7 @@ import com.hbm.world.feature.Sellafield;
|
||||
import com.hbm.world.generator.CellularDungeonFactory;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
@ -531,7 +532,7 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
if (rand.nextInt(25) == 0) {
|
||||
if(rand.nextInt(25) == 0) {
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosY = rand.nextInt(25);
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
@ -539,6 +540,25 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
OilBubble.spawnOil(world, randPosX, randPosY, randPosZ, 7 + rand.nextInt(9));
|
||||
}
|
||||
|
||||
if(rand.nextInt(50) == 0) {
|
||||
int randPosX = i + rand.nextInt(16);
|
||||
int randPosZ = j + rand.nextInt(16);
|
||||
|
||||
for(int x = -4; x <= 4; x++) {
|
||||
for(int y = 0; y <= 4; y++) {
|
||||
for(int z = -4; z <= 4; z++) {
|
||||
|
||||
if(Math.abs(x) + Math.abs(y) + Math.abs(z) <= 6) {
|
||||
Block b = world.getBlock(randPosX + x, y, randPosZ + z);
|
||||
if(b.isReplaceableOreGen(world, randPosX + x, y, randPosZ + z, Blocks.stone) || b.isReplaceableOreGen(world, randPosX + x, y, randPosZ + z, Blocks.bedrock)) {
|
||||
world.setBlock(randPosX + x, y, randPosZ + z, ModBlocks.ore_bedrock_oil);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (GeneralConfig.enableNITAN) {
|
||||
|
||||
if (i <= 10000 && i + 16 >= 10000 && j <= 10000 && j + 16 >= 10000) {
|
||||
|
||||
@ -48,6 +48,7 @@ public class ModDamageSource extends DamageSource {
|
||||
public static DamageSource lunar = (new DamageSource("lunar")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource monoxide = (new DamageSource("monoxide")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource asbestos = (new DamageSource("asbestos")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource blacklung = (new DamageSource("blacklung")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
public static DamageSource mku = (new DamageSource("mku")).setDamageIsAbsolute().setDamageBypassesArmor();
|
||||
|
||||
public static final String s_bullet = "revolverBullet";
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.lib;
|
||||
public class RefStrings {
|
||||
public static final String MODID = "hbm";
|
||||
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
||||
public static final String VERSION = "1.0.27 BETA (4000)";
|
||||
public static final String VERSION = "1.0.27 BETA (4011)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -72,6 +72,7 @@ import com.hbm.tileentity.bomb.*;
|
||||
import com.hbm.tileentity.conductor.*;
|
||||
import com.hbm.tileentity.deco.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineFrackingTower;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineFractionTower;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineGasFlare;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
|
||||
@ -173,6 +174,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFractionTower.class, new RenderFractionTower());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySpacer.class, new RenderSpacer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePumpjack.class, new RenderPumpjack());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFrackingTower.class, new RenderFrackingTower());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbofan.class, new RenderTurbofan());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePress.class, new RenderPress());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
|
||||
|
||||
@ -813,6 +813,8 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.rag, 4), new Object[] { "SW", "WS", 'S', Items.string, 'W', Blocks.wool });
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_condenser), new Object[] { "SIS", "ICI", "SIS", 'S', "ingotSteel", 'I', "plateIron", 'C', ModItems.board_copper }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_fracking_tower), new Object[] { "NDN", "PRP", "CRC", 'N', "ingotNiobium", 'D', ModBlocks.machine_well, 'P', ModItems.plate_desh, 'R', ModItems.pipes_steel, 'C', ModBlocks.concrete_smooth }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.canister_fracksol, 4), new Object[] { "dustSulfur", "dustSulfur", "dustSulfur", "dustSulfur", ModItems.gas_petroleum, ModItems.canister_empty, ModItems.canister_empty, ModItems.canister_empty, ModItems.canister_empty }));
|
||||
|
||||
if(GeneralConfig.enableBabyMode) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.cordite, 3), new Object[] { ModItems.ballistite, Items.gunpowder, new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
@ -1164,6 +1164,16 @@ public class ModEventHandler {
|
||||
@SubscribeEvent
|
||||
public void chatEvent(ServerChatEvent event) {
|
||||
|
||||
World world = event.player.worldObj;
|
||||
|
||||
for(Object e : world.loadedEntityList) {
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
Entity entity = (Entity)e;
|
||||
entity.onUpdate();
|
||||
System.out.println("Took " + (System.currentTimeMillis() - time) + "ms to tick " + entity);
|
||||
}
|
||||
|
||||
EntityPlayerMP player = event.player;
|
||||
String message = event.message;
|
||||
|
||||
|
||||
@ -61,6 +61,7 @@ public class ResourceManager {
|
||||
//Oil Pumps
|
||||
public static final IModelCustom derrick = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/derrick.obj"));
|
||||
public static final IModelCustom pumpjack = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/pumpjack.obj"));
|
||||
public static final IModelCustom fracking_tower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/fracking_tower.obj"));
|
||||
|
||||
//Refinery
|
||||
public static final IModelCustom refinery = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/refinery.obj"));
|
||||
@ -322,6 +323,7 @@ public class ResourceManager {
|
||||
//Oil Pumps
|
||||
public static final ResourceLocation derrick_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/derrick.png");
|
||||
public static final ResourceLocation pumpjack_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/pumpjack.png");
|
||||
public static final ResourceLocation fracking_tower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fracking_tower.png");
|
||||
|
||||
//Refinery
|
||||
public static final ResourceLocation refinery_tex = new ResourceLocation(RefStrings.MODID, "textures/models/refinery.png");
|
||||
|
||||
@ -41,8 +41,6 @@ public class PacketDispatcher {
|
||||
wrapper.registerMessage(TETurretPacket.Handler.class, TETurretPacket.class, i++, Side.CLIENT);
|
||||
//Signals server to consume items and create template
|
||||
wrapper.registerMessage(ItemFolderPacket.Handler.class, ItemFolderPacket.class, i++, Side.SERVER);
|
||||
//Pumpjack rotation for animation rendering
|
||||
wrapper.registerMessage(TEPumpjackPacket.Handler.class, TEPumpjackPacket.class, i++, Side.CLIENT);
|
||||
//Turbofan spin for rendering
|
||||
wrapper.registerMessage(TETurbofanPacket.Handler.class, TETurbofanPacket.class, i++, Side.CLIENT);
|
||||
//Press item for rendering
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TEPumpjackPacket implements IMessage {
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int spin;
|
||||
boolean progress;
|
||||
|
||||
public TEPumpjackPacket()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TEPumpjackPacket(int x, int y, int z, int spin, boolean bool)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.spin = spin;
|
||||
this.progress = bool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
spin = buf.readInt();
|
||||
progress = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeInt(spin);
|
||||
buf.writeBoolean(progress);
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<TEPumpjackPacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(TEPumpjackPacket m, MessageContext ctx) {
|
||||
try {
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
|
||||
if (te != null && te instanceof TileEntityMachinePumpjack) {
|
||||
|
||||
TileEntityMachinePumpjack gen = (TileEntityMachinePumpjack) te;
|
||||
gen.rotation = m.spin;
|
||||
gen.isProgressing = m.progress;
|
||||
}
|
||||
} catch(Exception x) { }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderFrackingTower extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.fracking_tower_tex);
|
||||
ResourceManager.fracking_tower.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
|
||||
@ -12,8 +13,6 @@ import net.minecraft.util.Vec3;
|
||||
|
||||
public class RenderPumpjack extends TileEntitySpecialRenderer {
|
||||
|
||||
int i;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
|
||||
@ -21,17 +20,16 @@ public class RenderPumpjack extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
switch(tileEntity.getBlockMetadata()) {
|
||||
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
switch(tileEntity.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityMachinePumpjack)
|
||||
i = ((TileEntityMachinePumpjack) tileEntity).rotation;
|
||||
|
||||
float rotation = (System.currentTimeMillis() % 3600) / 10F;
|
||||
TileEntityMachinePumpjack pj = (TileEntityMachinePumpjack) tileEntity;
|
||||
|
||||
float rotation = pj.prevRot + (pj.rot - pj.prevRot) * f;
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
@ -126,8 +124,8 @@ public class RenderPumpjack extends TileEntitySpecialRenderer {
|
||||
tess.addVertex((width + pd) * i, 3.5 + sumY, -3.5 + sumZ);
|
||||
tess.addVertex((width - pd) * i, 3.5 + sumY, -3.5 + sumZ);
|
||||
|
||||
tess.addVertex((width + pd) * i, 2 + height, 0);
|
||||
tess.addVertex((width - pd) * i, 2 + height, 0);
|
||||
tess.addVertex((width + pd) * i, 2 + height, 0);
|
||||
}
|
||||
|
||||
double p = 0.03125D;
|
||||
|
||||
@ -6,12 +6,7 @@ import com.hbm.tileentity.bomb.*;
|
||||
import com.hbm.tileentity.conductor.*;
|
||||
import com.hbm.tileentity.deco.*;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineFractionTower;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineGasFlare;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
import com.hbm.tileentity.machine.oil.TileEntitySpacer;
|
||||
import com.hbm.tileentity.machine.oil.*;
|
||||
import com.hbm.tileentity.machine.pile.*;
|
||||
import com.hbm.tileentity.machine.rbmk.*;
|
||||
import com.hbm.tileentity.network.*;
|
||||
@ -73,9 +68,6 @@ public class TileMappings {
|
||||
map.put(TileEntityMachineIGenerator.class, "tileentity_igenerator");
|
||||
map.put(TileEntityDummy.class, "tileentity_dummy");
|
||||
map.put(TileEntityMachineCyclotron.class, "tileentity_cyclotron");
|
||||
map.put(TileEntityMachineOilWell.class, "tileentity_derrick");
|
||||
map.put(TileEntityMachineGasFlare.class, "tileentity_gasflare");
|
||||
map.put(TileEntityMachineRefinery.class, "tileentity_refinery");
|
||||
map.put(TileEntityOilDuct.class, "tileentity_oil_duct");
|
||||
map.put(TileEntityOilDuctSolid.class, "tileentity_oil_duct_solid");
|
||||
map.put(TileEntityGasDuct.class, "tileentity_gas_duct");
|
||||
@ -93,7 +85,6 @@ public class TileMappings {
|
||||
map.put(TileEntityTurretLight.class, "tileentity_turret_light");
|
||||
map.put(TileEntityTurretFlamer.class, "tileentity_turret_flamer");
|
||||
map.put(TileEntityTurretTau.class, "tileentity_turret_tau");
|
||||
map.put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
|
||||
map.put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
|
||||
map.put(TileEntityCrateIron.class, "tileentity_crate_iron");
|
||||
map.put(TileEntityCrateSteel.class, "tileentity_crate_steel");
|
||||
@ -238,6 +229,12 @@ public class TileMappings {
|
||||
map.put(TileEntityCondenser.class, "tileentity_condenser");
|
||||
map.put(TileEntityTowerSmall.class, "tileentity_cooling_tower_small");
|
||||
map.put(TileEntityTowerLarge.class, "tileentity_cooling_tower_large");
|
||||
|
||||
map.put(TileEntityMachineOilWell.class, "tileentity_derrick");
|
||||
map.put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
|
||||
map.put(TileEntityMachineFrackingTower.class, "tileentity_fracking_tower");
|
||||
map.put(TileEntityMachineGasFlare.class, "tileentity_gasflare");
|
||||
map.put(TileEntityMachineRefinery.class, "tileentity_refinery");
|
||||
}
|
||||
|
||||
private static void putPile() {
|
||||
|
||||
@ -1,7 +1,125 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
|
||||
public class TileEntityMachineFrackingTower extends TileEntity {
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
public class TileEntityMachineFrackingTower extends TileEntityOilDrillBase implements IFluidAcceptor {
|
||||
|
||||
public TileEntityMachineFrackingTower() {
|
||||
super();
|
||||
tanks = new FluidTank[3];
|
||||
tanks[0] = new FluidTank(FluidType.OIL, 64_000, 0);
|
||||
tanks[1] = new FluidTank(FluidType.GAS, 64_000, 1);
|
||||
tanks[2] = new FluidTank(FluidType.FRACKSOL, 64_000, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.frackingTower";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 5_000_000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPowerReq() {
|
||||
return 5000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDelay() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDrillDepth() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPump() {
|
||||
boolean b = this.tanks[2].getFill() >= 10;
|
||||
|
||||
if(!b) {
|
||||
this.indicator = 3;
|
||||
}
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSuckBlock(Block b) {
|
||||
return super.canSuckBlock(b) || b == ModBlocks.ore_bedrock_oil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doSuck(int x, int y, int z) {
|
||||
super.doSuck(x, y, z);
|
||||
|
||||
if(worldObj.getBlock(x, y, z) == ModBlocks.ore_bedrock_oil) {
|
||||
onSuck(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuck(int x, int y, int z) {
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
|
||||
int oil = 0;
|
||||
int gas = 0;
|
||||
|
||||
if(b == ModBlocks.ore_oil) {
|
||||
oil = 1000;
|
||||
gas = 100 + worldObj.rand.nextInt(401);
|
||||
}
|
||||
if(b == ModBlocks.ore_bedrock_oil) {
|
||||
oil = 100;
|
||||
gas = 10 + worldObj.rand.nextInt(41);
|
||||
}
|
||||
|
||||
this.tanks[0].setFill(this.tanks[0].getFill() + oil);
|
||||
if(this.tanks[0].getFill() > this.tanks[0].getMaxFill()) this.tanks[0].setFill(tanks[0].getMaxFill());
|
||||
this.tanks[1].setFill(this.tanks[1].getFill() + gas);
|
||||
if(this.tanks[1].getFill() > this.tanks[1].getMaxFill()) this.tanks[1].setFill(tanks[1].getMaxFill());
|
||||
|
||||
this.tanks[2].setFill(tanks[2].getFill() - 10);
|
||||
|
||||
for(int i = 0; i < 10; i++) {
|
||||
int rX = xCoord + (int)(worldObj.rand.nextGaussian() * 75);
|
||||
int rZ = zCoord + (int)(worldObj.rand.nextGaussian() * 75);
|
||||
int rY = worldObj.getHeightValue(rX, rZ) - 1;
|
||||
|
||||
Block ground = worldObj.getBlock(rX, rY, rZ);
|
||||
|
||||
if(ground == Blocks.grass || ground == Blocks.dirt) {
|
||||
worldObj.setBlock(rX, rY, rZ, worldObj.rand.nextInt(10) == 0 ? ModBlocks.dirt_oily : ModBlocks.dirt_dead);
|
||||
|
||||
} else if(ground.getMaterial() == Material.leaves) {
|
||||
worldObj.setBlockToAir(rX, rY, rZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
fillFluid(this.xCoord - 1, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord + 1, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord - 1, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord + 1, getTact(), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
return type == tanks[2].getTankType() ? tanks[2].getMaxFill() : 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TileEntityMachineOilWell extends TileEntityOilDrillBase {
|
||||
|
||||
@ -27,6 +31,36 @@ public class TileEntityMachineOilWell extends TileEntityOilDrillBase {
|
||||
return 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrill(int y) {
|
||||
Block b = worldObj.getBlock(xCoord, y, zCoord);
|
||||
ItemStack stack = new ItemStack(b);
|
||||
int[] ids = OreDictionary.getOreIDs(stack);
|
||||
for(Integer i : ids) {
|
||||
String name = OreDictionary.getOreName(i);
|
||||
|
||||
if("oreUranium".equals(name)) {
|
||||
for(int j = -1; j <= 1; j++) {
|
||||
for(int k = -1; k <= 1; k++) {
|
||||
if(worldObj.getBlock(xCoord + j, yCoord + 7, zCoord + j).isReplaceable(worldObj, xCoord + j, yCoord + 7, zCoord + k)) {
|
||||
worldObj.setBlock(xCoord + k, yCoord + 7, zCoord + k, ModBlocks.gas_radon_dense);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if("oreAsbestos".equals(name)) {
|
||||
for(int j = -1; j <= 1; j++) {
|
||||
for(int k = -1; k <= 1; k++) {
|
||||
if(worldObj.getBlock(xCoord + j, yCoord + 7, zCoord + j).isReplaceable(worldObj, xCoord + j, yCoord + 7, zCoord + k)) {
|
||||
worldObj.setBlock(xCoord + k, yCoord + 7, zCoord + k, ModBlocks.gas_asbestos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuck(int x, int y, int z) {
|
||||
|
||||
|
||||
@ -1,538 +1,149 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.particle.EntityGasFX;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEPumpjackPacket;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TileEntityMachinePumpjack extends TileEntity implements ISidedInventory, IConsumer, IFluidContainer, IFluidSource {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
public long power;
|
||||
public int warning;
|
||||
public int warning2;
|
||||
public static final long maxPower = 100000;
|
||||
public int age = 0;
|
||||
public int age2 = 0;
|
||||
public List<IFluidAcceptor> list1 = new ArrayList();
|
||||
public List<IFluidAcceptor> list2 = new ArrayList();
|
||||
public FluidTank[] tanks;
|
||||
public boolean isProgressing;
|
||||
public int rotation;
|
||||
public class TileEntityMachinePumpjack extends TileEntityOilDrillBase {
|
||||
|
||||
private static final int[] slots_top = new int[] {1};
|
||||
private static final int[] slots_bottom = new int[] {2, 0};
|
||||
private static final int[] slots_side = new int[] {0};
|
||||
Random rand = new Random();
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachinePumpjack() {
|
||||
slots = new ItemStack[6];
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(FluidType.OIL, 128000, 0);
|
||||
tanks[1] = new FluidTank(FluidType.GAS, 128000, 1);
|
||||
}
|
||||
public float rot = 0;
|
||||
public float prevRot = 0;
|
||||
public float speed = 0;
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.hasCustomInventoryName() ? this.customName : "container.pumpjack";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||
{
|
||||
return false;
|
||||
}else{
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=128;
|
||||
}
|
||||
}
|
||||
|
||||
//You scrubs aren't needed for anything (right now)
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].stackSize <= j)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
}
|
||||
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||
if (slots[i].stackSize == 0)
|
||||
{
|
||||
slots[i] = null;
|
||||
}
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
this.power = nbt.getLong("powerTime");
|
||||
this.age = nbt.getInteger("age");
|
||||
this.rotation = nbt.getInteger("rotation");
|
||||
|
||||
this.tanks[0].readFromNBT(nbt, "oil");
|
||||
this.tanks[1].readFromNBT(nbt, "gas");
|
||||
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if(b0 >= 0 && b0 < slots.length)
|
||||
{
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("powerTime", power);
|
||||
nbt.setInteger("age", age);
|
||||
nbt.setInteger("rotation", rotation);
|
||||
|
||||
this.tanks[0].writeToNBT(nbt, "oil");
|
||||
this.tanks[1].writeToNBT(nbt, "gas");
|
||||
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for(int i = 0; i < slots.length; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||
nbt1.setByte("slot", (byte)i);
|
||||
slots[i].writeToNBT(nbt1);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||
{
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public long getPowerScaled(long i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
int timer = 20;
|
||||
|
||||
age++;
|
||||
age2++;
|
||||
if(age >= timer)
|
||||
age -= timer;
|
||||
if(age2 >= 20)
|
||||
age2 -= 20;
|
||||
if(age2 == 9 || age2 == 19) {
|
||||
fillFluidInit(tanks[0].getTankType());
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
this.tanks[0].unloadTank(1, 2, slots);
|
||||
this.tanks[1].unloadTank(3, 4, slots);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
}
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
if(power >= 200) {
|
||||
|
||||
//operation start
|
||||
|
||||
if(age == timer - 1) {
|
||||
warning = 0;
|
||||
|
||||
//warning 0, green: derrick is operational
|
||||
//warning 1, red: derrick is full, has no power or the drill is jammed
|
||||
//warning 2, yellow: drill has reached max depth
|
||||
|
||||
for(int i = this.yCoord - 1; i > this.yCoord - 1 - 100; i--) {
|
||||
|
||||
if(i <= 5) {
|
||||
//Code 2: The drilling ended
|
||||
warning = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
Block b = worldObj.getBlock(this.xCoord, i, this.zCoord);
|
||||
if(b == ModBlocks.oil_pipe)
|
||||
continue;
|
||||
|
||||
if((b.isReplaceable(worldObj, xCoord, i, zCoord) || b.getExplosionResistance(null) < 100) && !(b == ModBlocks.ore_oil || b == ModBlocks.ore_oil_empty)) {
|
||||
worldObj.setBlock(xCoord, i, zCoord, ModBlocks.oil_pipe);
|
||||
|
||||
//Code 2: The drilling ended
|
||||
if(i == this.yCoord - 100)
|
||||
warning = 2;
|
||||
break;
|
||||
|
||||
} else if(this.tanks[0].getFill() < this.tanks[0].getMaxFill() && this.tanks[1].getFill() < this.tanks[1].getMaxFill()) {
|
||||
if(succ(this.xCoord, i, this.zCoord)) {
|
||||
|
||||
this.tanks[0].setFill(this.tanks[0].getFill() + 650);
|
||||
if(this.tanks[0].getFill() > this.tanks[0].getMaxFill())
|
||||
this.tanks[0].setFill(tanks[0].getMaxFill());
|
||||
|
||||
|
||||
this.tanks[1].setFill(this.tanks[1].getFill() + (100 + rand.nextInt(301)));
|
||||
if(this.tanks[1].getFill() > this.tanks[1].getMaxFill())
|
||||
this.tanks[1].setFill(tanks[1].getMaxFill());
|
||||
|
||||
break;
|
||||
} else {
|
||||
worldObj.setBlock(xCoord, i, zCoord, ModBlocks.oil_pipe);
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
//Code 1: Drill jammed
|
||||
warning = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//operation end
|
||||
|
||||
power -= 200;
|
||||
} else {
|
||||
warning = 1;
|
||||
}
|
||||
|
||||
warning2 = 0;
|
||||
if(tanks[1].getFill() > 0) {
|
||||
if(slots[5] != null && (slots[5].getItem() == ModItems.fuse || slots[5].getItem() == ModItems.screwdriver)) {
|
||||
warning2 = 2;
|
||||
tanks[1].setFill(tanks[1].getFill() - 50);
|
||||
if(tanks[1].getFill() <= 0)
|
||||
tanks[1].setFill(0);
|
||||
worldObj.spawnEntityInWorld(new EntityGasFX(worldObj, this.xCoord + 0.5F, this.yCoord + 0.5F, this.zCoord + 0.5F, 0.0, 0.0, 0.0));
|
||||
} else {
|
||||
warning2 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
isProgressing = warning == 0;
|
||||
rotation += (warning == 0 ? 5 : 0);
|
||||
rotation = rotation % 360;
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEPumpjackPacket(xCoord, yCoord, zCoord, rotation, isProgressing), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean succ(int x, int y, int z) {
|
||||
|
||||
list.clear();
|
||||
|
||||
succ1(x, y, z);
|
||||
succ2(x, y, z);
|
||||
|
||||
if(!list.isEmpty()) {
|
||||
|
||||
int i = rand.nextInt(list.size());
|
||||
int a = list.get(i)[0];
|
||||
int b = list.get(i)[1];
|
||||
int c = list.get(i)[2];
|
||||
|
||||
if(worldObj.getBlock(a, b, c) == ModBlocks.ore_oil) {
|
||||
|
||||
worldObj.setBlock(a, b, c, ModBlocks.ore_oil_empty);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void succInit1(int x, int y, int z) {
|
||||
succ1(x + 1, y, z);
|
||||
succ1(x - 1, y, z);
|
||||
succ1(x, y + 1, z);
|
||||
succ1(x, y - 1, z);
|
||||
succ1(x, y, z + 1);
|
||||
succ1(x, y, z - 1);
|
||||
}
|
||||
|
||||
public void succInit2(int x, int y, int z) {
|
||||
succ2(x + 1, y, z);
|
||||
succ2(x - 1, y, z);
|
||||
succ2(x, y + 1, z);
|
||||
succ2(x, y - 1, z);
|
||||
succ2(x, y, z + 1);
|
||||
succ2(x, y, z - 1);
|
||||
}
|
||||
|
||||
List<int[]> list = new ArrayList<int[]>();
|
||||
|
||||
public void succ1(int x, int y, int z) {
|
||||
if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil_empty &&
|
||||
worldObj.getBlockMetadata(x, y, z) == 0) {
|
||||
worldObj.setBlockMetadataWithNotify(x, y, z, 1, 2);
|
||||
succInit1(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void succ2(int x, int y, int z) {
|
||||
if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil_empty &&
|
||||
worldObj.getBlockMetadata(x, y, z) == 1) {
|
||||
worldObj.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
||||
succInit2(x, y, z);
|
||||
} else if(worldObj.getBlock(x, y, z) == ModBlocks.ore_oil) {
|
||||
list.add(new int[] { x, y, z });
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
|
||||
public String getName() {
|
||||
return "container.pumpjack";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
return 65536.0D;
|
||||
return 250_000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
if (age2 >= 0 && age2 < 10) {
|
||||
return true;
|
||||
public int getPowerReq() {
|
||||
return 200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDelay() {
|
||||
return 25;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrill(int y) {
|
||||
Block b = worldObj.getBlock(xCoord, y, zCoord);
|
||||
ItemStack stack = new ItemStack(b);
|
||||
int[] ids = OreDictionary.getOreIDs(stack);
|
||||
for(Integer i : ids) {
|
||||
String name = OreDictionary.getOreName(i);
|
||||
|
||||
if("oreUranium".equals(name)) {
|
||||
for(int j = 2; j < 6; j++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(j);
|
||||
if(worldObj.getBlock(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ).isReplaceable(worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ)) {
|
||||
worldObj.setBlock(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ, ModBlocks.gas_radon_dense);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if("oreAsbestos".equals(name)) {
|
||||
for(int j = 2; j < 6; j++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(j);
|
||||
if(worldObj.getBlock(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ).isReplaceable(worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ)) {
|
||||
worldObj.setBlock(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ, ModBlocks.gas_asbestos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
this.prevRot = rot;
|
||||
|
||||
if(this.indicator == 0) {
|
||||
this.rot += speed;
|
||||
}
|
||||
|
||||
if(this.rot >= 360) {
|
||||
this.prevRot -= 360;
|
||||
this.rot -= 360;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendUpdate() {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setInteger("indicator", this.indicator);
|
||||
data.setFloat("speed", this.indicator == 0 ? (5F + (2F * this.speedLevel)) + (this.overLevel - 1F) * 10: 0F);
|
||||
this.networkPack(data, 25);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
this.indicator = nbt.getInteger("indicator");
|
||||
this.speed = nbt.getFloat("speed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuck(int x, int y, int z) {
|
||||
|
||||
this.tanks[0].setFill(this.tanks[0].getFill() + 750);
|
||||
if(this.tanks[0].getFill() > this.tanks[0].getMaxFill()) this.tanks[0].setFill(tanks[0].getMaxFill());
|
||||
this.tanks[1].setFill(this.tanks[1].getFill() + (50 + worldObj.rand.nextInt(201)));
|
||||
if(this.tanks[1].getFill() > this.tanks[1].getMaxFill()) this.tanks[1].setFill(tanks[1].getMaxFill());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
int i = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
|
||||
if(i == 5) {
|
||||
fillFluid(this.xCoord - 2, this.yCoord, this.zCoord + 2, getTact(), type);
|
||||
fillFluid(this.xCoord - 2, this.yCoord, this.zCoord - 2, getTact(), type);
|
||||
fillFluid(this.xCoord - 3, this.yCoord, this.zCoord + 2, getTact(), type);
|
||||
fillFluid(this.xCoord - 3, this.yCoord, this.zCoord - 2, getTact(), type);
|
||||
}
|
||||
if(i == 3) {
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 2, getTact(), type);
|
||||
fillFluid(this.xCoord - 2, this.yCoord, this.zCoord - 2, getTact(), type);
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 3, getTact(), type);
|
||||
fillFluid(this.xCoord - 2, this.yCoord, this.zCoord - 3, getTact(), type);
|
||||
}
|
||||
if(i == 4) {
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord + 2, getTact(), type);
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 2, getTact(), type);
|
||||
fillFluid(this.xCoord + 3, this.yCoord, this.zCoord + 2, getTact(), type);
|
||||
fillFluid(this.xCoord + 3, this.yCoord, this.zCoord - 2, getTact(), type);
|
||||
}
|
||||
if(i == 2) {
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord + 2, getTact(), type);
|
||||
fillFluid(this.xCoord - 2, this.yCoord, this.zCoord + 2, getTact(), type);
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord + 3, getTact(), type);
|
||||
fillFluid(this.xCoord - 2, this.yCoord, this.zCoord + 3, getTact(), type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getFill();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
tanks[1].setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return this.list1;
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return this.list2;
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
list1.clear();
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
list2.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
int pX2 = xCoord + rot.offsetX * 2;
|
||||
int pZ2 = zCoord + rot.offsetZ * 2;
|
||||
int pX4 = xCoord + rot.offsetX * 4;
|
||||
int pZ4 = zCoord + rot.offsetZ * 4;
|
||||
int oX = Math.abs(dir.offsetX) * 2;
|
||||
int oZ = Math.abs(dir.offsetZ) * 2;
|
||||
|
||||
return list;
|
||||
fillFluid(pX2 + oX, this.yCoord, pZ2 + oZ, getTact(), type);
|
||||
fillFluid(pX2 - oX, this.yCoord, pZ2 - oZ, getTact(), type);
|
||||
fillFluid(pX4 + oX, this.yCoord, pZ4 + oZ, getTact(), type);
|
||||
fillFluid(pX4 - oX, this.yCoord, pZ4 - oZ, getTact(), type);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 7,
|
||||
yCoord,
|
||||
zCoord - 7,
|
||||
xCoord + 8,
|
||||
yCoord + 6,
|
||||
zCoord + 8
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,9 @@ import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
@ -21,7 +24,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -37,7 +39,7 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public TileEntityOilDrillBase() {
|
||||
super(5);
|
||||
super(8);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(FluidType.OIL, 64_000, 0);
|
||||
tanks[1] = new FluidTank(FluidType.GAS, 64_000, 1);
|
||||
@ -59,6 +61,10 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
this.tanks[i].writeToNBT(nbt, "t" + i);
|
||||
}
|
||||
|
||||
public int speedLevel;
|
||||
public int energyLevel;
|
||||
public int overLevel;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
@ -67,17 +73,38 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
this.tanks[0].unloadTank(1, 2, slots);
|
||||
this.tanks[1].unloadTank(3, 4, slots);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
UpgradeManager.eval(slots, 5, 7);
|
||||
this.speedLevel = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
|
||||
this.energyLevel = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
|
||||
this.overLevel = Math.min(UpgradeManager.getLevel(UpgradeType.OVERDRIVE), 3) + 1;
|
||||
int abLevel = Math.min(UpgradeManager.getLevel(UpgradeType.AFTERBURN), 3);
|
||||
|
||||
for(int i = 0; i < tanks.length; i++) {
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
}
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, this.getMaxPower());
|
||||
int toBurn = Math.min(tanks[1].getFill(), abLevel * 10);
|
||||
|
||||
if(this.power >= this.getPowerReq() && this.tanks[0].getFill() < this.tanks[0].getMaxFill() && this.tanks[1].getFill() < this.tanks[1].getMaxFill()) {
|
||||
if(toBurn > 0) {
|
||||
tanks[1].setFill(tanks[1].getFill() - toBurn);
|
||||
this.power += toBurn * 5;
|
||||
|
||||
this.power -= this.getPowerReq();
|
||||
if(this.power > this.getMaxPower())
|
||||
this.power = this.getMaxPower();
|
||||
}
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, this.getMaxPower());
|
||||
|
||||
if(this.worldObj.getTotalWorldTime() % 10 == 0)
|
||||
this.fillFluidInit(tanks[0].getTankType());
|
||||
if(this.worldObj.getTotalWorldTime() % 10 == 5)
|
||||
this.fillFluidInit(tanks[1].getTankType());
|
||||
|
||||
if(this.power >= this.getPowerReqEff() && this.tanks[0].getFill() < this.tanks[0].getMaxFill() && this.tanks[1].getFill() < this.tanks[1].getMaxFill()) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % getDelay() == 0) {
|
||||
this.power -= this.getPowerReqEff();
|
||||
|
||||
if(worldObj.getTotalWorldTime() % getDelayEff() == 0) {
|
||||
this.indicator = 0;
|
||||
|
||||
for(int y = yCoord - 1; y >= getDrillDepth(); y--) {
|
||||
@ -101,18 +128,44 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
this.indicator = 2;
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setInteger("indicator", this.indicator);
|
||||
this.networkPack(data, 25);
|
||||
this.sendUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void sendUpdate() {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", power);
|
||||
data.setInteger("indicator", this.indicator);
|
||||
this.networkPack(data, 25);
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
this.indicator = nbt.getInteger("indicator");
|
||||
}
|
||||
|
||||
public boolean canPump() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack stack) {
|
||||
super.setInventorySlotContents(i, stack);
|
||||
|
||||
if(stack != null && i >= 5 && i <= 7 && stack.getItem() instanceof ItemMachineUpgrade)
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, "hbm:item.upgradePlug", 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public int getPowerReqEff() {
|
||||
int req = this.getPowerReq();
|
||||
return (req + (req / 4 * this.speedLevel) - (req / 4 * this.energyLevel)) * this.overLevel;
|
||||
}
|
||||
|
||||
public int getDelayEff() {
|
||||
int delay = getDelay();
|
||||
return Math.max((delay - (delay / 4 * this.speedLevel) + (delay / 10 * this.energyLevel) / this.overLevel), 1);
|
||||
}
|
||||
|
||||
public abstract int getPowerReq();
|
||||
public abstract int getDelay();
|
||||
|
||||
@ -120,12 +173,15 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
Block b = worldObj.getBlock(xCoord, y, zCoord);
|
||||
|
||||
if(b.getExplosionResistance(null) < 1000) {
|
||||
onDrill(y);
|
||||
worldObj.setBlock(xCoord, y, zCoord, ModBlocks.oil_pipe);
|
||||
} else {
|
||||
this.indicator = 2;
|
||||
}
|
||||
}
|
||||
|
||||
public void onDrill(int y) { }
|
||||
|
||||
public int getDrillDepth() {
|
||||
return 5;
|
||||
}
|
||||
@ -137,6 +193,9 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
if(!canSuckBlock(b))
|
||||
return false;
|
||||
|
||||
if(!this.canPump())
|
||||
return true;
|
||||
|
||||
trace.clear();
|
||||
|
||||
return suckRec(xCoord, y, zCoord, 0);
|
||||
@ -162,7 +221,7 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
|
||||
if(b == ModBlocks.ore_oil) {
|
||||
if(b == ModBlocks.ore_oil || b == ModBlocks.ore_bedrock_oil) {
|
||||
doSuck(x, y, z);
|
||||
return true;
|
||||
}
|
||||
@ -191,7 +250,7 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
return this.worldObj.getTotalWorldTime() % 2 == 0;
|
||||
return this.worldObj.getTotalWorldTime() % 20 < 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -201,20 +260,23 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getFill();
|
||||
|
||||
for(FluidTank tank : tanks) {
|
||||
if(type == tank.getTankType()) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
tanks[1].setFill(i);
|
||||
for(FluidTank tank : tanks) {
|
||||
if(type == tank.getTankType()) {
|
||||
tank.setFill(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -236,13 +298,13 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
if(index < tanks.length && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
if(index < tanks.length && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
|
||||
@ -206,6 +206,7 @@ container.factoryAdvanced=Fortgeschrittene Fabrik
|
||||
container.factoryTitanium=Einfache Fabrik
|
||||
container.fluidtank=Tank
|
||||
container.forceField=Kraftfeldgenerator
|
||||
container.frackingTower=Hydraulischer Frackingturm
|
||||
container.fusionMultiblock=Großer Fusionsreaktor
|
||||
container.fusionaryWatzPlant=Fusionares Watzwerk
|
||||
container.gasCentrifuge=Gaszentrifuge
|
||||
@ -423,6 +424,7 @@ hbmfluid.coolant=Kühlflüssigkeit
|
||||
hbmfluid.cryogel=Kryogel
|
||||
hbmfluid.deuterium=Deuterium
|
||||
hbmfluid.diesel=Diesel
|
||||
hbmfluid.fracksol=Frackinglösung
|
||||
hbmfluid.gas=Erdgas
|
||||
hbmfluid.gasoline=Bleibenzin
|
||||
hbmfluid.heatingoil=Heizöl
|
||||
@ -868,6 +870,7 @@ item.canister_biofuel.name=Biodieselkanister
|
||||
item.canister_bitumen.name=Bitumenkanister
|
||||
item.canister_canola.name=Schmiermittelkanister
|
||||
item.canister_empty.name=Leerer Kanister
|
||||
item.canister_fracksol.name=Frackinglösungskanister
|
||||
item.canister_fuel.name=Dieselkanister
|
||||
item.canister_gasoline.name=Bleibenzinkanister
|
||||
item.canister_gasoline.desc=blei ist freund$lasse deinen freund in deinen blutstrom$*lädt waffe* jetzt sofort
|
||||
@ -2886,6 +2889,8 @@ tile.dfc_emitter.name=DFC-Emitter
|
||||
tile.dfc_injector.name=DFC-Brennstoffinjektor
|
||||
tile.dfc_receiver.name=DFC-Receiver
|
||||
tile.dfc_stabilizer.name=DFC-Stabilisator
|
||||
tile.dirt_dead.name=Tote Erde
|
||||
tile.dirt_oily.name=Ölige Erde
|
||||
tile.drill_pipe.name=Bohrgestänge
|
||||
tile.ducrete.name=Ducrete-Fliese
|
||||
tile.ducrete_smooth.name=Ducrete
|
||||
@ -3039,6 +3044,7 @@ tile.machine_fensu.name=FEnSU
|
||||
tile.machine_flare.name=Abfackelturm
|
||||
tile.machine_fluidtank.name=Tank
|
||||
tile.machine_forcefield.name=Kraftfeldgenerator
|
||||
tile.machine_fracking_tower.name=Hydraulischer Frackingturm
|
||||
tile.machine_fraction_tower.name=Fraktionierungsturm
|
||||
tile.machine_gascent.name=Gaszentrifuge
|
||||
tile.machine_generator.name=Atomreaktor (Alt)
|
||||
@ -3135,6 +3141,7 @@ tile.ore_aluminium.name=Aluminiumerz
|
||||
tile.ore_asbestos.name=Asbesterz
|
||||
tile.ore_australium.name=Australisches Erz
|
||||
tile.ore_bedrock_coltan.name=Bedrock-Coltanerz
|
||||
tile.ore_bedrock_oil.name=Bedrock-Ölvorkommen
|
||||
tile.ore_beryllium.name=Berylliumerz
|
||||
tile.ore_cinnebar.name=Zinnobererz
|
||||
tile.ore_coal_oil.name=Öliges Kohleerz
|
||||
|
||||
@ -274,6 +274,7 @@ container.factoryAdvanced=Advanced Factory
|
||||
container.factoryTitanium=Basic Factory
|
||||
container.fluidtank=Tank
|
||||
container.forceField=Forcefield Emitter
|
||||
container.frackingTower=Hydraulic Fracking Tower
|
||||
container.fusionMultiblock=Big Fusion Reactor
|
||||
container.fusionaryWatzPlant=Fusionary Watz Plant
|
||||
container.gasCentrifuge=Gas Centrifuge
|
||||
@ -491,6 +492,7 @@ hbmfluid.coolant=Coolant
|
||||
hbmfluid.cryogel=Cryogel
|
||||
hbmfluid.deuterium=Deuterium
|
||||
hbmfluid.diesel=Diesel
|
||||
hbmfluid.fracksol=Fracking Solution
|
||||
hbmfluid.gas=Natural Gas
|
||||
hbmfluid.gasoline=Leaded Gasoline
|
||||
hbmfluid.heatingoil=Heating Oil
|
||||
@ -936,6 +938,7 @@ item.canister_biofuel.name=Biofuel Canister
|
||||
item.canister_bitumen.name=Bitumen Canister
|
||||
item.canister_canola.name=Engine Lubricant
|
||||
item.canister_empty.name=Empty Canister
|
||||
item.canister_fracksol.name=Fracking Solution Canister
|
||||
item.canister_fuel.name=Diesel Canister
|
||||
item.canister_gasoline.name=Leaded Gasoline Canister
|
||||
item.canister_gasoline.desc=lead is friend$let friend into your blood stream$*cocks gun* do it now.
|
||||
@ -2953,6 +2956,8 @@ tile.dfc_emitter.name=DFC Emitter
|
||||
tile.dfc_injector.name=DFC Fuel Injector
|
||||
tile.dfc_receiver.name=DFC Receiver
|
||||
tile.dfc_stabilizer.name=DFC Stabilizer
|
||||
tile.dirt_dead.name=Dead Dirt
|
||||
tile.dirt_oily.name=Oily Dirt
|
||||
tile.drill_pipe.name=Drill Pipe
|
||||
tile.ducrete.name=Ducrete Tile
|
||||
tile.ducrete_smooth.name=Ducrete
|
||||
@ -3107,6 +3112,7 @@ tile.machine_flare.name=Gas Flare
|
||||
tile.machine_fluidtank.name=Tank
|
||||
tile.machine_forcefield.name=Forcefield Emitter
|
||||
tile.machine_fraction_tower.name=Fractioning Tower
|
||||
tile.machine_fracking_tower.name=Hydraulic Fracking Tower
|
||||
tile.machine_gascent.name=Gas Centrifuge
|
||||
tile.machine_generator.name=Nuclear Reactor (Old)
|
||||
tile.machine_geo.name=Geothermal Electric Generator
|
||||
@ -3202,6 +3208,7 @@ tile.ore_aluminium.name=Aluminium Ore
|
||||
tile.ore_asbestos.name=Asbestos Ore
|
||||
tile.ore_australium.name=Australian Ore
|
||||
tile.ore_bedrock_coltan.name=Bedrock Coltan Ore
|
||||
tile.ore_bedrock_oil.name=Bedrock Oil Deposit
|
||||
tile.ore_beryllium.name=Beryllium Ore
|
||||
tile.ore_cinnebar.name=Cinnabar Ore
|
||||
tile.ore_coal_oil.name=Oily Coal Ore
|
||||
|
||||
3073
src/main/resources/assets/hbm/models/machines/fracking_tower.obj
Normal file
|
Before Width: | Height: | Size: 846 B After Width: | Height: | Size: 924 B |
BIN
src/main/resources/assets/hbm/textures/blocks/dirt_oily_alt.png
Normal file
|
After Width: | Height: | Size: 846 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 491 B |
BIN
src/main/resources/assets/hbm/textures/items/ingot_cf_test1.png
Normal file
|
After Width: | Height: | Size: 491 B |
BIN
src/main/resources/assets/hbm/textures/items/ingot_cf_test2.png
Normal file
|
After Width: | Height: | Size: 386 B |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 5.0 KiB |
@ -3,7 +3,7 @@
|
||||
"modid": "hbm",
|
||||
"name": "Hbm's Nuclear Tech",
|
||||
"description": "A mod that adds weapons, nuclear themed stuff and machines",
|
||||
"version":"1.0.27_X4000",
|
||||
"version":"1.0.27_X4011",
|
||||
"mcversion": "1.7.10",
|
||||
"url": "",
|
||||
"updateUrl": "",
|
||||
|
||||