Almost finfihsed derrick, removed obsolete code in ISources

This commit is contained in:
HbmMods 2017-05-21 19:30:16 +02:00
parent d5c6411c00
commit c2510f65bf
75 changed files with 3174 additions and 1181 deletions

View File

@ -153,6 +153,9 @@ tile.machine_industrial_generator.name=Industrieller Generator
container.iGenerator=Industrieller Generator
tile.machine_cyclotron.name=Zyklotron
container.cyclotron=Zyklotron
tile.machine_well.name=Ölbohrturm
tile.oil_pipe.name=Rohölrohr
container.oilWell=Ölbohrturm
tile.rail_highspeed.name=Hochgeschwindigkeitsschienen
tile.rail_booster.name=Hochgeschwindigkeits-Boosterschienen
@ -347,6 +350,9 @@ tile.ore_unobtainium.name=Glimmerblende
tile.ore_daffergon.name=Dellit
tile.ore_verticium.name=Dollargrünes Mineral
tile.ore_oil.name=Ölvorkommen
tile.ore_oil_empty.name=Leeres Ölvorkommen
tile.reinforced_brick.name=Verstärkter Stein
tile.reinforced_glass.name=Verstärktes Glas
tile.reinforced_sand.name=Verstärkter Sandstein
@ -483,6 +489,7 @@ item.oil_canola.name=Rohes Canola-Öl
item.canister_empty.name=Leerer Kanister
item.canister_canola.name=Schmiermittelkanister
item.canister_oil.name=Rohölkanister
item.canister_fuel.name=Treibstoffkanister
item.canister_napalm.name=Napalm B
item.canister_NITAN.name=NITAN© 100 Oktan Supertreibstoff
@ -1056,6 +1063,7 @@ item.crystal_energy.name=Energiekristall
item.pellet_coolant.name=Kühlcluster
item.linker.name=Telelinker
item.oil_detector.name=Ölvorkommen-Detektor
item.thermo_element.name=Thermoelektrisches Element
item.limiter.name=Generator-Limiter

View File

@ -153,6 +153,9 @@ tile.machine_industrial_generator.name=Industrial Generator
container.iGenerator=Industrial Generator
tile.machine_cyclotron.name=Cyclotron
container.cyclotron=Cyclotron
tile.machine_well.name=Oil Derrick
tile.oil_pipe.name=Cruse Oil Pipe
container.oilWell=Oil Derrick
tile.rail_highspeed.name=High Speed Rail
tile.rail_booster.name=High Speed Booster Rail
@ -347,6 +350,9 @@ tile.ore_unobtainium.name=Brightblende Ore
tile.ore_daffergon.name=Dellite
tile.ore_verticium.name=Dollar Green Mineral
tile.ore_oil.name=Oil Deposit
tile.ore_oil_empty.name=Empty Oil Deposit
tile.reinforced_brick.name=Reinforced Stone
tile.reinforced_glass.name=Reinforced Glass
tile.reinforced_sand.name=Reinforced Sandstone
@ -483,6 +489,7 @@ item.oil_canola.name=Raw Canola Oil
item.canister_empty.name=Empty Canister
item.canister_canola.name=Engine Lubricant
item.canister_oil.name=Crude Oil Canister
item.canister_fuel.name=Fuel Canister
item.canister_napalm.name=Napalm B
item.canister_NITAN.name=NITAN© 100 Octane Super Fuel
@ -1056,6 +1063,7 @@ item.crystal_energy.name=Energy Crystal
item.pellet_coolant.name=Coolant Cluster
item.linker.name=Telelinker
item.oil_detector.name=Oil Reservoir Detector
item.thermo_element.name=Thermoelectric Element
item.limiter.name=Generator Limiter

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

View File

@ -29,6 +29,7 @@ import com.hbm.blocks.generic.BlockCrate;
import com.hbm.blocks.generic.BlockGeneric;
import com.hbm.blocks.generic.BlockMush;
import com.hbm.blocks.generic.BlockMushHuge;
import com.hbm.blocks.generic.BlockNoDrop;
import com.hbm.blocks.generic.BlockOre;
import com.hbm.blocks.generic.BlockPlasma;
import com.hbm.blocks.generic.DecoBlock;
@ -53,6 +54,7 @@ import com.hbm.blocks.machine.BlockSeal;
import com.hbm.blocks.machine.DummyBlockCentrifuge;
import com.hbm.blocks.machine.DummyBlockCyclotron;
import com.hbm.blocks.machine.DummyBlockIGenerator;
import com.hbm.blocks.machine.DummyBlockWell;
import com.hbm.blocks.machine.FWatzCore;
import com.hbm.blocks.machine.FWatzHatch;
import com.hbm.blocks.machine.FactoryCoreAdvanced;
@ -72,6 +74,7 @@ import com.hbm.blocks.machine.MachineElectricFurnace;
import com.hbm.blocks.machine.MachineGenerator;
import com.hbm.blocks.machine.MachineIGenerator;
import com.hbm.blocks.machine.MachineNukeFurnace;
import com.hbm.blocks.machine.MachineOilWell;
import com.hbm.blocks.machine.MachinePuF6Tank;
import com.hbm.blocks.machine.MachineRTG;
import com.hbm.blocks.machine.MachineReactor;
@ -165,6 +168,9 @@ public class ModBlocks {
public static Block ore_daffergon;
public static Block ore_verticium;
public static Block ore_oil;
public static Block ore_oil_empty;
public static Block block_uranium;
public static Block block_titanium;
public static Block block_sulfur;
@ -404,7 +410,7 @@ public class ModBlocks {
public static final int guiID_machine_reix_mainframe = 38;
public static Block machine_rtg_grey;
public static final int guiID_machine_rtg = 40;
public static final int guiID_machine_rtg = 42;
//public static Block machine_rtg_red;
//public static Block machine_rtg_orange;
//public static Block machine_rtg_yellow;
@ -413,6 +419,10 @@ public class ModBlocks {
//public static Block machine_rtg_blue;
//public static Block machine_rtg_purple;
public static Block machine_well;
public static Block oil_pipe;
public static final int guiID_machine_well = 40;
public static Block launch_pad;
public static Block launch_pad_generic;
public static Block launch_pad_incendiary;
@ -466,6 +476,8 @@ public class ModBlocks {
public static Block dummy_block_centrifuge;
public static Block dummy_block_cyclotron;
public static Block dummy_port_cyclotron;
public static Block dummy_block_well;
public static Block dummy_port_well;
private static void initializeBlock() {
@ -510,6 +522,9 @@ public class ModBlocks {
ore_unobtainium = new BlockGeneric(Material.rock).setBlockName("ore_unobtainium").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_unobtainium");
ore_daffergon = new BlockGeneric(Material.rock).setBlockName("ore_daffergon").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_daffergon");
ore_verticium = new BlockGeneric(Material.rock).setBlockName("ore_verticium").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_verticium");
ore_oil = new BlockOre(Material.rock).setBlockName("ore_oil").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_oil");
ore_oil_empty = new BlockGeneric(Material.rock).setBlockName("ore_oil_empty").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_oil_empty");
block_uranium = new BlockGeneric(Material.iron).setBlockName("block_uranium").setCreativeTab(MainRegistry.tabBlock).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_uranium");
block_titanium = new BlockGeneric(Material.iron).setBlockName("block_titanium").setCreativeTab(MainRegistry.tabBlock).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_titanium");
@ -726,9 +741,12 @@ public class ModBlocks {
rail_highspeed = new RailHighspeed().setBlockName("rail_highspeed").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_highspeed");
rail_booster = new RailBooster().setBlockName("rail_booster").setHardness(5.0F).setResistance(10.0F).setCreativeTab(CreativeTabs.tabTransport).setBlockTextureName(RefStrings.MODID + ":rail_booster");
crate = new BlockCrate(Material.iron).setBlockName("crate").setStepSound(Block.soundTypeWood).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":crate");
machine_well = new MachineOilWell(Material.iron).setBlockName("machine_well").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":machine_well");
oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":oil_pipe");
machine_schrabidium_transmutator = new MachineSchrabidiumTransmutator(Material.iron).setBlockName("machine_schrabidium_transmutator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock);
machine_reix_mainframe = new MachineReiXMainframe(Material.iron).setBlockName("machine_reix_mainframe").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.tabBlock);
@ -761,6 +779,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_steel");
dummy_port_cyclotron = new DummyBlockCyclotron(Material.iron).setBlockName("dummy_port_cyclotron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
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");
}
private static void registerBlock() {
@ -789,6 +809,8 @@ public class ModBlocks {
GameRegistry.registerBlock(ore_fluorite, ore_fluorite.getUnlocalizedName());
GameRegistry.registerBlock(ore_beryllium, ore_beryllium.getUnlocalizedName());
GameRegistry.registerBlock(ore_lead, ore_lead.getUnlocalizedName());
GameRegistry.registerBlock(ore_oil, ore_oil.getUnlocalizedName());
GameRegistry.registerBlock(ore_oil_empty, ore_oil_empty.getUnlocalizedName());
GameRegistry.registerBlock(ore_schrabidium, ItemSchrabidiumBlock.class, ore_schrabidium.getUnlocalizedName());
//Rare Minerals
@ -946,6 +968,7 @@ public class ModBlocks {
GameRegistry.registerBlock(machine_electric_furnace_on, machine_electric_furnace_on.getUnlocalizedName());
GameRegistry.registerBlock(machine_shredder, machine_shredder.getUnlocalizedName());
GameRegistry.registerBlock(machine_deuterium, machine_deuterium.getUnlocalizedName());
GameRegistry.registerBlock(machine_well, machine_well.getUnlocalizedName());
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
GameRegistry.registerBlock(machine_combine_factory, machine_combine_factory.getUnlocalizedName());
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
@ -1042,6 +1065,11 @@ public class ModBlocks {
GameRegistry.registerBlock(dummy_block_centrifuge, dummy_block_centrifuge.getUnlocalizedName());
GameRegistry.registerBlock(dummy_block_cyclotron, dummy_block_cyclotron.getUnlocalizedName());
GameRegistry.registerBlock(dummy_port_cyclotron, dummy_port_cyclotron.getUnlocalizedName());
GameRegistry.registerBlock(dummy_block_well, dummy_block_well.getUnlocalizedName());
GameRegistry.registerBlock(dummy_port_well, dummy_port_well.getUnlocalizedName());
//Other Technical Blocks
GameRegistry.registerBlock(oil_pipe, oil_pipe.getUnlocalizedName());
//???
GameRegistry.registerBlock(crystal_virus, crystal_virus.getUnlocalizedName());

View File

@ -0,0 +1,20 @@
package com.hbm.blocks.generic;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
public class BlockNoDrop extends Block {
public BlockNoDrop(Material p_i45394_1_) {
super(p_i45394_1_);
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return null;
}
}

View File

@ -20,6 +20,7 @@ import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityMooshroom;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.potion.Potion;
@ -214,4 +215,14 @@ public class BlockOre extends Block {
}
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
{
if (world.getBlock(x, y - 1, z) == ModBlocks.ore_oil_empty)
{
world.setBlock(x, y, z, ModBlocks.ore_oil_empty);
world.setBlock(x, y - 1, z, ModBlocks.ore_oil);
}
}
}

View File

@ -0,0 +1,106 @@
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.TileEntityDummy;
import com.hbm.tileentity.TileEntityMachineIGenerator;
import com.hbm.tileentity.TileEntityMachineOilWell;
import com.hbm.tileentity.TileEntityMachineCyclotron;
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();
}
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;
}
}
}

View File

@ -0,0 +1,177 @@
package com.hbm.blocks.machine;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.MultiblockHandler;
import com.hbm.interfaces.IMultiblock;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityDummy;
import com.hbm.tileentity.TileEntityMachineCyclotron;
import com.hbm.tileentity.TileEntityMachineOilWell;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class MachineOilWell extends BlockContainer implements IMultiblock {
private final Random field_149933_a = new Random();
private Random rand;
private static boolean keepInventory;
public MachineOilWell(Material p_i45386_1_) {
super(p_i45386_1_);
rand = new Random();
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return Item.getItemFromBlock(ModBlocks.machine_well);
}
@Override
public int getRenderType() {
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@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())
{
TileEntityMachineOilWell entity = (TileEntityMachineOilWell) world.getTileEntity(x, y, z);
if(entity != null)
{
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_well, world, x, y, z);
}
return true;
} else {
return false;
}
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityMachineOilWell();
}
/*@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)
{
TileEntityMachineOilWell tileentityfurnace = (TileEntityMachineOilWell)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) {
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.wellDimension)) {
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.wellDimension, ModBlocks.dummy_block_well);
DummyBlockWell.safeBreak = true;
world.setBlock(x, y, z + 1, ModBlocks.dummy_port_well);
TileEntity te = world.getTileEntity(x, y, z + 1);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
world.setBlock(x, y, z - 1, ModBlocks.dummy_port_well);
TileEntity te2 = world.getTileEntity(x, y, z - 1);
if(te instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te2;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
world.setBlock(x + 1, y, z, ModBlocks.dummy_port_well);
TileEntity te3 = world.getTileEntity(x + 1, y, z);
if(te3 instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te3;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
world.setBlock(x - 1, y, z, ModBlocks.dummy_port_well);
TileEntity te4 = world.getTileEntity(x - 1, y, z);
if(te4 instanceof TileEntityDummy) {
TileEntityDummy dummy = (TileEntityDummy)te4;
dummy.targetX = x;
dummy.targetY = y;
dummy.targetZ = z;
}
DummyBlockWell.safeBreak = false;
} else
world.func_147480_a(x, y, z, true);
}
}

View File

@ -1,15 +1,17 @@
package com.hbm.calc;
import com.hbm.interfaces.ISource;
import net.minecraft.tileentity.TileEntity;
public class UnionOfTileEntitiesAndBooleans {
public UnionOfTileEntitiesAndBooleans(TileEntity tileentity, boolean bool)
public UnionOfTileEntitiesAndBooleans(ISource tileentity, boolean bool)
{
source = tileentity;
ticked = bool;
}
public TileEntity source;
public ISource source;
public boolean ticked = false;
}

View File

@ -0,0 +1,81 @@
package com.hbm.entity.particle;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class EntityOilSpillFX extends EntityModFX
{
float smokeParticleScale;
public int particleAge;
public int maxAge;
private static final String __OBFID = "CL_00000924";
public EntityOilSpillFX(World world) {
super(world, 0, 0, 0);
}
public EntityOilSpillFX(World p_i1225_1_, double p_i1225_2_, double p_i1225_4_, double p_i1225_6_, double p_i1225_8_, double p_i1225_10_, double p_i1225_12_)
{
this(p_i1225_1_, p_i1225_2_, p_i1225_4_, p_i1225_6_, p_i1225_8_, p_i1225_10_, p_i1225_12_, 1.0F);
}
public EntityOilSpillFX(World p_i1226_1_, double p_i1226_2_, double p_i1226_4_, double p_i1226_6_, double p_i1226_8_, double p_i1226_10_, double p_i1226_12_, float p_i1226_14_)
{
super(p_i1226_1_, p_i1226_2_, p_i1226_4_, p_i1226_6_, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += p_i1226_8_;
this.motionY += p_i1226_10_;
this.motionZ += p_i1226_12_;
this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D);
this.particleScale *= 0.75F;
this.particleScale *= p_i1226_14_;
this.smokeParticleScale = this.particleScale;
//this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
//this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1226_14_);
this.noClip = false;
}
/**
* Called to update the entity's position/logic.
*/
@Override
public void onUpdate()
{
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if(maxAge < 15)
{
maxAge = rand.nextInt(4) + 15;
}
this.particleAge++;
if (this.particleAge >= maxAge)
{
this.setDead();
}
this.motionX *= 0.7599999785423279D;
this.motionY *= 0.7599999785423279D;
this.motionZ *= 0.7599999785423279D;
if (this.onGround)
{
this.motionX *= 0.699999988079071D;
this.motionZ *= 0.699999988079071D;
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
}
}

View File

@ -0,0 +1,67 @@
package com.hbm.entity.projectile;
import com.hbm.entity.effect.EntityCloudFleija;
import com.hbm.entity.logic.EntityNukeExplosionAdvanced;
import com.hbm.entity.particle.EntityOilSpillFX;
import com.hbm.entity.particle.EntitySSmokeFX;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityBlaze;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityOilSpill extends EntityThrowable {
public EntityOilSpill(World p_i1773_1_)
{
super(p_i1773_1_);
}
public EntityOilSpill(World p_i1774_1_, EntityLivingBase p_i1774_2_)
{
super(p_i1774_1_, p_i1774_2_);
}
public void entityInit() {
}
public EntityOilSpill(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
{
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
}
@Override
public void onUpdate() {
super.onUpdate();
if(!worldObj.isRemote) {
worldObj.spawnEntityInWorld(new EntityOilSpillFX(worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
if(this.isBurning()) {
this.setDead();
worldObj.createExplosion(null, posX, posY, posZ, 1.5F, true);
}
}
}
@Override
protected void onImpact(MovingObjectPosition p_70184_1_)
{
if (p_70184_1_.entityHit != null)
{
byte b0 = 0;
p_70184_1_.entityHit.attackEntityFrom(ModDamageSource.shrapnel, b0);
}
if(this.ticksExisted > 5) {
this.setDead();
}
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.explosion;
import java.util.Random;
import com.hbm.entity.particle.EntityDSmokeFX;
import com.hbm.entity.projectile.EntityOilSpill;
import com.hbm.entity.projectile.EntityRubble;
import com.hbm.entity.projectile.EntityShrapnel;
@ -73,6 +74,20 @@ public class ExplosionLarge {
}
}
public static void spawnOilSpills(World world, double x, double y, double z, int count) {
for(int i = 0; i < count; i++) {
EntityOilSpill shrapnel = new EntityOilSpill(world);
shrapnel.posX = x;
shrapnel.posY = y;
shrapnel.posZ = z;
shrapnel.motionY = ((rand.nextFloat() * 0.5) + 0.5) * (1 + (count / (15 + rand.nextInt(21)))) + (rand.nextFloat() / 50 * count) * 0.25F;
shrapnel.motionX = rand.nextGaussian() * 1 * (1 + (count / 50)) * 0.15F;
shrapnel.motionZ = rand.nextGaussian() * 1 * (1 + (count / 50)) * 0.15F;
world.spawnEntityInWorld(shrapnel);
}
}
public static void explode(World world, double x, double y, double z, float strength, boolean cloud, boolean rubble, boolean shrapnel) {
world.createExplosion(null, x, y, z, strength, true);
if(cloud)

View File

@ -20,6 +20,7 @@ import com.hbm.inventory.container.ContainerMachineCoal;
import com.hbm.inventory.container.ContainerMachineCyclotron;
import com.hbm.inventory.container.ContainerMachineDeuterium;
import com.hbm.inventory.container.ContainerMachineDiesel;
import com.hbm.inventory.container.ContainerMachineOilWell;
import com.hbm.inventory.container.ContainerMachineRTG;
import com.hbm.inventory.container.ContainerMachineSchrabidiumTransmutator;
import com.hbm.inventory.container.ContainerMachineShredder;
@ -59,6 +60,7 @@ import com.hbm.inventory.gui.GUIMachineDeuterium;
import com.hbm.inventory.gui.GUIMachineDiesel;
import com.hbm.inventory.gui.GUIMachineElectricFurnace;
import com.hbm.inventory.gui.GUIMachineGenerator;
import com.hbm.inventory.gui.GUIMachineOilWell;
import com.hbm.inventory.gui.GUIMachinePuF6Tank;
import com.hbm.inventory.gui.GUIMachineRTG;
import com.hbm.inventory.gui.GUIMachineReactor;
@ -90,6 +92,7 @@ import com.hbm.tileentity.TileEntityDiFurnace;
import com.hbm.tileentity.TileEntityFWatzCore;
import com.hbm.tileentity.TileEntityFusionMultiblock;
import com.hbm.tileentity.TileEntityMachineIGenerator;
import com.hbm.tileentity.TileEntityMachineOilWell;
import com.hbm.tileentity.TileEntityLaunchPad;
import com.hbm.tileentity.TileEntityMachineBattery;
import com.hbm.tileentity.TileEntityMachineCMBFactory;
@ -455,6 +458,14 @@ public class GUIHandler implements IGuiHandler {
return new ContainerMachineCyclotron(player.inventory, (TileEntityMachineCyclotron) entity);
}
}
case ModBlocks.guiID_machine_well:
{
if(entity instanceof TileEntityMachineOilWell)
{
return new ContainerMachineOilWell(player.inventory, (TileEntityMachineOilWell) entity);
}
}
}
return null;
}
@ -787,6 +798,14 @@ public class GUIHandler implements IGuiHandler {
return new GUIMachineCyclotron(player.inventory, (TileEntityMachineCyclotron) entity);
}
}
case ModBlocks.guiID_machine_well:
{
if(entity instanceof TileEntityMachineOilWell)
{
return new GUIMachineOilWell(player.inventory, (TileEntityMachineOilWell) entity);
}
}
}
}
return null;

View File

@ -46,6 +46,7 @@ public class MultiblockHandler {
public static final int[] iGenDimensionWest = new int[] { 3, 2, 2, 0, 1, 1 };
public static final int[] centDimension = new int[] { 0, 0, 2, 0, 0, 0 };
public static final int[] cyclDimension = new int[] { 1, 1, 5, 0, 1, 1 };
public static final int[] wellDimension = new int[] { 1, 1, 5, 0, 1, 1 };
//Approved!
public static boolean checkSpace(World world, int x, int y, int z, int[] i) {

View File

@ -1,8 +1,16 @@
package com.hbm.interfaces;
import java.util.List;
public interface ISource {
void ffgeuaInit();
void ffgeua(int x, int y, int z, boolean newTact);
boolean getTact();
int getSPower();
void setSPower(int i);
List<IConsumer> getList();
void clearList();
}

View File

@ -5,9 +5,9 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class SlotDiFurnace extends Slot {
public class SlotMachineOutput extends Slot {
public SlotDiFurnace(EntityPlayer player, IInventory inventory, int i, int j, int k) {
public SlotMachineOutput(EntityPlayer player, IInventory inventory, int i, int j, int k) {
super(inventory, i, j, k);
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineCentrifuge;
import net.minecraft.entity.player.EntityPlayer;
@ -22,10 +22,10 @@ public class ContainerCentrifuge extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 26, 17));
this.addSlotToContainer(new Slot(tedf, 1, 26, 53));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 2, 134, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 3, 152, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 4, 134, 53));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 5, 152, 53));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 134, 17));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 152, 17));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 134, 53));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 5, 152, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityCoreAdvanced;
import com.hbm.tileentity.TileEntityCoreTitanium;
@ -35,26 +35,26 @@ public class ContainerCoreAdvanced extends Container {
this.addSlotToContainer(new Slot(tedf, 9, 8, 54));
this.addSlotToContainer(new Slot(tedf, 10, 8, 72));
//Outputs
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 11, 134, 54));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 12, 134, 72));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 134, 54));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 12, 134, 72));
//Output Storage
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 13, 8, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 14, 26, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 15, 44, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 16, 62, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 17, 80, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 18, 98, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 19, 116, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 20, 134, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 21, 152, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 13, 8, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 26, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 15, 44, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 16, 62, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 17, 80, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 18, 98, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 19, 116, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 20, 134, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 21, 152, 108));
//Power Cell
this.addSlotToContainer(new Slot(tedf, 22, 44, 72));
//More Inputs
this.addSlotToContainer(new Slot(tedf, 23, 26, 54));
this.addSlotToContainer(new Slot(tedf, 24, 26, 72));
//More Outputs
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 25, 152, 54));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 26, 152, 72));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 25, 152, 54));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 26, 152, 72));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityCoreTitanium;
import com.hbm.tileentity.TileEntityMachineGenerator;
@ -35,18 +35,18 @@ public class ContainerCoreTitanium extends Container {
this.addSlotToContainer(new Slot(tedf, 9, 8, 54));
this.addSlotToContainer(new Slot(tedf, 10, 8, 72));
//Outputs
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 11, 152, 54));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 12, 152, 72));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 152, 54));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 12, 152, 72));
//Output Storage
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 13, 8, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 14, 26, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 15, 44, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 16, 62, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 17, 80, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 18, 98, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 19, 116, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 20, 134, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 21, 152, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 13, 8, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 26, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 15, 44, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 16, 62, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 17, 80, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 18, 98, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 19, 116, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 20, 134, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 21, 152, 108));
//Power Cell
this.addSlotToContainer(new Slot(tedf, 22, 44, 72));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityDiFurnace;
import net.minecraft.entity.player.EntityPlayer;
@ -29,7 +29,7 @@ public class ContainerDiFurnace extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 80, 18));
this.addSlotToContainer(new Slot(tedf, 1, 80, 54));
this.addSlotToContainer(new Slot(tedf, 2, 8, 36));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 3, 134, 36));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 134, 36));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineElectricFurnace;
import net.minecraft.entity.player.EntityPlayer;
@ -26,7 +26,7 @@ public class ContainerElectricFurnace extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 56, 53));
this.addSlotToContainer(new Slot(tedf, 1, 56, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 2, 116, 35));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 116, 35));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineCMBFactory;
import com.hbm.tileentity.TileEntityMachineShredder;
@ -28,7 +28,7 @@ public class ContainerMachineCMBFactory extends Container {
this.addSlotToContainer(new Slot(tedf, 1, 80, 17));
this.addSlotToContainer(new Slot(tedf, 2, 62, 53));
this.addSlotToContainer(new Slot(tedf, 3, 80, 53));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 4, 134, 35));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 134, 35));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineCyclotron;
import com.hbm.tileentity.TileEntityMachineRTG;
@ -40,11 +40,11 @@ public class ContainerMachineCyclotron extends Container {
//Cell
this.addSlotToContainer(new Slot(tedf, 10, 8, 108));
//Output
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 11, 44, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 12, 62, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 13, 80, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 14, 98, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 15, 116, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 44, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 12, 62, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 13, 80, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 98, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 15, 116, 108));
for(int i = 0; i < 3; i++)
{
@ -78,13 +78,13 @@ public class ContainerMachineCyclotron extends Container {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 14) {
if (!this.mergeItemStack(var5, 15, this.inventorySlots.size(), true))
if (par2 <= 15) {
if (!this.mergeItemStack(var5, 16, this.inventorySlots.size(), true))
{
return null;
}
}
else if (!this.mergeItemStack(var5, 0, 15, false))
else if (!this.mergeItemStack(var5, 0, 16, false))
{
return null;
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineDeuterium;
import net.minecraft.entity.player.EntityPlayer;
@ -27,7 +27,7 @@ private TileEntityMachineDeuterium nukeBoy;
this.addSlotToContainer(new Slot(tedf, 1, 26, 90));
this.addSlotToContainer(new Slot(tedf, 2, 44, 90));
this.addSlotToContainer(new Slot(tedf, 3, 80, 54));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 4, 140, 54));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 140, 54));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineCoal;
import com.hbm.tileentity.TileEntityMachineDiesel;
@ -26,7 +26,7 @@ public class ContainerMachineDiesel extends Container {
diFurnace = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 53));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 1, 80, 53));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 80, 53));
this.addSlotToContainer(new Slot(tedf, 2, 116, 53));
for(int i = 0; i < 3; i++)

View File

@ -0,0 +1,140 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineOilWell;
import com.hbm.tileentity.TileEntityMachineRTG;
import com.hbm.tileentity.TileEntityMachineUF6Tank;
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 ContainerMachineOilWell extends Container {
private TileEntityMachineOilWell testNuke;
private int oil;
private int power;
private int warning;
public ContainerMachineOilWell(InventoryPlayer invPlayer, TileEntityMachineOilWell tedf) {
oil = 0;
power = 0;
warning = 0;
testNuke = tedf;
//Battery
this.addSlotToContainer(new Slot(tedf, 0, 44, 53));
//Canister Input
this.addSlotToContainer(new Slot(tedf, 1, 134, 17));
//Canister Output
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 134, 53));
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));
}
}
for(int i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
}
}
@Override
public void addCraftingToCrafters(ICrafting crafting) {
super.addCraftingToCrafters(crafting);
crafting.sendProgressBarUpdate(this, 0, this.testNuke.oil);
crafting.sendProgressBarUpdate(this, 1, this.testNuke.power);
crafting.sendProgressBarUpdate(this, 2, this.testNuke.warning);
}
@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 <= 14) {
if (!this.mergeItemStack(var5, 15, this.inventorySlots.size(), true))
{
return null;
}
}
else if (!this.mergeItemStack(var5, 0, 15, 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.oil != this.testNuke.oil)
{
par1.sendProgressBarUpdate(this, 0, this.testNuke.oil);
}
if(this.power != this.testNuke.power)
{
par1.sendProgressBarUpdate(this, 1, this.testNuke.power);
}
if(this.power != this.testNuke.warning)
{
par1.sendProgressBarUpdate(this, 2, this.testNuke.warning);
}
}
this.oil = this.testNuke.oil;
this.power = this.testNuke.power;
this.warning = this.testNuke.warning;
}
@Override
public void updateProgressBar(int i, int j) {
if(i == 0)
{
testNuke.oil = j;
}
if(i == 1)
{
testNuke.power = j;
}
if(i == 2)
{
testNuke.warning = j;
}
}
}

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineRTG;
import com.hbm.tileentity.TileEntityMachineUF6Tank;

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineDeuterium;
import com.hbm.tileentity.TileEntityMachineSchrabidiumTransmutator;
@ -25,7 +25,7 @@ private TileEntityMachineSchrabidiumTransmutator nukeBoy;
nukeBoy = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 63));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 1, 134, 63));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 134, 63));
this.addSlotToContainer(new Slot(tedf, 2, 26, 18));
this.addSlotToContainer(new Slot(tedf, 3, 8, 108));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineDiesel;
import com.hbm.tileentity.TileEntityMachineShredder;
@ -31,24 +31,24 @@ public class ContainerMachineShredder extends Container {
this.addSlotToContainer(new Slot(tedf, 6, 44, 54));
this.addSlotToContainer(new Slot(tedf, 7, 62, 54));
this.addSlotToContainer(new Slot(tedf, 8, 80, 54));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 9, 116, 18));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 10, 134, 18));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 11, 152, 18));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 12, 116, 36));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 13, 134, 36));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 14, 152, 36));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 15, 116, 54));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 16, 134, 54));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 17, 152, 54));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 18, 116, 72));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 19, 134, 72));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 20, 152, 72));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 21, 116, 90));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 22, 134, 90));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 23, 152, 90));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 24, 116, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 25, 134, 108));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 26, 152, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 9, 116, 18));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 10, 134, 18));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 11, 152, 18));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 12, 116, 36));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 13, 134, 36));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 14, 152, 36));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 15, 116, 54));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 16, 134, 54));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 17, 152, 54));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 18, 116, 72));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 19, 134, 72));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 20, 152, 72));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 21, 116, 90));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 22, 134, 90));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 23, 152, 90));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 24, 116, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 25, 134, 108));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 26, 152, 108));
this.addSlotToContainer(new Slot(tedf, 27, 44, 108));
this.addSlotToContainer(new Slot(tedf, 28, 80, 108));
this.addSlotToContainer(new Slot(tedf, 29, 8, 108));

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityNukeFurnace;
import net.minecraft.entity.player.EntityPlayer;
@ -26,7 +26,7 @@ public class ContainerNukeFurnace extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 56, 53));
this.addSlotToContainer(new Slot(tedf, 1, 56, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 2, 116, 35));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 116, 35));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachinePuF6Tank;
import net.minecraft.entity.player.EntityPlayer;
@ -21,9 +21,9 @@ public class ContainerPuF6Tank extends Container {
testNuke = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 1, 44, 53));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 44, 53));
this.addSlotToContainer(new Slot(tedf, 2, 116, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 3, 116, 53));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 116, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineReactor;
import net.minecraft.entity.player.EntityPlayer;
@ -26,7 +26,7 @@ public class ContainerReactor extends Container {
this.addSlotToContainer(new Slot(tedf, 0, 56, 53));
this.addSlotToContainer(new Slot(tedf, 1, 56, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 2, 116, 35));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 116, 35));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityRtgFurnace;
import net.minecraft.entity.player.EntityPlayer;
@ -26,7 +26,7 @@ public class ContainerRtgFurnace extends Container {
this.addSlotToContainer(new Slot(tedf, 1, 38, 53));
this.addSlotToContainer(new Slot(tedf, 2, 56, 53));
this.addSlotToContainer(new Slot(tedf, 3, 74, 53));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 4, 116, 35));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 4, 116, 35));
for(int i = 0; i < 3; i++)
{

View File

@ -1,6 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotDiFurnace;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.TileEntityMachineUF6Tank;
import net.minecraft.entity.player.EntityPlayer;
@ -21,9 +21,9 @@ public class ContainerUF6Tank extends Container {
testNuke = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 1, 44, 53));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 44, 53));
this.addSlotToContainer(new Slot(tedf, 2, 116, 17));
this.addSlotToContainer(new SlotDiFurnace(invPlayer.player, tedf, 3, 116, 53));
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 116, 53));
for(int i = 0; i < 3; i++)
{

View File

@ -0,0 +1,58 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerMachineOilWell;
import com.hbm.inventory.container.ContainerMachineRTG;
import com.hbm.inventory.container.ContainerUF6Tank;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.TileEntityMachineOilWell;
import com.hbm.tileentity.TileEntityMachineRTG;
import com.hbm.tileentity.TileEntityMachineUF6Tank;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIMachineOilWell extends GuiContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_well.png");
private TileEntityMachineOilWell derrick;
public GUIMachineOilWell(InventoryPlayer invPlayer, TileEntityMachineOilWell tedf) {
super(new ContainerMachineOilWell(invPlayer, tedf));
derrick = tedf;
this.xSize = 176;
this.ySize = 166;
}
@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 = derrick.getPowerScaled(52);
drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i);
int j = derrick.getOilScaled(52);
drawTexturedModalRect(guiLeft + 80, guiTop + 69 - j, 192, 52 - j, 34, j);
int k = derrick.warning;
if(k == 2)
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 176, 52, 16, 16);
if(k == 1)
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 192, 52, 16, 16);
}
}

View File

@ -66,6 +66,7 @@ import com.hbm.items.tool.ItemMatch;
import com.hbm.items.tool.ItemModBucket;
import com.hbm.items.tool.ItemMultitoolPassive;
import com.hbm.items.tool.ItemMultitoolTool;
import com.hbm.items.tool.ItemOilDetector;
import com.hbm.items.tool.ItemRamManipulator;
import com.hbm.items.tool.ItemWand;
import com.hbm.items.tool.ItemWandD;
@ -417,6 +418,7 @@ public class ModItems {
public static Item oil_canola;
public static Item canister_empty;
public static Item canister_canola;
public static Item canister_oil;
public static Item canister_fuel;
public static Item canister_napalm;
public static Item canister_NITAN;
@ -566,6 +568,7 @@ public class ModItems {
public static Item designator;
public static Item designator_range;
public static Item linker;
public static Item oil_detector;
public static Item missile_generic;
public static Item missile_anti_ballistic;
@ -933,6 +936,14 @@ public class ModItems {
public static Item d_smoke6;
public static Item d_smoke7;
public static Item d_smoke8;
public static Item spill1;
public static Item spill2;
public static Item spill3;
public static Item spill4;
public static Item spill5;
public static Item spill6;
public static Item spill7;
public static Item spill8;
public static Item energy_ball;
public static Item discharge;
public static Item empblast;
@ -1257,6 +1268,7 @@ public class ModItems {
oil_canola = new Item().setUnlocalizedName("oil_canola").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":oil_canola");
canister_empty = new ItemCustomLore().setUnlocalizedName("canister_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":canister_empty");
canister_canola = new ItemCustomLore().setUnlocalizedName("canister_canola").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_canola");
canister_oil = new ItemCustomLore().setUnlocalizedName("canister_oil").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_oil");
canister_fuel = new ItemCustomLore().setUnlocalizedName("canister_fuel").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_fuel");
canister_napalm = new ItemCustomLore().setUnlocalizedName("canister_napalm").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_napalm");
canister_NITAN = new ItemCustomLore().setUnlocalizedName("canister_NITAN").setCreativeTab(MainRegistry.tabParts).setContainerItem(ModItems.canister_empty).setTextureName(RefStrings.MODID + ":canister_superfuel");
@ -1612,6 +1624,7 @@ public class ModItems {
remote = new ItemRamManipulator().setUnlocalizedName("remote").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":remote");
chopper = new ItemChopper().setUnlocalizedName("chopper").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":chopper");
linker = new ItemTeleLink().setUnlocalizedName("linker").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":linker");
oil_detector = new ItemOilDetector().setUnlocalizedName("oil_detector").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":oil_detector");
euphemium_helmet = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 0).setUnlocalizedName("astatine_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_helmet");
euphemium_plate = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 1).setUnlocalizedName("astatine_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_plate");
@ -1770,6 +1783,14 @@ public class ModItems {
d_smoke6 = new Item().setUnlocalizedName("d_smoke6").setTextureName(RefStrings.MODID + ":d_smoke6");
d_smoke7 = new Item().setUnlocalizedName("d_smoke7").setTextureName(RefStrings.MODID + ":d_smoke7");
d_smoke8 = new Item().setUnlocalizedName("d_smoke8").setTextureName(RefStrings.MODID + ":d_smoke8");
spill1 = new Item().setUnlocalizedName("spill1").setTextureName(RefStrings.MODID + ":spill1");
spill2 = new Item().setUnlocalizedName("spill2").setTextureName(RefStrings.MODID + ":spill2");
spill3 = new Item().setUnlocalizedName("spill3").setTextureName(RefStrings.MODID + ":spill3");
spill4 = new Item().setUnlocalizedName("spill4").setTextureName(RefStrings.MODID + ":spill4");
spill5 = new Item().setUnlocalizedName("spill5").setTextureName(RefStrings.MODID + ":spill5");
spill6 = new Item().setUnlocalizedName("spill6").setTextureName(RefStrings.MODID + ":spill6");
spill7 = new Item().setUnlocalizedName("spill7").setTextureName(RefStrings.MODID + ":spill7");
spill8 = new Item().setUnlocalizedName("spill8").setTextureName(RefStrings.MODID + ":spill8");
energy_ball = new Item().setUnlocalizedName("energy_ball").setTextureName(RefStrings.MODID + ":energy_ball");
discharge = new Item().setUnlocalizedName("discharge").setTextureName(RefStrings.MODID + ":discharge");
empblast = new Item().setUnlocalizedName("empblast").setTextureName(RefStrings.MODID + ":empblast");
@ -2133,6 +2154,7 @@ public class ModItems {
//Canisters
GameRegistry.registerItem(canister_empty, canister_empty.getUnlocalizedName());
GameRegistry.registerItem(canister_canola, canister_canola.getUnlocalizedName());
GameRegistry.registerItem(canister_oil, canister_oil.getUnlocalizedName());
GameRegistry.registerItem(canister_fuel, canister_fuel.getUnlocalizedName());
GameRegistry.registerItem(canister_napalm, canister_napalm.getUnlocalizedName());
GameRegistry.registerItem(canister_NITAN, canister_NITAN.getUnlocalizedName());
@ -2294,6 +2316,7 @@ public class ModItems {
GameRegistry.registerItem(designator, designator.getUnlocalizedName());
GameRegistry.registerItem(designator_range, designator_range.getUnlocalizedName());
GameRegistry.registerItem(linker, linker.getUnlocalizedName());
GameRegistry.registerItem(oil_detector, oil_detector.getUnlocalizedName());
//Missiles
GameRegistry.registerItem(missile_generic, missile_generic.getUnlocalizedName());
@ -2692,6 +2715,14 @@ public class ModItems {
GameRegistry.registerItem(d_smoke6, d_smoke6.getUnlocalizedName());
GameRegistry.registerItem(d_smoke7, d_smoke7.getUnlocalizedName());
GameRegistry.registerItem(d_smoke8, d_smoke8.getUnlocalizedName());
GameRegistry.registerItem(spill1, spill1.getUnlocalizedName());
GameRegistry.registerItem(spill2, spill2.getUnlocalizedName());
GameRegistry.registerItem(spill3, spill3.getUnlocalizedName());
GameRegistry.registerItem(spill4, spill4.getUnlocalizedName());
GameRegistry.registerItem(spill5, spill5.getUnlocalizedName());
GameRegistry.registerItem(spill6, spill6.getUnlocalizedName());
GameRegistry.registerItem(spill7, spill7.getUnlocalizedName());
GameRegistry.registerItem(spill8, spill8.getUnlocalizedName());
GameRegistry.registerItem(energy_ball, energy_ball.getUnlocalizedName());
GameRegistry.registerItem(discharge, discharge.getUnlocalizedName());
GameRegistry.registerItem(empblast, empblast.getUnlocalizedName());

View File

@ -0,0 +1,70 @@
package com.hbm.items.tool;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class ItemOilDetector extends Item {
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
list.add("Right click to scan for oil.");
list.add("Scanner can only detect larger deposits!");
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
boolean oil = false;
boolean direct = false;
int x = (int)player.posX;
int y = (int)player.posY;
int z = (int)player.posZ;
for(int i = y + 15; i > 5; i--)
if(world.getBlock(x, i, z) == ModBlocks.ore_oil)
direct = true;
for(int i = y + 15; i > 5; i--)
if(world.getBlock(x + 5, i, z) == ModBlocks.ore_oil)
oil = true;
for(int i = y + 15; i > 5; i--)
if(world.getBlock(x - 5, i, z) == ModBlocks.ore_oil)
oil = true;
for(int i = y + 15; i > 5; i--)
if(world.getBlock(x, i, z + 5) == ModBlocks.ore_oil)
oil = true;
for(int i = y + 15; i > 5; i--)
if(world.getBlock(x, i, z - 5) == ModBlocks.ore_oil)
oil = true;
if(direct)
oil = true;
if(world.isRemote)
{
if(oil) {
player.addChatMessage(new ChatComponentText("Oil deposit detected!"));
if(direct)
player.addChatMessage(new ChatComponentText("Oil deposit directly below!"));
} else {
player.addChatMessage(new ChatComponentText("No oil detected."));
}
}
world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
player.swingItem();
return stack;
}
}

View File

@ -90,6 +90,7 @@ public class GunRpg extends Item
if (!p_77615_2_.isRemote)
{
entityarrow.canBePickedUp = 2;
p_77615_2_.spawnEntityInWorld(entityarrow);
}
}

View File

@ -13,6 +13,7 @@ import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.ISource;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityCable;
import com.hbm.tileentity.TileEntityLaunchPad;
import com.hbm.tileentity.TileEntityMachineBattery;
import com.hbm.tileentity.TileEntityMachineDeuterium;
@ -256,14 +257,15 @@ public class Library {
world.getBlock(x, y, z) == ModBlocks.watz_conductor ||
world.getBlock(x, y, z) == ModBlocks.fwatz_hatch ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_igenerator ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_cyclotron)
world.getBlock(x, y, z) == ModBlocks.dummy_port_cyclotron ||
world.getBlock(x, y, z) == ModBlocks.dummy_port_well)
{
return true;
}
return false;
}
public static boolean checkUnionList(List<UnionOfTileEntitiesAndBooleans> list, TileEntity that) {
public static boolean checkUnionList(List<UnionOfTileEntitiesAndBooleans> list, ISource that) {
for(UnionOfTileEntitiesAndBooleans union : list)
{
@ -425,26 +427,63 @@ public class Library {
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
}
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() > 0)
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
}
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() > 0)
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
}
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_titanium && slots[index].getItemDamage() > 0)
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
}
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_advanced && slots[index].getItemDamage() > 0)
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
}
for(int i = 0; i < 5; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() > 0)
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 15; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() > 0)
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 10; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_titanium && slots[index].getItemDamage() > 0)
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 10; i++)
if(power - 100 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.factory_core_advanced && slots[index].getItemDamage() > 0)
{
power -= 100;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 50; i++)
if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_sword && slots[index].getItemDamage() > 0)
{
power -= 1;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 50; i++)
if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_pickaxe && slots[index].getItemDamage() > 0)
{
power -= 1;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 50; i++)
if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_axe && slots[index].getItemDamage() > 0)
{
power -= 1;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 50; i++)
if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_shovel && slots[index].getItemDamage() > 0)
{
power -= 1;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
return power;
}
@ -452,7 +491,7 @@ public class Library {
if(slots[index] != null && slots[index].getItem() == ModItems.battery_creative)
{
power = maxPower;
return maxPower;
}
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_generic && slots[index].getItemDamage() < 50)
@ -461,29 +500,155 @@ public class Library {
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
}
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() < 200)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
}
for(int i = 0; i < 5; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_advanced && slots[index].getItemDamage() < 200)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
} else break;
for(int i = 0; i < 15; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() < 10000)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
} else break;
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.battery_schrabidium && slots[index].getItemDamage() < 10000)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
}
for(int i = 0; i < 25; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.fusion_core && slots[index].getItemDamage() < 5000)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
} else break;
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.fusion_core && slots[index].getItemDamage() < 5000)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
}
for(int i = 0; i < 10; i++)
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.energy_core && slots[index].getItemDamage() < 5000)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
} else break;
if(power + 100 <= maxPower && slots[index] != null && slots[index].getItem() == ModItems.energy_core && slots[index].getItemDamage() < 5000)
{
power += 100;
slots[index].setItemDamage(slots[index].getItemDamage() + 1);
}
return power;
}
//Flut-Füll gesteuerter Energieübertragungsalgorithmus
//Flood fill controlle energy transmission algorithm
public static void ffgeua(int x, int y, int z, boolean newTact, ISource that, World worldObj) {
Block block = worldObj.getBlock(x, y, z);
TileEntity tileentity = worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.dummy_port_well && worldObj.getBlock(x + 1, y, z) == ModBlocks.machine_well)
{
tileentity = worldObj.getTileEntity(x + 1, y, z);
}
if(block == ModBlocks.dummy_port_well && worldObj.getBlock(x - 1, y, z) == ModBlocks.machine_well)
{
tileentity = worldObj.getTileEntity(x - 1, y, z);
}
if(block == ModBlocks.dummy_port_well && worldObj.getBlock(x, y, z + 1) == ModBlocks.machine_well)
{
tileentity = worldObj.getTileEntity(x, y, z + 1);
}
if(block == ModBlocks.dummy_port_well && worldObj.getBlock(x, y, z - 1) == ModBlocks.machine_well)
{
tileentity = worldObj.getTileEntity(x, y, z - 1);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, that))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == that)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
that.ffgeua(x, y + 1, z, that.getTact());
that.ffgeua(x, y - 1, z, that.getTact());
that.ffgeua(x - 1, y, z, that.getTact());
that.ffgeua(x + 1, y, z, that.getTact());
that.ffgeua(x, y, z - 1, that.getTact());
that.ffgeua(x, y, z + 1, that.getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(that, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, that))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == that)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
that.ffgeua(x, y + 1, z, that.getTact());
that.ffgeua(x, y - 1, z, that.getTact());
that.ffgeua(x - 1, y, z, that.getTact());
that.ffgeua(x + 1, y, z, that.getTact());
that.ffgeua(x, y, z - 1, that.getTact());
that.ffgeua(x, y, z + 1, that.getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(that, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
that.getList().add((IConsumer)tileentity);
}
if(!newTact)
{
int size = that.getList().size();
if(size > 0)
{
int part = that.getSPower() / size;
for(IConsumer consume : that.getList())
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
that.setSPower(that.getSPower()-part);
consume.setPower(consume.getPower() + part);
} else {
that.setSPower(that.getSPower() - (consume.getMaxPower() - consume.getPower()));
consume.setPower(consume.getMaxPower());
}
}
}
}
that.clearList();
}
}
}

View File

@ -57,6 +57,7 @@ import com.hbm.entity.mob.EntityHunterChopper;
import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.particle.EntityBSmokeFX;
import com.hbm.entity.particle.EntityDSmokeFX;
import com.hbm.entity.particle.EntityOilSpillFX;
import com.hbm.entity.particle.EntitySSmokeFX;
import com.hbm.entity.particle.EntitySmokeFX;
import com.hbm.entity.projectile.EntityBaleflare;
@ -71,6 +72,7 @@ import com.hbm.entity.projectile.EntityMinerBeam;
import com.hbm.entity.projectile.EntityMiniMIRV;
import com.hbm.entity.projectile.EntityMiniNuke;
import com.hbm.entity.projectile.EntityNightmareBlast;
import com.hbm.entity.projectile.EntityOilSpill;
import com.hbm.entity.projectile.EntityPlasmaBeam;
import com.hbm.entity.projectile.EntityRainbow;
import com.hbm.entity.projectile.EntityRocket;
@ -91,6 +93,7 @@ import com.hbm.render.entity.RenderBlackHole;
import com.hbm.render.entity.RenderChopperMine;
import com.hbm.render.entity.RenderCloudFleija;
import com.hbm.render.entity.RenderEMPBlast;
import com.hbm.render.entity.RenderEmpty;
import com.hbm.render.entity.RenderFallout;
import com.hbm.render.entity.RenderFireball;
import com.hbm.render.entity.RenderFlare;
@ -114,6 +117,7 @@ import com.hbm.render.entity.RenderRubble;
import com.hbm.render.entity.RenderShrapnel;
import com.hbm.render.entity.RenderSmallNukeAlt;
import com.hbm.render.entity.SSmokeRenderer;
import com.hbm.render.entity.SpillRenderer;
import com.hbm.render.item.ItemRenderBFLauncher;
import com.hbm.render.item.ItemRenderBaleflare;
import com.hbm.render.item.ItemRenderBigSword;
@ -157,6 +161,7 @@ import com.hbm.render.tileentity.RenderCrashedBomb;
import com.hbm.render.tileentity.RenderCyclotron;
import com.hbm.render.tileentity.RenderDecoBlock;
import com.hbm.render.tileentity.RenderDecoBlockAlt;
import com.hbm.render.tileentity.RenderDerrick;
import com.hbm.render.tileentity.RenderIGenerator;
import com.hbm.render.tileentity.RenderLaunchPadTier1;
import com.hbm.render.tileentity.RenderNukeBoy;
@ -194,6 +199,7 @@ import com.hbm.tileentity.TileEntityDecoPoleTop;
import com.hbm.tileentity.TileEntityDecoSteelPoles;
import com.hbm.tileentity.TileEntityDecoTapeRecorder;
import com.hbm.tileentity.TileEntityMachineIGenerator;
import com.hbm.tileentity.TileEntityMachineOilWell;
import com.hbm.tileentity.TileEntityLaunchPad;
import com.hbm.tileentity.TileEntityMachineCentrifuge;
import com.hbm.tileentity.TileEntityMachineCyclotron;
@ -248,6 +254,7 @@ public class ClientProxy extends ServerProxy
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePuF6Tank.class, new RenderPuF6Tank());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineIGenerator.class, new RenderIGenerator());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCyclotron.class, new RenderCyclotron());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineOilWell.class, new RenderDerrick());
//RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderRocket());
RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderSnowball(ModItems.man_core));
@ -410,11 +417,13 @@ public class ClientProxy extends ServerProxy
RenderingRegistry.registerEntityRenderingHandler(EntityChopperMine.class, new RenderChopperMine());
RenderingRegistry.registerEntityRenderingHandler(EntityRubble.class, new RenderRubble());
RenderingRegistry.registerEntityRenderingHandler(EntityShrapnel.class, new RenderShrapnel());
RenderingRegistry.registerEntityRenderingHandler(EntityOilSpill.class, new RenderEmpty());
RenderingRegistry.registerEntityRenderingHandler(EntitySmokeFX.class, new ModEffectRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntityBSmokeFX.class, new BSmokeRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntityDSmokeFX.class, new DSmokeRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntitySSmokeFX.class, new SSmokeRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntityOilSpillFX.class, new SpillRenderer(ModItems.nuclear_waste));
RenderingRegistry.registerEntityRenderingHandler(EntityCombineBall.class, new RenderSnowball(ModItems.energy_ball));
RenderingRegistry.registerEntityRenderingHandler(EntityDischarge.class, new ElectricityRenderer(ModItems.discharge));
RenderingRegistry.registerEntityRenderingHandler(EntityEMPBlast.class, new RenderEMPBlast());

View File

@ -891,6 +891,8 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_steel, 2), new Object[] { "dustIron", "dustCoal" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { "dustSteel", "dustTungsten" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 2), new Object[] { "dustSteel", ModItems.powder_cobalt }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { "dustIron", "dustCoal", "dustTungsten", "dustTungsten" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_dura_steel, 4), new Object[] { "dustIron", "dustCoal", ModItems.powder_cobalt, ModItems.powder_cobalt }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.powder_polymer, 2), new Object[] { "dustCoal", "dustSalpeter" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.saw, 1), new Object[] { "IIL", "PP ", 'P', "plateSteel", 'I', "ingotSteel", 'L', Items.leather }));

View File

@ -81,6 +81,7 @@ import com.hbm.entity.mob.EntityHunterChopper;
import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.particle.EntityBSmokeFX;
import com.hbm.entity.particle.EntityDSmokeFX;
import com.hbm.entity.particle.EntityOilSpillFX;
import com.hbm.entity.particle.EntitySSmokeFX;
import com.hbm.entity.particle.EntitySmokeFX;
import com.hbm.entity.projectile.EntityBaleflare;
@ -95,6 +96,7 @@ import com.hbm.entity.projectile.EntityMinerBeam;
import com.hbm.entity.projectile.EntityMiniMIRV;
import com.hbm.entity.projectile.EntityMiniNuke;
import com.hbm.entity.projectile.EntityNightmareBlast;
import com.hbm.entity.projectile.EntityOilSpill;
import com.hbm.entity.projectile.EntityPlasmaBeam;
import com.hbm.entity.projectile.EntityRainbow;
import com.hbm.entity.projectile.EntityRocket;
@ -127,6 +129,7 @@ import com.hbm.tileentity.TileEntityFWatzCore;
import com.hbm.tileentity.TileEntityFusionMultiblock;
import com.hbm.tileentity.TileEntityHatch;
import com.hbm.tileentity.TileEntityMachineIGenerator;
import com.hbm.tileentity.TileEntityMachineOilWell;
import com.hbm.tileentity.TileEntityLaunchPad;
import com.hbm.tileentity.TileEntityMachineBattery;
import com.hbm.tileentity.TileEntityMachineCMBFactory;
@ -189,7 +192,7 @@ public class MainRegistry
//Tool Materials
public static ToolMaterial enumToolMaterialSchrabidium = EnumHelper.addToolMaterial("SCHRABIDIUM", 3, 10000, 50.0F, 100.0F, 200);
public static ToolMaterial enumToolMaterialHammer = EnumHelper.addToolMaterial("SCHRABIDIUMHAMMER", 3, 0, 50.0F, 999999996F, 200);
public static ToolMaterial enumToolMaterialChainsaw = EnumHelper.addToolMaterial("CHAINSAW", 3, 5000, 50.0F, 47.0F, 0);
public static ToolMaterial enumToolMaterialChainsaw = EnumHelper.addToolMaterial("CHAINSAW", 3, 1500, 50.0F, 22.0F, 0);
public static ToolMaterial enumToolMaterialSteel = EnumHelper.addToolMaterial("STEEL", 2, 500, 7.5F, 2.0F, 10);
public static ToolMaterial enumToolMaterialTitanium = EnumHelper.addToolMaterial("TITANIUM", 3, 750, 9.0F, 2.5F, 15);
public static ToolMaterial enumToolMaterialAlloy= EnumHelper.addToolMaterial("ALLOY", 3, 2000, 15.0F, 5.0F, 5);
@ -379,6 +382,7 @@ public class MainRegistry
GameRegistry.registerTileEntity(TileEntityMachineIGenerator.class, "tileentity_igenerator");
GameRegistry.registerTileEntity(TileEntityDummy.class, "tileentity_dummy");
GameRegistry.registerTileEntity(TileEntityMachineCyclotron.class, "tileentity_cyclotron");
GameRegistry.registerTileEntity(TileEntityMachineOilWell.class, "tileentity_derrick");
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
@ -452,6 +456,8 @@ public class MainRegistry
EntityRegistry.registerModEntity(EntityGrenadeShrapnel.class, "entity_grenade_shrapnel", 69, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityBlackHole.class, "entity_black_hole", 70, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityGrenadeBlackHole.class, "entity_grenade_black_hole", 71, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityOilSpillFX.class, "entity_spill_fx", 72, this, 1000, 1, true);
EntityRegistry.registerModEntity(EntityOilSpill.class, "entity_oil_spill", 73, this, 1000, 1, true);
EntityRegistry.registerGlobalEntityID(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", EntityRegistry.findGlobalUniqueEntityId(), 0x204131, 0x75CE00);
EntityRegistry.registerGlobalEntityID(EntityHunterChopper.class, "entity_mob_hunter_chopper", EntityRegistry.findGlobalUniqueEntityId(), 0x000020, 0x2D2D72);

View File

@ -0,0 +1,51 @@
package com.hbm.render.entity;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.Callable;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.hbm.entity.particle.EntityBSmokeFX;
import com.hbm.entity.particle.EntitySmokeFX;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EntityDiggingFX;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPotion;
import net.minecraft.potion.PotionHelper;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ReportedException;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class RenderEmpty extends Render {
public RenderEmpty() {}
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
float p_76986_9_) {
}
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return null;
}
}

View File

@ -0,0 +1,147 @@
package com.hbm.render.entity;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.Callable;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.hbm.entity.particle.EntityOilSpillFX;
import com.hbm.entity.particle.EntitySSmokeFX;
import com.hbm.entity.particle.EntitySmokeFX;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EntityDiggingFX;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPotion;
import net.minecraft.potion.PotionHelper;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ReportedException;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class SpillRenderer extends Render {
private Item field_94151_a;
private int field_94150_f;
private static final String __OBFID = "CL_00001008";
public SpillRenderer(Item p_i1259_1_, int p_i1259_2_) {
this.field_94151_a = p_i1259_1_;
this.field_94150_f = p_i1259_2_;
}
public SpillRenderer(Item p_i1260_1_) {
this(p_i1260_1_, 0);
}
/**
* Actually renders the given argument. This is a synthetic bridge method,
* always casting down its argument and then handing it off to a worker
* function which does the actual work. In all probabilty, the class Render
* is generic (Render<T extends Entity) and this method has signature public
* void func_76986_a(T entity, double d, double d1, double d2, float f,
* float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
float p_76986_9_) {
if (p_76986_1_ instanceof EntityOilSpillFX) {
EntityOilSpillFX fx = (EntityOilSpillFX) p_76986_1_;
if (fx.particleAge <= fx.maxAge && fx.particleAge >= fx.maxAge / 8 * 7) {
field_94151_a = ModItems.spill8;
}
if (fx.particleAge < fx.maxAge / 8 * 7 && fx.particleAge >= fx.maxAge / 8 * 6) {
field_94151_a = ModItems.spill7;
}
if (fx.particleAge < fx.maxAge / 8 * 6 && fx.particleAge >= fx.maxAge / 8 * 5) {
field_94151_a = ModItems.spill6;
}
if (fx.particleAge < fx.maxAge / 8 * 5 && fx.particleAge >= fx.maxAge / 8 * 4) {
field_94151_a = ModItems.spill5;
}
if (fx.particleAge < fx.maxAge / 8 * 4 && fx.particleAge >= fx.maxAge / 8 * 3) {
field_94151_a = ModItems.spill4;
}
if (fx.particleAge < fx.maxAge / 8 * 3 && fx.particleAge >= fx.maxAge / 8 * 2) {
field_94151_a = ModItems.spill3;
}
if (fx.particleAge < fx.maxAge / 8 * 2 && fx.particleAge >= fx.maxAge / 8 * 1) {
field_94151_a = ModItems.spill2;
}
if (fx.particleAge < fx.maxAge / 8 && fx.particleAge >= 0) {
field_94151_a = ModItems.spill1;
}
IIcon iicon = field_94151_a.getIconFromDamage(0);
if (iicon != null) {
GL11.glPushMatrix();
GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
GL11.glScalef(7.5F, 7.5F, 7.5F);
//
GL11.glScalef(0.25F, 0.25F, 0.25F);
//
this.bindEntityTexture(p_76986_1_);
Tessellator tessellator = Tessellator.instance;
this.func_77026_a(tessellator, iicon);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called
* unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return TextureMap.locationItemsTexture;
}
private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) {
float f = p_77026_2_.getMinU();
float f1 = p_77026_2_.getMaxU();
float f2 = p_77026_2_.getMinV();
float f3 = p_77026_2_.getMaxV();
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
p_77026_1_.startDrawingQuads();
p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
p_77026_1_.addVertexWithUV((double) (0.0F - f5), (double) (0.0F - f6), 0.0D, (double) f, (double) f3);
p_77026_1_.addVertexWithUV((double) (f4 - f5), (double) (0.0F - f6), 0.0D, (double) f1, (double) f3);
p_77026_1_.addVertexWithUV((double) (f4 - f5), (double) (f4 - f6), 0.0D, (double) f1, (double) f2);
p_77026_1_.addVertexWithUV((double) (0.0F - f5), (double) (f4 - f6), 0.0D, (double) f, (double) f2);
p_77026_1_.draw();
}
}

View File

@ -0,0 +1,40 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
public class RenderDerrick extends TileEntitySpecialRenderer {
private static final ResourceLocation body = new ResourceLocation(RefStrings.MODID, "models/derrick.obj");
private IModelCustom genModel;
private ResourceLocation genTexture;
public RenderDerrick()
{
genModel = AdvancedModelLoader.loadModel(body);
genTexture = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png");
}
@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.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
bindTexture(genTexture);
genModel.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -93,106 +93,8 @@ public class TileEntityConverterRfHe extends TileEntity implements ISource, IEne
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -222,4 +124,24 @@ public class TileEntityConverterRfHe extends TileEntity implements ISource, IEne
return (storage.getEnergyStored() * i) / storage.getMaxEnergyStored();
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -404,106 +404,8 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory,
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -522,4 +424,24 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory,
return false;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -1249,106 +1249,8 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -1366,4 +1268,24 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve
return false;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -261,7 +261,10 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
Library.ffgeua(x, y, z, newTact, this, worldObj);
/*Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
@ -360,7 +363,7 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
}
}
list.clear();
}
}*/
}
@Override
@ -387,4 +390,24 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
return maxPower;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -367,106 +367,8 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -487,4 +389,24 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
return false;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -556,90 +556,8 @@ public class TileEntityMachineCyclotron extends TileEntity implements ISidedInve
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if (block == ModBlocks.factory_titanium_conductor
&& this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) {
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if (block == ModBlocks.factory_titanium_conductor
&& this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) {
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if (block == ModBlocks.factory_advanced_conductor
&& this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) {
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if (block == ModBlocks.factory_advanced_conductor
&& this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) {
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if (tileentity instanceof IConductor) {
if (tileentity instanceof TileEntityCable) {
if (Library.checkUnionList(((TileEntityCable) tileentity).uoteab, this)) {
for (int i = 0; i < ((TileEntityCable) tileentity).uoteab.size(); i++) {
if (((TileEntityCable) tileentity).uoteab.get(i).source == this) {
if (((TileEntityCable) tileentity).uoteab.get(i).ticked != newTact) {
((TileEntityCable) tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if (tileentity instanceof TileEntityWireCoated) {
if (Library.checkUnionList(((TileEntityWireCoated) tileentity).uoteab, this)) {
for (int i = 0; i < ((TileEntityWireCoated) tileentity).uoteab.size(); i++) {
if (((TileEntityWireCoated) tileentity).uoteab.get(i).source == this) {
if (((TileEntityWireCoated) tileentity).uoteab.get(i).ticked != newTact) {
((TileEntityWireCoated) tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if (tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery
&& ((TileEntityMachineBattery) tileentity).conducts)) {
list.add((IConsumer) tileentity);
}
if (!newTact) {
int size = list.size();
if (size > 0) {
int part = this.power / size;
for (IConsumer consume : list) {
if (consume.getPower() < consume.getMaxPower()) {
if (consume.getMaxPower() - consume.getPower() >= part) {
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -669,4 +587,24 @@ public class TileEntityMachineCyclotron extends TileEntity implements ISidedInve
{
return 65536.0D;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -333,90 +333,8 @@ public class TileEntityMachineDiesel extends TileEntity implements ISidedInvento
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if (block == ModBlocks.factory_titanium_conductor
&& this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) {
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if (block == ModBlocks.factory_titanium_conductor
&& this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) {
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if (block == ModBlocks.factory_advanced_conductor
&& this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) {
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if (block == ModBlocks.factory_advanced_conductor
&& this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) {
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if (tileentity instanceof IConductor) {
if (tileentity instanceof TileEntityCable) {
if (Library.checkUnionList(((TileEntityCable) tileentity).uoteab, this)) {
for (int i = 0; i < ((TileEntityCable) tileentity).uoteab.size(); i++) {
if (((TileEntityCable) tileentity).uoteab.get(i).source == this) {
if (((TileEntityCable) tileentity).uoteab.get(i).ticked != newTact) {
((TileEntityCable) tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if (tileentity instanceof TileEntityWireCoated) {
if (Library.checkUnionList(((TileEntityWireCoated) tileentity).uoteab, this)) {
for (int i = 0; i < ((TileEntityWireCoated) tileentity).uoteab.size(); i++) {
if (((TileEntityWireCoated) tileentity).uoteab.get(i).source == this) {
if (((TileEntityWireCoated) tileentity).uoteab.get(i).ticked != newTact) {
((TileEntityWireCoated) tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if (tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery
&& ((TileEntityMachineBattery) tileentity).conducts)) {
list.add((IConsumer) tileentity);
}
if (!newTact) {
int size = list.size();
if (size > 0) {
int part = this.power / size;
for (IConsumer consume : list) {
if (consume.getPower() < consume.getMaxPower()) {
if (consume.getMaxPower() - consume.getPower() >= part) {
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -436,4 +354,24 @@ public class TileEntityMachineDiesel extends TileEntity implements ISidedInvento
return false;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -612,106 +612,8 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -732,4 +634,24 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
return false;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -530,90 +530,8 @@ public class TileEntityMachineIGenerator extends TileEntity implements ISidedInv
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if (block == ModBlocks.factory_titanium_conductor
&& this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core) {
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if (block == ModBlocks.factory_titanium_conductor
&& this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core) {
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if (block == ModBlocks.factory_advanced_conductor
&& this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core) {
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if (block == ModBlocks.factory_advanced_conductor
&& this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core) {
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if (tileentity instanceof IConductor) {
if (tileentity instanceof TileEntityCable) {
if (Library.checkUnionList(((TileEntityCable) tileentity).uoteab, this)) {
for (int i = 0; i < ((TileEntityCable) tileentity).uoteab.size(); i++) {
if (((TileEntityCable) tileentity).uoteab.get(i).source == this) {
if (((TileEntityCable) tileentity).uoteab.get(i).ticked != newTact) {
((TileEntityCable) tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if (tileentity instanceof TileEntityWireCoated) {
if (Library.checkUnionList(((TileEntityWireCoated) tileentity).uoteab, this)) {
for (int i = 0; i < ((TileEntityWireCoated) tileentity).uoteab.size(); i++) {
if (((TileEntityWireCoated) tileentity).uoteab.get(i).source == this) {
if (((TileEntityWireCoated) tileentity).uoteab.get(i).ticked != newTact) {
((TileEntityWireCoated) tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated) tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if (tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery
&& ((TileEntityMachineBattery) tileentity).conducts)) {
list.add((IConsumer) tileentity);
}
if (!newTact) {
int size = list.size();
if (size > 0) {
int part = this.power / size;
for (IConsumer consume : list) {
if (consume.getPower() < consume.getMaxPower()) {
if (consume.getMaxPower() - consume.getPower() >= part) {
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -657,4 +575,24 @@ public class TileEntityMachineIGenerator extends TileEntity implements ISidedInv
return 65536.0D;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -0,0 +1,398 @@
package com.hbm.tileentity;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.MachineElectricFurnace;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.interfaces.IConsumer;
import com.hbm.items.ModItems;
import com.hbm.items.special.ItemBattery;
import com.hbm.lib.Library;
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.init.Blocks;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityMachineOilWell extends TileEntity implements ISidedInventory, IConsumer {
private ItemStack slots[];
public int oil;
public int power;
public int warning;
public static final int maxPower = 100000;
public static final int maxOil = 640;
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();
int age = 0;
private String customName;
public TileEntityMachineOilWell() {
slots = new ItemStack[3];
}
@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.oilWell";
}
@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) <=64;
}
}
//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 ItemBattery)
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.getInteger("powerTime");
this.oil = nbt.getInteger("oil");
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.setInteger("powerTime", power);
nbt.setInteger("oil", oil);
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 int getOilScaled(int i) {
return (oil * i) / maxOil;
}
public int getPowerScaled(int i) {
return (power * i) / maxPower;
}
@Override
public void updateEntity() {
int timer = 50;
age++;
if(age >= timer)
age -= timer;
if(!worldObj.isRemote) {
if(slots[1] != null && slots[1].getItem() == ModItems.canister_empty && oil >= 10) {
if(slots[2] == null) {
oil -= 10;
slots[2] = new ItemStack(ModItems.canister_oil);
slots[1].stackSize--;
if(slots[1].stackSize <= 0)
slots[1]= null;
} else if(slots[2] != null && slots[2].getItem() == ModItems.canister_oil && slots[2].stackSize < slots[2].getMaxStackSize()) {
oil -= 10;
slots[2].stackSize++;
slots[1].stackSize--;
if(slots[1].stackSize <= 0)
slots[1]= null;
}
}
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
if(power >= 10) {
//operation start
if(age % timer == 0) {
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 == Blocks.air || b == Blocks.grass || b == Blocks.dirt ||
b == Blocks.stone || b == Blocks.sand || b == Blocks.sandstone) {
worldObj.setBlock(xCoord, i, zCoord, ModBlocks.oil_pipe);
//Code 2: The drilling ended
if(i == this.yCoord - 100)
warning = 2;
break;
} else if((b == ModBlocks.ore_oil || b == ModBlocks.ore_oil_empty) && this.oil < this.maxOil) {
if(succ(this.xCoord, i, this.zCoord)) {
oil += 5;
if(oil > maxOil)
oil = maxOil;
ExplosionLarge.spawnOilSpills(worldObj, xCoord + 0.5F, yCoord + 5.5F, zCoord + 0.5F, 3);
break;
} else {
worldObj.setBlock(xCoord, i, zCoord, ModBlocks.oil_pipe);
break;
}
} else {
//Code 1: Drill jammed
warning = 1;
break;
}
}
}
//operation end
power -= 10;
} else {
warning = 1;
}
}
}
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(int i) {
power = i;
}
@Override
public int getPower() {
return power;
}
@Override
public int getMaxPower() {
return maxPower;
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
return 65536.0D;
}
}

View File

@ -248,106 +248,8 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -368,4 +270,24 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
return false;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -761,106 +761,8 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -877,4 +779,24 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv
return false;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}

View File

@ -682,106 +682,8 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I
@Override
public void ffgeua(int x, int y, int z, boolean newTact) {
Block block = this.worldObj.getBlock(x, y, z);
TileEntity tileentity = this.worldObj.getTileEntity(x, y, z);
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_titanium_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_titanium_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y + 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y + 1, z);
}
if(block == ModBlocks.factory_advanced_conductor && this.worldObj.getBlock(x, y - 1, z) == ModBlocks.factory_advanced_core)
{
tileentity = this.worldObj.getTileEntity(x, y - 1, z);
}
if(tileentity instanceof IConductor)
{
if(tileentity instanceof TileEntityCable)
{
if(Library.checkUnionList(((TileEntityCable)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityCable)tileentity).uoteab.size(); i++)
{
if(((TileEntityCable)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityCable)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityCable)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityCable)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
if(tileentity instanceof TileEntityWireCoated)
{
if(Library.checkUnionList(((TileEntityWireCoated)tileentity).uoteab, this))
{
for(int i = 0; i < ((TileEntityWireCoated)tileentity).uoteab.size(); i++)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).source == this)
{
if(((TileEntityWireCoated)tileentity).uoteab.get(i).ticked != newTact)
{
((TileEntityWireCoated)tileentity).uoteab.get(i).ticked = newTact;
ffgeua(x, y + 1, z, getTact());
ffgeua(x, y - 1, z, getTact());
ffgeua(x - 1, y, z, getTact());
ffgeua(x + 1, y, z, getTact());
ffgeua(x, y, z - 1, getTact());
ffgeua(x, y, z + 1, getTact());
}
}
}
} else {
((TileEntityWireCoated)tileentity).uoteab.add(new UnionOfTileEntitiesAndBooleans(this, newTact));
}
}
}
if(tileentity instanceof IConsumer && newTact && !(tileentity instanceof TileEntityMachineBattery && ((TileEntityMachineBattery)tileentity).conducts))
{
list.add((IConsumer)tileentity);
}
if(!newTact)
{
int size = list.size();
if(size > 0)
{
int part = this.power / size;
for(IConsumer consume : list)
{
if(consume.getPower() < consume.getMaxPower())
{
if(consume.getMaxPower() - consume.getPower() >= part)
{
this.power -= part;
consume.setPower(consume.getPower() + part);
} else {
this.power -= consume.getMaxPower() - consume.getPower();
consume.setPower(consume.getMaxPower());
}
}
}
}
list.clear();
}
Library.ffgeua(x, y, z, newTact, this, worldObj);
}
@Override
@ -798,4 +700,24 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I
return false;
}
@Override
public int getSPower() {
return power;
}
@Override
public void setSPower(int i) {
this.power = i;
}
@Override
public List<IConsumer> getList() {
return list;
}
@Override
public void clearList() {
this.list.clear();
}
}