Finished Factories!
@ -99,6 +99,17 @@ tile.launch_pad.name=Raketenabschussrampe
|
||||
container.launchPad=Raketenabschussrampe
|
||||
tile.book_guide.name=Hbm's Nuclear Tech Mod Handbuch
|
||||
|
||||
tile.factory_titanium_hull.name=Einfache Fabrikshülle
|
||||
tile.factory_titanium_furnace.name=Einfache Fabrikzugriffsluke
|
||||
tile.factory_titanium_core.name=Einfache Fabrikkernkomponente
|
||||
item.factory_core_titanium.name=Einfacher Fabrikenergiecluster
|
||||
container.factoryTitanium=Einfache Fabrik
|
||||
tile.factory_advanced_hull.name=Fortgeschrittene Fabrikshülle
|
||||
tile.factory_advanced_furnace.name=Fortgeschrittene Fabrikzugriffsluke
|
||||
tile.factory_advanced_core.name=Fortgeschrittene Fabrikkernkomponente
|
||||
item.factory_core_advanced.name=Fortgeschrittene Fabrikenergiecluster
|
||||
container.factoryAdvanced=Fortgeschrittene Fabrik
|
||||
|
||||
tile.test_nuke.name=Test Atombombe
|
||||
|
||||
item.ingot_uranium.name=Uranbarren
|
||||
@ -124,6 +135,8 @@ item.plate_schrabidium.name=Schrabidiumplatte
|
||||
item.ingot_schrabidium.name=Schrabidiumbarren
|
||||
item.nugget_schrabidium.name=Schrabidiumnugget
|
||||
item.plate_copper.name=Kupferplatte
|
||||
item.ingot_advanced_alloy.name=Fortgeschrittene Legierung
|
||||
item.plate_advanced_alloy.name=Fortgeschrittene Legierungsplatte
|
||||
|
||||
item.nugget_u235.name=U235-Nugget
|
||||
item.nugget_u238.name=U238-Nugget
|
||||
|
||||
@ -99,6 +99,17 @@ tile.launch_pad.name=Missile Launch Pad
|
||||
container.launchPad=Missile Launch Pad
|
||||
tile.book_guide.name=Hbm's Nuclear Tech Mod Manual
|
||||
|
||||
tile.factory_titanium_hull.name=Basic Factory Casing
|
||||
tile.factory_titanium_furnace.name=Basic Factory Access Hatch
|
||||
tile.factory_titanium_core.name=Basic Factory Core Component
|
||||
item.factory_core_titanium.name=Basic Factory Energy Cluster
|
||||
container.factoryTitanium=Basic Factory
|
||||
tile.factory_advanced_hull.name=Advanced Factory Casing
|
||||
tile.factory_advanced_furnace.name=Advanced Factory Access Hatch
|
||||
tile.factory_advanced_core.name=Advanced Factory Core Component
|
||||
item.factory_core_advanced.name=Advanced Factory Energy Cluster
|
||||
container.factoryAdvanced=Advanced Factory
|
||||
|
||||
tile.test_nuke.name=Test Nuke
|
||||
|
||||
item.ingot_uranium.name=Uranium Ingot
|
||||
@ -124,6 +135,8 @@ item.plate_schrabidium.name=Schrabidium Plate
|
||||
item.ingot_schrabidium.name=Schrabidium Ingot
|
||||
item.nugget_schrabidium.name=Schrabidium Nugget
|
||||
item.plate_copper.name=Copper Plate
|
||||
item.ingot_advanced_alloy.name=Advanced Alloy Ingot
|
||||
item.plate_advanced_alloy.name=Advanced Alloy Plate
|
||||
|
||||
item.nugget_u235.name=U235 Nugget
|
||||
item.nugget_u238.name=U238 Nugget
|
||||
|
||||
|
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 358 B |
BIN
assets/hbm/textures/gui/factory_advanced.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
assets/hbm/textures/items/factory_core_advanced.png
Normal file
|
After Width: | Height: | Size: 301 B |
BIN
assets/hbm/textures/items/factory_core_titanium.png
Normal file
|
After Width: | Height: | Size: 304 B |
BIN
assets/hbm/textures/items/ingot_advanced_alloy.png
Normal file
|
After Width: | Height: | Size: 283 B |
BIN
assets/hbm/textures/items/plate_advanced_alloy.png
Normal file
|
After Width: | Height: | Size: 270 B |
79
com/hbm/blocks/FactoryCoreAdvanced.java
Normal file
@ -0,0 +1,79 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class FactoryCoreAdvanced extends BlockContainer {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private static boolean keepInventory;
|
||||
|
||||
protected FactoryCoreAdvanced(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityCoreAdvanced();
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
TileEntityCoreAdvanced tileentityfurnace = (TileEntityCoreAdvanced)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_);
|
||||
}
|
||||
}
|
||||
80
com/hbm/blocks/FactoryCoreTitanium.java
Normal file
@ -0,0 +1,80 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class FactoryCoreTitanium extends BlockContainer {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private static boolean keepInventory;
|
||||
|
||||
protected FactoryCoreTitanium(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityCoreTitanium();
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
TileEntityCoreTitanium tileentityfurnace = (TileEntityCoreTitanium)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_);
|
||||
}
|
||||
|
||||
}
|
||||
@ -15,6 +15,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
@ -106,22 +107,136 @@ public class FactoryHatch extends Block {
|
||||
}
|
||||
}
|
||||
|
||||
/*@Override
|
||||
@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())
|
||||
{
|
||||
TileEntityNukeFurnace entity = (TileEntityNukeFurnace) world.getTileEntity(x, y, z);
|
||||
if(entity != null)
|
||||
if(this == ModBlocks.factory_titanium_furnace)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_nuke_furnace, world, x, y, z);
|
||||
if(world.getBlockMetadata(x, y, z) == 2)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z + 1) instanceof TileEntityCoreTitanium)
|
||||
{
|
||||
if(((TileEntityCoreTitanium)world.getTileEntity(x, y, z + 1)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_factory_titanium, world, x, y, z + 1);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Basic Factory] Error: Factory Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Basic Factory] Error: Factory Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 3)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z - 1) instanceof TileEntityCoreTitanium)
|
||||
{
|
||||
if(((TileEntityCoreTitanium)world.getTileEntity(x, y, z - 1)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_factory_titanium, world, x, y, z - 1);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Basic Factory] Error: Factory Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Basic Factory] Error: Factory Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 4)
|
||||
{
|
||||
if(world.getTileEntity(x + 1, y, z) instanceof TileEntityCoreTitanium)
|
||||
{
|
||||
if(((TileEntityCoreTitanium)world.getTileEntity(x + 1, y, z)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_factory_titanium, world, x + 1, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Basic Factory] Error: Factory Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Basic Factory] Error: Factory Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 5)
|
||||
{
|
||||
if(world.getTileEntity(x - 1, y, z) instanceof TileEntityCoreTitanium)
|
||||
{
|
||||
if(((TileEntityCoreTitanium)world.getTileEntity(x - 1, y, z)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_factory_titanium, world, x - 1, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Basic Factory] Error: Factory Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Basic Factory] Error: Factory Core not found!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModBlocks.factory_advanced_furnace)
|
||||
{
|
||||
if(world.getBlockMetadata(x, y, z) == 2)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z + 1) instanceof TileEntityCoreAdvanced)
|
||||
{
|
||||
if(((TileEntityCoreAdvanced)world.getTileEntity(x, y, z + 1)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_factory_advanced, world, x, y, z + 1);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Advanced Factory] Error: Factory Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Advanced Factory] Error: Factory Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 3)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z - 1) instanceof TileEntityCoreAdvanced)
|
||||
{
|
||||
if(((TileEntityCoreAdvanced)world.getTileEntity(x, y, z - 1)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_factory_advanced, world, x, y, z - 1);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Advanced Factory] Error: Factory Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Advanced Factory] Error: Factory Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 4)
|
||||
{
|
||||
if(world.getTileEntity(x + 1, y, z) instanceof TileEntityCoreAdvanced)
|
||||
{
|
||||
if(((TileEntityCoreAdvanced)world.getTileEntity(x + 1, y, z)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_factory_advanced, world, x + 1, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Advanced Factory] Error: Factory Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Advanced Factory] Error: Factory Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 5)
|
||||
{
|
||||
if(world.getTileEntity(x - 1, y, z) instanceof TileEntityCoreAdvanced)
|
||||
{
|
||||
if(((TileEntityCoreAdvanced)world.getTileEntity(x - 1, y, z)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_factory_advanced, world, x - 1, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Advanced Factory] Error: Factory Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Advanced Factory] Error: Factory Core not found!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -57,6 +57,7 @@ public class ModBlocks {
|
||||
public static Block block_waste;
|
||||
public static Block block_beryllium;
|
||||
public static Block block_schrabidium;
|
||||
public static Block block_advanced_alloy;
|
||||
|
||||
public static Block reinforced_brick;
|
||||
public static Block reinforced_glass;
|
||||
@ -175,10 +176,12 @@ public class ModBlocks {
|
||||
public static Block factory_titanium_hull;
|
||||
public static Block factory_titanium_furnace;
|
||||
public static Block factory_titanium_core;
|
||||
public static final int guiID_factory_titanium = 24;
|
||||
|
||||
public static Block factory_advanced_hull;
|
||||
public static Block factory_advanced_furnace;
|
||||
public static Block factory_advanced_core;
|
||||
public static final int guiID_factory_advanced = 25;
|
||||
|
||||
public static Block launch_pad;
|
||||
public static Block launch_pad_generic;
|
||||
@ -251,6 +254,7 @@ public class ModBlocks {
|
||||
block_waste = new BlockOre(Material.iron).setBlockName("block_waste").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_waste");
|
||||
block_beryllium = new BlockGeneric(Material.iron).setBlockName("block_beryllium").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_beryllium");
|
||||
block_schrabidium = new BlockGeneric(Material.iron).setBlockName("block_schrabidium").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(600.0F).setBlockTextureName(RefStrings.MODID + ":block_schrabidium");
|
||||
block_advanced_alloy = new BlockGeneric(Material.iron).setBlockName("block_advanced_alloy").setCreativeTab(MainRegistry.tabBlock).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_advanced_alloy");
|
||||
|
||||
reinforced_brick = new BlockGeneric(Material.rock).setBlockName("reinforced_brick").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(15).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_brick");
|
||||
reinforced_glass = new ReinforcedBlock(Material.glass).setBlockName("reinforced_glass").setCreativeTab(MainRegistry.tabBlock).setLightOpacity(0).setHardness(15.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":reinforced_glass");
|
||||
@ -340,10 +344,10 @@ public class ModBlocks {
|
||||
|
||||
factory_titanium_hull = new BlockGeneric(Material.iron).setBlockName("factory_titanium_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_hull");
|
||||
factory_titanium_furnace = new FactoryHatch(Material.iron).setBlockName("factory_titanium_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_furnace");
|
||||
factory_titanium_core = new BlockGeneric(Material.iron).setBlockName("factory_titanium_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_core");
|
||||
factory_titanium_core = new FactoryCoreTitanium(Material.iron).setBlockName("factory_titanium_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_titanium_core");
|
||||
factory_advanced_hull = new BlockGeneric(Material.iron).setBlockName("factory_advanced_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_advanced_hull");
|
||||
factory_advanced_furnace = new FactoryHatch(Material.iron).setBlockName("factory_advanced_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_advanced_furnace");
|
||||
factory_advanced_core = new BlockGeneric(Material.iron).setBlockName("factory_advanced_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_advanced_core");
|
||||
factory_advanced_core = new FactoryCoreAdvanced(Material.iron).setBlockName("factory_advanced_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_advanced_core");
|
||||
|
||||
launch_pad = new LaunchPad(Material.iron).setBlockName("launch_pad").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":launch_pad");
|
||||
launch_pad_generic = new LaunchPad(Material.iron).setBlockName("launch_pad_generic").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":launch_pad");
|
||||
@ -406,6 +410,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(block_niter, block_niter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_copper, block_copper.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_red_copper, block_red_copper.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_advanced_alloy, block_advanced_alloy.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_tungsten, block_tungsten.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_aluminium, block_aluminium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block_fluorite, block_fluorite.getUnlocalizedName());
|
||||
|
||||
621
com/hbm/blocks/TileEntityCoreAdvanced.java
Normal file
@ -0,0 +1,621 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.interfaces.IFactory;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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.world.World;
|
||||
|
||||
public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventory, IFactory {
|
||||
|
||||
public int progress = 0;
|
||||
public int power = 0;
|
||||
public final static int processTime = 100;
|
||||
public final static int maxPower = ModItems.factory_core_advanced.getMaxDamage();
|
||||
private ItemStack slots[];
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityCoreAdvanced() {
|
||||
slots = new ItemStack[27];
|
||||
}
|
||||
@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.factoryAdvanced";
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@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 int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
this.progress = nbt.getShort("cookTime");
|
||||
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.setShort("cookTime", (short) progress);
|
||||
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 boolean isStructureValid(World world) {
|
||||
if(world.getBlock(this.xCoord, this.yCoord, this.zCoord) == ModBlocks.factory_advanced_core &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord - 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord - 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord - 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord + 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord + 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord + 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord - 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord, this.zCoord - 1) == ModBlocks.factory_advanced_furnace &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord - 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord) == ModBlocks.factory_advanced_furnace &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord) == ModBlocks.factory_advanced_furnace &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord + 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord, this.zCoord + 1) == ModBlocks.factory_advanced_furnace &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord + 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord - 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord - 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord - 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord + 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord + 1) == ModBlocks.factory_advanced_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord + 1) == ModBlocks.factory_advanced_hull)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getPowerScaled(int i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int i) {
|
||||
return (progress * i) / processTime;
|
||||
}
|
||||
|
||||
public boolean isProcessable(ItemStack item) {
|
||||
if(item != null)
|
||||
{
|
||||
return FurnaceRecipes.smelting().getSmeltingResult(item) != null;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(this.slots[22] != null && this.slots[22].getItem() == ModItems.factory_core_advanced)
|
||||
{
|
||||
this.power = ModItems.factory_core_advanced.getMaxDamage() - this.slots[22].getItemDamage();
|
||||
} else {
|
||||
this.power = 0;
|
||||
}
|
||||
|
||||
if(this.slots[9] == null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null && isProcessable(slots[i]))
|
||||
{
|
||||
slots[9] = slots[i].copy();
|
||||
slots[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].getItem() == slots[9].getItem() && slots[i].getItemDamage() == slots[9].getItemDamage())
|
||||
{
|
||||
if(slots[9].stackSize + slots[i].stackSize <= slots[i].getMaxStackSize())
|
||||
{
|
||||
slots[9].stackSize += slots[i].stackSize;
|
||||
slots[i] = null;
|
||||
} else {
|
||||
int j = slots[9].getMaxStackSize() - slots[9].stackSize;
|
||||
slots[9].stackSize += j;
|
||||
slots[i].stackSize -= j;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.slots[10] == null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null && isProcessable(slots[i]))
|
||||
{
|
||||
slots[10] = slots[i].copy();
|
||||
slots[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].getItem() == slots[10].getItem() && slots[i].getItemDamage() == slots[10].getItemDamage())
|
||||
{
|
||||
if(slots[10].stackSize + slots[i].stackSize <= slots[i].getMaxStackSize())
|
||||
{
|
||||
slots[10].stackSize += slots[i].stackSize;
|
||||
slots[i] = null;
|
||||
} else {
|
||||
int j = slots[10].getMaxStackSize() - slots[10].stackSize;
|
||||
slots[10].stackSize += j;
|
||||
slots[i].stackSize -= j;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.slots[23] == null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null && isProcessable(slots[i]))
|
||||
{
|
||||
slots[23] = slots[i].copy();
|
||||
slots[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].getItem() == slots[23].getItem() && slots[i].getItemDamage() == slots[23].getItemDamage())
|
||||
{
|
||||
if(slots[23].stackSize + slots[i].stackSize <= slots[i].getMaxStackSize())
|
||||
{
|
||||
slots[23].stackSize += slots[i].stackSize;
|
||||
slots[i] = null;
|
||||
} else {
|
||||
int j = slots[23].getMaxStackSize() - slots[23].stackSize;
|
||||
slots[23].stackSize += j;
|
||||
slots[i].stackSize -= j;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.slots[24] == null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null && isProcessable(slots[i]))
|
||||
{
|
||||
slots[24] = slots[i].copy();
|
||||
slots[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].getItem() == slots[24].getItem() && slots[i].getItemDamage() == slots[24].getItemDamage())
|
||||
{
|
||||
if(slots[24].stackSize + slots[i].stackSize <= slots[i].getMaxStackSize())
|
||||
{
|
||||
slots[24].stackSize += slots[i].stackSize;
|
||||
slots[i] = null;
|
||||
} else {
|
||||
int j = slots[24].getMaxStackSize() - slots[24].stackSize;
|
||||
slots[24].stackSize += j;
|
||||
slots[i].stackSize -= j;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.power > 0 && (isProcessable(slots[9]) || isProcessable(slots[10]) || isProcessable(slots[23]) || isProcessable(slots[24])) && isStructureValid(worldObj))
|
||||
{
|
||||
this.progress += 1;
|
||||
this.slots[22].setItemDamage(this.slots[22].getItemDamage() + 1);
|
||||
} else {
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(slots[9] != null && slots[11] != null && (FurnaceRecipes.smelting().getSmeltingResult(slots[9]).getItem() != slots[11].getItem() || FurnaceRecipes.smelting().getSmeltingResult(slots[9]).getItemDamage() != slots[11].getItemDamage()))
|
||||
{
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(slots[10] != null && slots[12] != null && (FurnaceRecipes.smelting().getSmeltingResult(slots[10]).getItem() != slots[12].getItem() || FurnaceRecipes.smelting().getSmeltingResult(slots[10]).getItemDamage() != slots[12].getItemDamage()))
|
||||
{
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(slots[23] != null && slots[25] != null && (FurnaceRecipes.smelting().getSmeltingResult(slots[23]).getItem() != slots[25].getItem() || FurnaceRecipes.smelting().getSmeltingResult(slots[23]).getItemDamage() != slots[25].getItemDamage()))
|
||||
{
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(slots[24] != null && slots[26] != null && (FurnaceRecipes.smelting().getSmeltingResult(slots[24]).getItem() != slots[26].getItem() || FurnaceRecipes.smelting().getSmeltingResult(slots[24]).getItemDamage() != slots[26].getItemDamage()))
|
||||
{
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(this.progress >= this.processTime)
|
||||
{
|
||||
if(this.slots[9] != null && isProcessable(this.slots[9]))
|
||||
{
|
||||
ItemStack itemStack = FurnaceRecipes.smelting().getSmeltingResult(slots[9]);
|
||||
if(slots[11] == null)
|
||||
{
|
||||
slots[11] = itemStack.copy();
|
||||
}else if(slots[11].isItemEqual(itemStack)) {
|
||||
slots[11].stackSize += itemStack.stackSize;
|
||||
}
|
||||
if(slots[9].stackSize <= 0)
|
||||
{
|
||||
slots[9] = new ItemStack(slots[9].getItem().setFull3D());
|
||||
}else{
|
||||
slots[9].stackSize--;
|
||||
}
|
||||
if(slots[9].stackSize <= 0)
|
||||
{
|
||||
slots[9] = null;
|
||||
}
|
||||
}
|
||||
if(this.slots[10] != null && isProcessable(this.slots[10]))
|
||||
{
|
||||
ItemStack itemStack = FurnaceRecipes.smelting().getSmeltingResult(slots[10]);
|
||||
if(slots[12] == null)
|
||||
{
|
||||
slots[12] = itemStack.copy();
|
||||
}else if(slots[12].isItemEqual(itemStack)) {
|
||||
slots[12].stackSize += itemStack.stackSize;
|
||||
}
|
||||
if(slots[10].stackSize <= 0)
|
||||
{
|
||||
slots[10] = new ItemStack(slots[10].getItem().setFull3D());
|
||||
}else{
|
||||
slots[10].stackSize--;
|
||||
}
|
||||
if(slots[10].stackSize <= 0)
|
||||
{
|
||||
slots[10] = null;
|
||||
}
|
||||
}
|
||||
if(this.slots[23] != null && isProcessable(this.slots[23]))
|
||||
{
|
||||
ItemStack itemStack = FurnaceRecipes.smelting().getSmeltingResult(slots[23]);
|
||||
if(slots[25] == null)
|
||||
{
|
||||
slots[25] = itemStack.copy();
|
||||
}else if(slots[25].isItemEqual(itemStack)) {
|
||||
slots[25].stackSize += itemStack.stackSize;
|
||||
}
|
||||
if(slots[23].stackSize <= 0)
|
||||
{
|
||||
slots[23] = new ItemStack(slots[23].getItem().setFull3D());
|
||||
}else{
|
||||
slots[23].stackSize--;
|
||||
}
|
||||
if(slots[23].stackSize <= 0)
|
||||
{
|
||||
slots[23] = null;
|
||||
}
|
||||
}
|
||||
if(this.slots[24] != null && isProcessable(this.slots[24]))
|
||||
{
|
||||
ItemStack itemStack = FurnaceRecipes.smelting().getSmeltingResult(slots[24]);
|
||||
if(slots[26] == null)
|
||||
{
|
||||
slots[26] = itemStack.copy();
|
||||
}else if(slots[26].isItemEqual(itemStack)) {
|
||||
slots[26].stackSize += itemStack.stackSize;
|
||||
}
|
||||
if(slots[24].stackSize <= 0)
|
||||
{
|
||||
slots[24] = new ItemStack(slots[24].getItem().setFull3D());
|
||||
}else{
|
||||
slots[24].stackSize--;
|
||||
}
|
||||
if(slots[24].stackSize <= 0)
|
||||
{
|
||||
slots[24] = null;
|
||||
}
|
||||
}
|
||||
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(this.slots[11] != null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
int j = i + 13;
|
||||
if(slots[j] != null)
|
||||
{
|
||||
if(slots[j].getItem() == slots[11].getItem() && slots[j].getItemDamage() == slots[11].getItemDamage())
|
||||
{
|
||||
if(slots[j].stackSize < slots[j].getMaxStackSize())
|
||||
{
|
||||
if(slots[j].stackSize + slots[11].stackSize <= slots[11].getMaxStackSize())
|
||||
{
|
||||
slots[j].stackSize += slots[11].stackSize;
|
||||
slots[11] = null;
|
||||
break;
|
||||
} else {
|
||||
int k = slots[j].getMaxStackSize() - slots[j].stackSize;
|
||||
if(k < 0)
|
||||
{
|
||||
slots[j].stackSize += k;
|
||||
slots[11].stackSize -= k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
slots[j] = slots[11].copy();
|
||||
slots[11] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.slots[12] != null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
int j = i + 13;
|
||||
if(slots[j] != null)
|
||||
{
|
||||
if(slots[j].getItem() == slots[12].getItem() && slots[j].getItemDamage() == slots[12].getItemDamage())
|
||||
{
|
||||
if(slots[j].stackSize < slots[j].getMaxStackSize())
|
||||
{
|
||||
if(slots[j].stackSize + slots[12].stackSize <= slots[12].getMaxStackSize())
|
||||
{
|
||||
slots[j].stackSize += slots[12].stackSize;
|
||||
slots[12] = null;
|
||||
break;
|
||||
} else {
|
||||
int k = slots[j].getMaxStackSize() - slots[j].stackSize;
|
||||
if(k < 0)
|
||||
{
|
||||
slots[j].stackSize += k;
|
||||
slots[12].stackSize -= k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
slots[j] = slots[12].copy();
|
||||
slots[12] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.slots[25] != null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
int j = i + 13;
|
||||
if(slots[j] != null)
|
||||
{
|
||||
if(slots[j].getItem() == slots[25].getItem() && slots[j].getItemDamage() == slots[25].getItemDamage())
|
||||
{
|
||||
if(slots[j].stackSize < slots[j].getMaxStackSize())
|
||||
{
|
||||
if(slots[j].stackSize + slots[25].stackSize <= slots[25].getMaxStackSize())
|
||||
{
|
||||
slots[j].stackSize += slots[25].stackSize;
|
||||
slots[25] = null;
|
||||
break;
|
||||
} else {
|
||||
int k = slots[j].getMaxStackSize() - slots[j].stackSize;
|
||||
if(k < 0)
|
||||
{
|
||||
slots[j].stackSize += k;
|
||||
slots[25].stackSize -= k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
slots[j] = slots[25].copy();
|
||||
slots[25] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.slots[26] != null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
int j = i + 13;
|
||||
if(slots[j] != null)
|
||||
{
|
||||
if(slots[j].getItem() == slots[26].getItem() && slots[j].getItemDamage() == slots[26].getItemDamage())
|
||||
{
|
||||
if(slots[j].stackSize < slots[j].getMaxStackSize())
|
||||
{
|
||||
if(slots[j].stackSize + slots[26].stackSize <= slots[26].getMaxStackSize())
|
||||
{
|
||||
slots[j].stackSize += slots[26].stackSize;
|
||||
slots[26] = null;
|
||||
break;
|
||||
} else {
|
||||
int k = slots[j].getMaxStackSize() - slots[j].stackSize;
|
||||
if(k < 0)
|
||||
{
|
||||
slots[j].stackSize += k;
|
||||
slots[26].stackSize -= k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
slots[j] = slots[26].copy();
|
||||
slots[26] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
437
com/hbm/blocks/TileEntityCoreTitanium.java
Normal file
@ -0,0 +1,437 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import com.hbm.interfaces.IFactory;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
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.world.World;
|
||||
|
||||
public class TileEntityCoreTitanium extends TileEntity implements ISidedInventory, IFactory {
|
||||
|
||||
public int progress = 0;
|
||||
public int power = 0;
|
||||
public final static int processTime = 200;
|
||||
public final static int maxPower = ModItems.factory_core_titanium.getMaxDamage();
|
||||
private ItemStack slots[];
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityCoreTitanium() {
|
||||
slots = new ItemStack[23];
|
||||
}
|
||||
@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.factoryTitanium";
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@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 int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
this.progress = nbt.getShort("cookTime");
|
||||
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.setShort("cookTime", (short) progress);
|
||||
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 boolean isStructureValid(World world) {
|
||||
if(world.getBlock(this.xCoord, this.yCoord, this.zCoord) == ModBlocks.factory_titanium_core &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord - 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord - 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord - 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord + 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord + 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord + 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord - 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord, this.zCoord - 1) == ModBlocks.factory_titanium_furnace &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord - 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord) == ModBlocks.factory_titanium_furnace &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord) == ModBlocks.factory_titanium_furnace &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord + 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord, this.zCoord + 1) == ModBlocks.factory_titanium_furnace &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord + 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord - 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord - 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord - 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord + 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord + 1) == ModBlocks.factory_titanium_hull &&
|
||||
world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord + 1) == ModBlocks.factory_titanium_hull)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getPowerScaled(int i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int i) {
|
||||
return (progress * i) / processTime;
|
||||
}
|
||||
|
||||
public boolean isProcessable(ItemStack item) {
|
||||
if(item != null)
|
||||
{
|
||||
return FurnaceRecipes.smelting().getSmeltingResult(item) != null;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(this.slots[22] != null && this.slots[22].getItem() == ModItems.factory_core_titanium)
|
||||
{
|
||||
this.power = ModItems.factory_core_titanium.getMaxDamage() - this.slots[22].getItemDamage();
|
||||
} else {
|
||||
this.power = 0;
|
||||
}
|
||||
|
||||
if(this.slots[9] == null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null && isProcessable(slots[i]))
|
||||
{
|
||||
slots[9] = slots[i].copy();
|
||||
slots[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].getItem() == slots[9].getItem() && slots[i].getItemDamage() == slots[9].getItemDamage())
|
||||
{
|
||||
if(slots[9].stackSize + slots[i].stackSize <= slots[i].getMaxStackSize())
|
||||
{
|
||||
slots[9].stackSize += slots[i].stackSize;
|
||||
slots[i] = null;
|
||||
} else {
|
||||
int j = 64 - slots[9].stackSize;
|
||||
slots[9].stackSize += j;
|
||||
slots[i].stackSize -= j;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.slots[10] == null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null && isProcessable(slots[i]))
|
||||
{
|
||||
slots[10] = slots[i].copy();
|
||||
slots[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].getItem() == slots[10].getItem() && slots[i].getItemDamage() == slots[10].getItemDamage())
|
||||
{
|
||||
if(slots[10].stackSize + slots[i].stackSize <= slots[i].getMaxStackSize())
|
||||
{
|
||||
slots[10].stackSize += slots[i].stackSize;
|
||||
slots[i] = null;
|
||||
} else {
|
||||
int j = 64 - slots[10].stackSize;
|
||||
slots[10].stackSize += j;
|
||||
slots[i].stackSize -= j;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.power > 0 && (isProcessable(slots[9]) || isProcessable(slots[10])) && isStructureValid(worldObj))
|
||||
{
|
||||
this.progress += 1;
|
||||
this.slots[22].setItemDamage(this.slots[22].getItemDamage() + 1);
|
||||
} else {
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(slots[9] != null && slots[11] != null && (FurnaceRecipes.smelting().getSmeltingResult(slots[9]).getItem() != slots[11].getItem() || FurnaceRecipes.smelting().getSmeltingResult(slots[9]).getItemDamage() != slots[11].getItemDamage()))
|
||||
{
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(slots[10] != null && slots[12] != null && (FurnaceRecipes.smelting().getSmeltingResult(slots[10]).getItem() != slots[12].getItem() || FurnaceRecipes.smelting().getSmeltingResult(slots[10]).getItemDamage() != slots[12].getItemDamage()))
|
||||
{
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(this.progress >= this.processTime)
|
||||
{
|
||||
if(this.slots[9] != null && isProcessable(this.slots[9]))
|
||||
{
|
||||
ItemStack itemStack = FurnaceRecipes.smelting().getSmeltingResult(slots[9]);
|
||||
if(slots[11] == null)
|
||||
{
|
||||
slots[11] = itemStack.copy();
|
||||
}else if(slots[11].isItemEqual(itemStack)) {
|
||||
slots[11].stackSize += itemStack.stackSize;
|
||||
}
|
||||
if(slots[9].stackSize <= 0)
|
||||
{
|
||||
slots[9] = new ItemStack(slots[9].getItem().setFull3D());
|
||||
}else{
|
||||
slots[9].stackSize--;
|
||||
}
|
||||
if(slots[9].stackSize <= 0)
|
||||
{
|
||||
slots[9] = null;
|
||||
}
|
||||
}
|
||||
if(this.slots[10] != null && isProcessable(this.slots[10]))
|
||||
{
|
||||
ItemStack itemStack = FurnaceRecipes.smelting().getSmeltingResult(slots[10]);
|
||||
if(slots[12] == null)
|
||||
{
|
||||
slots[12] = itemStack.copy();
|
||||
}else if(slots[12].isItemEqual(itemStack)) {
|
||||
slots[12].stackSize += itemStack.stackSize;
|
||||
}
|
||||
if(slots[10].stackSize <= 0)
|
||||
{
|
||||
slots[10] = new ItemStack(slots[10].getItem().setFull3D());
|
||||
}else{
|
||||
slots[10].stackSize--;
|
||||
}
|
||||
if(slots[10].stackSize <= 0)
|
||||
{
|
||||
slots[10] = null;
|
||||
}
|
||||
}
|
||||
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(this.slots[11] != null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
int j = i + 13;
|
||||
if(slots[j] != null)
|
||||
{
|
||||
if(slots[j].getItem() == slots[11].getItem() && slots[j].getItemDamage() == slots[11].getItemDamage())
|
||||
{
|
||||
if(slots[j].stackSize < slots[j].getMaxStackSize())
|
||||
{
|
||||
if(slots[j].stackSize + slots[11].stackSize <= slots[11].getMaxStackSize())
|
||||
{
|
||||
slots[j].stackSize += slots[11].stackSize;
|
||||
slots[11] = null;
|
||||
break;
|
||||
} else {
|
||||
int k = slots[j].getMaxStackSize() - slots[j].stackSize;
|
||||
if(k < 0)
|
||||
{
|
||||
slots[j].stackSize += k;
|
||||
slots[11].stackSize -= k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
slots[j] = slots[11].copy();
|
||||
slots[11] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.slots[12] != null)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
int j = i + 13;
|
||||
if(slots[j] != null)
|
||||
{
|
||||
if(slots[j].getItem() == slots[12].getItem() && slots[j].getItemDamage() == slots[12].getItemDamage())
|
||||
{
|
||||
if(slots[j].stackSize < slots[j].getMaxStackSize())
|
||||
{
|
||||
if(slots[j].stackSize + slots[12].stackSize <= slots[12].getMaxStackSize())
|
||||
{
|
||||
slots[j].stackSize += slots[12].stackSize;
|
||||
slots[12] = null;
|
||||
break;
|
||||
} else {
|
||||
int k = slots[j].getMaxStackSize() - slots[j].stackSize;
|
||||
if(k < 0)
|
||||
{
|
||||
slots[j].stackSize += k;
|
||||
slots[12].stackSize -= k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
slots[j] = slots[12].copy();
|
||||
slots[12] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -472,6 +472,16 @@ public class TileEntityMachineBattery extends TileEntity implements ISidedInvent
|
||||
power -= 100;
|
||||
slots[1].setItemDamage(slots[1].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[1] != null && slots[1].getItem() == ModItems.factory_core_titanium && slots[1].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[1].setItemDamage(slots[1].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[1] != null && slots[1].getItem() == ModItems.factory_core_advanced && slots[1].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[1].setItemDamage(slots[1].getItemDamage() - 1);
|
||||
}
|
||||
|
||||
if(/*power + 100 <= maxPower && */slots[0] != null && slots[0].getItem() == ModItems.battery_creative)
|
||||
{
|
||||
|
||||
@ -245,6 +245,16 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
power -= 100;
|
||||
slots[2].setItemDamage(slots[2].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[2] != null && slots[2].getItem() == ModItems.factory_core_titanium && slots[2].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[2].setItemDamage(slots[2].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[2] != null && slots[2].getItem() == ModItems.factory_core_advanced && slots[2].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[2].setItemDamage(slots[2].getItemDamage() - 1);
|
||||
}
|
||||
|
||||
//Electric Furnace
|
||||
if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof MachineElectricFurnace)
|
||||
|
||||
@ -779,6 +779,16 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
power -= 100;
|
||||
slots[11].setItemDamage(slots[11].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[11] != null && slots[11].getItem() == ModItems.factory_core_titanium && slots[11].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[11].setItemDamage(slots[11].getItemDamage() - 1);
|
||||
}
|
||||
if(power - 100 >= 0 && slots[11] != null && slots[11].getItem() == ModItems.factory_core_advanced && slots[11].getItemDamage() > 0)
|
||||
{
|
||||
power -= 100;
|
||||
slots[11].setItemDamage(slots[11].getItemDamage() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void attemptPower(int i) {
|
||||
|
||||
124
com/hbm/gui/ContainerCoreAdvanced.java
Normal file
@ -0,0 +1,124 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import com.hbm.blocks.TileEntityCoreAdvanced;
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
|
||||
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 ContainerCoreAdvanced extends Container {
|
||||
|
||||
private TileEntityCoreAdvanced diFurnace;
|
||||
private int progress;
|
||||
private int power;
|
||||
|
||||
public ContainerCoreAdvanced(InventoryPlayer invPlayer, TileEntityCoreAdvanced tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
//Input Storage
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 26, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 44, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 62, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 80, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 98, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 116, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 134, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 8, 152, 18));
|
||||
//Inputs
|
||||
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));
|
||||
//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));
|
||||
//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));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, this.diFurnace.progress);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.power);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.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.progress != this.diFurnace.progress)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 0, this.diFurnace.progress);
|
||||
}
|
||||
|
||||
if(this.power != this.diFurnace.power)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.power);
|
||||
}
|
||||
}
|
||||
|
||||
this.progress = this.diFurnace.progress;
|
||||
this.power = this.diFurnace.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 0)
|
||||
{
|
||||
diFurnace.progress = j;
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
diFurnace.power = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
119
com/hbm/gui/ContainerCoreTitanium.java
Normal file
@ -0,0 +1,119 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.blocks.TileEntityMachineGenerator;
|
||||
|
||||
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 ContainerCoreTitanium extends Container {
|
||||
|
||||
private TileEntityCoreTitanium diFurnace;
|
||||
private int progress;
|
||||
private int power;
|
||||
|
||||
public ContainerCoreTitanium(InventoryPlayer invPlayer, TileEntityCoreTitanium tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
//Input Storage
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 26, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 44, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 62, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 80, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 98, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 116, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 134, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 8, 152, 18));
|
||||
//Inputs
|
||||
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));
|
||||
//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));
|
||||
//Power Cell
|
||||
this.addSlotToContainer(new Slot(tedf, 22, 44, 72));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, this.diFurnace.progress);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.power);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.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.progress != this.diFurnace.progress)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 0, this.diFurnace.progress);
|
||||
}
|
||||
|
||||
if(this.power != this.diFurnace.power)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.power);
|
||||
}
|
||||
}
|
||||
|
||||
this.progress = this.diFurnace.progress;
|
||||
this.power = this.diFurnace.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 0)
|
||||
{
|
||||
diFurnace.progress = j;
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
diFurnace.power = j;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
52
com/hbm/gui/GUICoreAdvanced.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.TileEntityCoreAdvanced;
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
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 GUICoreAdvanced extends GuiContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/factory_advanced.png");
|
||||
private TileEntityCoreAdvanced diFurnace;
|
||||
|
||||
public GUICoreAdvanced(InventoryPlayer invPlayer, TileEntityCoreAdvanced tedf) {
|
||||
super(new ContainerCoreAdvanced(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.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);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
int i = diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 62, guiTop + 72, 0, 240, i, 16);
|
||||
}
|
||||
|
||||
if(diFurnace.progress > 0) {
|
||||
int j = diFurnace.getProgressScaled(90);
|
||||
drawTexturedModalRect(guiLeft + 43, guiTop + 53, 0, 222, j, 18);
|
||||
}
|
||||
}
|
||||
}
|
||||
53
com/hbm/gui/GUICoreTitanium.java
Normal file
@ -0,0 +1,53 @@
|
||||
package com.hbm.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.blocks.TileEntityMachineGenerator;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
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.inventory.Container;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUICoreTitanium extends GuiContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/factory_titanium.png");
|
||||
private TileEntityCoreTitanium diFurnace;
|
||||
|
||||
public GUICoreTitanium(InventoryPlayer invPlayer, TileEntityCoreTitanium tedf) {
|
||||
super(new ContainerCoreTitanium(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.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);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
int i = diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 62, guiTop + 72, 0, 240, i, 16);
|
||||
}
|
||||
|
||||
if(diFurnace.progress > 0) {
|
||||
int j = diFurnace.getProgressScaled(90);
|
||||
drawTexturedModalRect(guiLeft + 43, guiTop + 53, 0, 222, j, 18);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -53,6 +53,11 @@ public class MachineRecipes {
|
||||
return new ItemStack(ModItems.canister_fuel, 1);
|
||||
}
|
||||
|
||||
|
||||
if(item == ModItems.ingot_red_copper && item2 == ModItems.ingot_steel || item == ModItems.ingot_steel && item2 == ModItems.ingot_red_copper) {
|
||||
return new ItemStack(ModItems.ingot_advanced_alloy, 2);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
15
com/hbm/interfaces/IFactory.java
Normal file
@ -0,0 +1,15 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IFactory {
|
||||
|
||||
boolean isStructureValid(World world);
|
||||
|
||||
public int getPowerScaled(int i);
|
||||
|
||||
public int getProgressScaled(int i);
|
||||
|
||||
public boolean isProcessable(ItemStack item);
|
||||
}
|
||||
@ -16,7 +16,7 @@ public class ItemBattery extends Item {
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
if(itemstack.getItem() != ModItems.fusion_core)
|
||||
if(itemstack.getItem() != ModItems.fusion_core && itemstack.getItem() != ModItems.factory_core_titanium && itemstack.getItem() != ModItems.factory_core_advanced)
|
||||
{
|
||||
list.add("Energy stored: " + ((this.getMaxDamage() - this.getDamage(itemstack)) * 100) + " HE");
|
||||
} else {
|
||||
@ -39,7 +39,7 @@ public class ItemBattery extends Item {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
if(this == ModItems.fusion_core)
|
||||
if(this == ModItems.fusion_core || this == ModItems.factory_core_titanium || this == ModItems.factory_core_advanced)
|
||||
{
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@ -53,6 +53,7 @@ public class ModItems {
|
||||
public static Item nugget_plutonium_fuel;
|
||||
public static Item nugget_mox_fuel;
|
||||
public static Item nugget_schrabidium_fuel;
|
||||
public static Item ingot_advanced_alloy;
|
||||
|
||||
public static Item nugget_uranium;
|
||||
public static Item nugget_u235;
|
||||
@ -79,6 +80,7 @@ public class ModItems {
|
||||
public static Item nugget_beryllium;
|
||||
public static Item plate_gold;
|
||||
public static Item hazmat_cloth;
|
||||
public static Item plate_advanced_alloy;
|
||||
|
||||
public static Item powder_lead;
|
||||
public static Item powder_neptunium;
|
||||
@ -354,6 +356,9 @@ public class ModItems {
|
||||
|
||||
public static Item fusion_core;
|
||||
|
||||
public static Item factory_core_titanium;
|
||||
public static Item factory_core_advanced;
|
||||
|
||||
public static Item ingot_euphemium;
|
||||
public static Item nugget_euphemium;
|
||||
public static Item rod_quad_euphemium;
|
||||
@ -449,6 +454,7 @@ public class ModItems {
|
||||
nugget_plutonium_fuel = new Item().setUnlocalizedName("nugget_plutonium_fuel").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_plutonium");
|
||||
nugget_mox_fuel = new Item().setUnlocalizedName("nugget_mox_fuel").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_mox_fuel");
|
||||
nugget_schrabidium_fuel = new Item().setUnlocalizedName("nugget_schrabidium_fuel").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_schrabidium_fuel");
|
||||
ingot_advanced_alloy = new Item().setUnlocalizedName("ingot_advanced_alloy").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":ingot_advanced_alloy");
|
||||
|
||||
niter = new Item().setUnlocalizedName("niter").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":salpeter");
|
||||
ingot_copper = new Item().setUnlocalizedName("ingot_copper").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":ingot_copper");
|
||||
@ -466,6 +472,7 @@ public class ModItems {
|
||||
plate_schrabidium = new ItemCustomLore().setUnlocalizedName("plate_schrabidium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":plate_schrabidium");
|
||||
plate_copper = new Item().setUnlocalizedName("plate_copper").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":plate_copper");
|
||||
plate_gold = new Item().setUnlocalizedName("plate_gold").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":plate_gold");
|
||||
plate_advanced_alloy = new Item().setUnlocalizedName("plate_advanced_alloy").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":plate_advanced_alloy");
|
||||
|
||||
nugget_uranium = new Item().setUnlocalizedName("nugget_uranium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_uranium");
|
||||
nugget_u235 = new Item().setUnlocalizedName("nugget_u235").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":nugget_uranium");
|
||||
@ -747,6 +754,9 @@ public class ModItems {
|
||||
battery_creative = new Item().setUnlocalizedName("battery_creative").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_creative");
|
||||
|
||||
fusion_core = new ItemBattery(5000).setUnlocalizedName("fusion_core").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fusion_core");
|
||||
|
||||
factory_core_titanium = new ItemBattery(70400).setUnlocalizedName("factory_core_titanium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":factory_core_titanium");
|
||||
factory_core_advanced = new ItemBattery(41600).setUnlocalizedName("factory_core_advanced").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":factory_core_advanced");
|
||||
|
||||
nuke_starter_kit = new ItemStarterKit().setUnlocalizedName("nuke_starter_kit").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":nuke_starter_kit");
|
||||
nuke_advanced_kit = new ItemStarterKit().setUnlocalizedName("nuke_advanced_kit").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":nuke_advanced_kit");
|
||||
@ -839,6 +849,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(ingot_titanium, ingot_titanium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_copper, ingot_copper.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_red_copper, ingot_red_copper.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_advanced_alloy, ingot_advanced_alloy.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_tungsten, ingot_tungsten.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_aluminium, ingot_aluminium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_steel, ingot_steel.getUnlocalizedName());
|
||||
@ -888,6 +899,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(neutron_reflector, neutron_reflector.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_schrabidium, plate_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_copper, plate_copper.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_advanced_alloy, plate_advanced_alloy.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_gold, plate_gold.getUnlocalizedName());
|
||||
GameRegistry.registerItem(hazmat_cloth, hazmat_cloth.getUnlocalizedName());
|
||||
|
||||
@ -990,6 +1002,8 @@ public class ModItems {
|
||||
GameRegistry.registerItem(battery_schrabidium, battery_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(battery_creative, battery_creative.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fusion_core, fusion_core.getUnlocalizedName());
|
||||
GameRegistry.registerItem(factory_core_titanium, factory_core_titanium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(factory_core_advanced, factory_core_advanced.getUnlocalizedName());
|
||||
|
||||
//Fuelrods
|
||||
GameRegistry.registerItem(rod_empty, rod_empty.getUnlocalizedName());
|
||||
|
||||
@ -337,6 +337,16 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TLT", "RIR", "TST", 'T', ModItems.ingot_tungsten, 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper, 'S', Item.getItemFromBlock(ModBlocks.block_sulfur), 'L', Item.getItemFromBlock(ModBlocks.block_lead) });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_coal_off), 1), new Object[] { "STS", "SCS", "SFS", 'S', ModItems.ingot_steel, 'T', ModItems.tank_steel, 'C', ModItems.ingot_red_copper, 'F', Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off) });
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 1), new Object[] { "PIP", "I I", "PIP", 'P', ModItems.plate_titanium, 'I', ModItems.ingot_titanium });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_furnace), 1), new Object[] { "HMH", "MFM", "HMH", 'H', Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 'M', ModItems.motor, 'F', Item.getItemFromBlock(Blocks.furnace) });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_core), 1), new Object[] { "HPH", "PCP", "HPH", 'H', Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 'C', ModItems.circuit_aluminium, 'P', Item.getItemFromBlock(Blocks.piston) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.factory_core_titanium, 1, ModItems.factory_core_titanium.getMaxDamage()), new Object[] { "BRB", "RHR", "BRB", 'B', new ItemStack(ModItems.battery_generic, 1, ModItems.battery_generic.getMaxDamage()), 'R', Item.getItemFromBlock(Blocks.redstone_block), 'H', Item.getItemFromBlock(ModBlocks.factory_titanium_hull) });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 1), new Object[] { "PIP", "I I", "PIP", 'P', ModItems.plate_advanced_alloy, 'I', ModItems.ingot_advanced_alloy });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_furnace), 1), new Object[] { "HMH", "MFM", "HMH", 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 'M', ModItems.motor, 'F', Item.getItemFromBlock(Blocks.furnace) });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_advanced_core), 1), new Object[] { "HPH", "PCP", "HPH", 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull), 'C', ModItems.circuit_red_copper, 'P', Item.getItemFromBlock(Blocks.piston) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.factory_core_advanced, 1, ModItems.factory_core_advanced.getMaxDamage()), new Object[] { "BLB", "SHS", "BLB", 'B', new ItemStack(ModItems.battery_advanced, 1, ModItems.battery_advanced.getMaxDamage()), 'S', Item.getItemFromBlock(ModBlocks.block_sulfur), 'L', Item.getItemFromBlock(ModBlocks.block_lead), 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull) });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.factory_core_advanced, 1, ModItems.factory_core_advanced.getMaxDamage()), new Object[] { "BSB", "LHL", "BSB", 'B', new ItemStack(ModItems.battery_advanced, 1, ModItems.battery_advanced.getMaxDamage()), 'S', Item.getItemFromBlock(ModBlocks.block_sulfur), 'L', Item.getItemFromBlock(ModBlocks.block_lead), 'H', Item.getItemFromBlock(ModBlocks.factory_advanced_hull) });
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.brick_light), 8), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.fence, 'B', Blocks.brick_block });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.brick_concrete), 8), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.iron_bars, 'B', Blocks.stone });
|
||||
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.brick_obsidian), 8), new Object[] { "FBF", "BFB", "FBF", 'F', Blocks.iron_bars, 'B', Blocks.obsidian });
|
||||
|
||||
@ -2,6 +2,8 @@ package com.hbm.main;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.TileEntityBombMulti;
|
||||
import com.hbm.blocks.TileEntityCoreAdvanced;
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.blocks.TileEntityDiFurnace;
|
||||
import com.hbm.blocks.TileEntityLaunchPad;
|
||||
import com.hbm.blocks.TileEntityMachineBattery;
|
||||
@ -26,6 +28,8 @@ import com.hbm.blocks.TileEntityTestNuke;
|
||||
import com.hbm.gui.ContainerBombMulti;
|
||||
import com.hbm.gui.ContainerDiFurnace;
|
||||
import com.hbm.gui.ContainerCentrifuge;
|
||||
import com.hbm.gui.ContainerCoreAdvanced;
|
||||
import com.hbm.gui.ContainerCoreTitanium;
|
||||
import com.hbm.gui.ContainerElectricFurnace;
|
||||
import com.hbm.gui.ContainerGenerator;
|
||||
import com.hbm.gui.ContainerLaunchPadTier1;
|
||||
@ -46,6 +50,8 @@ import com.hbm.gui.ContainerRtgFurnace;
|
||||
import com.hbm.gui.ContainerTestNuke;
|
||||
import com.hbm.gui.ContainerUF6Tank;
|
||||
import com.hbm.gui.GUIBombMulti;
|
||||
import com.hbm.gui.GUICoreAdvanced;
|
||||
import com.hbm.gui.GUICoreTitanium;
|
||||
import com.hbm.gui.GUILaunchPadTier1;
|
||||
import com.hbm.gui.GUIMachineBattery;
|
||||
import com.hbm.gui.GUIMachineCentrifuge;
|
||||
@ -257,6 +263,22 @@ public class GUIHandler implements IGuiHandler {
|
||||
return new ContainerLaunchPadTier1(player.inventory, (TileEntityLaunchPad) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_factory_titanium:
|
||||
{
|
||||
if(entity instanceof TileEntityCoreTitanium)
|
||||
{
|
||||
return new ContainerCoreTitanium(player.inventory, (TileEntityCoreTitanium) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_factory_advanced:
|
||||
{
|
||||
if(entity instanceof TileEntityCoreAdvanced)
|
||||
{
|
||||
return new ContainerCoreAdvanced(player.inventory, (TileEntityCoreAdvanced) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -445,6 +467,22 @@ public class GUIHandler implements IGuiHandler {
|
||||
return new GUILaunchPadTier1(player.inventory, (TileEntityLaunchPad) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_factory_titanium:
|
||||
{
|
||||
if(entity instanceof TileEntityCoreTitanium)
|
||||
{
|
||||
return new GUICoreTitanium(player.inventory, (TileEntityCoreTitanium) entity);
|
||||
}
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_factory_advanced:
|
||||
{
|
||||
if(entity instanceof TileEntityCoreAdvanced)
|
||||
{
|
||||
return new GUICoreAdvanced(player.inventory, (TileEntityCoreAdvanced) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -17,6 +17,8 @@ import cpw.mods.fml.common.ModMetadata;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.TileEntityBombMulti;
|
||||
import com.hbm.blocks.TileEntityCoreAdvanced;
|
||||
import com.hbm.blocks.TileEntityCoreTitanium;
|
||||
import com.hbm.blocks.TileEntityDecoBlock;
|
||||
import com.hbm.blocks.TileEntityDecoPoleSatelliteReceiver;
|
||||
import com.hbm.blocks.TileEntityDecoPoleTop;
|
||||
@ -191,6 +193,8 @@ public class MainRegistry
|
||||
GameRegistry.registerTileEntity(TileEntityYellowBarrel.class, "tileentity_nukebarrel");
|
||||
GameRegistry.registerTileEntity(TileEntityLaunchPad.class, "tileentity_launch1");
|
||||
GameRegistry.registerTileEntity(TileEntityDecoBlock.class, "tileentity_deco");
|
||||
GameRegistry.registerTileEntity(TileEntityCoreTitanium.class, "tileentity_core_titanium");
|
||||
GameRegistry.registerTileEntity(TileEntityCoreAdvanced.class, "tileentity_core_advanced");
|
||||
|
||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||
|
||||