Auto formatted, and cleaned imports

This commit is contained in:
Modmuss50 2015-04-15 16:23:12 +01:00
parent c001231216
commit 8e7d6b011e
64 changed files with 2268 additions and 2587 deletions

View file

@ -1,7 +1,10 @@
package techreborn;
import java.io.File;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import techreborn.client.GuiHandler;
import techreborn.compat.CompatManager;
import techreborn.config.ConfigTechReborn;
@ -12,11 +15,8 @@ import techreborn.lib.ModInfo;
import techreborn.packets.PacketHandler;
import techreborn.util.LogHelper;
import techreborn.world.TROreGen;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import java.io.File;
@Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCUIES, guiFactory = ModInfo.GUI_FACTORY_CLASS)
public class Core {

View file

@ -21,19 +21,19 @@ public class CentrifugeRecipie {
public CentrifugeRecipie(Item inputItem, int inputAmount, Item output1, Item output2, Item output3, Item output4, int tickTime, int cells) {
this.inputItem = new ItemStack(inputItem, inputAmount);
if(output1!= null)
if (output1 != null)
this.output1 = new ItemStack(output1);
if(output2!= null)
if (output2 != null)
this.output2 = new ItemStack(output2);
if(output3!= null)
if (output3 != null)
this.output3 = new ItemStack(output3);
if(output4!= null)
if (output4 != null)
this.output4 = new ItemStack(output4);
this.tickTime = tickTime;
this.cells = cells;
}
public CentrifugeRecipie(CentrifugeRecipie centrifugeRecipie){
public CentrifugeRecipie(CentrifugeRecipie centrifugeRecipie) {
this.inputItem = centrifugeRecipie.getInputItem();
this.output1 = centrifugeRecipie.getOutput1();
this.output2 = centrifugeRecipie.getOutput2();

View file

@ -4,16 +4,15 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class RollingMachineRecipie {
ItemStack inputItem1, inputItem2, inputItem3, inputItem4 ,inputItem5, inputItem6,
ItemStack inputItem1, inputItem2, inputItem3, inputItem4, inputItem5, inputItem6,
inputItem7, inputItem8, inputItem9;
ItemStack output1;
int tickTime;
public RollingMachineRecipie(ItemStack inputItem1, ItemStack inputItem2, ItemStack inputItem3, ItemStack inputItem4,
ItemStack inputItem5, ItemStack inputItem6, ItemStack inputItem7, ItemStack inputItem8,ItemStack inputItem9,
ItemStack output1, int tickTime)
{
ItemStack inputItem5, ItemStack inputItem6, ItemStack inputItem7, ItemStack inputItem8, ItemStack inputItem9,
ItemStack output1, int tickTime) {
this.inputItem1 = inputItem1;
this.inputItem2 = inputItem2;
this.inputItem3 = inputItem3;
@ -28,26 +27,26 @@ public class RollingMachineRecipie {
}
public RollingMachineRecipie(Item inputItem1,Item inputItem2, Item inputItem3, Item inputItem4, Item inputItem5,
public RollingMachineRecipie(Item inputItem1, Item inputItem2, Item inputItem3, Item inputItem4, Item inputItem5,
Item inputItem6, Item inputItem7, Item inputItem8, Item inputItem9, int inputAmount,
Item output1, int tickTime) {
if(inputItem1 != null)
if (inputItem1 != null)
this.inputItem1 = new ItemStack(inputItem1, inputAmount);
if(inputItem2 != null)
if (inputItem2 != null)
this.inputItem2 = new ItemStack(inputItem2, inputAmount);
if(inputItem3 != null)
if (inputItem3 != null)
this.inputItem3 = new ItemStack(inputItem3, inputAmount);
if(inputItem4 != null)
if (inputItem4 != null)
this.inputItem4 = new ItemStack(inputItem4, inputAmount);
if(inputItem5 != null)
if (inputItem5 != null)
this.inputItem5 = new ItemStack(inputItem5, inputAmount);
if(inputItem6 != null)
if (inputItem6 != null)
this.inputItem6 = new ItemStack(inputItem6, inputAmount);
if(inputItem7 != null)
if (inputItem7 != null)
this.inputItem7 = new ItemStack(inputItem7, inputAmount);
if(inputItem8 != null)
if (inputItem8 != null)
this.inputItem8 = new ItemStack(inputItem8, inputAmount);
if(inputItem9 != null)
if (inputItem9 != null)
this.inputItem9 = new ItemStack(inputItem9, inputAmount);
this.output1 = new ItemStack(output1);
@ -55,8 +54,7 @@ public class RollingMachineRecipie {
;
}
public RollingMachineRecipie(RollingMachineRecipie rollingmachineRecipie)
{
public RollingMachineRecipie(RollingMachineRecipie rollingmachineRecipie) {
this.inputItem1 = rollingmachineRecipie.getInputItem1();
this.inputItem2 = rollingmachineRecipie.getInputItem2();
this.inputItem3 = rollingmachineRecipie.getInputItem3();
@ -71,50 +69,47 @@ public class RollingMachineRecipie {
this.tickTime = rollingmachineRecipie.getTickTime();
}
public ItemStack getInputItem1()
{
public ItemStack getInputItem1() {
return inputItem1;
}
public ItemStack getInputItem2()
{
public ItemStack getInputItem2() {
return inputItem2;
}
public ItemStack getInputItem3()
{
public ItemStack getInputItem3() {
return inputItem3;
}
public ItemStack getInputItem4()
{
public ItemStack getInputItem4() {
return inputItem4;
}
public ItemStack getInputItem5()
{
public ItemStack getInputItem5() {
return inputItem5;
}
public ItemStack getInputItem6()
{
public ItemStack getInputItem6() {
return inputItem6;
}
public ItemStack getInputItem7()
{
public ItemStack getInputItem7() {
return inputItem7;
}
public ItemStack getInputItem8()
{
public ItemStack getInputItem8() {
return inputItem8;
}
public ItemStack getInputItem9()
{
public ItemStack getInputItem9() {
return inputItem9;
}
public ItemStack getOutput1()
{
public ItemStack getOutput1() {
return output1;
}
public int getTickTime()
{
public int getTickTime() {
return tickTime;
}

View file

@ -1,19 +1,19 @@
package techreborn.api;
import java.util.ArrayList;
import techreborn.util.ItemUtils;
import java.util.ArrayList;
public final class TechRebornAPI {
public static ArrayList<CentrifugeRecipie> centrifugeRecipies = new ArrayList<CentrifugeRecipie>();
public static ArrayList<RollingMachineRecipie> rollingmachineRecipes = new ArrayList<RollingMachineRecipie>();
public static void registerCentrifugeRecipe(CentrifugeRecipie recipie){
public static void registerCentrifugeRecipe(CentrifugeRecipie recipie) {
boolean shouldAdd = true;
for(CentrifugeRecipie centrifugeRecipie : centrifugeRecipies){
if(ItemUtils.isItemEqual(centrifugeRecipie.getInputItem(), recipie.getInputItem(), false, true)){
for (CentrifugeRecipie centrifugeRecipie : centrifugeRecipies) {
if (ItemUtils.isItemEqual(centrifugeRecipie.getInputItem(), recipie.getInputItem(), false, true)) {
try {
throw new RegisteredItemRecipe("Item " + recipie.getInputItem().getUnlocalizedName() + " is already being used in a recipe for the Centrifuge");
} catch (RegisteredItemRecipe registeredItemRecipe) {
@ -22,14 +22,14 @@ public final class TechRebornAPI {
}
}
}
if(shouldAdd)
if (shouldAdd)
centrifugeRecipies.add(recipie);
}
public static void registerRollingMachineRecipe(RollingMachineRecipie recipie){
public static void registerRollingMachineRecipe(RollingMachineRecipie recipie) {
boolean shouldAdd = true;
for(CentrifugeRecipie centrifugeRecipie : centrifugeRecipies){
if(ItemUtils.isItemEqual(centrifugeRecipie.getInputItem(), recipie.getInputItem1(), false, true)){
for (CentrifugeRecipie centrifugeRecipie : centrifugeRecipies) {
if (ItemUtils.isItemEqual(centrifugeRecipie.getInputItem(), recipie.getInputItem1(), false, true)) {
try {
throw new RegisteredItemRecipe("Item " + recipie.getInputItem1().getUnlocalizedName() + " is already being used in a recipe for the RollingMachine");
} catch (RegisteredItemRecipe registeredItemRecipe) {
@ -38,16 +38,14 @@ public final class TechRebornAPI {
}
}
}
if(shouldAdd)
if (shouldAdd)
rollingmachineRecipes.add(recipie);
}
}
class RegisteredItemRecipe extends Exception
{
public RegisteredItemRecipe(String message)
{
class RegisteredItemRecipe extends Exception {
public RegisteredItemRecipe(String message) {
super(message);
}
}

View file

@ -1,5 +1,3 @@
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI")
package techreborn.api;
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api;
import cpw.mods.fml.common.API;

View file

@ -11,7 +11,7 @@ import techreborn.tiles.TileCentrifuge;
public class BlockCentrifuge extends BlockContainer {
public BlockCentrifuge(){
public BlockCentrifuge() {
super(Material.piston);
}
@ -22,7 +22,7 @@ public class BlockCentrifuge extends BlockContainer {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking())
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.centrifugeID, world, x, y, z);
return true;
}

View file

@ -1,8 +1,7 @@
package techreborn.blocks;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -13,22 +12,21 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockOre extends Block{
import java.util.List;
import java.util.Random;
public class BlockOre extends Block {
public static final String[] types = new String[]
{
"Galena", "Iridium", "Ruby", "Sapphire", "Bauxite", "Pyrite", "Cinnabar", "Sphalerite",
"Tungston","Sheldonite", "Olivine", "Sodalite"
"Tungston", "Sheldonite", "Olivine", "Sodalite"
};
private IIcon[] textures;
public BlockOre(Material material)
{
public BlockOre(Material material) {
super(material);
setBlockName("techreborn.ore");
setCreativeTab(TechRebornCreativeTab.instance);
@ -36,49 +34,41 @@ public class BlockOre extends Block{
}
@Override
public Item getItemDropped(int meta, Random random, int fortune)
{
public Item getItemDropped(int meta, Random random, int fortune) {
return Item.getItemFromBlock(this);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; meta++)
{
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; meta++) {
list.add(new ItemStack(item, 1, meta));
}
}
@Override
public int damageDropped(int metaData)
{
public int damageDropped(int metaData) {
//TODO RubyOre Returns Rubys
return metaData;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
this.textures = new IIcon[types.length];
for (int i = 0; i < types.length; i++)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "ore/ore"+types[i]);
for (int i = 0; i < types.length; i++) {
textures[i] = iconRegister.registerIcon("techreborn:" + "ore/ore" + types[i]);
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metaData)
{
public IIcon getIcon(int side, int metaData) {
metaData = MathHelper.clamp_int(metaData, 0, types.length - 1);
if (ForgeDirection.getOrientation(side) == ForgeDirection.UP
|| ForgeDirection.getOrientation(side) == ForgeDirection.DOWN)
{
|| ForgeDirection.getOrientation(side) == ForgeDirection.DOWN) {
return textures[metaData];
} else {
return textures[metaData];

View file

@ -1,5 +1,7 @@
package techreborn.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -10,8 +12,6 @@ import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileQuantumChest;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockQuantumChest extends BlockContainer {
@ -33,7 +33,7 @@ public class BlockQuantumChest extends BlockContainer {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking())
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.quantumChestID, world, x, y, z);
return true;
}

View file

@ -1,5 +1,7 @@
package techreborn.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -10,8 +12,6 @@ import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileQuantumTank;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockQuantumTank extends BlockContainer {
@ -32,7 +32,7 @@ public class BlockQuantumTank extends BlockContainer {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking())
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z);
return true;
}

View file

@ -2,11 +2,6 @@ package techreborn.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.TileRollingMachine;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -14,16 +9,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.TileRollingMachine;
public class BlockRollingMachine extends BlockContainer{
public class BlockRollingMachine extends BlockContainer {
@SideOnly(Side.CLIENT)
private IIcon top;
@SideOnly(Side.CLIENT)
private IIcon other;
public BlockRollingMachine(Material material)
{
public BlockRollingMachine(Material material) {
super(material.piston);
setCreativeTab(TechRebornCreativeTab.instance);
setBlockName("techreborn.rollingmachine");
@ -31,30 +29,27 @@ public class BlockRollingMachine extends BlockContainer{
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileRollingMachine();
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking())
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.rollingMachineID, world, x, y, z);
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister icon)
{
public void registerBlockIcons(IIconRegister icon) {
top = icon.registerIcon("techreborn:machine/rollingmachine_top");
other = icon.registerIcon("techreborn:machine/rollingmachine_side");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int currentSide, int meta)
{
public IIcon getIcon(int currentSide, int meta) {
if (currentSide == 1) {
return top;
} else {

View file

@ -1,8 +1,7 @@
package techreborn.blocks;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -13,10 +12,11 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.client.TechRebornCreativeTab;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockStorage extends Block{
import java.util.List;
import java.util.Random;
public class BlockStorage extends Block {
public static final String[] types = new String[]
{
@ -26,8 +26,7 @@ public class BlockStorage extends Block{
private IIcon[] textures;
public BlockStorage(Material material)
{
public BlockStorage(Material material) {
super(material);
setBlockName("techreborn.storage");
setCreativeTab(TechRebornCreativeTab.instance);
@ -35,48 +34,40 @@ public class BlockStorage extends Block{
}
@Override
public Item getItemDropped(int par1, Random random, int par2)
{
public Item getItemDropped(int par1, Random random, int par2) {
return Item.getItemFromBlock(this);
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; meta++)
{
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; meta++) {
list.add(new ItemStack(item, 1, meta));
}
}
@Override
public int damageDropped(int metaData)
{
public int damageDropped(int metaData) {
return metaData;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
public void registerBlockIcons(IIconRegister iconRegister) {
this.textures = new IIcon[types.length];
for (int i = 0; i < types.length; i++)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "storage/storage"+types[i]);
for (int i = 0; i < types.length; i++) {
textures[i] = iconRegister.registerIcon("techreborn:" + "storage/storage" + types[i]);
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metaData)
{
public IIcon getIcon(int side, int metaData) {
metaData = MathHelper.clamp_int(metaData, 0, types.length - 1);
if (ForgeDirection.getOrientation(side) == ForgeDirection.UP
|| ForgeDirection.getOrientation(side) == ForgeDirection.DOWN)
{
|| ForgeDirection.getOrientation(side) == ForgeDirection.DOWN) {
return textures[metaData];
} else {
return textures[metaData];

View file

@ -1,7 +1,7 @@
package techreborn.blocks;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -14,8 +14,8 @@ import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileThermalGenerator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
public class BlockThermalGenerator extends BlockContainer {
@ -55,7 +55,7 @@ public class BlockThermalGenerator extends BlockContainer {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking())
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y, z);
return true;
}

View file

@ -1,24 +1,12 @@
package techreborn.client;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import techreborn.client.container.ContainerCentrifuge;
import techreborn.client.container.ContainerQuantumChest;
import techreborn.client.container.ContainerQuantumTank;
import techreborn.client.container.ContainerRollingMachine;
import techreborn.client.container.ContainerThermalGenerator;
import techreborn.client.gui.GuiCentrifuge;
import techreborn.client.gui.GuiQuantumChest;
import techreborn.client.gui.GuiQuantumTank;
import techreborn.client.gui.GuiRollingMachine;
import techreborn.client.gui.GuiThermalGenerator;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileQuantumChest;
import techreborn.tiles.TileQuantumTank;
import techreborn.tiles.TileRollingMachine;
import techreborn.tiles.TileThermalGenerator;
import cpw.mods.fml.common.network.IGuiHandler;
import techreborn.client.container.*;
import techreborn.client.gui.*;
import techreborn.tiles.*;
public class GuiHandler implements IGuiHandler {
@ -26,20 +14,20 @@ public class GuiHandler implements IGuiHandler {
public static final int quantumTankID = 1;
public static final int quantumChestID = 2;
public static final int centrifugeID = 3;
public static final int rollingMachineID =4;
public static final int rollingMachineID = 4;
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if(ID == thermalGeneratorID){
if (ID == thermalGeneratorID) {
return new ContainerThermalGenerator((TileThermalGenerator) world.getTileEntity(x, y, z), player);
} else if(ID == quantumTankID){
} else if (ID == quantumTankID) {
return new ContainerQuantumTank((TileQuantumTank) world.getTileEntity(x, y, z), player);
} else if(ID == quantumChestID){
} else if (ID == quantumChestID) {
return new ContainerQuantumChest((TileQuantumChest) world.getTileEntity(x, y, z), player);
} else if(ID == centrifugeID){
} else if (ID == centrifugeID) {
return new ContainerCentrifuge((TileCentrifuge) world.getTileEntity(x, y, z), player);
} else if(ID == rollingMachineID){
} else if (ID == rollingMachineID) {
return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(x, y, z), player);
}
@ -48,16 +36,16 @@ public class GuiHandler implements IGuiHandler {
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if(ID == thermalGeneratorID){
return new GuiThermalGenerator(player, (TileThermalGenerator)world.getTileEntity(x, y, z));
} else if(ID == quantumTankID){
return new GuiQuantumTank(player, (TileQuantumTank)world.getTileEntity(x, y, z));
} else if(ID == quantumChestID){
return new GuiQuantumChest(player, (TileQuantumChest)world.getTileEntity(x, y, z));
} else if(ID == centrifugeID){
return new GuiCentrifuge(player, (TileCentrifuge)world.getTileEntity(x, y, z));
} else if(ID == rollingMachineID){
return new GuiRollingMachine(player, (TileRollingMachine)world.getTileEntity(x, y, z));
if (ID == thermalGeneratorID) {
return new GuiThermalGenerator(player, (TileThermalGenerator) world.getTileEntity(x, y, z));
} else if (ID == quantumTankID) {
return new GuiQuantumTank(player, (TileQuantumTank) world.getTileEntity(x, y, z));
} else if (ID == quantumChestID) {
return new GuiQuantumChest(player, (TileQuantumChest) world.getTileEntity(x, y, z));
} else if (ID == centrifugeID) {
return new GuiCentrifuge(player, (TileCentrifuge) world.getTileEntity(x, y, z));
} else if (ID == rollingMachineID) {
return new GuiRollingMachine(player, (TileRollingMachine) world.getTileEntity(x, y, z));
}
return null;
}

View file

@ -14,7 +14,7 @@ public class ContainerCentrifuge extends TechRebornContainer {
public int tickTime;
public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player){
public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player) {
tile = tileCentrifuge;
this.player = player;
@ -58,7 +58,7 @@ public class ContainerCentrifuge extends TechRebornContainer {
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); ++i) {
ICrafting icrafting = (ICrafting)this.crafters.get(i);
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.tickTime != this.tile.tickTime) {
icrafting.sendProgressBarUpdate(this, 0, this.tile.tickTime);
}

View file

@ -21,16 +21,13 @@ public class ContainerQuantumTank extends TechRebornContainer {
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
for (i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}

View file

@ -1,17 +1,16 @@
package techreborn.client.container;
import techreborn.client.SlotOutput;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileRollingMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import techreborn.tiles.TileRollingMachine;
public class ContainerRollingMachine extends TechRebornContainer{
public class ContainerRollingMachine extends TechRebornContainer {
EntityPlayer player;
TileRollingMachine tile;
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player){
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player) {
tile = tileRollingmachine;
this.player = player;

View file

@ -21,16 +21,13 @@ public class ContainerThermalGenerator extends TechRebornContainer {
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
for (i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}

View file

@ -28,8 +28,7 @@ public class GuiCentrifuge extends GuiContainer {
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRendererObj.drawString("Centrifuge", 110, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(centrifuge.tickTime + " " + centrifuge.isRunning, 110, this.ySize - 96 + 2, 4210752);

View file

@ -26,15 +26,14 @@ public class GuiQuantumChest extends GuiContainer {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l , 0, 0, this.xSize, this.ySize);
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRendererObj.drawString("Quantum Chest", 8, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
if(tile.storedItem != null)
if (tile.storedItem != null)
this.fontRendererObj.drawString(tile.storedItem.stackSize + "", 10, 30, 16448255);
}
}

View file

@ -25,11 +25,10 @@ public class GuiQuantumTank extends GuiContainer {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l , 0, 0, this.xSize, this.ySize);
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRendererObj.drawString("Quantum Tank", 8, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);

View file

@ -1,20 +1,17 @@
package techreborn.client.gui;
import techreborn.client.container.ContainerCentrifuge;
import techreborn.client.container.ContainerRollingMachine;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileRollingMachine;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import techreborn.client.container.ContainerRollingMachine;
import techreborn.tiles.TileRollingMachine;
public class GuiRollingMachine extends GuiContainer{
public class GuiRollingMachine extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/rollingmachine.png");
TileRollingMachine rollingMachine;
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine)
{
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine) {
super(new ContainerRollingMachine(tileRollingmachine, player));
this.xSize = 176;
this.ySize = 167;
@ -22,8 +19,7 @@ public class GuiRollingMachine extends GuiContainer{
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
{
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;

View file

@ -25,11 +25,10 @@ public class GuiThermalGenerator extends GuiContainer {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l , 0, 0, this.xSize, this.ySize);
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
{
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRendererObj.drawString("Thermal Generator", 8, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);

View file

@ -1,13 +1,13 @@
package techreborn.compat;
import techreborn.compat.waila.CompatModuleWaila;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import techreborn.compat.waila.CompatModuleWaila;
public class CompatManager {
public static void init(FMLInitializationEvent event) {
if(Loader.isModLoaded("Waila")){
if (Loader.isModLoaded("Waila")) {
new CompatModuleWaila().init(event);
}
}

View file

@ -36,16 +36,16 @@ public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
this.input.add(pStack);
if(recipie.getOutput1() != null){
if (recipie.getOutput1() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput1(), 80 - offset, 5 - offset));
}
if(recipie.getOutput2() != null){
if (recipie.getOutput2() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput2(), 110 - offset, 35 - offset));
}
if(recipie.getOutput3() != null){
if (recipie.getOutput3() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput3(), 80 - offset, 65 - offset));
}
if(recipie.getOutput4() != null){
if (recipie.getOutput4() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput4(), 50 - offset, 35 - offset));
}
@ -94,11 +94,11 @@ public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
GuiDraw.drawTooltipBox(10, 80, 145, 50);
GuiDraw.drawString("Info:", 14, 84, -1);
CachedRecipe recipe = arecipes.get(recipeIndex);
if(recipe instanceof CachedCentrifugeRecipe){
if (recipe instanceof CachedCentrifugeRecipe) {
CachedCentrifugeRecipe centrifugeRecipie = (CachedCentrifugeRecipe) recipe;
GuiDraw.drawString("EU needed: " + (ConfigTechReborn.CentrifugeInputTick * centrifugeRecipie.centrifugeRecipie.getTickTime()), 14, 94, -1);
GuiDraw.drawString("Ticks to smelt: " + centrifugeRecipie.centrifugeRecipie.getTickTime(), 14, 104, -1);
GuiDraw.drawString("Time to smelt: " + centrifugeRecipie.centrifugeRecipie.getTickTime() / 20 + " seconds" , 14, 114, -1);
GuiDraw.drawString("Time to smelt: " + centrifugeRecipie.centrifugeRecipie.getTickTime() / 20 + " seconds", 14, 114, -1);
}
}
@ -115,7 +115,7 @@ public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("tr.centrifuge")) {
for(CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies){
for (CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies) {
addCached(centrifugeRecipie);
}
} else {
@ -125,17 +125,17 @@ public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(ItemStack result) {
for(CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies){
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput1(), result)){
for (CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies) {
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput1(), result)) {
addCached(centrifugeRecipie);
}
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput2(), result)){
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput2(), result)) {
addCached(centrifugeRecipie);
}
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput3(), result)){
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput3(), result)) {
addCached(centrifugeRecipie);
}
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput4(), result)){
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput4(), result)) {
addCached(centrifugeRecipie);
}
}
@ -143,8 +143,8 @@ public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for(CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies){
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInputItem(), ingredient)){
for (CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies) {
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInputItem(), ingredient)) {
addCached(centrifugeRecipie);
}
}

View file

@ -1,26 +1,23 @@
package techreborn.compat.nei;
import techreborn.lib.ModInfo;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import techreborn.lib.ModInfo;
public class NEIConfig implements IConfigureNEI{
public class NEIConfig implements IConfigureNEI {
@Override
public String getName()
{
public String getName() {
return ModInfo.MOD_ID;
}
@Override
public String getVersion()
{
public String getVersion() {
return ModInfo.MOD_VERSION;
}
@Override
public void loadConfig()
{
public void loadConfig() {
CentrifugeRecipeHandler centrifugeRecipeHandler = new CentrifugeRecipeHandler();
API.registerRecipeHandler(centrifugeRecipeHandler);

View file

@ -1,9 +1,9 @@
package techreborn.compat.waila;
import mcp.mobius.waila.api.IWailaRegistrar;
import techreborn.tiles.TileMachineBase;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import mcp.mobius.waila.api.IWailaRegistrar;
import techreborn.tiles.TileMachineBase;
public class CompatModuleWaila {

View file

@ -1,8 +1,5 @@
package techreborn.compat.waila;
import java.util.ArrayList;
import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
@ -13,6 +10,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import techreborn.tiles.TileMachineBase;
import java.util.ArrayList;
import java.util.List;
public class WailaProviderMachines implements IWailaDataProvider {
private List<String> info = new ArrayList<String>();

View file

@ -1,9 +1,9 @@
package techreborn.config;
import java.io.File;
import net.minecraftforge.common.config.Configuration;
import java.io.File;
public class ConfigTechReborn {
private static ConfigTechReborn instance = null;
public static String CATEGORY_WORLD = "world";
@ -52,13 +52,9 @@ public class ConfigTechReborn {
public static boolean ExpensiveSolar;
public static Configuration config;
private ConfigTechReborn(File configFile)
{
private ConfigTechReborn(File configFile) {
config = new Configuration(configFile);
config.load();
@ -68,8 +64,7 @@ public class ConfigTechReborn {
}
public static ConfigTechReborn initialize(File configFile)
{
public static ConfigTechReborn initialize(File configFile) {
if (instance == null)
instance = new ConfigTechReborn(configFile);
@ -80,8 +75,7 @@ public class ConfigTechReborn {
return instance;
}
public static ConfigTechReborn instance()
{
public static ConfigTechReborn instance() {
if (instance == null) {
throw new IllegalStateException(
@ -90,8 +84,7 @@ public class ConfigTechReborn {
return instance;
}
public static void Configs()
{
public static void Configs() {
GalenaOreTrue = config.get(CATEGORY_WORLD,
"Allow GalenaOre", true,
"Allow GalenaOre to be generated in your world.")

View file

@ -1,27 +1,25 @@
package techreborn.config;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.client.config.DummyConfigElement;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.GuiConfigEntries;
import cpw.mods.fml.client.config.GuiConfigEntries.CategoryEntry;
import cpw.mods.fml.client.config.IConfigElement;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
public class TechRebornConfigGui extends GuiConfig{
public TechRebornConfigGui(GuiScreen top)
{
import java.util.ArrayList;
import java.util.List;
public class TechRebornConfigGui extends GuiConfig {
public TechRebornConfigGui(GuiScreen top) {
super(top, getConfigCategories(), "TechReborn", false, false,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config
.toString()));
}
private static List<IConfigElement> getConfigCategories()
{
private static List<IConfigElement> getConfigCategories() {
List<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(new DummyConfigElement.DummyCategoryElement("General",
"tr.configgui.category.trGeneral", TRGeneral.class));
@ -37,35 +35,31 @@ public class TechRebornConfigGui extends GuiConfig{
public static class TRGeneral extends CategoryEntry {
public TRGeneral(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
public TRGeneral(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) {
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen()
{
protected GuiScreen buildChildScreen() {
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(Configuration.CATEGORY_GENERAL)))
.getChildElements(), this.owningScreen.modID,
Configuration.CATEGORY_GENERAL,
this.configElement.requiresWorldRestart()|| this.owningScreen.allRequireWorldRestart,
this.configElement.requiresMcRestart()|| this.owningScreen.allRequireMcRestart,
this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString()));
}
}
// World
public static class TRWORLD extends CategoryEntry {
public TRWORLD(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
public TRWORLD(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) {
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen()
{
protected GuiScreen buildChildScreen() {
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(ConfigTechReborn.CATEGORY_WORLD)))
@ -82,14 +76,12 @@ public class TechRebornConfigGui extends GuiConfig{
// Power
public static class TRPOWER extends CategoryEntry {
public TRPOWER(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
public TRPOWER(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) {
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen()
{
protected GuiScreen buildChildScreen() {
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(ConfigTechReborn.CATEGORY_POWER)))
@ -106,14 +98,12 @@ public class TechRebornConfigGui extends GuiConfig{
// Crafting
public static class TRCRAFTING extends CategoryEntry {
public TRCRAFTING(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
public TRCRAFTING(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) {
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen()
{
protected GuiScreen buildChildScreen() {
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(ConfigTechReborn.CATEGORY_CRAFTING)))

View file

@ -1,34 +1,30 @@
package techreborn.config;
import cpw.mods.fml.client.IModGuiFactory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import cpw.mods.fml.client.IModGuiFactory;
public class TechRebornGUIFactory implements IModGuiFactory{
public class TechRebornGUIFactory implements IModGuiFactory {
@Override
public void initialize(Minecraft minecraftInstance)
{
public void initialize(Minecraft minecraftInstance) {
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass()
{
public Class<? extends GuiScreen> mainConfigGuiClass() {
return TechRebornConfigGui.class;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
{
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(
RuntimeOptionCategoryElement element)
{
RuntimeOptionCategoryElement element) {
return null;
}

View file

@ -1,5 +1,6 @@
package techreborn.init;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
@ -10,13 +11,8 @@ import techreborn.itemblocks.ItemBlockOre;
import techreborn.itemblocks.ItemBlockQuantumChest;
import techreborn.itemblocks.ItemBlockQuantumTank;
import techreborn.itemblocks.ItemBlockStorage;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileQuantumChest;
import techreborn.tiles.TileQuantumTank;
import techreborn.tiles.TileRollingMachine;
import techreborn.tiles.TileThermalGenerator;
import techreborn.tiles.*;
import techreborn.util.LogHelper;
import cpw.mods.fml.common.registry.GameRegistry;
public class ModBlocks {
@ -29,8 +25,7 @@ public class ModBlocks {
public static Block ore;
public static Block storage;
public static void init()
{
public static void init() {
thermalGenerator = new BlockThermalGenerator().setBlockName("techreborn.thermalGenerator").setBlockTextureName("techreborn:ThermalGenerator_other").setCreativeTab(TechRebornCreativeTab.instance);
GameRegistry.registerBlock(thermalGenerator, "techreborn.thermalGenerator");
GameRegistry.registerTileEntity(TileThermalGenerator.class, "TileThermalGenerator");
@ -63,37 +58,36 @@ public class ModBlocks {
registerOreDict();
}
public static void registerOreDict()
{
OreDictionary.registerOre("oreGalena", new ItemStack(ore,1,0));
OreDictionary.registerOre("oreIridium", new ItemStack(ore,1,1));
OreDictionary.registerOre("oreRuby", new ItemStack(ore,1,2));
OreDictionary.registerOre("oreSapphire", new ItemStack(ore,1,3));
OreDictionary.registerOre("oreBauxite", new ItemStack(ore,1,4));
OreDictionary.registerOre("orePyrite", new ItemStack(ore,1,5));
OreDictionary.registerOre("oreCinnabar", new ItemStack(ore,1,6));
OreDictionary.registerOre("oreSphalerite", new ItemStack(ore,1,7));
OreDictionary.registerOre("oreTungston", new ItemStack(ore,1,8));
OreDictionary.registerOre("oreSheldonite", new ItemStack(ore,1,9));
OreDictionary.registerOre("oreOlivine", new ItemStack(ore,1,10));
OreDictionary.registerOre("oreSodalite", new ItemStack(ore,1,11));
public static void registerOreDict() {
OreDictionary.registerOre("oreGalena", new ItemStack(ore, 1, 0));
OreDictionary.registerOre("oreIridium", new ItemStack(ore, 1, 1));
OreDictionary.registerOre("oreRuby", new ItemStack(ore, 1, 2));
OreDictionary.registerOre("oreSapphire", new ItemStack(ore, 1, 3));
OreDictionary.registerOre("oreBauxite", new ItemStack(ore, 1, 4));
OreDictionary.registerOre("orePyrite", new ItemStack(ore, 1, 5));
OreDictionary.registerOre("oreCinnabar", new ItemStack(ore, 1, 6));
OreDictionary.registerOre("oreSphalerite", new ItemStack(ore, 1, 7));
OreDictionary.registerOre("oreTungston", new ItemStack(ore, 1, 8));
OreDictionary.registerOre("oreSheldonite", new ItemStack(ore, 1, 9));
OreDictionary.registerOre("oreOlivine", new ItemStack(ore, 1, 10));
OreDictionary.registerOre("oreSodalite", new ItemStack(ore, 1, 11));
OreDictionary.registerOre("blockSilver", new ItemStack(storage,1,0));
OreDictionary.registerOre("blockAluminium", new ItemStack(storage,1,1));
OreDictionary.registerOre("blockTitanium", new ItemStack(storage,1,2));
OreDictionary.registerOre("blockSapphire", new ItemStack(storage,1,3));
OreDictionary.registerOre("blockRuby", new ItemStack(storage,1,4));
OreDictionary.registerOre("blockGreenSapphire", new ItemStack(storage,1,5));
OreDictionary.registerOre("blockChrome", new ItemStack(storage,1,6));
OreDictionary.registerOre("blockElectrum", new ItemStack(storage,1,7));
OreDictionary.registerOre("blockTungsten", new ItemStack(storage,1,8));
OreDictionary.registerOre("blockLead", new ItemStack(storage,1,9));
OreDictionary.registerOre("blockZinc", new ItemStack(storage,1,10));
OreDictionary.registerOre("blockBrass", new ItemStack(storage,1,11));
OreDictionary.registerOre("blockSteel", new ItemStack(storage,1,12));
OreDictionary.registerOre("blockPlatinum", new ItemStack(storage,1,13));
OreDictionary.registerOre("blockNickel", new ItemStack(storage,1,14));
OreDictionary.registerOre("blockInvar", new ItemStack(storage,1,15));
OreDictionary.registerOre("blockSilver", new ItemStack(storage, 1, 0));
OreDictionary.registerOre("blockAluminium", new ItemStack(storage, 1, 1));
OreDictionary.registerOre("blockTitanium", new ItemStack(storage, 1, 2));
OreDictionary.registerOre("blockSapphire", new ItemStack(storage, 1, 3));
OreDictionary.registerOre("blockRuby", new ItemStack(storage, 1, 4));
OreDictionary.registerOre("blockGreenSapphire", new ItemStack(storage, 1, 5));
OreDictionary.registerOre("blockChrome", new ItemStack(storage, 1, 6));
OreDictionary.registerOre("blockElectrum", new ItemStack(storage, 1, 7));
OreDictionary.registerOre("blockTungsten", new ItemStack(storage, 1, 8));
OreDictionary.registerOre("blockLead", new ItemStack(storage, 1, 9));
OreDictionary.registerOre("blockZinc", new ItemStack(storage, 1, 10));
OreDictionary.registerOre("blockBrass", new ItemStack(storage, 1, 11));
OreDictionary.registerOre("blockSteel", new ItemStack(storage, 1, 12));
OreDictionary.registerOre("blockPlatinum", new ItemStack(storage, 1, 13));
OreDictionary.registerOre("blockNickel", new ItemStack(storage, 1, 14));
OreDictionary.registerOre("blockInvar", new ItemStack(storage, 1, 15));
}

View file

@ -1,11 +1,10 @@
package techreborn.init;
import org.apache.logging.log4j.message.MapMessage.MapFormat;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import techreborn.items.ItemDusts;
import techreborn.items.ItemGems;
@ -18,7 +17,6 @@ import techreborn.items.tools.ItemAdvancedDrill;
import techreborn.items.tools.ItemOmniTool;
import techreborn.items.tools.ItemRockCutter;
import techreborn.util.LogHelper;
import cpw.mods.fml.common.registry.GameRegistry;
public class ModItems {
@ -33,8 +31,7 @@ public class ModItems {
public static Item omniTool;
public static Item advancedDrill;
public static void init()
{
public static void init() {
dusts = new ItemDusts();
GameRegistry.registerItem(dusts, "dust");
ingots = new ItemIngots();
@ -61,98 +58,97 @@ public class ModItems {
registerOreDict();
}
public static void registerOreDict()
{
public static void registerOreDict() {
//Dusts
OreDictionary.registerOre("dustAlmandine", new ItemStack(dusts,1,0));
OreDictionary.registerOre("dustAluminium", new ItemStack(dusts,1,1));
OreDictionary.registerOre("dustAndradite", new ItemStack(dusts,1,2));
OreDictionary.registerOre("dustBasalt", new ItemStack(dusts,1,4));
OreDictionary.registerOre("dustBauxite", new ItemStack(dusts,1,5));
OreDictionary.registerOre("dustBrass", new ItemStack(dusts,1,6));
OreDictionary.registerOre("dustBronze", new ItemStack(dusts,1,7));
OreDictionary.registerOre("dustCalcite", new ItemStack(dusts,1,8));
OreDictionary.registerOre("dustCharcoal", new ItemStack(dusts,1,9));
OreDictionary.registerOre("dustChrome", new ItemStack(dusts,1,10));
OreDictionary.registerOre("dustCinnabar", new ItemStack(dusts,1,11));
OreDictionary.registerOre("dustClay", new ItemStack(dusts,1,12));
OreDictionary.registerOre("dustCoal", new ItemStack(dusts,1,13));
OreDictionary.registerOre("dustCopper", new ItemStack(dusts,1,14));
OreDictionary.registerOre("dustDiamond", new ItemStack(dusts,1,16));
OreDictionary.registerOre("dustElectrum", new ItemStack(dusts,1,17));
OreDictionary.registerOre("dustEmerald", new ItemStack(dusts,1,18));
OreDictionary.registerOre("dustEnderEye", new ItemStack(dusts,1,19));
OreDictionary.registerOre("dustEnderPearl", new ItemStack(dusts,1,20));
OreDictionary.registerOre("dustEndstone", new ItemStack(dusts,1,21));
OreDictionary.registerOre("dustFlint", new ItemStack(dusts,1,22));
OreDictionary.registerOre("dustGold", new ItemStack(dusts,1,23));
OreDictionary.registerOre("dustGreenSapphire", new ItemStack(dusts,1,24));
OreDictionary.registerOre("dustGrossular", new ItemStack(dusts,1,25));
OreDictionary.registerOre("dustInvar", new ItemStack(dusts,1,26));
OreDictionary.registerOre("dustIron", new ItemStack(dusts,1,27));
OreDictionary.registerOre("dustLazurite", new ItemStack(dusts,1,28));
OreDictionary.registerOre("dustLead", new ItemStack(dusts,1,29));
OreDictionary.registerOre("dustMagnesium", new ItemStack(dusts,1,30));
OreDictionary.registerOre("dustMarble", new ItemStack(dusts,31));
OreDictionary.registerOre("dustNetherrack", new ItemStack(dusts,32));
OreDictionary.registerOre("dustNickel", new ItemStack(dusts,1,33));
OreDictionary.registerOre("dustObsidian", new ItemStack(dusts,1,34));
OreDictionary.registerOre("dustOlivine", new ItemStack(dusts,1,35));
OreDictionary.registerOre("dustPhosphor", new ItemStack(dusts,1,36));
OreDictionary.registerOre("dustPlatinum", new ItemStack(dusts,1,37));
OreDictionary.registerOre("dustPyrite", new ItemStack(dusts,1,38));
OreDictionary.registerOre("dustPyrope", new ItemStack(dusts,1,39));
OreDictionary.registerOre("dustRedGarnet", new ItemStack(dusts,1,40));
OreDictionary.registerOre("dustRedrock", new ItemStack(dusts,1,41));
OreDictionary.registerOre("dustRuby", new ItemStack(dusts,1,42));
OreDictionary.registerOre("dustSaltpeter", new ItemStack(dusts,1,43));
OreDictionary.registerOre("dustSapphire", new ItemStack(dusts,1,44));
OreDictionary.registerOre("dustSilver", new ItemStack(dusts,1,45));
OreDictionary.registerOre("dustSodalite", new ItemStack(dusts,1,46));
OreDictionary.registerOre("dustSpessartine", new ItemStack(dusts,1,47));
OreDictionary.registerOre("dustSphalerite", new ItemStack(dusts,1,48));
OreDictionary.registerOre("dustSteel", new ItemStack(dusts,1,49));
OreDictionary.registerOre("dustSulfur", new ItemStack(dusts,1,50));
OreDictionary.registerOre("dustTin", new ItemStack(dusts,1,51));
OreDictionary.registerOre("dustTitanium", new ItemStack(dusts,1,52));
OreDictionary.registerOre("dustTungsten", new ItemStack(dusts,1,53));
OreDictionary.registerOre("dustUranium", new ItemStack(dusts,1,54));
OreDictionary.registerOre("dustUvarovite", new ItemStack(dusts,1,55));
OreDictionary.registerOre("dustYellowGarnet", new ItemStack(dusts,1,56));
OreDictionary.registerOre("dustZinc", new ItemStack(dusts,1,57));
OreDictionary.registerOre("ingotCobalt", new ItemStack(dusts,1,58));
OreDictionary.registerOre("ingotArdite", new ItemStack(ingots,1,59));
OreDictionary.registerOre("ingotManyullyn", new ItemStack(ingots,1,60));
OreDictionary.registerOre("ingotAluminumBrass", new ItemStack(ingots,1,61));
OreDictionary.registerOre("ingotAlumite", new ItemStack(ingots,1,62));
OreDictionary.registerOre("dustAlmandine", new ItemStack(dusts, 1, 0));
OreDictionary.registerOre("dustAluminium", new ItemStack(dusts, 1, 1));
OreDictionary.registerOre("dustAndradite", new ItemStack(dusts, 1, 2));
OreDictionary.registerOre("dustBasalt", new ItemStack(dusts, 1, 4));
OreDictionary.registerOre("dustBauxite", new ItemStack(dusts, 1, 5));
OreDictionary.registerOre("dustBrass", new ItemStack(dusts, 1, 6));
OreDictionary.registerOre("dustBronze", new ItemStack(dusts, 1, 7));
OreDictionary.registerOre("dustCalcite", new ItemStack(dusts, 1, 8));
OreDictionary.registerOre("dustCharcoal", new ItemStack(dusts, 1, 9));
OreDictionary.registerOre("dustChrome", new ItemStack(dusts, 1, 10));
OreDictionary.registerOre("dustCinnabar", new ItemStack(dusts, 1, 11));
OreDictionary.registerOre("dustClay", new ItemStack(dusts, 1, 12));
OreDictionary.registerOre("dustCoal", new ItemStack(dusts, 1, 13));
OreDictionary.registerOre("dustCopper", new ItemStack(dusts, 1, 14));
OreDictionary.registerOre("dustDiamond", new ItemStack(dusts, 1, 16));
OreDictionary.registerOre("dustElectrum", new ItemStack(dusts, 1, 17));
OreDictionary.registerOre("dustEmerald", new ItemStack(dusts, 1, 18));
OreDictionary.registerOre("dustEnderEye", new ItemStack(dusts, 1, 19));
OreDictionary.registerOre("dustEnderPearl", new ItemStack(dusts, 1, 20));
OreDictionary.registerOre("dustEndstone", new ItemStack(dusts, 1, 21));
OreDictionary.registerOre("dustFlint", new ItemStack(dusts, 1, 22));
OreDictionary.registerOre("dustGold", new ItemStack(dusts, 1, 23));
OreDictionary.registerOre("dustGreenSapphire", new ItemStack(dusts, 1, 24));
OreDictionary.registerOre("dustGrossular", new ItemStack(dusts, 1, 25));
OreDictionary.registerOre("dustInvar", new ItemStack(dusts, 1, 26));
OreDictionary.registerOre("dustIron", new ItemStack(dusts, 1, 27));
OreDictionary.registerOre("dustLazurite", new ItemStack(dusts, 1, 28));
OreDictionary.registerOre("dustLead", new ItemStack(dusts, 1, 29));
OreDictionary.registerOre("dustMagnesium", new ItemStack(dusts, 1, 30));
OreDictionary.registerOre("dustMarble", new ItemStack(dusts, 31));
OreDictionary.registerOre("dustNetherrack", new ItemStack(dusts, 32));
OreDictionary.registerOre("dustNickel", new ItemStack(dusts, 1, 33));
OreDictionary.registerOre("dustObsidian", new ItemStack(dusts, 1, 34));
OreDictionary.registerOre("dustOlivine", new ItemStack(dusts, 1, 35));
OreDictionary.registerOre("dustPhosphor", new ItemStack(dusts, 1, 36));
OreDictionary.registerOre("dustPlatinum", new ItemStack(dusts, 1, 37));
OreDictionary.registerOre("dustPyrite", new ItemStack(dusts, 1, 38));
OreDictionary.registerOre("dustPyrope", new ItemStack(dusts, 1, 39));
OreDictionary.registerOre("dustRedGarnet", new ItemStack(dusts, 1, 40));
OreDictionary.registerOre("dustRedrock", new ItemStack(dusts, 1, 41));
OreDictionary.registerOre("dustRuby", new ItemStack(dusts, 1, 42));
OreDictionary.registerOre("dustSaltpeter", new ItemStack(dusts, 1, 43));
OreDictionary.registerOre("dustSapphire", new ItemStack(dusts, 1, 44));
OreDictionary.registerOre("dustSilver", new ItemStack(dusts, 1, 45));
OreDictionary.registerOre("dustSodalite", new ItemStack(dusts, 1, 46));
OreDictionary.registerOre("dustSpessartine", new ItemStack(dusts, 1, 47));
OreDictionary.registerOre("dustSphalerite", new ItemStack(dusts, 1, 48));
OreDictionary.registerOre("dustSteel", new ItemStack(dusts, 1, 49));
OreDictionary.registerOre("dustSulfur", new ItemStack(dusts, 1, 50));
OreDictionary.registerOre("dustTin", new ItemStack(dusts, 1, 51));
OreDictionary.registerOre("dustTitanium", new ItemStack(dusts, 1, 52));
OreDictionary.registerOre("dustTungsten", new ItemStack(dusts, 1, 53));
OreDictionary.registerOre("dustUranium", new ItemStack(dusts, 1, 54));
OreDictionary.registerOre("dustUvarovite", new ItemStack(dusts, 1, 55));
OreDictionary.registerOre("dustYellowGarnet", new ItemStack(dusts, 1, 56));
OreDictionary.registerOre("dustZinc", new ItemStack(dusts, 1, 57));
OreDictionary.registerOre("ingotCobalt", new ItemStack(dusts, 1, 58));
OreDictionary.registerOre("ingotArdite", new ItemStack(ingots, 1, 59));
OreDictionary.registerOre("ingotManyullyn", new ItemStack(ingots, 1, 60));
OreDictionary.registerOre("ingotAluminumBrass", new ItemStack(ingots, 1, 61));
OreDictionary.registerOre("ingotAlumite", new ItemStack(ingots, 1, 62));
//Ingots
OreDictionary.registerOre("ingotIridium", new ItemStack(ingots,1,3));
OreDictionary.registerOre("ingotSilver", new ItemStack(ingots,1,4));
OreDictionary.registerOre("ingotAluminium", new ItemStack(ingots,1,5));
OreDictionary.registerOre("ingotTitanium", new ItemStack(ingots,1,6));
OreDictionary.registerOre("ingotChrome", new ItemStack(ingots,1,7));
OreDictionary.registerOre("ingotElectrum", new ItemStack(ingots,1,8));
OreDictionary.registerOre("ingotTungsten", new ItemStack(ingots,1,9));
OreDictionary.registerOre("ingotLead", new ItemStack(ingots,1,10));
OreDictionary.registerOre("ingotZinc", new ItemStack(ingots,1,11));
OreDictionary.registerOre("ingotBrass", new ItemStack(ingots,1,12));
OreDictionary.registerOre("ingotSteel", new ItemStack(ingots,1,13));
OreDictionary.registerOre("ingotPlatinum", new ItemStack(ingots,1,14));
OreDictionary.registerOre("ingotNickel", new ItemStack(ingots,1,15));
OreDictionary.registerOre("ingotInvar", new ItemStack(ingots,1,16));
OreDictionary.registerOre("ingotCobalt", new ItemStack(ingots,1,17));
OreDictionary.registerOre("ingotArdite", new ItemStack(ingots,1,18));
OreDictionary.registerOre("ingotManyullyn", new ItemStack(ingots,1,19));
OreDictionary.registerOre("ingotAluminumBrass", new ItemStack(ingots,1,20));
OreDictionary.registerOre("ingotAlumite", new ItemStack(ingots,1,21));
OreDictionary.registerOre("ingotIridium", new ItemStack(ingots, 1, 3));
OreDictionary.registerOre("ingotSilver", new ItemStack(ingots, 1, 4));
OreDictionary.registerOre("ingotAluminium", new ItemStack(ingots, 1, 5));
OreDictionary.registerOre("ingotTitanium", new ItemStack(ingots, 1, 6));
OreDictionary.registerOre("ingotChrome", new ItemStack(ingots, 1, 7));
OreDictionary.registerOre("ingotElectrum", new ItemStack(ingots, 1, 8));
OreDictionary.registerOre("ingotTungsten", new ItemStack(ingots, 1, 9));
OreDictionary.registerOre("ingotLead", new ItemStack(ingots, 1, 10));
OreDictionary.registerOre("ingotZinc", new ItemStack(ingots, 1, 11));
OreDictionary.registerOre("ingotBrass", new ItemStack(ingots, 1, 12));
OreDictionary.registerOre("ingotSteel", new ItemStack(ingots, 1, 13));
OreDictionary.registerOre("ingotPlatinum", new ItemStack(ingots, 1, 14));
OreDictionary.registerOre("ingotNickel", new ItemStack(ingots, 1, 15));
OreDictionary.registerOre("ingotInvar", new ItemStack(ingots, 1, 16));
OreDictionary.registerOre("ingotCobalt", new ItemStack(ingots, 1, 17));
OreDictionary.registerOre("ingotArdite", new ItemStack(ingots, 1, 18));
OreDictionary.registerOre("ingotManyullyn", new ItemStack(ingots, 1, 19));
OreDictionary.registerOre("ingotAluminumBrass", new ItemStack(ingots, 1, 20));
OreDictionary.registerOre("ingotAlumite", new ItemStack(ingots, 1, 21));
//Gems
OreDictionary.registerOre("gemRuby", new ItemStack(gems,1,0));
OreDictionary.registerOre("gemSapphire", new ItemStack(gems,1,1));
OreDictionary.registerOre("gemGreenSapphire", new ItemStack(gems,1,2));
OreDictionary.registerOre("gemOlivine", new ItemStack(gems,1,3));
OreDictionary.registerOre("gemRedGarnet", new ItemStack(gems,1,4));
OreDictionary.registerOre("gemYellowGarnet", new ItemStack(gems,1,5));
OreDictionary.registerOre("gemRuby", new ItemStack(gems, 1, 0));
OreDictionary.registerOre("gemSapphire", new ItemStack(gems, 1, 1));
OreDictionary.registerOre("gemGreenSapphire", new ItemStack(gems, 1, 2));
OreDictionary.registerOre("gemOlivine", new ItemStack(gems, 1, 3));
OreDictionary.registerOre("gemRedGarnet", new ItemStack(gems, 1, 4));
OreDictionary.registerOre("gemYellowGarnet", new ItemStack(gems, 1, 5));
}

View file

@ -16,8 +16,7 @@ import techreborn.util.RecipeRemover;
public class ModRecipes {
public static ConfigTechReborn config;
public static void init()
{
public static void init() {
removeIc2Recipes();
addShaplessRecipes();
addShappedRecipes();
@ -25,49 +24,47 @@ public class ModRecipes {
addMachineRecipes();
}
public static void removeIc2Recipes()
{
if(config.ExpensiveMacerator);
public static void removeIc2Recipes() {
if (config.ExpensiveMacerator) ;
RecipeRemover.removeAnyRecipe(IC2Items.getItem("macerator"));
if(config.ExpensiveDrill);
if (config.ExpensiveDrill) ;
RecipeRemover.removeAnyRecipe(IC2Items.getItem("miningDrill"));
if(config.ExpensiveDiamondDrill);
if (config.ExpensiveDiamondDrill) ;
RecipeRemover.removeAnyRecipe(IC2Items.getItem("diamondDrill"));
if(config.ExpensiveSolar);
if (config.ExpensiveSolar) ;
RecipeRemover.removeAnyRecipe(IC2Items.getItem("solarPanel"));
LogHelper.info("IC2 Recipes Removed");
}
public static void addShappedRecipes()
{
public static void addShappedRecipes() {
//IC2 Recipes
if(config.ExpensiveMacerator);
if (config.ExpensiveMacerator) ;
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("macerator"),
new Object[]{"FDF", "DMD", "FCF",
'F', Items.flint,
'D', Items.diamond,
'M', IC2Items.getItem("machine"),
'C', IC2Items.getItem("electronicCircuit")});
if(config.ExpensiveDrill);
if (config.ExpensiveDrill) ;
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("miningDrill"),
new Object[]{" S ", "SCS", "SBS",
'S', "ingotSteel",
'B', IC2Items.getItem("reBattery"),
'C', IC2Items.getItem("electronicCircuit")});
if(config.ExpensiveDiamondDrill);
if (config.ExpensiveDiamondDrill) ;
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("diamondDrill"),
new Object[]{" D ", "DBD", "TCT",
'D', "gemDiamond",
'T', "ingotTitanium",
'B', IC2Items.getItem("miningDrill"),
'C', IC2Items.getItem("advancedCircuit")});
if(config.ExpensiveSolar);
if (config.ExpensiveSolar) ;
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("solarPanel"),
new Object[]{"PPP", "SZS", "CGC",
'P', "paneGlass",
'S', new ItemStack(ModItems.parts,1,1),
'S', new ItemStack(ModItems.parts, 1, 1),
'Z', IC2Items.getItem("carbonPlate"),
'G', IC2Items.getItem("generator"),
'C', IC2Items.getItem("electronicCircuit")});
@ -79,12 +76,12 @@ public class ModRecipes {
'C', IC2Items.getItem("electronicCircuit"),
'G', IC2Items.getItem("geothermalGenerator")});
//TechReborn Recipes
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,4,6),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 4, 6),
new Object[]{"EEE", "EAE", "EEE",
'E', "gemEmerald",
'A', IC2Items.getItem("electronicCircuit")});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,7),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 7),
new Object[]{"AGA", "RPB", "ASA",
'A', "ingotAluminium",
'G', "dyeGreen",
@ -93,154 +90,151 @@ public class ModRecipes {
'B', "dyeBlue",
'S', Items.glowstone_dust,});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,4,8),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 4, 8),
new Object[]{"DSD", "S S", "DSD",
'D', "dustDiamond",
'S', "ingotSteel"});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,16,13),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 16, 13),
new Object[]{"CSC", "SCS", "CSC",
'S', "ingotSteel",
'C', IC2Items.getItem("electronicCircuit")});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,2,14),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 2, 14),
new Object[]{"TST", "SBS", "TST",
'S', "ingotSteel",
'T', "ingotTungsten",
'B', "blockSteel"});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,15),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 15),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotAluminium",
'M', new ItemStack(ModItems.parts,1,13)});
'M', new ItemStack(ModItems.parts, 1, 13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,16),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 16),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotBronze",
'M', new ItemStack(ModItems.parts,1,13)});
'M', new ItemStack(ModItems.parts, 1, 13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,17),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 17),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotSteel",
'M', new ItemStack(ModItems.parts,1,13)});
'M', new ItemStack(ModItems.parts, 1, 13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,18),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 18),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotTitanium",
'M', new ItemStack(ModItems.parts,1,13)});
'M', new ItemStack(ModItems.parts, 1, 13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,19),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 19),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotBrass",
'M', new ItemStack(ModItems.parts,1,13)});
'M', new ItemStack(ModItems.parts, 1, 13)});
//Storage Blocks
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,0),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 0),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotSilver",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,1),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 1),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotAluminium",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,2),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 2),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotTitanium",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,3),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 3),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemSapphire",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,4),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 4),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemRuby",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,5),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 5),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemGreenSapphire",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,6),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 6),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotChrome",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,7),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 7),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotElectrum",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,8),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 8),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotTungsten",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,9),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 9),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotLead",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,10),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 10),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotZinc",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,11),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 11),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotBrass",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,12),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 12),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotSteel",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,13),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 13),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotPlatinum",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,14),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 14),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotNickel",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,15),
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 15),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotInvar",});
LogHelper.info("Shapped Recipes Added");
}
public static void addShaplessRecipes()
{
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,4), "blockSilver");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,5), "blockAluminium");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,6), "blockTitanium");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.gems,9,1), "blockSapphire");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.gems,9,0), "blockRuby");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.gems,9,2), "blockGreenSapphire");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,7), "blockChrome");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,8), "blockElectrum");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,9), "blockTungsten");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,10), "blockLead");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,11), "blockZinc");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,12), "blockBrass");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,13), "blockSteel");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,14), "blockPlatinum");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,15), "blockNickel");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots,9,16), "blockInvar");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.rockCutter,1,27), Items.apple);
public static void addShaplessRecipes() {
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 4), "blockSilver");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 5), "blockAluminium");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 6), "blockTitanium");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.gems, 9, 1), "blockSapphire");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.gems, 9, 0), "blockRuby");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.gems, 9, 2), "blockGreenSapphire");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 7), "blockChrome");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 8), "blockElectrum");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 9), "blockTungsten");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 10), "blockLead");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 11), "blockZinc");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 12), "blockBrass");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 13), "blockSteel");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 14), "blockPlatinum");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 15), "blockNickel");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.ingots, 9, 16), "blockInvar");
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.rockCutter, 1, 27), Items.apple);
LogHelper.info("Shapless Recipes Added");
}
public static void addSmeltingRecipes()
{
GameRegistry.addSmelting(new ItemStack(ModItems.dusts,1 ,27), new ItemStack(Items.iron_ingot), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts,1 ,23), new ItemStack(Items.gold_ingot), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts,1 ,14), IC2Items.getItem("copperIngot"), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts,1 ,51), IC2Items.getItem("tinIngot"), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts,1 ,7), IC2Items.getItem("bronzeIngot"), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts,1 ,29), IC2Items.getItem("leadIngot"), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts,1 ,45), IC2Items.getItem("silverIngot"), 1F);
public static void addSmeltingRecipes() {
GameRegistry.addSmelting(new ItemStack(ModItems.dusts, 1, 27), new ItemStack(Items.iron_ingot), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts, 1, 23), new ItemStack(Items.gold_ingot), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts, 1, 14), IC2Items.getItem("copperIngot"), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts, 1, 51), IC2Items.getItem("tinIngot"), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts, 1, 7), IC2Items.getItem("bronzeIngot"), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts, 1, 29), IC2Items.getItem("leadIngot"), 1F);
GameRegistry.addSmelting(new ItemStack(ModItems.dusts, 1, 45), IC2Items.getItem("silverIngot"), 1F);
LogHelper.info("Smelting Recipes Added");
}
public static void addMachineRecipes()
{
public static void addMachineRecipes() {
TechRebornAPI.registerCentrifugeRecipe(new CentrifugeRecipie(Items.apple, 4, Items.beef, Items.baked_potato, null, null, 120, 4));
TechRebornAPI.registerCentrifugeRecipe(new CentrifugeRecipie(Items.nether_star, 1, Items.diamond, Items.emerald, Items.bed, Items.cake, 500, 8));
TechRebornAPI.registerRollingMachineRecipe(new RollingMachineRecipie(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.furnace), 4));

View file

@ -5,10 +5,9 @@ import net.minecraft.item.ItemMultiTexture;
import techreborn.blocks.BlockOre;
import techreborn.init.ModBlocks;
public class ItemBlockOre extends ItemMultiTexture{
public class ItemBlockOre extends ItemMultiTexture {
public ItemBlockOre(Block block)
{
public ItemBlockOre(Block block) {
super(ModBlocks.ore, ModBlocks.ore, BlockOre.types);
}

View file

@ -1,7 +1,7 @@
package techreborn.itemblocks;
import java.util.List;
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.item.ItemBlock;
@ -9,8 +9,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import techreborn.init.ModBlocks;
import techreborn.tiles.TileQuantumChest;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
public class ItemBlockQuantumChest extends ItemBlock {
@ -19,7 +19,7 @@ public class ItemBlockQuantumChest extends ItemBlock {
super(p_i45328_1_);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
@ -31,8 +31,7 @@ public class ItemBlockQuantumChest extends ItemBlock {
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
{
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
if (!world.setBlock(x, y, z, ModBlocks.quantumChest, metadata, 3)) {
return false;
}

View file

@ -15,8 +15,7 @@ public class ItemBlockQuantumTank extends ItemBlock {
}
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
{
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
if (!world.setBlock(x, y, z, ModBlocks.quantumTank, metadata, 3)) {
return false;
}

View file

@ -2,14 +2,12 @@ package techreborn.itemblocks;
import net.minecraft.block.Block;
import net.minecraft.item.ItemMultiTexture;
import techreborn.blocks.BlockOre;
import techreborn.blocks.BlockStorage;
import techreborn.init.ModBlocks;
public class ItemBlockStorage extends ItemMultiTexture{
public class ItemBlockStorage extends ItemMultiTexture {
public ItemBlockStorage(Block block)
{
public ItemBlockStorage(Block block) {
super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types);
}

View file

@ -1,7 +1,5 @@
package techreborn.items;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
@ -10,23 +8,23 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTab;
public class ItemDusts extends ItemTR
{
import java.util.List;
public class ItemDusts extends ItemTR {
public static final String[] types = new String[]
{
"Almandine", "Aluminium", "Andradite", "Ashes", "Basalt", "Bauxite", "Brass", "Bronze",
"Calcite","Charcoal", "Chrome", "Cinnabar", "Clay", "Coal", "Copper", "DarkAshes", "Diamond",
"Electrum","Emerald", "EnderEye", "EnderPearl", "Endstone", "Flint", "Gold", "GreenSapphire", "Grossular",
"Calcite", "Charcoal", "Chrome", "Cinnabar", "Clay", "Coal", "Copper", "DarkAshes", "Diamond",
"Electrum", "Emerald", "EnderEye", "EnderPearl", "Endstone", "Flint", "Gold", "GreenSapphire", "Grossular",
"Invar", "Iron", "Lazurite", "Lead", "Magnesium", "Marble", "Netherrack", "Nickel", "Obsidian",
"Olivine","Phosphor", "Platinum", "Pyrite", "Pyrope", "RedGarnet", "Redrock", "Ruby", "Saltpeter", "Sapphire",
"Olivine", "Phosphor", "Platinum", "Pyrite", "Pyrope", "RedGarnet", "Redrock", "Ruby", "Saltpeter", "Sapphire",
"Silver", "Sodalite", "Spessartine", "Sphalerite", "Steel", "Sulfur", "Tin", "Titanium", "Tungsten", "Uranium",
"Uvarovite", "YellowGarnet", "Zinc", "Cobalt", "Ardite" , "Manyullyn" , "AlBrass", "Alumite"
"Uvarovite", "YellowGarnet", "Zinc", "Cobalt", "Ardite", "Manyullyn", "AlBrass", "Alumite"
};
private IIcon[] textures;
public ItemDusts()
{
public ItemDusts() {
setUnlocalizedName("techreborn.dust");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTab.instance);
@ -34,22 +32,18 @@ public class ItemDusts extends ItemTR
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "dust/" +types[i]+ "Dust");
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "dust/" + types[i] + "Dust");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta)
{
if (meta < 0 || meta >= textures.length)
{
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
@ -58,11 +52,9 @@ public class ItemDusts extends ItemTR
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
if (meta < 0 || meta >= types.length) {
meta = 0;
}
@ -70,17 +62,14 @@ public class ItemDusts extends ItemTR
}
// Adds Dusts SubItems To Creative Tab
public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; ++meta)
{
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; ++meta) {
list.add(new ItemStack(item, 1, meta));
}
}
@Override
public EnumRarity getRarity(ItemStack itemstack)
{
public EnumRarity getRarity(ItemStack itemstack) {
return EnumRarity.uncommon;
}

View file

@ -1,7 +1,5 @@
package techreborn.items;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
@ -10,7 +8,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTab;
public class ItemGems extends Item{
import java.util.List;
public class ItemGems extends Item {
public static final String[] types = new String[]
{
"Ruby", "Sapphire", "GreenSapphire", "Olivine", "RedGarnet", "YellowGarnet"
@ -18,8 +18,7 @@ public class ItemGems extends Item{
private IIcon[] textures;
public ItemGems()
{
public ItemGems() {
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.gem");
setHasSubtypes(true);
@ -27,22 +26,18 @@ public class ItemGems extends Item{
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "gem/" +types[i]);
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "gem/" + types[i]);
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta)
{
if (meta < 0 || meta >= textures.length)
{
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
@ -51,11 +46,9 @@ public class ItemGems extends Item{
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
if (meta < 0 || meta >= types.length) {
meta = 0;
}
@ -63,17 +56,14 @@ public class ItemGems extends Item{
}
// Adds Dusts SubItems To Creative Tab
public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; ++meta)
{
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; ++meta) {
list.add(new ItemStack(item, 1, meta));
}
}
@Override
public EnumRarity getRarity(ItemStack itemstack)
{
public EnumRarity getRarity(ItemStack itemstack) {
return EnumRarity.uncommon;
}

View file

@ -1,7 +1,5 @@
package techreborn.items;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
@ -10,18 +8,19 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTab;
public class ItemIngots extends Item{
import java.util.List;
public class ItemIngots extends Item {
public static final String[] types = new String[]
{
"IridiumAlloy", "HotTungstenSteel", "TungstenSteel", "Iridium", "Silver", "Aluminium", "Titanium", "Chrome",
"Electrum","Tungsten", "Lead", "Zinc", "Brass", "Steel", "Platinum", "Nickel", "Invar",
"Cobalt", "Ardite" , "Manyullyn" , "AlBrass", "Alumite"
"Electrum", "Tungsten", "Lead", "Zinc", "Brass", "Steel", "Platinum", "Nickel", "Invar",
"Cobalt", "Ardite", "Manyullyn", "AlBrass", "Alumite"
};
private IIcon[] textures;
public ItemIngots()
{
public ItemIngots() {
setCreativeTab(TechRebornCreativeTab.instance);
setHasSubtypes(true);
setUnlocalizedName("techreborn.ingot");
@ -29,22 +28,18 @@ public class ItemIngots extends Item{
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "ingot/" +types[i]+ "Ingot");
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "ingot/" + types[i] + "Ingot");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta)
{
if (meta < 0 || meta >= textures.length)
{
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
@ -53,11 +48,9 @@ public class ItemIngots extends Item{
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
if (meta < 0 || meta >= types.length) {
meta = 0;
}
@ -65,17 +58,14 @@ public class ItemIngots extends Item{
}
// Adds Dusts SubItems To Creative Tab
public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; ++meta)
{
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; ++meta) {
list.add(new ItemStack(item, 1, meta));
}
}
@Override
public EnumRarity getRarity(ItemStack itemstack)
{
public EnumRarity getRarity(ItemStack itemstack) {
return EnumRarity.uncommon;
}

View file

@ -1,7 +1,5 @@
package techreborn.items;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity;
@ -10,18 +8,20 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTab;
public class ItemParts extends Item{
import java.util.List;
public class ItemParts extends Item {
public static final String[] types = new String[]
{
"LazuriteChunk", "SiliconPlate", "MagnaliumPlate", "EnergeyFlowCircuit", "DataControlCircuit", "SuperConductor",
"DataStorageCircuit", "ComputerMonitor", "DiamondSawBlade","DiamondGrinder", "KanthalHeatingCoil",
"DataStorageCircuit", "ComputerMonitor", "DiamondSawBlade", "DiamondGrinder", "KanthalHeatingCoil",
"NichromeHeatingCoil", "CupronickelHeatingCoil", "MachineParts", "WolframiamGrinder",
"AluminiumMachineHull", "BronzeMachineHull","SteelMachineHull","TitaniumMachineHull", "BrassMachineHull"
"AluminiumMachineHull", "BronzeMachineHull", "SteelMachineHull", "TitaniumMachineHull", "BrassMachineHull"
};
private IIcon[] textures;
public ItemParts()
{
public ItemParts() {
setCreativeTab(TechRebornCreativeTab.instance);
setHasSubtypes(true);
setUnlocalizedName("techreborn.part");
@ -29,22 +29,18 @@ public class ItemParts extends Item{
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "part/" +types[i]);
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "part/" + types[i]);
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta)
{
if (meta < 0 || meta >= textures.length)
{
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
@ -53,11 +49,9 @@ public class ItemParts extends Item{
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
if (meta < 0 || meta >= types.length) {
meta = 0;
}
@ -65,17 +59,14 @@ public class ItemParts extends Item{
}
// Adds Dusts SubItems To Creative Tab
public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; ++meta)
{
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; ++meta) {
list.add(new ItemStack(item, 1, meta));
}
}
@Override
public EnumRarity getRarity(ItemStack itemstack)
{
public EnumRarity getRarity(ItemStack itemstack) {
return EnumRarity.rare;
}

View file

@ -5,17 +5,15 @@ import net.minecraft.item.Item;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
public class ItemTR extends Item{
public class ItemTR extends Item {
public ItemTR()
{
public ItemTR() {
setNoRepair();
setCreativeTab(TechRebornCreativeTab.instance);
}
@Override
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon(ModInfo.MOD_ID + ":" + getUnlocalizedName().toLowerCase().substring(5));
}

View file

@ -1,11 +1,9 @@
package techreborn.items.armor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@ -19,10 +17,10 @@ import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemGravityChest extends ItemArmor implements IElectricItem, ISpecialArmor{
import java.util.List;
public class ItemGravityChest extends ItemArmor implements IElectricItem, ISpecialArmor {
public static int maxCharge = ConfigTechReborn.GravityCharge;
public int tier = 3;
@ -30,8 +28,7 @@ public class ItemGravityChest extends ItemArmor implements IElectricItem, ISpeci
public double transferLimit = 1000;
public int energyPerDamage = 100;
public ItemGravityChest(ArmorMaterial material, int par3, int par4)
{
public ItemGravityChest(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.gravity");
@ -42,50 +39,43 @@ public class ItemGravityChest extends ItemArmor implements IElectricItem, ISpeci
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "items/gravity");
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "techreborn:" + "textures/models/gravity.png";
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this)
{
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack)
{
if (world.isRemote);
if (ElectricItem.manager.canUse(stack, cost))
{
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
if (world.isRemote) ;
if (ElectricItem.manager.canUse(stack, cost)) {
player.capabilities.allowFlying = true;
if (player.fallDistance > 0.0F)
player.fallDistance = 0;
if(player.capabilities.allowFlying == true & !player.onGround)
if (player.capabilities.allowFlying == true & !player.onGround)
ElectricItem.manager.discharge(stack, cost, tier, false, true, false);
if(!ElectricItem.manager.canUse(stack, cost))
if (!ElectricItem.manager.canUse(stack, cost))
player.capabilities.allowFlying = false;
}
@ -93,51 +83,42 @@ public class ItemGravityChest extends ItemArmor implements IElectricItem, ISpeci
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack)
{
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
public double getTransferLimit(ItemStack itemStack) {
return transferLimit;
}
public int getEnergyPerDamage()
{
public int getEnergyPerDamage() {
return energyPerDamage;
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
{
if (source.isUnblockable())
{
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
} else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
@ -148,10 +129,8 @@ public class ItemGravityChest extends ItemArmor implements IElectricItem, ISpeci
}
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot)
{
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage())
{
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
} else {
return 0;
@ -159,18 +138,15 @@ public class ItemGravityChest extends ItemArmor implements IElectricItem, ISpeci
}
@Override
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot)
{
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
}
public double getDamageAbsorptionRatio()
{
public double getDamageAbsorptionRatio() {
return 1.1000000000000001D;
}
private double getBaseAbsorptionRatio()
{
private double getBaseAbsorptionRatio() {
return 0.14999999999999999D;
}

View file

@ -1,28 +1,27 @@
package techreborn.items.armor;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
public class ItemLapotronPack extends ItemArmor implements IElectricItem{
import java.util.List;
public class ItemLapotronPack extends ItemArmor implements IElectricItem {
public static final int maxCharge = ConfigTechReborn.LapotronPackCharge;
public static final int tier = ConfigTechReborn.LapotronPackTier;
public double transferLimit = 100000;
public ItemLapotronPack(ArmorMaterial armormaterial, int par2, int par3)
{
public ItemLapotronPack(ArmorMaterial armormaterial, int par2, int par3) {
super(armormaterial, par2, par3);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.lapotronpack");
@ -31,68 +30,57 @@ public class ItemLapotronPack extends ItemArmor implements IElectricItem{
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lapotronicEnergyOrb");
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "techreborn:" + "textures/models/lapotronpack.png";
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this)
{
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack)
{
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
public double getTransferLimit(ItemStack itemStack) {
return transferLimit;
}

View file

@ -1,7 +1,7 @@
package techreborn.items.armor;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -12,17 +12,16 @@ import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemLithiumBatpack extends ItemArmor implements IElectricItem{
import java.util.List;
public class ItemLithiumBatpack extends ItemArmor implements IElectricItem {
public static final int maxCharge = ConfigTechReborn.LithiumBatpackCharge;
public static final int tier = ConfigTechReborn.LithiumBatpackTier;
public double transferLimit = 10000;
public ItemLithiumBatpack(ArmorMaterial armorMaterial, int par3, int par4)
{
public ItemLithiumBatpack(ArmorMaterial armorMaterial, int par3, int par4) {
super(armorMaterial, par3, par4);
setMaxStackSize(1);
setUnlocalizedName("techreborn.lithiumbatpack");
@ -31,68 +30,57 @@ public class ItemLithiumBatpack extends ItemArmor implements IElectricItem{
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lithiumBatpack");
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "techreborn:" + "textures/models/lithiumbatpack.png";
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this)
{
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack)
{
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
public double getTransferLimit(ItemStack itemStack) {
return transferLimit;
}

View file

@ -1,11 +1,9 @@
package techreborn.items.tools;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import mcp.mobius.waila.api.impl.ConfigHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@ -13,26 +11,24 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.util.TorchHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemAdvancedDrill extends ItemPickaxe implements IElectricItem{
import java.util.List;
public class ItemAdvancedDrill extends ItemPickaxe implements IElectricItem {
public static final int maxCharge = ConfigTechReborn.AdvancedDrillCharge;
public int cost = 250;;
public int cost = 250;
;
public static final int tier = ConfigTechReborn.AdvancedDrillTier;
public double transferLimit = 100;
public ItemAdvancedDrill()
{
public ItemAdvancedDrill() {
super(ToolMaterial.EMERALD);
efficiencyOnProperMaterial = 20F;
setCreativeTab(TechRebornCreativeTab.instance);
@ -43,31 +39,26 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IElectricItem{
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/advancedDrill");
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this)
{
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving)
{
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@ -79,13 +70,11 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IElectricItem{
@Override
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
if (!ElectricItem.manager.canUse(stack, cost)) {
return 4.0F;
}
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F)
{
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
} else {
return super.getDigSpeed(stack, block, meta);
@ -93,14 +82,12 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IElectricItem{
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1)
{
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
return true;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset)
{
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}

View file

@ -1,14 +1,9 @@
package techreborn.items.tools;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.util.TorchHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@ -16,22 +11,24 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.util.TorchHelper;
public class ItemOmniTool extends ItemPickaxe implements IElectricItem{
import java.util.List;
public class ItemOmniTool extends ItemPickaxe implements IElectricItem {
public static final int maxCharge = ConfigTechReborn.OmniToolCharge;
public static final int tier = ConfigTechReborn.OmniToolTier;
public int cost = 100;
public int hitCost = 125;
public ItemOmniTool(ToolMaterial toolMaterial)
{
public ItemOmniTool(ToolMaterial toolMaterial) {
super(toolMaterial);
efficiencyOnProperMaterial = 13F;
setCreativeTab(TechRebornCreativeTab.instance);
@ -42,51 +39,42 @@ public class ItemOmniTool extends ItemPickaxe implements IElectricItem{
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/omnitool");
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true,false);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this)
{
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving)
{
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack)
{
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, Block block, int meta)
{
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 5.0F;
}
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F)
{
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
} else {
return super.getDigSpeed(stack, block, meta);
@ -94,60 +82,50 @@ public class ItemOmniTool extends ItemPickaxe implements IElectricItem{
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker)
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F);
}
return false;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset)
{
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
@Override
public boolean isRepairable()
{
public boolean isRepairable() {
return false;
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack)
{
public int getTier(ItemStack itemStack) {
return 2;
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
public double getTransferLimit(ItemStack itemStack) {
return 200;
}

View file

@ -1,7 +1,7 @@
package techreborn.items.tools;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.block.Block;
@ -16,17 +16,16 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemRockCutter extends ItemPickaxe implements IElectricItem{
import java.util.List;
public class ItemRockCutter extends ItemPickaxe implements IElectricItem {
public static final int maxCharge = ConfigTechReborn.RockCutterCharge;
public int cost = 500;
public static final int tier = ConfigTechReborn.RockCutterTier;
public ItemRockCutter(ToolMaterial toolMaterial)
{
public ItemRockCutter(ToolMaterial toolMaterial) {
super(toolMaterial);
setUnlocalizedName("techreborn.rockcutter");
setCreativeTab(TechRebornCreativeTab.instance);
@ -37,79 +36,66 @@ public class ItemRockCutter extends ItemPickaxe implements IElectricItem{
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/rockcutter");
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this)
{
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack)
{
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_pickaxe.canHarvestBlock(block, stack);
}
@Override
public boolean isRepairable()
{
public boolean isRepairable() {
return false;
}
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
par1ItemStack.addEnchantment(Enchantment.silkTouch, 1);
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack)
{
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
public double getTransferLimit(ItemStack itemStack) {
return 300;
}

View file

@ -1,7 +1,6 @@
package techreborn.lib;
public class ModInfo
{
public class ModInfo {
public static final String MOD_NAME = "TechReborn";
public static final String MOD_ID = "techreborn";
public static final String MOD_VERSION = "@MODVERSION@";

View file

@ -1,20 +1,19 @@
package techreborn.packets;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
import java.util.EnumMap;
import java.util.logging.Logger;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.Packet;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.FMLEmbeddedChannel;
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec;
import cpw.mods.fml.common.network.FMLOutboundHandler;
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.Packet;
import net.minecraft.world.World;
import java.io.IOException;
import java.util.EnumMap;
import java.util.logging.Logger;
public class PacketHandler extends FMLIndexedMessageToMessageCodec<SimplePacket> {
private static EnumMap<Side, FMLEmbeddedChannel> channels;

View file

@ -1,9 +1,7 @@
package techreborn.packets;
import com.google.common.base.Charsets;
import io.netty.buffer.ByteBuf;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@ -11,7 +9,7 @@ import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import com.google.common.base.Charsets;
import java.io.IOException;
public abstract class SimplePacket {
protected EntityPlayer player;

View file

@ -38,35 +38,35 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
public void updateEntity() {
super.updateEntity();
energy.updateEntity();
if(!worldObj.isRemote){
if(isRunning){
if(ItemUtils.isItemEqual(currentRecipe.getInputItem(), getStackInSlot(0), true, true)){
if(!hasTakenCells){
if(getStackInSlot(1) != null && getStackInSlot(1) != null && getStackInSlot(1).getUnlocalizedName().equals("ic2.itemFluidCell")){
if(getStackInSlot(1).stackSize >= currentRecipe.getCells()){
if (!worldObj.isRemote) {
if (isRunning) {
if (ItemUtils.isItemEqual(currentRecipe.getInputItem(), getStackInSlot(0), true, true)) {
if (!hasTakenCells) {
if (getStackInSlot(1) != null && getStackInSlot(1) != null && getStackInSlot(1).getUnlocalizedName().equals("ic2.itemFluidCell")) {
if (getStackInSlot(1).stackSize >= currentRecipe.getCells()) {
decrStackSize(1, currentRecipe.getCells());
hasTakenCells = true;
}
}
}
if(hasTakenCells && hasTakenItem){
if(tickTime == currentRecipe.getTickTime()) {
if(areAnyOutputsFull()){
if (hasTakenCells && hasTakenItem) {
if (tickTime == currentRecipe.getTickTime()) {
if (areAnyOutputsFull()) {
return;
}
if(areOutputsEmpty()){
if (areOutputsEmpty()) {
setOutput(1, currentRecipe.getOutput1());
setOutput(2, currentRecipe.getOutput2());
setOutput(3, currentRecipe.getOutput3());
setOutput(4, currentRecipe.getOutput4());
} else if(areOutputsEqual()){
if(currentRecipe.getOutput1() != null)
} else if (areOutputsEqual()) {
if (currentRecipe.getOutput1() != null)
increacseItemStack(1, 1);
if(currentRecipe.getOutput2() != null)
if (currentRecipe.getOutput2() != null)
increacseItemStack(2, 1);
if(currentRecipe.getOutput3() != null)
if (currentRecipe.getOutput3() != null)
increacseItemStack(3, 1);
if(currentRecipe.getOutput4() != null)
if (currentRecipe.getOutput4() != null)
increacseItemStack(4, 1);
}
tickTime = 0;
@ -76,10 +76,10 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
syncWithAll();
return;
}
if(energy.canUseEnergy(euTick)){
if(getStackInSlot(0) != null && ItemUtils.isItemEqual(getStackInSlot(0), currentRecipe.getInputItem(), true, true)){
if(energy.useEnergy(5)){
tickTime ++;
if (energy.canUseEnergy(euTick)) {
if (getStackInSlot(0) != null && ItemUtils.isItemEqual(getStackInSlot(0), currentRecipe.getInputItem(), true, true)) {
if (energy.useEnergy(5)) {
tickTime++;
}
}
}
@ -87,17 +87,17 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
}
} else {
//sets a new recipe
if(getStackInSlot(0) != null && currentRecipe == null){
for(CentrifugeRecipie recipie: TechRebornAPI.centrifugeRecipies){
if(ItemUtils.isItemEqual(recipie.getInputItem(), getStackInSlot(0), true, true)){
if (getStackInSlot(0) != null && currentRecipe == null) {
for (CentrifugeRecipie recipie : TechRebornAPI.centrifugeRecipies) {
if (ItemUtils.isItemEqual(recipie.getInputItem(), getStackInSlot(0), true, true)) {
currentRecipe = new CentrifugeRecipie(recipie);
}
}
}
if(!isRunning && currentRecipe != null){
if(areOutputsEqual() || !areAnyOutputsFull()){
if(getStackInSlot(0) != null && currentRecipe.getInputItem().stackSize <= getStackInSlot(0).stackSize){
if(energy.canUseEnergy(euTick)){
if (!isRunning && currentRecipe != null) {
if (areOutputsEqual() || !areAnyOutputsFull()) {
if (getStackInSlot(0) != null && currentRecipe.getInputItem().stackSize <= getStackInSlot(0).stackSize) {
if (energy.canUseEnergy(euTick)) {
decrStackSize(0, currentRecipe.getInputItem().stackSize);
hasTakenItem = true;
tickTime = 0;
@ -111,59 +111,59 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
}
}
public boolean areOutputsEqual(){
if(currentRecipe == null){
public boolean areOutputsEqual() {
if (currentRecipe == null) {
return false;
}
boolean boo = false;
if(currentRecipe.getOutput1() != null && ItemUtils.isItemEqual(getOutputItemStack(1), currentRecipe.getOutput1(), false, true)){
if (currentRecipe.getOutput1() != null && ItemUtils.isItemEqual(getOutputItemStack(1), currentRecipe.getOutput1(), false, true)) {
boo = true;
}
if(currentRecipe.getOutput2() != null && ItemUtils.isItemEqual(getOutputItemStack(2), currentRecipe.getOutput2(), false, true)){
if (currentRecipe.getOutput2() != null && ItemUtils.isItemEqual(getOutputItemStack(2), currentRecipe.getOutput2(), false, true)) {
boo = true;
}
if(currentRecipe.getOutput3() != null && ItemUtils.isItemEqual(getOutputItemStack(3), currentRecipe.getOutput3(), false, true)){
if (currentRecipe.getOutput3() != null && ItemUtils.isItemEqual(getOutputItemStack(3), currentRecipe.getOutput3(), false, true)) {
boo = true;
}
if(currentRecipe.getOutput4() != null && ItemUtils.isItemEqual(getOutputItemStack(4), currentRecipe.getOutput4(), false, true)){
if (currentRecipe.getOutput4() != null && ItemUtils.isItemEqual(getOutputItemStack(4), currentRecipe.getOutput4(), false, true)) {
boo = true;
}
return boo;
}
public boolean areOutputsEmpty(){
public boolean areOutputsEmpty() {
return getOutputItemStack(1) == null && getOutputItemStack(2) == null && getOutputItemStack(3) == null && getOutputItemStack(4) == null;
}
public boolean areAnyOutputsFull(){
if(currentRecipe.getOutput1() != null && getOutputItemStack(1) != null && getOutputItemStack(1).stackSize + currentRecipe.getOutput1().stackSize > currentRecipe.getOutput1().getMaxStackSize()){
public boolean areAnyOutputsFull() {
if (currentRecipe.getOutput1() != null && getOutputItemStack(1) != null && getOutputItemStack(1).stackSize + currentRecipe.getOutput1().stackSize > currentRecipe.getOutput1().getMaxStackSize()) {
return true;
}
if(currentRecipe.getOutput2() != null && getOutputItemStack(2) != null && getOutputItemStack(2).stackSize + currentRecipe.getOutput2().stackSize > currentRecipe.getOutput1().getMaxStackSize()){
if (currentRecipe.getOutput2() != null && getOutputItemStack(2) != null && getOutputItemStack(2).stackSize + currentRecipe.getOutput2().stackSize > currentRecipe.getOutput1().getMaxStackSize()) {
return true;
}
if(currentRecipe.getOutput3() != null && getOutputItemStack(3) != null && getOutputItemStack(3).stackSize + currentRecipe.getOutput3().stackSize > currentRecipe.getOutput1().getMaxStackSize()){
if (currentRecipe.getOutput3() != null && getOutputItemStack(3) != null && getOutputItemStack(3).stackSize + currentRecipe.getOutput3().stackSize > currentRecipe.getOutput1().getMaxStackSize()) {
return true;
}
if(currentRecipe.getOutput4() != null && getOutputItemStack(4) != null && getOutputItemStack(4).stackSize + currentRecipe.getOutput4().stackSize > currentRecipe.getOutput1().getMaxStackSize()){
if (currentRecipe.getOutput4() != null && getOutputItemStack(4) != null && getOutputItemStack(4).stackSize + currentRecipe.getOutput4().stackSize > currentRecipe.getOutput1().getMaxStackSize()) {
return true;
}
return false;
}
public ItemStack getOutputItemStack(int slot){
public ItemStack getOutputItemStack(int slot) {
return getStackInSlot(slot + 1);
}
public void increacseItemStack(int slot, int amount) {
if(getOutputItemStack(slot) == null){
if (getOutputItemStack(slot) == null) {
return;
}
decrStackSize(slot + 1, -amount);
}
public void setOutput(int slot, ItemStack stack){
if(stack == null){
public void setOutput(int slot, ItemStack stack) {
if (stack == null) {
return;
}
setInventorySlotContents(slot + 1, stack);
@ -174,8 +174,8 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
super.readFromNBT(tagCompound);
inventory.readFromNBT(tagCompound);
String recipeName = tagCompound.getString("recipe");
for(CentrifugeRecipie recipie : TechRebornAPI.centrifugeRecipies){
if(recipie.getInputItem().getUnlocalizedName().equals(recipeName)){
for (CentrifugeRecipie recipie : TechRebornAPI.centrifugeRecipies) {
if (recipie.getInputItem().getUnlocalizedName().equals(recipeName)) {
currentRecipe = new CentrifugeRecipie(recipie);
}
}
@ -193,7 +193,7 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
}
public void writeUpdateToNBT(NBTTagCompound tagCompound) {
if(currentRecipe != null){
if (currentRecipe != null) {
tagCompound.setString("recipe", currentRecipe.getInputItem().getUnlocalizedName());
} else {
tagCompound.setString("recipe", "none");
@ -297,7 +297,8 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
}
@Override
public void setFacing(short facing) {}
public void setFacing(short facing) {
}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
@ -317,11 +318,11 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
@Override
public int[] getAccessibleSlotsFromSide(int side) {
//Top
if(side == 1){
if (side == 1) {
return new int[]{0};
}
//Bottom
if(side == 0){
if (side == 0) {
return new int[]{1};
}
//Not bottom or top
@ -331,11 +332,11 @@ public class TileCentrifuge extends TileMachineBase implements IInventory, IWren
@Override
public boolean canInsertItem(int slot, ItemStack stack, int side) {
//Bottom
if(side == 0){
if (side == 0) {
return stack.getUnlocalizedName().equals("ic2.itemFluidCell");
}
//Not bottom or top
if(side >= 2){
if (side >= 2) {
return false;
}
return true;

View file

@ -15,7 +15,7 @@ import techreborn.util.ItemUtils;
import java.util.List;
public class TileQuantumChest extends TileMachineBase implements IInventory ,IWrenchable{
public class TileQuantumChest extends TileMachineBase implements IInventory, IWrenchable {
//Slot 0 = Input
//Slot 1 = Output
@ -27,7 +27,7 @@ public class TileQuantumChest extends TileMachineBase implements IInventory ,IWr
@Override
public void updateEntity() {
if(storedItem != null){
if (storedItem != null) {
ItemStack fakeStack = storedItem.copy();
fakeStack.stackSize = 1;
setInventorySlotContents(2, fakeStack);
@ -35,26 +35,26 @@ public class TileQuantumChest extends TileMachineBase implements IInventory ,IWr
setInventorySlotContents(2, null);
}
if(getStackInSlot(0) != null){
if(storedItem == null){
if (getStackInSlot(0) != null) {
if (storedItem == null) {
storedItem = getStackInSlot(0);
setInventorySlotContents(0, null);
} else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)){
if(storedItem.stackSize <=Integer.MAX_VALUE - getStackInSlot(0).stackSize){
} else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) {
if (storedItem.stackSize <= Integer.MAX_VALUE - getStackInSlot(0).stackSize) {
storedItem.stackSize += getStackInSlot(0).stackSize;
decrStackSize(0, getStackInSlot(0).stackSize);
}
}
}
if(storedItem != null && getStackInSlot(1) == null){
if (storedItem != null && getStackInSlot(1) == null) {
ItemStack itemStack = storedItem.copy();
itemStack.stackSize = itemStack.getMaxStackSize();
setInventorySlotContents(1, itemStack);
storedItem.stackSize -= itemStack.getMaxStackSize();
} else if(ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)){
} else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) {
int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).stackSize;
if(storedItem.stackSize >= wanted){
if (storedItem.stackSize >= wanted) {
decrStackSize(1, -wanted);
storedItem.stackSize -= wanted;
} else {
@ -89,13 +89,12 @@ public class TileQuantumChest extends TileMachineBase implements IInventory ,IWr
storedItem = null;
if (tagCompound.hasKey("storedStack"))
{
if (tagCompound.hasKey("storedStack")) {
storedItem = ItemStack.
loadItemStackFromNBT((NBTTagCompound)tagCompound.getTag("storedStack"));
loadItemStackFromNBT((NBTTagCompound) tagCompound.getTag("storedStack"));
}
if(storedItem != null){
if (storedItem != null) {
storedItem.stackSize = tagCompound.getInteger("storedQuantity");
}
}
@ -108,12 +107,10 @@ public class TileQuantumChest extends TileMachineBase implements IInventory ,IWr
public void writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
inventory.writeToNBT(tagCompound);
if (storedItem != null)
{
if (storedItem != null) {
tagCompound.setTag("storedStack", storedItem.writeToNBT(new NBTTagCompound()));
tagCompound.setInteger("storedQuantity", storedItem.stackSize);
}
else
} else
tagCompound.setInteger("storedQuantity", 0);
}
@ -220,11 +217,11 @@ public class TileQuantumChest extends TileMachineBase implements IInventory ,IWr
super.addWailaInfo(info);
int size = 0;
String name = "of nothing";
if(storedItem != null){
if (storedItem != null) {
name = storedItem.getDisplayName();
size += storedItem.stackSize;
}
if( getStackInSlot(1) != null){
if (getStackInSlot(1) != null) {
name = getStackInSlot(1).getDisplayName();
size += getStackInSlot(1).stackSize;
}

View file

@ -1,9 +1,6 @@
package techreborn.tiles;
import ic2.api.tile.IWrenchable;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@ -21,6 +18,8 @@ import techreborn.util.FluidUtils;
import techreborn.util.Inventory;
import techreborn.util.Tank;
import java.util.List;
public class TileQuantumTank extends TileMachineBase implements IFluidHandler, IInventory, IWrenchable {
public Tank tank = new Tank("TileQuantumTank", Integer.MAX_VALUE, this);
@ -66,9 +65,9 @@ public class TileQuantumTank extends TileMachineBase implements IFluidHandler, I
super.updateEntity();
FluidUtils.drainContainers(this, inventory, 0, 1);
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
if(tank.getFluidType() != null && getStackInSlot(2) == null){
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
} else if(tank.getFluidType() == null && getStackInSlot(2) != null){
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
setInventorySlotContents(2, null);
}
}
@ -206,7 +205,7 @@ public class TileQuantumTank extends TileMachineBase implements IFluidHandler, I
@Override
public void addWailaInfo(List<String> info) {
super.addWailaInfo(info);
if(tank.getFluid() != null){
if (tank.getFluid() != null) {
info.add(tank.getFluidAmount() + " of " + tank.getFluidType().getName());
} else {
info.add("Empty");

View file

@ -1,18 +1,14 @@
package techreborn.tiles;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import ic2.api.energy.prefab.BasicSink;
import ic2.api.tile.IWrenchable;
import techreborn.api.CentrifugeRecipie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.api.RollingMachineRecipie;
import techreborn.api.TechRebornAPI;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
public class TileRollingMachine extends TileMachineBase implements IWrenchable{
public class TileRollingMachine extends TileMachineBase implements IWrenchable {
public BasicSink energy;
public Inventory inventory = new Inventory(10, "TileRollingMachine", 64);
@ -23,14 +19,12 @@ public class TileRollingMachine extends TileMachineBase implements IWrenchable{
public int euTick = 5;
public TileRollingMachine()
{
public TileRollingMachine() {
energy = new BasicSink(this, 100000, 1);
}
@Override
public void updateEntity()
{
public void updateEntity() {
super.updateEntity();
energy.updateEntity();
}
@ -46,7 +40,8 @@ public class TileRollingMachine extends TileMachineBase implements IWrenchable{
}
@Override
public void setFacing(short facing) {}
public void setFacing(short facing) {
}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {

View file

@ -11,12 +11,7 @@ import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fluids.*;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.util.FluidUtils;
@ -45,7 +40,8 @@ public class TileThermalGenerator extends TileEntity implements IWrenchable, IFl
}
@Override
public void setFacing(short facing) {}
public void setFacing(short facing) {
}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
@ -130,13 +126,13 @@ public class TileThermalGenerator extends TileEntity implements IWrenchable, IFl
super.updateEntity();
FluidUtils.drainContainers(this, inventory, 0, 1);
energySource.updateEntity();
if(tank.getFluidAmount() > 0 && energySource.getCapacity() - energySource.getEnergyStored() >= euTick){
if (tank.getFluidAmount() > 0 && energySource.getCapacity() - energySource.getEnergyStored() >= euTick) {
tank.drain(1, true);
energySource.addEnergy(euTick);
}
if(tank.getFluidType() != null && getStackInSlot(2) == null){
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
} else if(tank.getFluidType() == null && getStackInSlot(2) != null){
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
setInventorySlotContents(2, null);
}
}

View file

@ -7,14 +7,12 @@ import net.minecraftforge.oredict.ShapelessOreRecipe;
public class CraftingHelper {
public static void addShapedOreRecipe(ItemStack outputItemStack, Object... objectInputs)
{
CraftingManager.getInstance().getRecipeList() .add(new ShapedOreRecipe(outputItemStack, objectInputs));
public static void addShapedOreRecipe(ItemStack outputItemStack, Object... objectInputs) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(outputItemStack, objectInputs));
}
public static void addShapelessOreRecipe(ItemStack outputItemStack, Object... objectInputs)
{
CraftingManager.getInstance().getRecipeList() .add(new ShapelessOreRecipe(outputItemStack, objectInputs));
public static void addShapelessOreRecipe(ItemStack outputItemStack, Object... objectInputs) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(outputItemStack, objectInputs));
}
}

View file

@ -1,54 +1,44 @@
package techreborn.util;
import org.apache.logging.log4j.Level;
import techreborn.lib.ModInfo;
import cpw.mods.fml.common.FMLLog;
import org.apache.logging.log4j.Level;
import techreborn.lib.ModInfo;
public class LogHelper {
public static void log(Level logLevel, Object object)
{
public static void log(Level logLevel, Object object) {
FMLLog.log(ModInfo.MOD_NAME, logLevel, String.valueOf(object));
}
public static void all(Object object)
{
public static void all(Object object) {
log(Level.ALL, object);
}
public static void debug(Object object)
{
public static void debug(Object object) {
log(Level.DEBUG, object);
}
public static void error(Object object)
{
public static void error(Object object) {
log(Level.ERROR, object);
}
public static void fatal(Object object)
{
public static void fatal(Object object) {
log(Level.FATAL, object);
}
public static void info(Object object)
{
public static void info(Object object) {
log(Level.INFO, object);
}
public static void off(Object object)
{
public static void off(Object object) {
log(Level.OFF, object);
}
public static void trace(Object object)
{
public static void trace(Object object) {
log(Level.TRACE, object);
}
public static void warn(Object object)
{
public static void warn(Object object) {
log(Level.WARN, object);
}

View file

@ -1,47 +1,38 @@
package techreborn.util;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
public class RecipeRemover
{
public static void removeShapedRecipes(List<ItemStack> removelist)
{
import java.util.List;
public class RecipeRemover {
public static void removeShapedRecipes(List<ItemStack> removelist) {
for (ItemStack stack : removelist)
removeShapedRecipe(stack);
}
public static void removeAnyRecipe(ItemStack resultItem)
{
public static void removeAnyRecipe(ItemStack resultItem) {
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (int i = 0; i < recipes.size(); i++)
{
for (int i = 0; i < recipes.size(); i++) {
IRecipe tmpRecipe = recipes.get(i);
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
{
if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) {
recipes.remove(i--);
}
}
}
public static void removeShapedRecipe(ItemStack resultItem)
{
public static void removeShapedRecipe(ItemStack resultItem) {
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (int i = 0; i < recipes.size(); i++)
{
for (int i = 0; i < recipes.size(); i++) {
IRecipe tmpRecipe = recipes.get(i);
if (tmpRecipe instanceof ShapedRecipes)
{
if (tmpRecipe instanceof ShapedRecipes) {
ShapedRecipes recipe = (ShapedRecipes) tmpRecipe;
ItemStack recipeResult = recipe.getRecipeOutput();
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
{
if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) {
recipes.remove(i++);
}
}

View file

@ -9,10 +9,8 @@ import net.minecraftforge.event.ForgeEventFactory;
public class TorchHelper {
public static boolean placeTorch(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset)
{
for (int i = 0; i < player.inventory.mainInventory.length; i++)
{
public static boolean placeTorch(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) continue;
Item item = torchStack.getItem();
@ -20,12 +18,10 @@ public class TorchHelper {
int oldMeta = torchStack.getItemDamage();
int oldSize = torchStack.stackSize;
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
if (player.capabilities.isCreativeMode)
{
if (player.capabilities.isCreativeMode) {
torchStack.setItemDamage(oldMeta);
torchStack.stackSize = oldSize;
} else if (torchStack.stackSize <= 0)
{
} else if (torchStack.stackSize <= 0) {
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
player.inventory.mainInventory[i] = null;
}

View file

@ -1,7 +1,6 @@
package techreborn.world;
import java.util.Random;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
@ -9,9 +8,10 @@ import net.minecraft.world.gen.feature.WorldGenMinable;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.util.LogHelper;
import cpw.mods.fml.common.IWorldGenerator;
public class TROreGen implements IWorldGenerator{
import java.util.Random;
public class TROreGen implements IWorldGenerator {
public static ConfigTechReborn config;
WorldGenMinable oreGalena;
@ -27,8 +27,7 @@ public class TROreGen implements IWorldGenerator{
WorldGenMinable oreOlivine;
WorldGenMinable oreSodalite;
public TROreGen()
{
public TROreGen() {
//World
oreGalena = new WorldGenMinable(ModBlocks.ore, 0, 8, Blocks.stone);
oreIridium = new WorldGenMinable(ModBlocks.ore, 1, 2, Blocks.stone);
@ -48,70 +47,53 @@ public class TROreGen implements IWorldGenerator{
}
@Override
public void generate(Random random, int xChunk, int zChunk, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
if(world.provider.isSurfaceWorld())
{
public void generate(Random random, int xChunk, int zChunk, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
if (world.provider.isSurfaceWorld()) {
generateUndergroundOres(random, xChunk * 16, zChunk * 16, world);
}
else if(world.provider.isHellWorld)
{
} else if (world.provider.isHellWorld) {
generateHellOres(random, xChunk * 16, zChunk * 16, world);
}
else
{
} else {
generateEndOres(random, xChunk * 16, zChunk * 16, world);
}
}
void generateUndergroundOres (Random random, int xChunk, int zChunk, World world)
{
void generateUndergroundOres(Random random, int xChunk, int zChunk, World world) {
int xPos, yPos, zPos;
if (config.GalenaOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.GalenaOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
oreGalena.generate(world, random, xPos, yPos, zPos);
}
}
if (config.IridiumOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.IridiumOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
oreIridium.generate(world, random, xPos, yPos, zPos);
}
}
if (config.RubyOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.RubyOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
oreRuby.generate(world, random, xPos, yPos, zPos);
}
}
if (config.SapphireOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.SapphireOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
oreSapphire.generate(world, random, xPos, yPos, zPos);
}
}
if (config.BauxiteOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.BauxiteOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
@ -120,33 +102,26 @@ public class TROreGen implements IWorldGenerator{
}
}
void generateHellOres (Random random, int xChunk, int zChunk, World world)
{
void generateHellOres(Random random, int xChunk, int zChunk, World world) {
int xPos, yPos, zPos;
if (config.PyriteOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.PyriteOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
orePyrite.generate(world, random, xPos, yPos, zPos);
}
}
if (config.CinnabarOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.CinnabarOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
oreCinnabar.generate(world, random, xPos, yPos, zPos);
}
}
if (config.SphaleriteOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.SphaleriteOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
@ -155,43 +130,34 @@ public class TROreGen implements IWorldGenerator{
}
}
void generateEndOres (Random random, int xChunk, int zChunk, World world)
{
void generateEndOres(Random random, int xChunk, int zChunk, World world) {
int xPos, yPos, zPos;
if (config.TungstonOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.TungstonOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
oreTungston.generate(world, random, xPos, yPos, zPos);
}
}
if (config.SheldoniteOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.SheldoniteOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
oreSheldonite.generate(world, random, xPos, yPos, zPos);
}
}
if (config.OlivineOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.OlivineOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);
oreOlivine.generate(world, random, xPos, yPos, zPos);
}
}
if (config.SodaliteOreTrue)
{
for (int i = 0; i <= 16; i++)
{
if (config.SodaliteOreTrue) {
for (int i = 0; i <= 16; i++) {
xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16);