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,46 +15,43 @@ 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 {
public static ConfigTechReborn config;
public static ConfigTechReborn config;
@Mod.Instance
public static Core INSTANCE;
@Mod.EventHandler
public void preinit(FMLPreInitializationEvent event) {
INSTANCE = this;
String path = event.getSuggestedConfigurationFile().getAbsolutePath()
.replace(ModInfo.MOD_ID, "TechReborn");
INSTANCE = this;
String path = event.getSuggestedConfigurationFile().getAbsolutePath()
.replace(ModInfo.MOD_ID, "TechReborn");
config = ConfigTechReborn.initialize(new File(path));
LogHelper.info("PreInitialization Compleate");
config = ConfigTechReborn.initialize(new File(path));
LogHelper.info("PreInitialization Compleate");
}
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
//Register ModBlocks
ModBlocks.init();
//Register ModItems
ModItems.init();
// Recipes
ModRecipes.init();
//Compat
CompatManager.init(event);
// WorldGen
GameRegistry.registerWorldGenerator(new TROreGen(), 0);
//Register Gui Handler
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
//Register ModBlocks
ModBlocks.init();
//Register ModItems
ModItems.init();
// Recipes
ModRecipes.init();
//Compat
CompatManager.init(event);
// WorldGen
GameRegistry.registerWorldGenerator(new TROreGen(), 0);
//Register Gui Handler
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
//packets
PacketHandler.setChannels(NetworkRegistry.INSTANCE.newChannel(ModInfo.MOD_ID + "_packets", new PacketHandler()));
LogHelper.info("Initialization Compleate");
}
LogHelper.info("Initialization Compleate");
}
}

View file

@ -4,72 +4,72 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class CentrifugeRecipie {
ItemStack inputItem;
ItemStack output1, output2, output3, output4;
int tickTime;
int cells;
ItemStack inputItem;
ItemStack output1, output2, output3, output4;
int tickTime;
int cells;
public CentrifugeRecipie(ItemStack inputItem, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int cells) {
this.inputItem = inputItem;
this.output1 = output1;
this.output2 = output2;
this.output3 = output3;
this.output4 = output4;
this.tickTime = tickTime;
this.cells = cells;
}
public CentrifugeRecipie(ItemStack inputItem, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int cells) {
this.inputItem = inputItem;
this.output1 = output1;
this.output2 = output2;
this.output3 = output3;
this.output4 = output4;
this.tickTime = tickTime;
this.cells = cells;
}
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)
this.output1 = new ItemStack(output1);
if(output2!= null)
this.output2 = new ItemStack(output2);
if(output3!= null)
this.output3 = new ItemStack(output3);
if(output4!= null)
this.output4 = new ItemStack(output4);
this.tickTime = tickTime;
this.cells = cells;
}
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)
this.output1 = new ItemStack(output1);
if (output2 != null)
this.output2 = new ItemStack(output2);
if (output3 != null)
this.output3 = new ItemStack(output3);
if (output4 != null)
this.output4 = new ItemStack(output4);
this.tickTime = tickTime;
this.cells = cells;
}
public CentrifugeRecipie(CentrifugeRecipie centrifugeRecipie){
this.inputItem = centrifugeRecipie.getInputItem();
this.output1 = centrifugeRecipie.getOutput1();
this.output2 = centrifugeRecipie.getOutput2();
this.output3 = centrifugeRecipie.getOutput3();
this.output4 = centrifugeRecipie.getOutput4();
this.tickTime = centrifugeRecipie.getTickTime();
this.cells = centrifugeRecipie.getCells();
}
public CentrifugeRecipie(CentrifugeRecipie centrifugeRecipie) {
this.inputItem = centrifugeRecipie.getInputItem();
this.output1 = centrifugeRecipie.getOutput1();
this.output2 = centrifugeRecipie.getOutput2();
this.output3 = centrifugeRecipie.getOutput3();
this.output4 = centrifugeRecipie.getOutput4();
this.tickTime = centrifugeRecipie.getTickTime();
this.cells = centrifugeRecipie.getCells();
}
public ItemStack getInputItem() {
return inputItem;
}
public ItemStack getInputItem() {
return inputItem;
}
public ItemStack getOutput1() {
return output1;
}
public ItemStack getOutput1() {
return output1;
}
public ItemStack getOutput2() {
return output2;
}
public ItemStack getOutput2() {
return output2;
}
public ItemStack getOutput3() {
return output3;
}
public ItemStack getOutput3() {
return output3;
}
public ItemStack getOutput4() {
return output4;
}
public ItemStack getOutput4() {
return output4;
}
public int getTickTime() {
return tickTime;
}
public int getTickTime() {
return tickTime;
}
public int getCells() {
return cells;
}
public int getCells() {
return cells;
}
}

View file

@ -4,121 +4,116 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class RollingMachineRecipie {
ItemStack inputItem1, inputItem2, inputItem3, inputItem4 ,inputItem5, inputItem6,
inputItem7, inputItem8, inputItem9;
ItemStack output1;
int tickTime;
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)
{
this.inputItem1 = inputItem1;
this.inputItem2 = inputItem2;
this.inputItem3 = inputItem3;
this.inputItem4 = inputItem4;
this.inputItem5 = inputItem5;
this.inputItem6 = inputItem6;
this.inputItem7 = inputItem7;
this.inputItem8 = inputItem8;
this.inputItem9 = inputItem9;
this.output1 = output1;
this.tickTime = tickTime;
}
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)
this.inputItem1 = new ItemStack(inputItem1, inputAmount);
if(inputItem2 != null)
this.inputItem2 = new ItemStack(inputItem2, inputAmount);
if(inputItem3 != null)
this.inputItem3 = new ItemStack(inputItem3, inputAmount);
if(inputItem4 != null)
this.inputItem4 = new ItemStack(inputItem4, inputAmount);
if(inputItem5 != null)
this.inputItem5 = new ItemStack(inputItem5, inputAmount);
if(inputItem6 != null)
this.inputItem6 = new ItemStack(inputItem6, inputAmount);
if(inputItem7 != null)
this.inputItem7 = new ItemStack(inputItem7, inputAmount);
if(inputItem8 != null)
this.inputItem8 = new ItemStack(inputItem8, inputAmount);
if(inputItem9 != null)
this.inputItem9 = new ItemStack(inputItem9, inputAmount);
public RollingMachineRecipie(ItemStack inputItem1, ItemStack inputItem2, ItemStack inputItem3, ItemStack inputItem4,
ItemStack inputItem5, ItemStack inputItem6, ItemStack inputItem7, ItemStack inputItem8, ItemStack inputItem9,
ItemStack output1, int tickTime) {
this.inputItem1 = inputItem1;
this.inputItem2 = inputItem2;
this.inputItem3 = inputItem3;
this.inputItem4 = inputItem4;
this.inputItem5 = inputItem5;
this.inputItem6 = inputItem6;
this.inputItem7 = inputItem7;
this.inputItem8 = inputItem8;
this.inputItem9 = inputItem9;
this.output1 = output1;
this.tickTime = tickTime;
this.output1 = new ItemStack(output1);
this.tickTime = tickTime;
;
}
}
public RollingMachineRecipie(RollingMachineRecipie rollingmachineRecipie)
{
this.inputItem1 = rollingmachineRecipie.getInputItem1();
this.inputItem2 = rollingmachineRecipie.getInputItem2();
this.inputItem3 = rollingmachineRecipie.getInputItem3();
this.inputItem4 = rollingmachineRecipie.getInputItem4();
this.inputItem5 = rollingmachineRecipie.getInputItem5();
this.inputItem6 = rollingmachineRecipie.getInputItem6();
this.inputItem7 = rollingmachineRecipie.getInputItem7();
this.inputItem8 = rollingmachineRecipie.getInputItem8();
this.inputItem9 = rollingmachineRecipie.getInputItem9();
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)
this.inputItem1 = new ItemStack(inputItem1, inputAmount);
if (inputItem2 != null)
this.inputItem2 = new ItemStack(inputItem2, inputAmount);
if (inputItem3 != null)
this.inputItem3 = new ItemStack(inputItem3, inputAmount);
if (inputItem4 != null)
this.inputItem4 = new ItemStack(inputItem4, inputAmount);
if (inputItem5 != null)
this.inputItem5 = new ItemStack(inputItem5, inputAmount);
if (inputItem6 != null)
this.inputItem6 = new ItemStack(inputItem6, inputAmount);
if (inputItem7 != null)
this.inputItem7 = new ItemStack(inputItem7, inputAmount);
if (inputItem8 != null)
this.inputItem8 = new ItemStack(inputItem8, inputAmount);
if (inputItem9 != null)
this.inputItem9 = new ItemStack(inputItem9, inputAmount);
this.output1 = rollingmachineRecipie.getOutput1();
this.tickTime = rollingmachineRecipie.getTickTime();
}
this.output1 = new ItemStack(output1);
this.tickTime = tickTime;
;
}
public ItemStack getInputItem1()
{
return inputItem1;
}
public ItemStack getInputItem2()
{
return inputItem2;
}
public ItemStack getInputItem3()
{
return inputItem3;
}
public ItemStack getInputItem4()
{
return inputItem4;
}
public ItemStack getInputItem5()
{
return inputItem5;
}
public ItemStack getInputItem6()
{
return inputItem6;
}
public ItemStack getInputItem7()
{
return inputItem7;
}
public ItemStack getInputItem8()
{
return inputItem8;
}
public ItemStack getInputItem9()
{
return inputItem9;
}
public RollingMachineRecipie(RollingMachineRecipie rollingmachineRecipie) {
this.inputItem1 = rollingmachineRecipie.getInputItem1();
this.inputItem2 = rollingmachineRecipie.getInputItem2();
this.inputItem3 = rollingmachineRecipie.getInputItem3();
this.inputItem4 = rollingmachineRecipie.getInputItem4();
this.inputItem5 = rollingmachineRecipie.getInputItem5();
this.inputItem6 = rollingmachineRecipie.getInputItem6();
this.inputItem7 = rollingmachineRecipie.getInputItem7();
this.inputItem8 = rollingmachineRecipie.getInputItem8();
this.inputItem9 = rollingmachineRecipie.getInputItem9();
public ItemStack getOutput1()
{
return output1;
}
this.output1 = rollingmachineRecipie.getOutput1();
this.tickTime = rollingmachineRecipie.getTickTime();
}
public ItemStack getInputItem1() {
return inputItem1;
}
public ItemStack getInputItem2() {
return inputItem2;
}
public ItemStack getInputItem3() {
return inputItem3;
}
public ItemStack getInputItem4() {
return inputItem4;
}
public ItemStack getInputItem5() {
return inputItem5;
}
public ItemStack getInputItem6() {
return inputItem6;
}
public ItemStack getInputItem7() {
return inputItem7;
}
public ItemStack getInputItem8() {
return inputItem8;
}
public ItemStack getInputItem9() {
return inputItem9;
}
public ItemStack getOutput1() {
return output1;
}
public int getTickTime() {
return tickTime;
}
public int getTickTime()
{
return tickTime;
}
}

View file

@ -1,53 +1,51 @@
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 ArrayList<CentrifugeRecipie> centrifugeRecipies = new ArrayList<CentrifugeRecipie>();
public static ArrayList<RollingMachineRecipie> rollingmachineRecipes = new ArrayList<RollingMachineRecipie>();
public static void registerCentrifugeRecipe(CentrifugeRecipie recipie){
boolean shouldAdd = 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) {
registeredItemRecipe.printStackTrace();
shouldAdd = false;
}
}
}
if(shouldAdd)
centrifugeRecipies.add(recipie);
}
public static void registerRollingMachineRecipe(RollingMachineRecipie recipie){
boolean shouldAdd = 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) {
registeredItemRecipe.printStackTrace();
shouldAdd = false;
}
}
}
if(shouldAdd)
rollingmachineRecipes.add(recipie);
}
public static void registerCentrifugeRecipe(CentrifugeRecipie recipie) {
boolean shouldAdd = 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) {
registeredItemRecipe.printStackTrace();
shouldAdd = false;
}
}
}
if (shouldAdd)
centrifugeRecipies.add(recipie);
}
public static void registerRollingMachineRecipe(RollingMachineRecipie recipie) {
boolean shouldAdd = 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) {
registeredItemRecipe.printStackTrace();
shouldAdd = false;
}
}
}
if (shouldAdd)
rollingmachineRecipes.add(recipie);
}
}
class RegisteredItemRecipe extends Exception
{
public RegisteredItemRecipe(String message)
{
super(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,76 +12,67 @@ 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{
public static final String[] types = new String[]
{
"Galena", "Iridium", "Ruby", "Sapphire", "Bauxite", "Pyrite", "Cinnabar", "Sphalerite",
"Tungston","Sheldonite", "Olivine", "Sodalite"
};
private IIcon[] textures;
public BlockOre(Material material)
{
super(material);
setBlockName("techreborn.ore");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(1f);
}
@Override
public Item getItemDropped(int meta, Random random, int fortune)
{
return Item.getItemFromBlock(this);
}
import java.util.List;
import java.util.Random;
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; meta++)
{
list.add(new ItemStack(item, 1, meta));
}
}
public class BlockOre extends Block {
@Override
public int damageDropped(int metaData)
{
//TODO RubyOre Returns Rubys
return metaData;
}
public static final String[] types = new String[]
{
"Galena", "Iridium", "Ruby", "Sapphire", "Bauxite", "Pyrite", "Cinnabar", "Sphalerite",
"Tungston", "Sheldonite", "Olivine", "Sodalite"
};
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
this.textures = new IIcon[types.length];
private IIcon[] textures;
for (int i = 0; i < types.length; i++)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "ore/ore"+types[i]);
}
}
public BlockOre(Material material) {
super(material);
setBlockName("techreborn.ore");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(1f);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metaData)
{
metaData = MathHelper.clamp_int(metaData, 0, types.length - 1);
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return Item.getItemFromBlock(this);
}
if (ForgeDirection.getOrientation(side) == ForgeDirection.UP
|| ForgeDirection.getOrientation(side) == ForgeDirection.DOWN)
{
return textures[metaData];
} else {
return textures[metaData];
}
}
@Override
@SideOnly(Side.CLIENT)
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) {
//TODO RubyOre Returns Rubys
return metaData;
}
@Override
@SideOnly(Side.CLIENT)
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]);
}
}
@Override
@SideOnly(Side.CLIENT)
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) {
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,47 +9,47 @@ 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{
@SideOnly(Side.CLIENT)
public class BlockRollingMachine extends BlockContainer {
@SideOnly(Side.CLIENT)
private IIcon top;
@SideOnly(Side.CLIENT)
private IIcon other;
public BlockRollingMachine(Material material)
{
super(material.piston);
setCreativeTab(TechRebornCreativeTab.instance);
setBlockName("techreborn.rollingmachine");
public BlockRollingMachine(Material material) {
super(material.piston);
setCreativeTab(TechRebornCreativeTab.instance);
setBlockName("techreborn.rollingmachine");
setHardness(2f);
}
}
@Override
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())
player.openGui(Core.INSTANCE, GuiHandler.rollingMachineID, world, x, y, z);
return true;
}
@Override
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())
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,74 +12,66 @@ 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{
public static final String[] types = new String[]
{
"Silver", "Aluminium", "Titanium", "Sapphire", "Ruby", "GreenSapphire", "Chrome", "Electrum", "Tungsten",
"Lead", "Zinc", "Brass", "Steel", "Platinum", "Nickel", "Invar",
};
private IIcon[] textures;
public BlockStorage(Material material)
{
super(material);
setBlockName("techreborn.storage");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(2f);
}
@Override
public Item getItemDropped(int par1, Random random, int par2)
{
return Item.getItemFromBlock(this);
}
import java.util.List;
import java.util.Random;
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; meta++)
{
list.add(new ItemStack(item, 1, meta));
}
}
public class BlockStorage extends Block {
@Override
public int damageDropped(int metaData)
{
return metaData;
}
public static final String[] types = new String[]
{
"Silver", "Aluminium", "Titanium", "Sapphire", "Ruby", "GreenSapphire", "Chrome", "Electrum", "Tungsten",
"Lead", "Zinc", "Brass", "Steel", "Platinum", "Nickel", "Invar",
};
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
this.textures = new IIcon[types.length];
private IIcon[] textures;
for (int i = 0; i < types.length; i++)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "storage/storage"+types[i]);
}
}
public BlockStorage(Material material) {
super(material);
setBlockName("techreborn.storage");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(2f);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metaData)
{
metaData = MathHelper.clamp_int(metaData, 0, types.length - 1);
@Override
public Item getItemDropped(int par1, Random random, int par2) {
return Item.getItemFromBlock(this);
}
if (ForgeDirection.getOrientation(side) == ForgeDirection.UP
|| ForgeDirection.getOrientation(side) == ForgeDirection.DOWN)
{
return textures[metaData];
} else {
return textures[metaData];
}
}
@Override
@SideOnly(Side.CLIENT)
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) {
return metaData;
}
@Override
@SideOnly(Side.CLIENT)
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]);
}
}
@Override
@SideOnly(Side.CLIENT)
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) {
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

@ -6,14 +6,14 @@ import techreborn.init.ModBlocks;
public class TechRebornCreativeTab extends CreativeTabs {
public static TechRebornCreativeTab instance = new TechRebornCreativeTab();
public static TechRebornCreativeTab instance = new TechRebornCreativeTab();
public TechRebornCreativeTab() {
super("techreborn");
}
public TechRebornCreativeTab() {
super("techreborn");
}
@Override
public Item getTabIconItem() {
return Item.getItemFromBlock(ModBlocks.thermalGenerator);
}
@Override
public Item getTabIconItem() {
return Item.getItemFromBlock(ModBlocks.thermalGenerator);
}
}

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,50 +1,49 @@
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{
EntityPlayer player;
TileRollingMachine tile;
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player){
tile = tileRollingmachine;
this.player = player;
public class ContainerRollingMachine extends TechRebornContainer {
//input
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 0, 30, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 1, 30, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 30, 53));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 3, 48, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 4, 48, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 5, 48, 53));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 6, 66, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 7, 66, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 8, 66, 53));
//outputs
this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 9, 124, 35));
EntityPlayer player;
TileRollingMachine tile;
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player) {
tile = tileRollingmachine;
this.player = player;
//input
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 0, 30, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 1, 30, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 30, 53));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 3, 48, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 4, 48, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 5, 48, 53));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 6, 66, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 7, 66, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 8, 66, 53));
//outputs
this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 9, 124, 35));
int i;
int i;
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 < 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) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}

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,33 +1,29 @@
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{
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/rollingmachine.png");
TileRollingMachine rollingMachine;
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine)
{
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) {
super(new ContainerRollingMachine(tileRollingmachine, player));
this.xSize = 176;
this.ySize = 167;
rollingMachine = tileRollingmachine;
}
@Override
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;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
@Override
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;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
}

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,14 +1,14 @@
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")){
new CompatModuleWaila().init(event);
}
}
public static void init(FMLInitializationEvent event) {
if (Loader.isModLoaded("Waila")) {
new CompatModuleWaila().init(event);
}
}
}

View file

@ -20,138 +20,138 @@ import java.util.List;
public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
public class CachedCentrifugeRecipe extends CachedRecipe {
public class CachedCentrifugeRecipe extends CachedRecipe {
private List<PositionedStack> input = new ArrayList<PositionedStack>();
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
public Point focus;
public CentrifugeRecipie centrifugeRecipie;
private List<PositionedStack> input = new ArrayList<PositionedStack>();
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
public Point focus;
public CentrifugeRecipie centrifugeRecipie;
public CachedCentrifugeRecipe(CentrifugeRecipie recipie) {
this.centrifugeRecipie = recipie;
int offset = 4;
PositionedStack pStack = new PositionedStack(recipie.getInputItem(), 80 - offset, 35 - offset);
pStack.setMaxSize(1);
this.input.add(pStack);
public CachedCentrifugeRecipe(CentrifugeRecipie recipie) {
this.centrifugeRecipie = recipie;
int offset = 4;
PositionedStack pStack = new PositionedStack(recipie.getInputItem(), 80 - offset, 35 - offset);
pStack.setMaxSize(1);
this.input.add(pStack);
if(recipie.getOutput1() != null){
this.outputs.add(new PositionedStack(recipie.getOutput1(), 80 - offset, 5 - offset));
}
if(recipie.getOutput2() != null){
this.outputs.add(new PositionedStack(recipie.getOutput2(), 110 - offset, 35 - offset));
}
if(recipie.getOutput3() != null){
this.outputs.add(new PositionedStack(recipie.getOutput3(), 80 - offset, 65 - offset));
}
if(recipie.getOutput4() != null){
this.outputs.add(new PositionedStack(recipie.getOutput4(), 50 - offset, 35 - offset));
}
if (recipie.getOutput1() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput1(), 80 - offset, 5 - offset));
}
if (recipie.getOutput2() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput2(), 110 - offset, 35 - offset));
}
if (recipie.getOutput3() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput3(), 80 - offset, 65 - offset));
}
if (recipie.getOutput4() != null) {
this.outputs.add(new PositionedStack(recipie.getOutput4(), 50 - offset, 35 - offset));
}
ItemStack cellStack = IC2Items.getItem("cell");
cellStack.stackSize = recipie.getCells();
this.outputs.add(new PositionedStack(cellStack, 50 - offset, 5 - offset));
ItemStack cellStack = IC2Items.getItem("cell");
cellStack.stackSize = recipie.getCells();
this.outputs.add(new PositionedStack(cellStack, 50 - offset, 5 - offset));
}
}
@Override
public List<PositionedStack> getIngredients() {
return this.getCycledIngredients(cycleticks / 20, this.input);
}
@Override
public List<PositionedStack> getIngredients() {
return this.getCycledIngredients(cycleticks / 20, this.input);
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
@Override
public List<PositionedStack> getOtherStacks() {
return this.outputs;
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public PositionedStack getResult() {
return null;
}
}
@Override
public String getRecipeName() {
return "Centrifuge";
}
@Override
public String getRecipeName() {
return "Centrifuge";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/centrifuge.png";
}
@Override
public String getGuiTexture() {
return "techreborn:textures/gui/centrifuge.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiCentrifuge.class;
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiCentrifuge.class;
}
@Override
public void drawBackground(int recipeIndex) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
GuiDraw.drawTooltipBox(10, 80, 145, 50);
GuiDraw.drawString("Info:", 14, 84, -1);
CachedRecipe recipe = arecipes.get(recipeIndex);
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);
}
@Override
public void drawBackground(int recipeIndex) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
GuiDraw.drawTooltipBox(10, 80, 145, 50);
GuiDraw.drawString("Info:", 14, 84, -1);
CachedRecipe recipe = arecipes.get(recipeIndex);
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);
}
}
}
@Override
public int recipiesPerPage() {
return 1;
}
@Override
public int recipiesPerPage() {
return 1;
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(75, 22, 15, 13), "tr.centrifuge", new Object[0]));
}
@Override
public void loadTransferRects() {
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(75, 22, 15, 13), "tr.centrifuge", new Object[0]));
}
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("tr.centrifuge")) {
for(CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies){
addCached(centrifugeRecipie);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("tr.centrifuge")) {
for (CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies) {
addCached(centrifugeRecipie);
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for(CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies){
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput1(), result)){
addCached(centrifugeRecipie);
}
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput2(), result)){
addCached(centrifugeRecipie);
}
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput3(), result)){
addCached(centrifugeRecipie);
}
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput4(), result)){
addCached(centrifugeRecipie);
}
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
for (CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies) {
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput1(), result)) {
addCached(centrifugeRecipie);
}
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput2(), result)) {
addCached(centrifugeRecipie);
}
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput3(), result)) {
addCached(centrifugeRecipie);
}
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getOutput4(), result)) {
addCached(centrifugeRecipie);
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for(CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies){
if(NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInputItem(), ingredient)){
addCached(centrifugeRecipie);
}
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
for (CentrifugeRecipie centrifugeRecipie : TechRebornAPI.centrifugeRecipies) {
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInputItem(), ingredient)) {
addCached(centrifugeRecipie);
}
}
}
private void addCached(CentrifugeRecipie recipie) {
this.arecipes.add(new CachedCentrifugeRecipe(recipie));
}
private void addCached(CentrifugeRecipie recipie) {
this.arecipes.add(new CachedCentrifugeRecipe(recipie));
}
}

View file

@ -1,30 +1,27 @@
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()
{
return ModInfo.MOD_ID;
}
@Override
public String getName() {
return ModInfo.MOD_ID;
}
@Override
public String getVersion()
{
return ModInfo.MOD_VERSION;
}
@Override
public String getVersion() {
return ModInfo.MOD_VERSION;
}
@Override
public void loadConfig()
{
CentrifugeRecipeHandler centrifugeRecipeHandler = new CentrifugeRecipeHandler();
API.registerRecipeHandler(centrifugeRecipeHandler);
API.registerUsageHandler(centrifugeRecipeHandler);
}
@Override
public void loadConfig() {
CentrifugeRecipeHandler centrifugeRecipeHandler = new CentrifugeRecipeHandler();
API.registerRecipeHandler(centrifugeRecipeHandler);
API.registerUsageHandler(centrifugeRecipeHandler);
}
}

View file

@ -1,17 +1,17 @@
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 {
public void init(FMLInitializationEvent event) {
FMLInterModComms.sendMessage("Waila", "register", getClass().getName() + ".callbackRegister");
}
public void init(FMLInitializationEvent event) {
FMLInterModComms.sendMessage("Waila", "register", getClass().getName() + ".callbackRegister");
}
public static void callbackRegister(IWailaRegistrar registrar) {
registrar.registerBodyProvider(new WailaProviderMachines(), TileMachineBase.class);
}
public static void callbackRegister(IWailaRegistrar registrar) {
registrar.registerBodyProvider(new WailaProviderMachines(), TileMachineBase.class);
}
}

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,43 +10,46 @@ 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>();
private List<String> info = new ArrayList<String>();
@Override
public List<String> getWailaBody(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
@Override
public List<String> getWailaBody(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
TileMachineBase machine = (TileMachineBase) accessor.getTileEntity();
TileMachineBase machine = (TileMachineBase) accessor.getTileEntity();
machine.addWailaInfo(info);
tip.addAll(info);
info.clear();
machine.addWailaInfo(info);
tip.addAll(info);
info.clear();
return tip;
}
return tip;
}
@Override
public List<String> getWailaHead(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
@Override
public List<String> getWailaHead(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return tip;
}
return tip;
}
@Override
public List<String> getWailaTail(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
@Override
public List<String> getWailaTail(ItemStack item, List<String> tip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
return tip;
}
return tip;
}
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return null;
}
return null;
}
@Override
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World w, int x, int y, int z) {
@Override
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World w, int x, int y, int z) {
return tag;
}
return tag;
}
}

View file

@ -1,32 +1,32 @@
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";
private static ConfigTechReborn instance = null;
public static String CATEGORY_WORLD = "world";
public static String CATEGORY_POWER = "power";
public static String CATEGORY_CRAFTING = "crafting";
//WORLDGEN
public static boolean GalenaOreTrue;
public static boolean IridiumOreTrue;
public static boolean RubyOreTrue;
public static boolean SapphireOreTrue;
public static boolean BauxiteOreTrue;
public static boolean PyriteOreTrue;
public static boolean CinnabarOreTrue;
public static boolean SphaleriteOreTrue;
public static boolean TungstonOreTrue;
public static boolean SheldoniteOreTrue;
public static boolean OlivineOreTrue;
public static boolean SodaliteOreTrue;
//WORLDGEN
public static boolean GalenaOreTrue;
public static boolean IridiumOreTrue;
public static boolean RubyOreTrue;
public static boolean SapphireOreTrue;
public static boolean BauxiteOreTrue;
public static boolean PyriteOreTrue;
public static boolean CinnabarOreTrue;
public static boolean SphaleriteOreTrue;
public static boolean TungstonOreTrue;
public static boolean SheldoniteOreTrue;
public static boolean OlivineOreTrue;
public static boolean SodaliteOreTrue;
//Power
public static int ThermalGenertaorOutput;
public static int CentrifugeInputTick;
public static int CentrifugeInputTick;
//Charge
public static int AdvancedDrillCharge;
public static int LapotronPackCharge;
@ -34,8 +34,8 @@ public class ConfigTechReborn {
public static int OmniToolCharge;
public static int RockCutterCharge;
public static int GravityCharge;
public static int CentrifugeCharge;
public static int ThermalGeneratorCharge;
public static int CentrifugeCharge;
public static int ThermalGeneratorCharge;
//Teir
public static int AdvancedDrillTier;
public static int LapotronPackTier;
@ -43,8 +43,8 @@ public class ConfigTechReborn {
public static int OmniToolTier;
public static int RockCutterTier;
public static int GravityTier;
public static int CentrifugeTier;
public static int ThermalGeneratorTier;
public static int CentrifugeTier;
public static int ThermalGeneratorTier;
//Crafting
public static boolean ExpensiveMacerator;
public static boolean ExpensiveDrill;
@ -52,104 +52,97 @@ public class ConfigTechReborn {
public static boolean ExpensiveSolar;
public static Configuration config;
private ConfigTechReborn(File configFile) {
config = new Configuration(configFile);
config.load();
public static Configuration config;
ConfigTechReborn.Configs();
private ConfigTechReborn(File configFile)
{
config = new Configuration(configFile);
config.load();
config.save();
ConfigTechReborn.Configs();
}
config.save();
public static ConfigTechReborn initialize(File configFile) {
}
if (instance == null)
instance = new ConfigTechReborn(configFile);
else
throw new IllegalStateException(
"Cannot initialize TechReborn Config twice");
public static ConfigTechReborn initialize(File configFile)
{
return instance;
}
if (instance == null)
instance = new ConfigTechReborn(configFile);
else
throw new IllegalStateException(
"Cannot initialize TechReborn Config twice");
public static ConfigTechReborn instance() {
if (instance == null) {
return instance;
}
throw new IllegalStateException(
"Instance of TechReborn Config requested before initialization");
}
return instance;
}
public static ConfigTechReborn instance()
{
if (instance == null) {
public static void Configs() {
GalenaOreTrue = config.get(CATEGORY_WORLD,
"Allow GalenaOre", true,
"Allow GalenaOre to be generated in your world.")
.getBoolean(true);
IridiumOreTrue = config.get(CATEGORY_WORLD,
"Allow IridiumOre", true,
"Allow IridiumOre to be generated in your world.")
.getBoolean(true);
RubyOreTrue = config.get(CATEGORY_WORLD,
"Allow RubyOre", true,
"Allow RubyOre to be generated in your world.")
.getBoolean(true);
SapphireOreTrue = config.get(CATEGORY_WORLD,
"Allow SapphireOre", true,
"Allow SapphireOre to be generated in your world.")
.getBoolean(true);
BauxiteOreTrue = config.get(CATEGORY_WORLD,
"Allow BauxiteOre", true,
"Allow BauxiteOre to be generated in your world.")
.getBoolean(true);
PyriteOreTrue = config.get(CATEGORY_WORLD,
"Allow PyriteOre", true,
"Allow PyriteOre to be generated in your world.")
.getBoolean(true);
CinnabarOreTrue = config.get(CATEGORY_WORLD,
"Allow CinnabarOre", true,
"Allow CinnabarOre to be generated in your world.")
.getBoolean(true);
SphaleriteOreTrue = config.get(CATEGORY_WORLD,
"Allow SphaleriteOre", true,
"Allow SphaleriteOre to be generated in your world.")
.getBoolean(true);
TungstonOreTrue = config.get(CATEGORY_WORLD,
"Allow TungstonOre", true,
"Allow TungstonOre to be generated in your world.")
.getBoolean(true);
SheldoniteOreTrue = config.get(CATEGORY_WORLD,
"Allow SheldoniteOre", true,
"Allow SheldoniteOre to be generated in your world.")
.getBoolean(true);
OlivineOreTrue = config.get(CATEGORY_WORLD,
"Allow OlivineOre", true,
"Allow OlivineOre to be generated in your world.")
.getBoolean(true);
SodaliteOreTrue = config.get(CATEGORY_WORLD,
"Allow SodaliteOre", true,
"Allow SodaliteOre to be generated in your world.")
.getBoolean(true);
throw new IllegalStateException(
"Instance of TechReborn Config requested before initialization");
}
return instance;
}
public static void Configs()
{
GalenaOreTrue = config.get(CATEGORY_WORLD,
"Allow GalenaOre", true,
"Allow GalenaOre to be generated in your world.")
.getBoolean(true);
IridiumOreTrue = config.get(CATEGORY_WORLD,
"Allow IridiumOre", true,
"Allow IridiumOre to be generated in your world.")
.getBoolean(true);
RubyOreTrue = config.get(CATEGORY_WORLD,
"Allow RubyOre", true,
"Allow RubyOre to be generated in your world.")
.getBoolean(true);
SapphireOreTrue = config.get(CATEGORY_WORLD,
"Allow SapphireOre", true,
"Allow SapphireOre to be generated in your world.")
.getBoolean(true);
BauxiteOreTrue = config.get(CATEGORY_WORLD,
"Allow BauxiteOre", true,
"Allow BauxiteOre to be generated in your world.")
.getBoolean(true);
PyriteOreTrue = config.get(CATEGORY_WORLD,
"Allow PyriteOre", true,
"Allow PyriteOre to be generated in your world.")
.getBoolean(true);
CinnabarOreTrue = config.get(CATEGORY_WORLD,
"Allow CinnabarOre", true,
"Allow CinnabarOre to be generated in your world.")
.getBoolean(true);
SphaleriteOreTrue = config.get(CATEGORY_WORLD,
"Allow SphaleriteOre", true,
"Allow SphaleriteOre to be generated in your world.")
.getBoolean(true);
TungstonOreTrue = config.get(CATEGORY_WORLD,
"Allow TungstonOre", true,
"Allow TungstonOre to be generated in your world.")
.getBoolean(true);
SheldoniteOreTrue = config.get(CATEGORY_WORLD,
"Allow SheldoniteOre", true,
"Allow SheldoniteOre to be generated in your world.")
.getBoolean(true);
OlivineOreTrue = config.get(CATEGORY_WORLD,
"Allow OlivineOre", true,
"Allow OlivineOre to be generated in your world.")
.getBoolean(true);
SodaliteOreTrue = config.get(CATEGORY_WORLD,
"Allow SodaliteOre", true,
"Allow SodaliteOre to be generated in your world.")
.getBoolean(true);
//Power
//Power
ThermalGenertaorOutput = config.get(CATEGORY_POWER,
"Thermal Generator Power", 30,
"The amount of power that the thermal generator makes for 1mb of lava")
.getInt();
CentrifugeInputTick = config.get(CATEGORY_POWER,
"Centrifuge power usage", 5,
"The amount of eu per tick that the Centrifuge uses.")
.getInt();
CentrifugeInputTick = config.get(CATEGORY_POWER,
"Centrifuge power usage", 5,
"The amount of eu per tick that the Centrifuge uses.")
.getInt();
//Charge
AdvancedDrillCharge = config.get(CATEGORY_POWER,
"Advanced drill max charge", 60000,
@ -175,14 +168,14 @@ public class ConfigTechReborn {
"Gravity Chestplate max charge", 100000,
"The amount of power that the Gravity Chestplate can hold")
.getInt();
CentrifugeCharge = config.get(CATEGORY_POWER,
"Centrifuge max charge", 1000000,
"The amount of power that the Centrifuge can hold")
.getInt();
ThermalGeneratorCharge = config.get(CATEGORY_POWER,
"Thermal Generator max charge", 1000000,
"The amount of power that the Thermal Generator can hold")
.getInt();
CentrifugeCharge = config.get(CATEGORY_POWER,
"Centrifuge max charge", 1000000,
"The amount of power that the Centrifuge can hold")
.getInt();
ThermalGeneratorCharge = config.get(CATEGORY_POWER,
"Thermal Generator max charge", 1000000,
"The amount of power that the Thermal Generator can hold")
.getInt();
//Teir
AdvancedDrillTier = config.get(CATEGORY_POWER,
"Advanced drill Tier", 2,
@ -208,36 +201,36 @@ public class ConfigTechReborn {
"GravityChestplate tier", 3,
"The tier of the GravityChestplate")
.getInt();
CentrifugeTier = config.get(CATEGORY_POWER,
"Centrifuge tier", 1,
"The tier of the Centrifuge")
.getInt();
ThermalGeneratorTier = config.get(CATEGORY_POWER,
"Thermal Generator tier", 1,
"The tier of the Thermal Generator")
.getInt();
//Crafting
ExpensiveMacerator = config.get(CATEGORY_CRAFTING,
"Allow Expensive Macerator", true,
"Allow TechReborn to overwrite the IC2 recipe for Macerator.")
.getBoolean(true);
ExpensiveDrill = config.get(CATEGORY_CRAFTING,
"Allow Expensive Drill", true,
"Allow TechReborn to overwrite the IC2 recipe for Drill.")
.getBoolean(true);
ExpensiveDiamondDrill = config.get(CATEGORY_CRAFTING,
"Allow Expensive DiamondDrill", true,
"Allow TechReborn to overwrite the IC2 recipe for DiamondDrill.")
.getBoolean(true);
ExpensiveSolar = config.get(CATEGORY_CRAFTING,
"Allow Expensive Solar panels", true,
"Allow TechReborn to overwrite the IC2 recipe for Solar panels.")
.getBoolean(true);
if (config.hasChanged())
config.save();
}
CentrifugeTier = config.get(CATEGORY_POWER,
"Centrifuge tier", 1,
"The tier of the Centrifuge")
.getInt();
ThermalGeneratorTier = config.get(CATEGORY_POWER,
"Thermal Generator tier", 1,
"The tier of the Thermal Generator")
.getInt();
//Crafting
ExpensiveMacerator = config.get(CATEGORY_CRAFTING,
"Allow Expensive Macerator", true,
"Allow TechReborn to overwrite the IC2 recipe for Macerator.")
.getBoolean(true);
ExpensiveDrill = config.get(CATEGORY_CRAFTING,
"Allow Expensive Drill", true,
"Allow TechReborn to overwrite the IC2 recipe for Drill.")
.getBoolean(true);
ExpensiveDiamondDrill = config.get(CATEGORY_CRAFTING,
"Allow Expensive DiamondDrill", true,
"Allow TechReborn to overwrite the IC2 recipe for DiamondDrill.")
.getBoolean(true);
ExpensiveSolar = config.get(CATEGORY_CRAFTING,
"Allow Expensive Solar panels", true,
"Allow TechReborn to overwrite the IC2 recipe for Solar panels.")
.getBoolean(true);
if (config.hasChanged())
config.save();
}
}

View file

@ -1,95 +1,87 @@
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)
{
super(top, getConfigCategories(), "TechReborn", false, false,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config
.toString()));
}
private static List<IConfigElement> getConfigCategories()
{
List<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(new DummyConfigElement.DummyCategoryElement("General",
"tr.configgui.category.trGeneral", TRGeneral.class));
list.add(new DummyConfigElement.DummyCategoryElement("World Gen",
"tr.configgui.category.trWorld", TRWORLD.class));
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() {
List<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(new DummyConfigElement.DummyCategoryElement("General",
"tr.configgui.category.trGeneral", TRGeneral.class));
list.add(new DummyConfigElement.DummyCategoryElement("World Gen",
"tr.configgui.category.trWorld", TRWORLD.class));
list.add(new DummyConfigElement.DummyCategoryElement("Power",
"tr.configgui.category.trPower", TRPOWER.class));
list.add(new DummyConfigElement.DummyCategoryElement("Crafting",
"tr.configgui.category.trCrafting", TRCRAFTING.class));
return list;
}
public static class TRGeneral extends CategoryEntry {
return list;
}
public TRGeneral(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
}
@Override
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,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString()));
}
}
// World
public static class TRWORLD extends CategoryEntry {
public TRWORLD(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen()
{
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(ConfigTechReborn.CATEGORY_WORLD)))
.getChildElements(), this.owningScreen.modID,
Configuration.CATEGORY_GENERAL,
this.configElement.requiresWorldRestart()
|| this.owningScreen.allRequireWorldRestart,
this.configElement.requiresMcRestart()
|| this.owningScreen.allRequireMcRestart,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config
.toString()));
}
}
public static class TRGeneral extends CategoryEntry {
// Power
public static class TRPOWER extends CategoryEntry {
public TRPOWER(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,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString()));
}
}
// World
public static class TRWORLD extends CategoryEntry {
public TRWORLD(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) {
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen() {
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(ConfigTechReborn.CATEGORY_WORLD)))
.getChildElements(), this.owningScreen.modID,
Configuration.CATEGORY_GENERAL,
this.configElement.requiresWorldRestart()
|| this.owningScreen.allRequireWorldRestart,
this.configElement.requiresMcRestart()
|| this.owningScreen.allRequireMcRestart,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config
.toString()));
}
}
// Power
public static class TRPOWER extends CategoryEntry {
public TRPOWER(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) {
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen() {
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(ConfigTechReborn.CATEGORY_POWER)))
@ -103,28 +95,26 @@ public class TechRebornConfigGui extends GuiConfig{
.toString()));
}
}
// Crafting
public static class TRCRAFTING extends CategoryEntry {
public TRCRAFTING(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement)
{
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen()
{
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(ConfigTechReborn.CATEGORY_CRAFTING)))
.getChildElements(), this.owningScreen.modID,
Configuration.CATEGORY_GENERAL,
this.configElement.requiresWorldRestart()
|| this.owningScreen.allRequireWorldRestart,
this.configElement.requiresMcRestart()
|| this.owningScreen.allRequireMcRestart,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config
.toString()));
}
}
// Crafting
public static class TRCRAFTING extends CategoryEntry {
public TRCRAFTING(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) {
super(owningScreen, owningEntryList, configElement);
}
@Override
protected GuiScreen buildChildScreen() {
return new GuiConfig(this.owningScreen,
(new ConfigElement(ConfigTechReborn.config
.getCategory(ConfigTechReborn.CATEGORY_CRAFTING)))
.getChildElements(), this.owningScreen.modID,
Configuration.CATEGORY_GENERAL,
this.configElement.requiresWorldRestart()
|| this.owningScreen.allRequireWorldRestart,
this.configElement.requiresMcRestart()
|| this.owningScreen.allRequireMcRestart,
GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config
.toString()));
}
}
}

View file

@ -1,35 +1,31 @@
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 {
@Override
public void initialize(Minecraft minecraftInstance) {
public class TechRebornGUIFactory implements IModGuiFactory{
@Override
public void initialize(Minecraft minecraftInstance)
{
}
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return TechRebornConfigGui.class;
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass()
{
return TechRebornConfigGui.class;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories()
{
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(
RuntimeOptionCategoryElement element)
{
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(
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,91 +11,84 @@ 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 {
public static Block thermalGenerator;
public static Block quantumTank;
public static Block quantumChest;
public static Block centrifuge;
public static Block RollingMachine;
public static Block ore;
public static Block storage;
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");
public static Block thermalGenerator;
public static Block quantumTank;
public static Block quantumChest;
public static Block centrifuge;
public static Block RollingMachine;
quantumTank = new BlockQuantumTank().setBlockName("techreborn.quantumTank").setBlockTextureName("techreborn:quantumTank").setCreativeTab(TechRebornCreativeTab.instance);
GameRegistry.registerBlock(quantumTank, ItemBlockQuantumTank.class, "techreborn.quantumTank");
GameRegistry.registerTileEntity(TileQuantumTank.class, "TileQuantumTank");
public static Block ore;
public static Block storage;
quantumChest = new BlockQuantumChest().setBlockName("techreborn.quantumChest").setBlockTextureName("techreborn:quantumChest").setCreativeTab(TechRebornCreativeTab.instance);
GameRegistry.registerBlock(quantumChest, ItemBlockQuantumChest.class, "techreborn.quantumChest");
GameRegistry.registerTileEntity(TileQuantumChest.class, "TileQuantumChest");
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");
centrifuge = new BlockCentrifuge().setBlockName("techreborn.centrifuge").setBlockTextureName("techreborn:centrifuge").setCreativeTab(TechRebornCreativeTab.instance);
GameRegistry.registerBlock(centrifuge, "techreborn.centrifuge");
GameRegistry.registerTileEntity(TileCentrifuge.class, "TileCentrifuge");
RollingMachine = new BlockRollingMachine(Material.piston);
GameRegistry.registerBlock(RollingMachine, "rollingmachine");
GameRegistry.registerTileEntity(TileRollingMachine.class, "TileRollingMachine");
ore = new BlockOre(Material.rock);
GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore");
LogHelper.info("TechReborns Blocks Loaded");
storage = new BlockStorage(Material.rock);
GameRegistry.registerBlock(storage, ItemBlockStorage.class, "techreborn.storage");
LogHelper.info("TechReborns Blocks Loaded");
quantumTank = new BlockQuantumTank().setBlockName("techreborn.quantumTank").setBlockTextureName("techreborn:quantumTank").setCreativeTab(TechRebornCreativeTab.instance);
GameRegistry.registerBlock(quantumTank, ItemBlockQuantumTank.class, "techreborn.quantumTank");
GameRegistry.registerTileEntity(TileQuantumTank.class, "TileQuantumTank");
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));
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));
quantumChest = new BlockQuantumChest().setBlockName("techreborn.quantumChest").setBlockTextureName("techreborn:quantumChest").setCreativeTab(TechRebornCreativeTab.instance);
GameRegistry.registerBlock(quantumChest, ItemBlockQuantumChest.class, "techreborn.quantumChest");
GameRegistry.registerTileEntity(TileQuantumChest.class, "TileQuantumChest");
}
centrifuge = new BlockCentrifuge().setBlockName("techreborn.centrifuge").setBlockTextureName("techreborn:centrifuge").setCreativeTab(TechRebornCreativeTab.instance);
GameRegistry.registerBlock(centrifuge, "techreborn.centrifuge");
GameRegistry.registerTileEntity(TileCentrifuge.class, "TileCentrifuge");
RollingMachine = new BlockRollingMachine(Material.piston);
GameRegistry.registerBlock(RollingMachine, "rollingmachine");
GameRegistry.registerTileEntity(TileRollingMachine.class, "TileRollingMachine");
ore = new BlockOre(Material.rock);
GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore");
LogHelper.info("TechReborns Blocks Loaded");
storage = new BlockStorage(Material.rock);
GameRegistry.registerBlock(storage, ItemBlockStorage.class, "techreborn.storage");
LogHelper.info("TechReborns Blocks Loaded");
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));
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,10 +17,9 @@ 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 {
public static Item dusts;
public static Item ingots;
public static Item gems;
@ -33,9 +31,8 @@ public class ModItems {
public static Item omniTool;
public static Item advancedDrill;
public static void init()
{
dusts = new ItemDusts();
public static void init() {
dusts = new ItemDusts();
GameRegistry.registerItem(dusts, "dust");
ingots = new ItemIngots();
GameRegistry.registerItem(ingots, "ingot");
@ -55,104 +52,103 @@ public class ModItems {
GameRegistry.registerItem(advancedDrill, "advancedDrill");
gravityChest = new ItemGravityChest(ArmorMaterial.DIAMOND, 7, 1);
GameRegistry.registerItem(gravityChest, "gravityChest");
LogHelper.info("TechReborns Items Loaded");
LogHelper.info("TechReborns Items Loaded");
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));
//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));
//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));
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));
//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));
//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));
}

View file

@ -14,237 +14,231 @@ import techreborn.util.LogHelper;
import techreborn.util.RecipeRemover;
public class ModRecipes {
public static ConfigTechReborn config;
public static ConfigTechReborn config;
public static void init()
{
removeIc2Recipes();
addShaplessRecipes();
addShappedRecipes();
addSmeltingRecipes();
addMachineRecipes();
}
public static void removeIc2Recipes()
{
if(config.ExpensiveMacerator);
RecipeRemover.removeAnyRecipe(IC2Items.getItem("macerator"));
if(config.ExpensiveDrill);
RecipeRemover.removeAnyRecipe(IC2Items.getItem("miningDrill"));
if(config.ExpensiveDiamondDrill);
RecipeRemover.removeAnyRecipe(IC2Items.getItem("diamondDrill"));
if(config.ExpensiveSolar);
RecipeRemover.removeAnyRecipe(IC2Items.getItem("solarPanel"));
public static void init() {
removeIc2Recipes();
addShaplessRecipes();
addShappedRecipes();
addSmeltingRecipes();
addMachineRecipes();
}
LogHelper.info("IC2 Recipes Removed");
}
public static void addShappedRecipes()
{
public static void removeIc2Recipes() {
if (config.ExpensiveMacerator) ;
RecipeRemover.removeAnyRecipe(IC2Items.getItem("macerator"));
if (config.ExpensiveDrill) ;
RecipeRemover.removeAnyRecipe(IC2Items.getItem("miningDrill"));
if (config.ExpensiveDiamondDrill) ;
RecipeRemover.removeAnyRecipe(IC2Items.getItem("diamondDrill"));
if (config.ExpensiveSolar) ;
RecipeRemover.removeAnyRecipe(IC2Items.getItem("solarPanel"));
//IC2 Recipes
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);
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("miningDrill"),
new Object[]{" S ", "SCS", "SBS",
'S', "ingotSteel",
'B', IC2Items.getItem("reBattery"),
'C', IC2Items.getItem("electronicCircuit")});
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);
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("solarPanel"),
new Object[]{"PPP", "SZS", "CGC",
'P', "paneGlass",
'S', new ItemStack(ModItems.parts,1,1),
'Z', IC2Items.getItem("carbonPlate"),
'G', IC2Items.getItem("generator"),
'C', IC2Items.getItem("electronicCircuit")});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.thermalGenerator),
new Object[]{"III", "IHI", "CGC",
'I', "ingotInvar",
'H', IC2Items.getItem("reinforcedGlass"),
'C', IC2Items.getItem("electronicCircuit"),
'G', IC2Items.getItem("geothermalGenerator")});
//TechReborn Recipes
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),
new Object[]{"AGA", "RPB", "ASA",
'A', "ingotAluminium",
'G', "dyeGreen",
'R', "dyeRed",
'P', "paneGlass",
'B', "dyeBlue",
'S', Items.glowstone_dust,});
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),
new Object[]{"CSC", "SCS", "CSC",
'S', "ingotSteel",
'C', IC2Items.getItem("electronicCircuit")});
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),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotAluminium",
'M', new ItemStack(ModItems.parts,1,13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,16),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotBronze",
'M', new ItemStack(ModItems.parts,1,13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,17),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotSteel",
'M', new ItemStack(ModItems.parts,1,13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,18),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotTitanium",
'M', new ItemStack(ModItems.parts,1,13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts,1,19),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotBrass",
'M', new ItemStack(ModItems.parts,1,13)});
//Storage Blocks
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,0),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotSilver",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,1),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotAluminium",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,2),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotTitanium",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,3),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemSapphire",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,4),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemRuby",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,5),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemGreenSapphire",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,6),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotChrome",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,7),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotElectrum",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,8),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotTungsten",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,9),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotLead",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,10),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotZinc",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,11),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotBrass",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,12),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotSteel",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,13),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotPlatinum",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage,1,14),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotNickel",});
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);
LogHelper.info("IC2 Recipes Removed");
}
public static void addShappedRecipes() {
//IC2 Recipes
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) ;
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("miningDrill"),
new Object[]{" S ", "SCS", "SBS",
'S', "ingotSteel",
'B', IC2Items.getItem("reBattery"),
'C', IC2Items.getItem("electronicCircuit")});
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) ;
CraftingHelper.addShapedOreRecipe(IC2Items.getItem("solarPanel"),
new Object[]{"PPP", "SZS", "CGC",
'P', "paneGlass",
'S', new ItemStack(ModItems.parts, 1, 1),
'Z', IC2Items.getItem("carbonPlate"),
'G', IC2Items.getItem("generator"),
'C', IC2Items.getItem("electronicCircuit")});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.thermalGenerator),
new Object[]{"III", "IHI", "CGC",
'I', "ingotInvar",
'H', IC2Items.getItem("reinforcedGlass"),
'C', IC2Items.getItem("electronicCircuit"),
'G', IC2Items.getItem("geothermalGenerator")});
//TechReborn Recipes
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),
new Object[]{"AGA", "RPB", "ASA",
'A', "ingotAluminium",
'G', "dyeGreen",
'R', "dyeRed",
'P', "paneGlass",
'B', "dyeBlue",
'S', Items.glowstone_dust,});
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),
new Object[]{"CSC", "SCS", "CSC",
'S', "ingotSteel",
'C', IC2Items.getItem("electronicCircuit")});
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),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotAluminium",
'M', new ItemStack(ModItems.parts, 1, 13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 16),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotBronze",
'M', new ItemStack(ModItems.parts, 1, 13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 17),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotSteel",
'M', new ItemStack(ModItems.parts, 1, 13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 18),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotTitanium",
'M', new ItemStack(ModItems.parts, 1, 13)});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 19),
new Object[]{"AAA", "AMA", "AAA",
'A', "ingotBrass",
'M', new ItemStack(ModItems.parts, 1, 13)});
//Storage Blocks
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 0),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotSilver",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 1),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotAluminium",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 2),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotTitanium",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 3),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemSapphire",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 4),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemRuby",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 5),
new Object[]{"AAA", "AAA", "AAA",
'A', "gemGreenSapphire",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 6),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotChrome",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 7),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotElectrum",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 8),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotTungsten",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 9),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotLead",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 10),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotZinc",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 11),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotBrass",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 12),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotSteel",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 13),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotPlatinum",});
CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.storage, 1, 14),
new Object[]{"AAA", "AAA", "AAA",
'A', "ingotNickel",});
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);
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);
LogHelper.info("Shapless Recipes Added");
}
LogHelper.info("Smelting Recipes Added");
}
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));
LogHelper.info("Machine 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);
LogHelper.info("Smelting Recipes Added");
}
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));
LogHelper.info("Machine Recipes Added");
}
}

View file

@ -5,11 +5,10 @@ import net.minecraft.item.ItemMultiTexture;
import techreborn.blocks.BlockOre;
import techreborn.init.ModBlocks;
public class ItemBlockOre extends ItemMultiTexture{
public ItemBlockOre(Block block)
{
super(ModBlocks.ore, ModBlocks.ore, BlockOre.types);
}
public class ItemBlockOre extends ItemMultiTexture {
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,15 +2,13 @@ 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 ItemBlockStorage(Block block)
{
super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types);
}
public class ItemBlockStorage extends ItemMultiTexture {
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,79 +8,70 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTab;
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",
"Invar", "Iron", "Lazurite", "Lead", "Magnesium", "Marble", "Netherrack", "Nickel", "Obsidian",
"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"
};
import java.util.List;
private IIcon[] textures;
public ItemDusts()
{
setUnlocalizedName("techreborn.dust");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTab.instance);
}
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister)
{
textures = new IIcon[types.length];
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",
"Invar", "Iron", "Lazurite", "Lead", "Magnesium", "Marble", "Netherrack", "Nickel", "Obsidian",
"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"
};
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)
{
meta = 0;
}
private IIcon[] textures;
return textures[meta];
}
public ItemDusts() {
setUnlocalizedName("techreborn.dust");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTab.instance);
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
meta = 0;
}
@Override
// Registers Textures For All Dusts
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");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab
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) {
return EnumRarity.uncommon;
}
return super.getUnlocalizedName() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab
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)
{
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,71 +8,63 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTab;
public class ItemGems extends Item{
public static final String[] types = new String[]
{
"Ruby", "Sapphire", "GreenSapphire", "Olivine", "RedGarnet", "YellowGarnet"
};
import java.util.List;
private IIcon[] textures;
public ItemGems()
{
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.gem");
setHasSubtypes(true);
}
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister)
{
textures = new IIcon[types.length];
public class ItemGems extends Item {
public static final String[] types = new String[]
{
"Ruby", "Sapphire", "GreenSapphire", "Olivine", "RedGarnet", "YellowGarnet"
};
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)
{
meta = 0;
}
private IIcon[] textures;
return textures[meta];
}
public ItemGems() {
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.gem");
setHasSubtypes(true);
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
meta = 0;
}
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
return super.getUnlocalizedName() + "." + types[meta];
}
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "gem/" + types[i]);
}
}
// Adds Dusts SubItems To Creative Tab
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)
{
return EnumRarity.uncommon;
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab
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) {
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,73 +8,65 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTab;
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"
};
import java.util.List;
private IIcon[] textures;
public ItemIngots()
{
setCreativeTab(TechRebornCreativeTab.instance);
setHasSubtypes(true);
setUnlocalizedName("techreborn.ingot");
}
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister)
{
textures = new IIcon[types.length];
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"
};
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)
{
meta = 0;
}
private IIcon[] textures;
return textures[meta];
}
public ItemIngots() {
setCreativeTab(TechRebornCreativeTab.instance);
setHasSubtypes(true);
setUnlocalizedName("techreborn.ingot");
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
meta = 0;
}
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
return super.getUnlocalizedName() + "." + types[meta];
}
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "ingot/" + types[i] + "Ingot");
}
}
// Adds Dusts SubItems To Creative Tab
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)
{
return EnumRarity.uncommon;
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab
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) {
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,73 +8,66 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTab;
public class ItemParts extends Item{
public static final String[] types = new String[]
{
"LazuriteChunk", "SiliconPlate", "MagnaliumPlate", "EnergeyFlowCircuit", "DataControlCircuit", "SuperConductor",
"DataStorageCircuit", "ComputerMonitor", "DiamondSawBlade","DiamondGrinder", "KanthalHeatingCoil",
"NichromeHeatingCoil", "CupronickelHeatingCoil", "MachineParts", "WolframiamGrinder",
"AluminiumMachineHull", "BronzeMachineHull","SteelMachineHull","TitaniumMachineHull", "BrassMachineHull"
};
import java.util.List;
private IIcon[] textures;
public ItemParts()
{
setCreativeTab(TechRebornCreativeTab.instance);
setHasSubtypes(true);
setUnlocalizedName("techreborn.part");
}
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister)
{
textures = new IIcon[types.length];
public class ItemParts extends Item {
public static final String[] types = new String[]
{
"LazuriteChunk", "SiliconPlate", "MagnaliumPlate", "EnergeyFlowCircuit", "DataControlCircuit", "SuperConductor",
"DataStorageCircuit", "ComputerMonitor", "DiamondSawBlade", "DiamondGrinder", "KanthalHeatingCoil",
"NichromeHeatingCoil", "CupronickelHeatingCoil", "MachineParts", "WolframiamGrinder",
"AluminiumMachineHull", "BronzeMachineHull", "SteelMachineHull", "TitaniumMachineHull", "BrassMachineHull"
};
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)
{
meta = 0;
}
private IIcon[] textures;
return textures[meta];
}
public ItemParts() {
setCreativeTab(TechRebornCreativeTab.instance);
setHasSubtypes(true);
setUnlocalizedName("techreborn.part");
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
meta = 0;
}
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
return super.getUnlocalizedName() + "." + types[meta];
}
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "part/" + types[i]);
}
}
// Adds Dusts SubItems To Creative Tab
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)
{
return EnumRarity.rare;
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab
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) {
return EnumRarity.rare;
}
}

View file

@ -5,18 +5,16 @@ import net.minecraft.item.Item;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
public class ItemTR extends Item{
public ItemTR()
{
setNoRepair();
setCreativeTab(TechRebornCreativeTab.instance);
}
@Override
public void registerIcons(IIconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon(ModInfo.MOD_ID + ":" + getUnlocalizedName().toLowerCase().substring(5));
}
public class ItemTR extends Item {
public ItemTR() {
setNoRepair();
setCreativeTab(TechRebornCreativeTab.instance);
}
@Override
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,125 +17,108 @@ 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{
public static int maxCharge = ConfigTechReborn.GravityCharge;
import java.util.List;
public class ItemGravityChest extends ItemArmor implements IElectricItem, ISpecialArmor {
public static int maxCharge = ConfigTechReborn.GravityCharge;
public int tier = 3;
public int cost = 100;
public double transferLimit = 1000;
public int energyPerDamage = 100;
public ItemGravityChest(ArmorMaterial material, int par3, int par4)
{
super(material, par3, par4);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.gravity");
setMaxStackSize(1);
setMaxDamage(120);
public ItemGravityChest(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.gravity");
setMaxStackSize(1);
setMaxDamage(120);
// isDamageable();
}
@SideOnly(Side.CLIENT)
@Override
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)
{
return "techreborn:" + "textures/models/gravity.png";
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
ItemStack itemStack = new ItemStack(this, 1);
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)
{
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))
{
player.capabilities.allowFlying = true;
if (player.fallDistance > 0.0F)
player.fallDistance = 0;
if(player.capabilities.allowFlying == true & !player.onGround)
ElectricItem.manager.discharge(stack, cost, tier, false, true, false);
if(!ElectricItem.manager.canUse(stack, cost))
player.capabilities.allowFlying = false;
}
if (player.fallDistance > 0.0F) player.fallDistance = 0;
}
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "items/gravity");
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
return this;
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "techreborn:" + "textures/models/gravity.png";
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
return this;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
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) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
return maxCharge;
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
if (world.isRemote) ;
if (ElectricItem.manager.canUse(stack, cost)) {
player.capabilities.allowFlying = true;
@Override
public int getTier(ItemStack itemStack)
{
return tier;
}
if (player.fallDistance > 0.0F)
player.fallDistance = 0;
@Override
public double getTransferLimit(ItemStack itemStack)
{
return transferLimit;
}
if (player.capabilities.allowFlying == true & !player.onGround)
ElectricItem.manager.discharge(stack, cost, tier, false, true, false);
public int getEnergyPerDamage()
{
if (!ElectricItem.manager.canUse(stack, cost))
player.capabilities.allowFlying = false;
}
if (player.fallDistance > 0.0F) player.fallDistance = 0;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return transferLimit;
}
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,99 +1,87 @@
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 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)
{
super(armormaterial, par2, par3);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.lapotronpack");
setMaxStackSize(1);
}
@SideOnly(Side.CLIENT)
@Override
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)
{
return "techreborn:" + "textures/models/lapotronpack.png";
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
ItemStack itemStack = new ItemStack(this, 1);
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)
{
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
public class ItemLapotronPack extends ItemArmor implements IElectricItem {
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
return true;
}
public static final int maxCharge = ConfigTechReborn.LapotronPackCharge;
public static final int tier = ConfigTechReborn.LapotronPackTier;
public double transferLimit = 100000;
@Override
public Item getChargedItem(ItemStack itemStack)
{
return this;
}
public ItemLapotronPack(ArmorMaterial armormaterial, int par2, int par3) {
super(armormaterial, par2, par3);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.lapotronpack");
setMaxStackSize(1);
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
return this;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lapotronicEnergyOrb");
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
return maxCharge;
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "techreborn:" + "textures/models/lapotronpack.png";
}
@Override
public int getTier(ItemStack itemStack)
{
return tier;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
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) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
return transferLimit;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
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,88 +12,76 @@ 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 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)
{
super(armorMaterial, par3, par4);
setMaxStackSize(1);
setUnlocalizedName("techreborn.lithiumbatpack");
setCreativeTab(TechRebornCreativeTab.instance);
}
@SideOnly(Side.CLIENT)
@Override
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)
{
return "techreborn:" + "textures/models/lithiumbatpack.png";
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
ItemStack itemStack = new ItemStack(this, 1);
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)
{
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
public class ItemLithiumBatpack extends ItemArmor implements IElectricItem {
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
return true;
}
public static final int maxCharge = ConfigTechReborn.LithiumBatpackCharge;
public static final int tier = ConfigTechReborn.LithiumBatpackTier;
public double transferLimit = 10000;
@Override
public Item getChargedItem(ItemStack itemStack)
{
return this;
}
public ItemLithiumBatpack(ArmorMaterial armorMaterial, int par3, int par4) {
super(armorMaterial, par3, par4);
setMaxStackSize(1);
setUnlocalizedName("techreborn.lithiumbatpack");
setCreativeTab(TechRebornCreativeTab.instance);
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
return this;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lithiumBatpack");
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
return maxCharge;
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "techreborn:" + "textures/models/lithiumbatpack.png";
}
@Override
public int getTier(ItemStack itemStack)
{
return tier;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
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) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
return transferLimit;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
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,61 +11,54 @@ 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);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName("techreborn.advancedDrill");
setUnlocalizedName("techreborn.advancedDrill");
}
@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,139 +11,122 @@ 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 static final int maxCharge = ConfigTechReborn.OmniToolCharge;
public static final int tier = ConfigTechReborn.OmniToolTier;
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)
{
super(toolMaterial);
efficiencyOnProperMaterial = 13F;
public ItemOmniTool(ToolMaterial toolMaterial) {
super(toolMaterial);
efficiencyOnProperMaterial = 13F;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(200);
setUnlocalizedName("techreborn.omniTool");
}
@SideOnly(Side.CLIENT)
@Override
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)
{
ItemStack itemStack = new ItemStack(this, 1);
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)
{
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/omnitool");
}
@Override
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;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
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) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
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 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 float getDigSpeed(ItemStack stack, Block block, int meta)
{
if (!ElectricItem.manager.canUse(stack, cost))
{
return 5.0F;
}
@Override
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);
}
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);
}
}
@Override
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 5.0F;
}
@Override
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;
}
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);
}
}
@Override
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 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 isRepairable()
{
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) {
return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
return this;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
return this;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
return false;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
return maxCharge;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public int getTier(ItemStack itemStack)
{
return 2;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
return 200;
}
@Override
public int getTier(ItemStack itemStack) {
return 2;
}
@Override
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,101 +16,87 @@ 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{
public static final int maxCharge = ConfigTechReborn.RockCutterCharge;
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)
{
super(toolMaterial);
setUnlocalizedName("techreborn.rockcutter");
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
public ItemRockCutter(ToolMaterial toolMaterial) {
super(toolMaterial);
setUnlocalizedName("techreborn.rockcutter");
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(27);
efficiencyOnProperMaterial = 16F;
}
@SideOnly(Side.CLIENT)
@Override
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)
{
ItemStack itemStack = new ItemStack(this, 1);
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)
{
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack)
{
return Items.diamond_pickaxe.canHarvestBlock(block, stack);
}
@Override
public boolean isRepairable()
{
return false;
}
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
par1ItemStack.addEnchantment(Enchantment.silkTouch, 1);
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
return false;
}
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
return this;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/rockcutter");
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
return this;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
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) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
return maxCharge;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_pickaxe.canHarvestBlock(block, stack);
}
@Override
public int getTier(ItemStack itemStack)
{
return tier;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
return 300;
}
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
par1ItemStack.addEnchantment(Enchantment.silkTouch, 1);
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return 300;
}
}

View file

@ -1,12 +1,11 @@
package techreborn.lib;
public class ModInfo
{
public static final String MOD_NAME = "TechReborn";
public static final String MOD_ID = "techreborn";
public static final String MOD_VERSION = "@MODVERSION@";
public static final String MOD_DEPENDENCUIES = "required-after:IC2@:";
public static final String SERVER_PROXY_CLASS = "techreborn.proxies.CommonProxy";
public static final String CLIENT_PROXY_CLASS = "techreborn.proxies.ClientProxy";
public static final String GUI_FACTORY_CLASS = "techreborn.config.TechRebornGUIFactory";
public class ModInfo {
public static final String MOD_NAME = "TechReborn";
public static final String MOD_ID = "techreborn";
public static final String MOD_VERSION = "@MODVERSION@";
public static final String MOD_DEPENDENCUIES = "required-after:IC2@:";
public static final String SERVER_PROXY_CLASS = "techreborn.proxies.CommonProxy";
public static final String CLIENT_PROXY_CLASS = "techreborn.proxies.ClientProxy";
public static final String GUI_FACTORY_CLASS = "techreborn.config.TechRebornGUIFactory";
}

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)){
boo = true;
}
if(currentRecipe.getOutput2() != null && ItemUtils.isItemEqual(getOutputItemStack(2), currentRecipe.getOutput2(), false, true)){
if (currentRecipe.getOutput1() != null && ItemUtils.isItemEqual(getOutputItemStack(1), currentRecipe.getOutput1(), false, true)) {
boo = true;
}
if(currentRecipe.getOutput3() != null && ItemUtils.isItemEqual(getOutputItemStack(3), currentRecipe.getOutput3(), false, true)){
if (currentRecipe.getOutput2() != null && ItemUtils.isItemEqual(getOutputItemStack(2), currentRecipe.getOutput2(), false, true)) {
boo = true;
}
if(currentRecipe.getOutput4() != null && ItemUtils.isItemEqual(getOutputItemStack(4), currentRecipe.getOutput4(), 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)) {
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()){
return true;
}
if(currentRecipe.getOutput2() != null && getOutputItemStack(2) != null && getOutputItemStack(2).stackSize + currentRecipe.getOutput2().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.getOutput3() != null && getOutputItemStack(3) != null && getOutputItemStack(3).stackSize + currentRecipe.getOutput3().stackSize > currentRecipe.getOutput1().getMaxStackSize()){
if (currentRecipe.getOutput2() != null && getOutputItemStack(2) != null && getOutputItemStack(2).stackSize + currentRecipe.getOutput2().stackSize > currentRecipe.getOutput1().getMaxStackSize()) {
return true;
}
if(currentRecipe.getOutput4() != null && getOutputItemStack(4) != null && getOutputItemStack(4).stackSize + currentRecipe.getOutput4().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()) {
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

@ -21,9 +21,9 @@ public class TileMachineBase extends TileEntity {
}
@SideOnly(Side.CLIENT)
public void addWailaInfo(List<String> info) {
public void addWailaInfo(List<String> info) {
}
}
public void syncWithAll() {
if (!worldObj.isRemote) {

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);
}
@ -177,34 +174,34 @@ public class TileQuantumChest extends TileMachineBase implements IInventory ,IWr
return inventory.isItemValidForSlot(slot, stack);
}
@Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
return false;
}
@Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
return false;
}
@Override
public short getFacing() {
return 0;
}
@Override
public short getFacing() {
return 0;
}
@Override
public void setFacing(short facing) {
}
@Override
public void setFacing(short facing) {
}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
return true;
}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
return true;
}
@Override
public float getWrenchDropRate() {
return 1F;
}
@Override
public float getWrenchDropRate() {
return 1F;
}
@Override
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
return getDropWithNBT();
}
@Override
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
return getDropWithNBT();
}
public ItemStack getDropWithNBT() {
NBTTagCompound tileEntity = new NBTTagCompound();
@ -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,66 +1,61 @@
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 BasicSink energy;
public class TileRollingMachine extends TileMachineBase implements IWrenchable {
public BasicSink energy;
public Inventory inventory = new Inventory(10, "TileRollingMachine", 64);
public boolean isRunning;
public int tickTime;
public RollingMachineRecipie currentRecipe;
public int euTick = 5;
public TileRollingMachine()
{
public TileRollingMachine() {
energy = new BasicSink(this, 100000, 1);
}
@Override
public void updateEntity()
{
super.updateEntity();
energy.updateEntity();
public void updateEntity() {
super.updateEntity();
energy.updateEntity();
}
@Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
return false;
}
@Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
return false;
}
@Override
public short getFacing() {
return 0;
}
@Override
public short getFacing() {
return 0;
}
@Override
public void setFacing(short facing) {}
@Override
public void setFacing(short facing) {
}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
return true;
}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
return true;
}
@Override
public float getWrenchDropRate() {
return 1.0F;
}
@Override
public float getWrenchDropRate() {
return 1.0F;
}
@Override
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
return new ItemStack(ModBlocks.RollingMachine, 1);
}
@Override
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
return new ItemStack(ModBlocks.RollingMachine, 1);
}
}

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) {
@ -69,7 +65,7 @@ public class TileThermalGenerator extends TileEntity implements IWrenchable, IFl
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
return tank.drain(resource.amount, doDrain);
return tank.drain(resource.amount, doDrain);
}
@Override
@ -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

@ -6,15 +6,13 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
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 addShapelessOreRecipe(ItemStack outputItemStack, Object... objectInputs)
{
CraftingManager.getInstance().getRecipeList() .add(new ShapelessOreRecipe(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));
}
}

View file

@ -7,27 +7,27 @@ import net.minecraftforge.oredict.OreDictionary;
* Created by mark on 12/04/15.
*/
public class ItemUtils {
public static boolean isItemEqual(final ItemStack a, final ItemStack b, final boolean matchDamage, final boolean matchNBT) {
if (a == null || b == null)
return false;
if (a.getItem() != b.getItem())
return false;
if (matchNBT && !ItemStack.areItemStackTagsEqual(a, b))
return false;
if (matchDamage && a.getHasSubtypes()) {
if (isWildcard(a) || isWildcard(b))
return true;
if (a.getItemDamage() != b.getItemDamage())
return false;
}
return true;
}
public static boolean isItemEqual(final ItemStack a, final ItemStack b, final boolean matchDamage, final boolean matchNBT) {
if (a == null || b == null)
return false;
if (a.getItem() != b.getItem())
return false;
if (matchNBT && !ItemStack.areItemStackTagsEqual(a, b))
return false;
if (matchDamage && a.getHasSubtypes()) {
if (isWildcard(a) || isWildcard(b))
return true;
if (a.getItemDamage() != b.getItemDamage())
return false;
}
return true;
}
public static boolean isWildcard(ItemStack stack) {
return isWildcard(stack.getItemDamage());
}
public static boolean isWildcard(ItemStack stack) {
return isWildcard(stack.getItemDamage());
}
public static boolean isWildcard(int damage) {
return damage == -1 || damage == OreDictionary.WILDCARD_VALUE;
}
public static boolean isWildcard(int damage) {
return damage == -1 || damage == OreDictionary.WILDCARD_VALUE;
}
}

View file

@ -1,55 +1,45 @@
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)
{
FMLLog.log(ModInfo.MOD_NAME, logLevel, String.valueOf(object));
}
public static void all(Object object)
{
log(Level.ALL, object);
}
public static void log(Level logLevel, Object object) {
FMLLog.log(ModInfo.MOD_NAME, logLevel, String.valueOf(object));
}
public static void debug(Object object)
{
log(Level.DEBUG, object);
}
public static void all(Object object) {
log(Level.ALL, object);
}
public static void error(Object object)
{
log(Level.ERROR, object);
}
public static void debug(Object object) {
log(Level.DEBUG, object);
}
public static void fatal(Object object)
{
log(Level.FATAL, object);
}
public static void error(Object object) {
log(Level.ERROR, object);
}
public static void info(Object object)
{
log(Level.INFO, object);
}
public static void fatal(Object object) {
log(Level.FATAL, object);
}
public static void off(Object object)
{
log(Level.OFF, object);
}
public static void info(Object object) {
log(Level.INFO, object);
}
public static void trace(Object object)
{
log(Level.TRACE, object);
}
public static void off(Object object) {
log(Level.OFF, object);
}
public static void trace(Object object) {
log(Level.TRACE, object);
}
public static void warn(Object object) {
log(Level.WARN, object);
}
public static void warn(Object object)
{
log(Level.WARN, object);
}
}

View file

@ -1,50 +1,41 @@
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)
{
for (ItemStack stack : removelist)
removeShapedRecipe(stack);
}
import java.util.List;
public static void removeAnyRecipe(ItemStack resultItem)
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (int i = 0; i < recipes.size(); i++)
{
IRecipe tmpRecipe = recipes.get(i);
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
{
recipes.remove(i--);
}
}
}
public class RecipeRemover {
public static void removeShapedRecipes(List<ItemStack> removelist) {
for (ItemStack stack : removelist)
removeShapedRecipe(stack);
}
public static void removeShapedRecipe(ItemStack resultItem)
{
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (int i = 0; i < recipes.size(); i++)
{
IRecipe tmpRecipe = recipes.get(i);
if (tmpRecipe instanceof ShapedRecipes)
{
ShapedRecipes recipe = (ShapedRecipes) tmpRecipe;
ItemStack recipeResult = recipe.getRecipeOutput();
public static void removeAnyRecipe(ItemStack resultItem) {
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (int i = 0; i < recipes.size(); i++) {
IRecipe tmpRecipe = recipes.get(i);
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) {
recipes.remove(i--);
}
}
}
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
{
recipes.remove(i++);
}
}
}
}
public static void removeShapedRecipe(ItemStack resultItem) {
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
for (int i = 0; i < recipes.size(); i++) {
IRecipe tmpRecipe = recipes.get(i);
if (tmpRecipe instanceof ShapedRecipes) {
ShapedRecipes recipe = (ShapedRecipes) tmpRecipe;
ItemStack recipeResult = recipe.getRecipeOutput();
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,109 +8,92 @@ 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{
public static ConfigTechReborn config;
WorldGenMinable oreGalena;
WorldGenMinable oreIridium;
WorldGenMinable oreRuby;
WorldGenMinable oreSapphire;
WorldGenMinable oreBauxite;
WorldGenMinable orePyrite;
WorldGenMinable oreCinnabar;
WorldGenMinable oreSphalerite;
WorldGenMinable oreTungston;
WorldGenMinable oreSheldonite;
WorldGenMinable oreOlivine;
WorldGenMinable oreSodalite;
public TROreGen()
{
//World
oreGalena = new WorldGenMinable(ModBlocks.ore, 0, 8, Blocks.stone);
oreIridium = new WorldGenMinable(ModBlocks.ore, 1, 2, Blocks.stone);
oreRuby = new WorldGenMinable(ModBlocks.ore, 2, 8, Blocks.stone);
oreSapphire = new WorldGenMinable(ModBlocks.ore, 3, 8, Blocks.stone);
oreBauxite = new WorldGenMinable(ModBlocks.ore, 4, 8, Blocks.stone);
//Nether
orePyrite = new WorldGenMinable(ModBlocks.ore, 5, 8, Blocks.netherrack);
oreCinnabar = new WorldGenMinable(ModBlocks.ore, 6, 8, Blocks.netherrack);
oreSphalerite = new WorldGenMinable(ModBlocks.ore, 7, 8, Blocks.netherrack);
//End
oreTungston = new WorldGenMinable(ModBlocks.ore, 8, 8, Blocks.end_stone);
oreSheldonite = new WorldGenMinable(ModBlocks.ore, 9, 8, Blocks.end_stone);
oreOlivine = new WorldGenMinable(ModBlocks.ore, 10, 8, Blocks.end_stone);
oreSodalite = new WorldGenMinable(ModBlocks.ore, 11, 8, Blocks.end_stone);
LogHelper.info("WorldGen Loaded");
}
@Override
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)
{
generateHellOres(random, xChunk * 16, zChunk * 16, world);
}
else
{
generateEndOres(random, xChunk * 16, zChunk * 16, world);
}
}
void generateUndergroundOres (Random random, int xChunk, int zChunk, World world)
{
import java.util.Random;
public class TROreGen implements IWorldGenerator {
public static ConfigTechReborn config;
WorldGenMinable oreGalena;
WorldGenMinable oreIridium;
WorldGenMinable oreRuby;
WorldGenMinable oreSapphire;
WorldGenMinable oreBauxite;
WorldGenMinable orePyrite;
WorldGenMinable oreCinnabar;
WorldGenMinable oreSphalerite;
WorldGenMinable oreTungston;
WorldGenMinable oreSheldonite;
WorldGenMinable oreOlivine;
WorldGenMinable oreSodalite;
public TROreGen() {
//World
oreGalena = new WorldGenMinable(ModBlocks.ore, 0, 8, Blocks.stone);
oreIridium = new WorldGenMinable(ModBlocks.ore, 1, 2, Blocks.stone);
oreRuby = new WorldGenMinable(ModBlocks.ore, 2, 8, Blocks.stone);
oreSapphire = new WorldGenMinable(ModBlocks.ore, 3, 8, Blocks.stone);
oreBauxite = new WorldGenMinable(ModBlocks.ore, 4, 8, Blocks.stone);
//Nether
orePyrite = new WorldGenMinable(ModBlocks.ore, 5, 8, Blocks.netherrack);
oreCinnabar = new WorldGenMinable(ModBlocks.ore, 6, 8, Blocks.netherrack);
oreSphalerite = new WorldGenMinable(ModBlocks.ore, 7, 8, Blocks.netherrack);
//End
oreTungston = new WorldGenMinable(ModBlocks.ore, 8, 8, Blocks.end_stone);
oreSheldonite = new WorldGenMinable(ModBlocks.ore, 9, 8, Blocks.end_stone);
oreOlivine = new WorldGenMinable(ModBlocks.ore, 10, 8, Blocks.end_stone);
oreSodalite = new WorldGenMinable(ModBlocks.ore, 11, 8, Blocks.end_stone);
LogHelper.info("WorldGen Loaded");
}
@Override
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) {
generateHellOres(random, xChunk * 16, zChunk * 16, world);
} else {
generateEndOres(random, xChunk * 16, zChunk * 16, 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);
@ -119,34 +101,27 @@ public class TROreGen implements IWorldGenerator{
}
}
}
void generateHellOres (Random random, int xChunk, int zChunk, World world)
{
int xPos, yPos, zPos;
if (config.PyriteOreTrue)
{
for (int i = 0; i <= 16; i++)
{
void generateHellOres(Random random, int xChunk, int zChunk, World world) {
int xPos, yPos, zPos;
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);
@ -154,44 +129,35 @@ public class TROreGen implements IWorldGenerator{
}
}
}
void generateEndOres (Random random, int xChunk, int zChunk, World world)
{
int xPos, yPos, zPos;
if (config.TungstonOreTrue)
{
for (int i = 0; i <= 16; i++)
{
void generateEndOres(Random random, int xChunk, int zChunk, World world) {
int xPos, yPos, zPos;
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);