Update for 1.7.2

Commit for version 1.1.0, the update to minecraft 1.7.2
This commit is contained in:
Tombenpotter committed 2014-04-17 22:27:40 +02:00
1 parent ad11bd5173
commit 1986c7a08f
220 files changed
+2521 -3434

No files matched your search

@@ -29,12 +29,11 @@ import javax.swing.ImageIcon;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.event.ForgeSubscribe;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
public class CapeEventHandler
{
public class CapeEventHandler {
private final String serverLocation = "https://raw.github.com/Tombenpotter/Electro-Magic-Tools/master/capes.txt";
private final int timeout = 1000;
@@ -44,28 +43,23 @@ public class CapeEventHandler
public static CapeEventHandler instance;
public CapeEventHandler()
{
public CapeEventHandler() {
buildCloakURLDatabase();
instance = this;
}
@ForgeSubscribe
@SubscribeEvent
public void onPreRenderSpecials(RenderPlayerEvent.Specials.Pre event) {
if (Loader.isModLoaded("shadersmod"))
{
if (Loader.isModLoaded("shadersmod")) {
return;
}
if (event.entityPlayer instanceof AbstractClientPlayer)
{
if (event.entityPlayer instanceof AbstractClientPlayer) {
AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) event.entityPlayer;
if (!capePlayers.contains(abstractClientPlayer))
{
String cloakURL = cloaks.get(event.entityPlayer.username);
if (!capePlayers.contains(abstractClientPlayer)) {
String cloakURL = cloaks.get(event.entityPlayer.getCommandSenderName());
if (cloakURL == null)
{
if (cloakURL == null) {
return;
}
@@ -81,8 +75,7 @@ public class CapeEventHandler
public void buildCloakURLDatabase() {
URL url;
try
{
try {
url = new URL(serverLocation);
URLConnection con = url.openConnection();
con.setConnectTimeout(timeout);
@@ -92,18 +85,14 @@ public class CapeEventHandler
String str;
int linetracker = 1;
while ((str = br.readLine()) != null)
{
if (!str.startsWith("--"))
{
if (str.contains(":"))
{
while ((str = br.readLine()) != null) {
if (!str.startsWith("--")) {
if (str.contains(":")) {
String nick = str.substring(0, str.indexOf(":"));
String link = str.substring(str.indexOf(":") + 1);
new Thread(new CloakPreload(link)).start();
cloaks.put(nick, link);
} else
{
} else {
System.err.println("[Electro-Magic Tools] [skins.txt] Syntax error on line " + linetracker + ": " + str);
}
}
@@ -111,66 +100,50 @@ public class CapeEventHandler
}
br.close();
} catch (MalformedURLException e)
{
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e)
{
} catch (IOException e) {
e.printStackTrace();
}
}
private class CloakThread implements Runnable
{
private class CloakThread implements Runnable {
AbstractClientPlayer abstractClientPlayer;
String cloakURL;
public CloakThread(AbstractClientPlayer player, String cloak)
{
public CloakThread(AbstractClientPlayer player, String cloak) {
abstractClientPlayer = player;
cloakURL = cloak;
}
@Override
public void run() {
try
{
try {
Image cape = new ImageIcon(new URL(cloakURL)).getImage();
BufferedImage bo = new BufferedImage(cape.getWidth(null), cape.getHeight(null), BufferedImage.TYPE_INT_ARGB);
bo.getGraphics().drawImage(cape, 0, 0, null);
ReflectionHelper.setPrivateValue(ThreadDownloadImageData.class, abstractClientPlayer.getTextureCape(), bo, new String[] { "bufferedImage", "field_110560_d" });
} catch (MalformedURLException e)
{
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}
private class CloakPreload implements Runnable
{
private class CloakPreload implements Runnable {
String cloakURL;
public CloakPreload(String link)
{
public CloakPreload(String link) {
cloakURL = link;
}
@Override
public void run() {
try
{
try {
TEST_GRAPHICS.drawImage(new ImageIcon(new URL(cloakURL)).getImage(), 0, 0, null);
} catch (MalformedURLException e)
{
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}
public void refreshCapes() {
cloaks.clear();
capePlayers.clear();
buildCloakURLDatabase();
}
}
@@ -12,14 +12,13 @@
package electricMagicTools.tombenpotter.electricmagictools.client;
import cpw.mods.fml.client.registry.RenderingRegistry;
import electricMagicTools.tombenpotter.electricmagictools.client.renderer.RenderArcher;
import electricMagicTools.tombenpotter.electricmagictools.client.renderer.RenderLaser;
import electricMagicTools.tombenpotter.electricmagictools.common.CommonProxy;
import electricMagicTools.tombenpotter.electricmagictools.common.entities.EntityArcher;
import electricMagicTools.tombenpotter.electricmagictools.common.entities.EntityLaser;
import electricMagicTools.tombenpotter.electricmagictools.common.entities.RenderArcher;
import electricMagicTools.tombenpotter.electricmagictools.common.entities.RenderLaser;
public class ClientProxy extends CommonProxy
{
public class ClientProxy extends CommonProxy {
@Override
public void load() {
@@ -13,7 +13,6 @@ package electricMagicTools.tombenpotter.electricmagictools.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
@@ -22,11 +21,9 @@ import org.lwjgl.opengl.GL11;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEtherealMacerator;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerEtheralMacerator;
public class GuiEtherealMacerator extends GuiContainer
{
public class GuiEtherealMacerator extends GuiContainer {
public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te)
{
public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te) {
super(new ContainerEtheralMacerator(inventory, te));
xSize = 176;
ySize = 165;
@@ -42,7 +39,7 @@ public class GuiEtherealMacerator extends GuiContainer
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRenderer.drawString(I18n.getString("Ethereal Processor"), 6, 6, 4210752);
this.fontRenderer.drawString(I18n.getString("Inventory"), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Ethereal Processor", 6, 6, 4210752);
this.fontRendererObj.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
}
}
@@ -13,7 +13,6 @@ package electricMagicTools.tombenpotter.electricmagictools.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
@@ -22,11 +21,9 @@ import org.lwjgl.opengl.GL11;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityIndustrialWandRecharge;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerIndustrialWandRecharge;
public class GuiIndustrialWandRecharger extends GuiContainer
{
public class GuiIndustrialWandRecharger extends GuiContainer {
public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te)
{
public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te) {
super(new ContainerIndustrialWandRecharge(inventory, te));
xSize = 176;
ySize = 165;
@@ -42,7 +39,7 @@ public class GuiIndustrialWandRecharger extends GuiContainer
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRenderer.drawString(I18n.getString("Industrial Wand Charging Station"), 6, 6, 4210752);
this.fontRenderer.drawString(I18n.getString("Inventory"), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Industrial Wand Charging Station", 6, 6, 4210752);
this.fontRendererObj.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
}
}
@@ -9,13 +9,12 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.entities;
package electricMagicTools.tombenpotter.electricmagictools.client.renderer;
import net.minecraft.client.renderer.entity.RenderSnowMan;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderArcher extends RenderSnowMan
{
public class RenderArcher extends RenderSnowMan {
}
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.entities;
package electricMagicTools.tombenpotter.electricmagictools.client.renderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
@@ -19,8 +19,9 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class RenderLaser extends Render
{
import electricMagicTools.tombenpotter.electricmagictools.common.entities.EntityLaser;
public class RenderLaser extends Render {
private static final ResourceLocation laserTexture = new ResourceLocation("electricmagictools:textures/models/lasermodel.png");
@@ -62,8 +63,7 @@ public class RenderLaser extends Render
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f9);
tessellator.draw();
for (int i = 0; i < 4; ++i)
{
for (int i = 0; i < 4; ++i) {
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glNormal3f(0.0F, 0.0F, f10);
tessellator.startDrawingQuads();
@@ -12,23 +12,19 @@
package electricMagicTools.tombenpotter.electricmagictools.common;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.blocks.BlockEMTMachines;
import electricMagicTools.tombenpotter.electricmagictools.common.blocks.BlockEMTSolars;
import electricMagicTools.tombenpotter.electricmagictools.common.blocks.BlockEMTSolars2;
import electricMagicTools.tombenpotter.electricmagictools.common.blocks.BlockEssentiaGenerators;
import electricMagicTools.tombenpotter.electricmagictools.common.blocks.BlockPortableNode;
import electricMagicTools.tombenpotter.electricmagictools.common.blocks.BlockShield;
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemBlockEMTMachines;
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemBlockEMTSolars;
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemBlockEMTSolars2;
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemBlockEssentiaGenerators;
public class BlockRegistry
{
import electricMagicTools.tombenpotter.electricmagictools.common.items.blocks.ItemBlockEMTMachines;
import electricMagicTools.tombenpotter.electricmagictools.common.items.blocks.ItemBlockEMTSolars;
import electricMagicTools.tombenpotter.electricmagictools.common.items.blocks.ItemBlockEMTSolars2;
import electricMagicTools.tombenpotter.electricmagictools.common.items.blocks.ItemBlockEssentiaGenerators;
public class BlockRegistry {
public static Block essentiaGens;
public static Block shield;
public static Block emtSolars;
@@ -37,52 +33,18 @@ public class BlockRegistry
public static Block portableNode;
public static void registerEMTBlocks() {
shield = new BlockShield(Config.shieldID).setUnlocalizedName("shield");
portableNode = new BlockPortableNode(Config.portableNodeID).setUnlocalizedName("portablenode");
emtSolars = new BlockEMTSolars(Config.emtSolarsID).setUnlocalizedName("emtsolars");
essentiaGens = new BlockEssentiaGenerators(Config.essentiaGensID).setUnlocalizedName("essentiaGens");
emtMachines = new BlockEMTMachines(Config.emtMachinesID).setUnlocalizedName("emtmachines");
emtSolars2 = new BlockEMTSolars2(Config.emtSolars2ID).setUnlocalizedName("emtsolars2");
shield = new BlockShield().setBlockName("shield");
portableNode = new BlockPortableNode().setBlockName("portablenode");
emtSolars = new BlockEMTSolars().setBlockName("emtsolars");
essentiaGens = new BlockEssentiaGenerators().setBlockName("essentiaGens");
emtMachines = new BlockEMTMachines().setBlockName("emtmachines");
emtSolars2 = new BlockEMTSolars2().setBlockName("emtsolars2");
GameRegistry.registerBlock(shield, "Shield Block");
GameRegistry.registerBlock(portableNode, "Portable Node");
GameRegistry.registerBlock(emtSolars, ItemBlockEMTSolars.class, "EMT Solar Panels");
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "Essentia Generators");
GameRegistry.registerBlock(emtMachines, ItemBlockEMTMachines.class, "EMT Machines");
GameRegistry.registerBlock(emtSolars2, ItemBlockEMTSolars2.class, "EMT Solars 2");
LanguageRegistry.addName(new ItemStack(essentiaGens, 1, 0), "Potentia Generator");
LanguageRegistry.addName(new ItemStack(essentiaGens, 1, 1), "Ignis Generator");
LanguageRegistry.addName(new ItemStack(essentiaGens, 1, 2), "Auram Generator");
LanguageRegistry.addName(new ItemStack(essentiaGens, 1, 3), "Arbor Generator");
LanguageRegistry.addName(new ItemStack(essentiaGens, 1, 4), "Saxum Generator");
LanguageRegistry.addName(shield, "Shield Block");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 0), "Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 1), "Double Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 2), "Triple Compessed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtMachines, 1, 0), "Industrial Wand Charging Station");
LanguageRegistry.addName(new ItemStack(emtMachines, 1, 1), "Ethereal Processor");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 3), "Water Infused Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 4), "Water Infused Double Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 5), "Water Infused Triple Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 6), "Entropy Infused Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 7), "Entropy Infused Double Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 8), "Entropy Infused Triple Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 9), "Order Infused Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 10), "Order Infused Double Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 11), "Order Infused Triple Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 12), "Fire Infused Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 13), "Fire Infused Double Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 14), "Fire Infused Triple Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars, 1, 15), "Air Infused Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars2, 1, 0), "Air Infused Double Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars2, 1, 1), "Air Infused Triple Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars2, 1, 2), "Earth Infused Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars2, 1, 3), "Earth Infused Double Compressed Solar Panel");
LanguageRegistry.addName(new ItemStack(emtSolars2, 1, 4), "Earth Infused Triple Compressed Solar Panel");
LanguageRegistry.addName(portableNode, "Portable Node");
}
}
@@ -22,8 +22,7 @@ import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntity
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerEtheralMacerator;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerIndustrialWandRecharge;
public class CommonProxy implements IGuiHandler
{
public class CommonProxy implements IGuiHandler {
public void load() {
registerRenders();
@@ -35,25 +34,20 @@ public class CommonProxy implements IGuiHandler
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getBlockTileEntity(x, y, z);
TileEntity entity = world.getTileEntity(x, y, z);
switch (ID)
{
switch (ID) {
case 0:
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge)
{
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) {
return new ContainerIndustrialWandRecharge(player.inventory, (TileEntityIndustrialWandRecharge) entity);
} else
{
} else {
return null;
}
case 1:
if (entity != null && entity instanceof TileEntityEtherealMacerator)
{
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
return new ContainerEtheralMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
} else
{
} else {
return null;
}
default:
@@ -63,25 +57,20 @@ public class CommonProxy implements IGuiHandler
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getBlockTileEntity(x, y, z);
TileEntity entity = world.getTileEntity(x, y, z);
switch (ID)
{
switch (ID) {
case 0:
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge)
{
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) {
return new GuiIndustrialWandRecharger(player.inventory, (TileEntityIndustrialWandRecharge) entity);
} else
{
} else {
return null;
}
case 1:
if (entity != null && entity instanceof TileEntityEtherealMacerator)
{
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
return new GuiEtherealMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
} else
{
} else {
return null;
}
default:
@@ -11,50 +11,17 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
public class Config
{
public static int thaumiumDrillID;
public static int thaumiumChainsawID;
public static int quantumThaumicHelmetID;
public static int diamondChainsawID;
public static int ironOmnitoolID;
public static int diamondOmnitoolID;
public static int thaumiumOmnitoolID;
public static int nanoThaumicHelmetID;
public static int explosionFocusID;
public static int christmasFocusID;
public static int shieldFocusID;
public static int shieldID;
public static int electricGogglesID;
public static int streamChainsawID;
public static int rockbreakerDrillID;
public static int thaumiumPlateID;
public static int solarHelmetRevealingID;
public static int thorHammerID;
public static int taintedThorHammerID;
public static int lightningSummonerID;
public static int electricThorHammerID;
public static int electricBootsTravellerID;
public static int quantumBootsTravellerID;
public static int nanoBootsTravellerID;
public static int electricScribingToolsID;
public class Config {
public static int essentiaGeneratorsDelay;
public static int etherealProcessorBaseSpeed;
public static int etherealProcessorBonus;
public static int itemEMTItemID;
public static int electricHoeGrowthID;
public static int chargeFocusProduction;
public static int chargeFocusID;
public static int emtSolarsID;
public static int essentiaGensID;
public static int emtMachinesID;
public static int emtSolars2ID;
public static int portableNodeID;
public static int armorBaubleProduction;
public static int inventoryBaubleProdution;
public static int wandChargeFocusCost;
public static double potentiaGenOutput;
public static double arborGenOutput;
@@ -75,6 +42,7 @@ public class Config
public static boolean nightVisionOff;
public static boolean enchanting;
public static boolean smoke;
public static boolean oneRingSpawn;
public static boolean thaumiumDrillResearch;
public static boolean thaumiumChainsawResearch;
@@ -116,6 +84,9 @@ public class Config
public static boolean portableNodeResarch;
public static boolean electricHoeGrowthResearch;
public static boolean chargeFocusResearch;
public static boolean wandChargeFocusResearch;
public static boolean inventoryChargingRing;
public static boolean armorChargingRing;
public static String CATEGORY_RESEARCH = "Research";
public static String CATEGORY_VALUES = "Numeric Values";
@@ -127,169 +98,80 @@ public class Config
config.load();
// Random Booleans
/** Random Booleans **/
capesOn = config.get(Configuration.CATEGORY_GENERAL, "Enable showing capes", true, "This config option is to enable or disable capes for people who have them. " + "Seriously, you shouldn't touch that unless you have another cape and " + "it conflicts with it.").getBoolean(capesOn);
toolsInBore = config.get(Configuration.CATEGORY_GENERAL, "Making the tools worth begin used in the Arcane Bore.", false, "This will augment the durablilty of the tools, and will also decrease the EU cost to 1. " + "The tools should have the same number of uses than before.").getBoolean(toolsInBore);
nightVisionOff = config.get(Configuration.CATEGORY_GENERAL, "Disable totally the nightvision ability of the Nanosuit Googles of Revealing, " + "Quantum Googles of Revealing and of the Quantum Solar Helmet of Revealing", false).getBoolean(nightVisionOff);
enchanting = config.get(Configuration.CATEGORY_GENERAL, "Disable the enchanting of my items. " + "Even if on, it will not make them be able to use the repair enchant! " + "This is disabled by default", true).getBoolean(enchanting);
enchanting = config.get(Configuration.CATEGORY_GENERAL, "Enable enchanting my tools and amors", false).getBoolean(enchanting);
smoke = config.get(Configuration.CATEGORY_GENERAL, "Disable the smoke effect for the Electric/Nano/Quantum Boots of the Traveller", false).getBoolean(smoke);
oneRingSpawn = config.get(Configuration.CATEGORY_GENERAL, "Disable the One Ring spawning in dungeon chests", false, "There is no other way to get this item.").getBoolean(oneRingSpawn);
// Item IDs
thaumiumDrillID = config.getItem("Thaumium Drill", 4000).getInt();
thaumiumChainsawID = config.getItem("Thaumium Chainsaw", 4001).getInt();
quantumThaumicHelmetID = config.getItem("Quantum Goggles of Revealing", 4002).getInt();
diamondChainsawID = config.getItem("Diamond Chainsaw", 4003).getInt();
ironOmnitoolID = config.getItem("Iron Omnitool", 4004).getInt();
diamondOmnitoolID = config.getItem("Diamond Omnitool", 4005).getInt();
thaumiumOmnitoolID = config.getItem("Thaumium Omnitool", 4006).getInt();
nanoThaumicHelmetID = config.getItem("Nanosuit Goggles of Revealing", 4007).getInt();
explosionFocusID = config.getItem("Explosion Focus", 4008).getInt();
christmasFocusID = config.getItem("Kris-tmas Focus", 4009).getInt();
shieldFocusID = config.getItem("Shield Focus", 4010).getInt();
electricGogglesID = config.getItem("Electric Goggles of Revealing", 4011).getInt();
streamChainsawID = config.getItem("Chainsaw of the Stream", 4012).getInt();
rockbreakerDrillID = config.getItem("Drill of the Rockbreaker", 4013).getInt();
thaumiumPlateID = config.getItem("Thauium Plate", 4014).getInt();
solarHelmetRevealingID = config.getItem("Solar Helmet of Revealing", 4015).getInt();
thorHammerID = config.getItem("Mjolnir", 4016).getInt();
taintedThorHammerID = config.getItem("Broken Relic of Mjolnir", 4017).getInt();
lightningSummonerID = config.getItem("Lightning Summoner", 4018).getInt();
electricThorHammerID = config.getItem("Supercharged Mjolnir", 4020).getInt();
electricBootsTravellerID = config.getItem("Electric Boots of the Traveller", 4021).getInt();
nanoBootsTravellerID = config.getItem("Nano Boots of the Traveller", 4022).getInt();
quantumBootsTravellerID = config.getItem("Quantum Boots of the Traveller", 4023).getInt();
electricScribingToolsID = config.getItem("Electric Scribing Tools", 4024).getInt();
itemEMTItemID = config.getItem("EMT Items", 4025).getInt();
electricHoeGrowthID = config.getItem("Electric Hoe of Growth", 4026).getInt();
chargeFocusID = config.getItem("Wand Focus: Charge", 4027).getInt();
// Block IDs
essentiaGensID = config.getBlock("Essentia Generators", 1500).getInt();
shieldID = config.getBlock("Shield", 1501).getInt();
emtMachinesID = config.getBlock("EMT Machines", 1502).getInt();
emtSolarsID = config.getBlock("EMT Solars", 1503).getInt();
emtSolars2ID = config.getBlock("EMT Solars 2", 1504).getInt();
portableNodeID = config.getBlock("Portable Node", 1505).getInt();
// EU Yield/Consumption modifier
/** EU Yield/Consumption modifier **/
potentiaGenOutput = config.get("Numeric Values", "Potentia Generator EU Output", 3500, "This is the number you have to modify if you want to make the Potentia Generator yield " + "more or less EU per unit of essentia.").getDouble(potentiaGenOutput);
arborGenOutput = config.get("Numeric Values", "Arbor Generator EU Output", 325, "This is the number you have to modify if you want to make the Arbor Generator yield " + "more or less EU per unit of essentia.").getDouble(arborGenOutput);
auramGenOutput = config.get("Numeric Values", "Auram Generator EU Output", 3200, "This is the number you have to modify if you want to make the Auram Generator yield " + "more or less EU per unit of essentia.").getDouble(auramGenOutput);
ignisGenOutput = config.get("Numeric Values", "Ignis Generator EU Output", 3200, "This is the number you have to modify if you want to make the Ignis Generator yield " + "more or less EU per unit of essentia.").getDouble(ignisGenOutput);
saxumGenOutput = config.get("Numeric Values", "Saxum Generator Output", 350, "This is the number you have to modify if you want to make the Saxum Generator yield " + "more or less EU per unit of essentia.").getDouble(saxumGenOutput);
wandChargerConsumption = config.get("Numeric Values", "Industrial Wand Charging Station EU Consumption", 50000, "This is the number you have to modify if you want to make the Industrial Wand Charging " + "Station use more or less EU to charge 1 unit of Vis on your wand.").getDouble(wandChargerConsumption);
compressedSolarOutput = config.get("Numeric Values", "Compressed Solar Panel EU Output", 10, "This is the number you have to modify if you want to make the Compressed Solar Panel yield " + "more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(compressedSolarOutput);
doubleCompressedSolarOutput = config.get("Numeric Values", "Double Compressed Solar Panel EU Output", 100, "This is the number you have to modify if you want to make the Double Compressed Solar Panel " + "yield more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(doubleCompressedSolarOutput);
tripleCompressedSolarOutput = config.get("Numeric Values", "Triple Compressed Solar Panel EU Output", 1000, "This is the number you have to modify if you want to make the Triple Compressed Solar Panel " + "yield more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(tripleCompressedSolarOutput);
essentiaGeneratorsDelay = config.get("Numeric Values", "Essentia Generators draw rate", 120, "The number of ticks the Essentia Generators wait before using 2 Essentia. " + "If you want them to be slower, increase the number.").getInt(essentiaGeneratorsDelay);
nanoBootsSpeed = config.get("Numeric Values", "Speed of the Nano Boots of the Traveller", 0.25, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsSpeed);
quantumBootsSpeed = config.get("Numeric Values", "Speed of the Quantum Boots of the Traveller", 0.5, "Watch out, that goes up REALLY quickly.").getDouble(quantumBootsSpeed);
nanoBootsJump = config.get("Numeric Values", "Jump height for the Nano Boots of the Traveller", 0.6, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsJump);
quantumBootsJump = config.get("Numeric Values", "Jump height for the Quantum Boots of the Traveller", 0.9, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsJump);
etherealProcessorBaseSpeed = config.get("Numeric Values", "Base Time the Etheral Processor takes to process a single item in number of ticks.", 400).getInt();
etherealProcessorBonus = config.get("Numeric Values", "Ethereal Processor Bonus", 10, "This number is the chance of getting a Thaumium Ingot as a bonus when " + "processing an item in the machine. It is 1 out of the number you will enter. " + "The default is 1/10 chance.").getInt();
chargeFocusProduction = config.get("Numeric Values", "Wand Focus: Charge production in EU/T", 64).getInt();
armorBaubleProduction = config.get("Numeric Values", "Armor Charging Ring produciton in EU/T", 32).getInt();
inventoryBaubleProdution = config.get("Numeric Values", "Inventory Charging Ring produciton in EU/T", 32).getInt();
wandChargeFocusCost = config.get("Numeric Values", "Wand Focus: Wand Charging Cost in EU/T", 40000).getInt();
// Disable Researches
/** Disable Researches **/
thaumiumDrillResearch = config.get("Research", "Thaumium Drill", false).getBoolean(thaumiumDrillResearch);
thaumiumChainsawResearch = config.get("Research", "Thaumium Chainsaw", false).getBoolean(thaumiumChainsawResearch);
thaumiumDrillResearch = config.get("Research", "Thaumium Omnitool", false).getBoolean(thaumiumOmnitoolResearch);
rockbreakerDrillResearch = config.get("Research", "Drill of the Rockbreaker", false).getBoolean(rockbreakerDrillResearch);
streamChainsawResearch = config.get("Research", "Chainsaw of the Stream", false).getBoolean(streamChainsawResearch);
electricGooglesResearch = config.get("Research", "Electric Googles of Revealing", false).getBoolean(electricGooglesResearch);
nanoGooglesResearch = config.get("Research", "Nanosuit Googles of Revealing", false).getBoolean(nanoGooglesResearch);
quantumGooglesResearch = config.get("Research", "Quantum Googles of Revealing", false).getBoolean(quantumGooglesResearch);
ironOmnitoolResearch = config.get("Research", "Omnitool", false).getBoolean(ironOmnitoolResearch);
diamondOmnitoolResearch = config.get("Research", "Diamond Omnitool", false).getBoolean(diamondOmnitoolResearch);
explosionFocusResearch = config.get("Research", "Explosion Focus", false).getBoolean(explosionFocusResearch);
christmasFocusResearch = config.get("Research", "Kris-tmas Focus", false).getBoolean(christmasFocusResearch);
shieldFocusResearch = config.get("Research", "Shield Focus", false).getBoolean(shieldFocusResearch);
shieldBlockResearch = config.get("Research", "Shield Block", false).getBoolean(shieldBlockResearch);
potentiaGeneratorResearch = config.get("Research", "Potentia Generator", false).getBoolean(potentiaGeneratorResearch);
ignisGeneratorResearch = config.get("Research", "Ignis Generator", false).getBoolean(ignisGeneratorResearch);
auramGeneratorResearch = config.get("Research", "Auram Generator", false).getBoolean(auramGeneratorResearch);
arborGeneratorResearch = config.get("Research", "Arbor Generator", false).getBoolean(arborGeneratorResearch);
wandChargingSationResearch = config.get("Research", "Industrial Wand Charging Station", false).getBoolean(wandChargingSationResearch);
tinyUraniumResearch = config.get("Research", "Tiny Piles of Uranium", false).getBoolean(tinyUraniumResearch);
thorHammerResearch = config.get("Research", "Mjolnir", false).getBoolean(thorHammerResearch);
superchargedThorHammerResearch = config.get("Research", "Supercharged Mjolnir", false).getBoolean(superchargedThorHammerResearch);
compressedSolarsResearch = config.get("Research", "Compressed Solars", false).getBoolean(compressedSolarsResearch);
solarHelmetResearch = config.get("Research", "Solar Helmet of Revealing", false).getBoolean(solarHelmetResearch);
electricBootsResearch = config.get("Research", "Electric Boots of the Traveller", false).getBoolean(electricBootsResearch);
nanoBootsResearch = config.get("Research", "Nano Boots of the Traveller", false).getBoolean(nanoBootsResearch);
quantumBootsResearch = config.get("Research", "Quantum Boots of the Traveller", false).getBoolean(quantumBootsResearch);
electricScribingToolsResearch = config.get("Research", "Electric Scribing Tools", false).getBoolean(electricScribingToolsResearch);
etherealProcessorResearch = config.get("Research", "Ethereal Processor", false).getBoolean(etherealProcessorResearch);
waterSolarsResearch = config.get("Research", "Water Solar Panels", false).getBoolean(waterSolarsResearch);
darkSolarsResearch = config.get("Research", "Entropy Solar Panels", false).getBoolean(darkSolarsResearch);
orderSolarsResearch = config.get("Research", "Order Solar Panels", false).getBoolean(orderSolarsResearch);
fireSolarsResearch = config.get("Research", "Fire Solar Panels", false).getBoolean(fireSolarsResearch);
airSolarsResearch = config.get("Research", "Air Solar Panels", false).getBoolean(airSolarsResearch);
earthSolarsResearch = config.get("Research", "Earth Solar Panels", false).getBoolean(earthSolarsResearch);
saxumGenResearch = config.get("Research", "Saxum Generator", false).getBoolean(saxumGenResearch);
uuMInfusionResearch = config.get("Research", "UU-Mater Infusion", false).getBoolean(uuMInfusionResearch);
portableNodeResarch = config.get("Research", "Portable Node", false).getBoolean(portableNodeResarch);
electricHoeGrowthResearch = config.get("Research", "Electric Hoe of Growth", false).getBoolean(electricHoeGrowthResearch);
chargeFocusResearch = config.get("Research", "Wand Focus: Charging", false).getBoolean(chargeFocusResearch);
wandChargeFocusResearch = config.get("Research", "Wand Focus: Wand Charging", false).getBoolean(wandChargeFocusResearch);
inventoryChargingRing = config.get("Research", "Inventory Charging Ring", false).getBoolean(inventoryChargingRing);
armorChargingRing = config.get("Research", "Armor Charging Ring", false).getBoolean(armorChargingRing);
config.save();
}
@@ -12,20 +12,13 @@
package electricMagicTools.tombenpotter.electricmagictools.common;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.item.Item;
public class CreativeTab
{
public static void load() {
LanguageRegistry.instance().addStringLocalization("itemGroup.tabTombenpotter", "en_US", "Electro-Magic Tools");
}
public static CreativeTabs tabTombenpotter = new CreativeTabs("tabTombenpotter")
{
public ItemStack getIconItemStack() {
return new ItemStack(ItemRegistry.thaumiumDrill);
public class CreativeTab {
public static CreativeTabs tabTombenpotter = new CreativeTabs("Electro-Magic Tools") {
@Override
public Item getTabIconItem() {
return ItemRegistry.thaumiumDrill;
}
};
}
@@ -1,88 +0,0 @@
/*******************************************************************************
* Copyright (c) 2014 Tombenpotter.
* All rights reserved.
*
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
*
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.ICraftingHandler;
public class EMTCraftingHandler implements ICraftingHandler
{
@SuppressWarnings("unused")
@Override
public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) {
ItemStack taintedhammer = new ItemStack(ItemRegistry.taintedThorHammer).copy();
for (int i = 0; i < craftMatrix.getSizeInventory(); i++)
{
if (craftMatrix.getStackInSlot(i) != null)
{
ItemStack itemstack = craftMatrix.getStackInSlot(i);
if ((itemstack != null) && (itemstack.itemID == new ItemStack(ItemRegistry.taintedThorHammer, 1, OreDictionary.WILDCARD_VALUE).itemID))
{
ItemStack newitemstack = new ItemStack(ItemRegistry.taintedThorHammer, 2, itemstack.getItemDamage() + 1);
if (newitemstack.getItemDamage() >= newitemstack.getMaxDamage())
{
newitemstack.stackSize -= 1;
}
craftMatrix.setInventorySlotContents(i, newitemstack);
break;
}
}
}
for (int i = 0; i < craftMatrix.getSizeInventory(); i++)
{
if (craftMatrix.getStackInSlot(i) != null)
{
ItemStack itemstack = craftMatrix.getStackInSlot(i);
if ((itemstack != null) && (itemstack.itemID == new ItemStack(ItemRegistry.thorHammer, 1, OreDictionary.WILDCARD_VALUE).itemID))
{
ItemStack newitemstack = new ItemStack(ItemRegistry.thorHammer, 2, itemstack.getItemDamage() + 1);
if (newitemstack.getItemDamage() >= newitemstack.getMaxDamage())
{
newitemstack.stackSize -= 1;
}
craftMatrix.setInventorySlotContents(i, newitemstack);
break;
}
}
}
for (int i = 0; i < craftMatrix.getSizeInventory(); i++)
{
if (craftMatrix.getStackInSlot(i) != null)
{
ItemStack itemstack = craftMatrix.getStackInSlot(i);
if ((itemstack != null) && (itemstack.itemID == new ItemStack(ItemRegistry.electricThorHammer, 1, OreDictionary.WILDCARD_VALUE).itemID))
{
ItemStack newitemstack = new ItemStack(ItemRegistry.electricThorHammer, 2, itemstack.getItemDamage() + 1);
if (newitemstack.getItemDamage() >= newitemstack.getMaxDamage())
{
newitemstack.stackSize -= 1;
}
craftMatrix.setInventorySlotContents(i, newitemstack);
break;
}
}
}
}
@Override
public void onSmelting(EntityPlayer player, ItemStack item) {
}
}
@@ -12,16 +12,14 @@
package electricMagicTools.tombenpotter.electricmagictools.common;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityList.EntityEggInfo;
import net.minecraft.entity.EntityLiving;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.entities.EntityArcher;
import electricMagicTools.tombenpotter.electricmagictools.common.entities.EntityLaser;
public class EMTEntityRegistry
{
public class EMTEntityRegistry {
private static int startEID = 300;
private static int entityIDs = 0;
@@ -29,8 +27,7 @@ public class EMTEntityRegistry
private static int getUniqueEntityID() {
do
{
do {
startEID++;
} while (EntityList.getStringFromID(startEID) != null);
return startEID;
@@ -47,10 +44,7 @@ public class EMTEntityRegistry
public static void registerEMTEntities() {
EntityRegistry.registerModEntity(EntityLaser.class, "entityLaser", entityIDs++, ElectricMagicTools.instance, 80, 3, true);
LanguageRegistry.instance().addStringLocalization("entity.Tombenpotter's Electro-Magic Tools.entityLaser.name", "Laser");
EntityRegistry.registerModEntity(EntityArcher.class, "entityArcher", entityIDs++, ElectricMagicTools.instance, 80, 3, true);
LanguageRegistry.instance().addStringLocalization("entity.Tombenpotter's Electro-Magic Tools.entityArcher.name", "Guardian Snowman");
registerEntityEgg(ARCHER_CLASS, 0x99111F, 0xE5685);
}
}
@@ -11,23 +11,24 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class EntityLivingHandler
{
public class EMTEventHandler {
@ForgeSubscribe
public void onEntityLivingDeath(LivingDeathEvent event) {
if (event.entityLiving instanceof EntityCreeper)
{
EntityCreeper creeper = (EntityCreeper) event.entityLiving;
if (creeper.getPowered())
{
event.entityLiving.dropItem(ItemRegistry.lightningSummoner.itemID, 1);
@SubscribeEvent
public void onEntityLivingDrops(LivingDropsEvent event) {
if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
if (event.entityLiving instanceof EntityCreeper) {
EntityCreeper creeper = (EntityCreeper) event.entityLiving;
if (creeper.getPowered()) {
event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ItemRegistry.lightningSummoner)));
}
}
}
}
}
@@ -30,21 +30,17 @@ import thaumcraft.api.research.ResearchPage.PageType;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EMTResearchItem extends ResearchItem
{
public class EMTResearchItem extends ResearchItem {
public EMTResearchItem(String par1, String par2)
{
public EMTResearchItem(String par1, String par2) {
super(par1, par2);
}
public EMTResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ItemStack icon)
{
public EMTResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ItemStack icon) {
super(par1, par2, tags, par3, par4, par5, icon);
}
public EMTResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ResourceLocation icon)
{
public EMTResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ResourceLocation icon) {
super(par1, par2, tags, par3, par4, par5, icon);
}
@@ -62,17 +58,14 @@ public class EMTResearchItem extends ResearchItem
@Override
public ResearchItem setPages(ResearchPage... par) {
for (ResearchPage page : par)
{
for (ResearchPage page : par) {
if (page.type == PageType.TEXT)
page.text = "emt.text." + key;
if (page.type == PageType.INFUSION_CRAFTING)
{
if (page.type == PageType.INFUSION_CRAFTING) {
if (parentsHidden == null || parentsHidden.length == 0)
parentsHidden = new String[] { "INFUSION" };
else
{
else {
String[] newParents = new String[parentsHidden.length + 1];
newParents[0] = "INFUSION";
for (int i = 0; i < parentsHidden.length; i++)
@@ -22,7 +22,6 @@ import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import electricMagicTools.tombenpotter.electricmagictools.client.CapeEventHandler;
@@ -30,25 +29,26 @@ import electricMagicTools.tombenpotter.electricmagictools.common.recipes.EMTInit
import electricMagicTools.tombenpotter.electricmagictools.common.recipes.EMTPostInitRecipes;
import electricMagicTools.tombenpotter.electricmagictools.common.recipes.UuMInfusionRecipes;
@Mod(modid = ElectricMagicTools.modid, name = "Electro-Magic Tools", version = "1.0.9", dependencies = "required-after:Thaumcraft ; required-after:IC2")
@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = { ElectricMagicTools.modid })
public class ElectricMagicTools
{
@Mod(modid = ElectricMagicTools.modid, name = "Electro-MagicTools", version = "1.1.0", dependencies = "required-after:Thaumcraft ; required-after:IC2")
public class ElectricMagicTools {
@SidedProxy(clientSide = "electricMagicTools.tombenpotter.electricmagictools.client.ClientProxy", serverSide = "electricMagicTools.tombenpotter.electricmagictools.common.CommonProxy")
public static CommonProxy proxy;
@Instance(ElectricMagicTools.modid)
public static ElectricMagicTools instance;
public static final String modid = "Tombenpotter's Electro-Magic Tools";
public static final String modid = "Electro-MagicTools";
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
/** Creating the config file **/
Config.create(event);
/** Registering the custom crafting handler --- UNUSED FOR NOW **/
// GameRegistry.registerCraftingHandler(new EMTCraftingHandler());
/** Items Registry **/
ItemRegistry.registerEMTItems();
/** Blocks registry **/
BlockRegistry.registerEMTBlocks();
System.out.println("[EMT] Electro-Magic Tools : Successful PreInit");
}
@@ -59,25 +59,18 @@ public class ElectricMagicTools
proxy.load();
/** Making mobs drop additional items **/
MinecraftForge.EVENT_BUS.register(new EntityLivingHandler());
/** Making Creative Tab **/
CreativeTab.load();
/** Items Registry **/
ItemRegistry.registerEMTItems();
/** Blocks registry **/
BlockRegistry.registerEMTBlocks();
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
/** Tile entities registry **/
TileEntityRegistry.registerEMTTileEntites();
/** Generating in dungeon chests **/
if (Config.thorHammerResearch == false)
{
if (Config.thorHammerResearch == false) {
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ItemRegistry.taintedThorHammer), 1, 1, 5));
}
if (Config.oneRingSpawn == false) {
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ItemRegistry.emtBauble, 1, 2), 1, 1, 3));
}
/** Adding the recipes that go in Init **/
EMTInitRecipes.add();
@@ -86,11 +79,10 @@ public class ElectricMagicTools
EMTEntityRegistry.registerEMTEntities();
/** GUI Handler Registry **/
NetworkRegistry.instance().registerGuiHandler(this, proxy);
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
/** Adds Capes **/
if (event.getSide() == Side.CLIENT && Config.capesOn == true)
{
if (event.getSide() == Side.CLIENT && Config.capesOn == true) {
MinecraftForge.EVENT_BUS.register(new CapeEventHandler());
}
@@ -12,8 +12,8 @@
package electricMagicTools.tombenpotter.electricmagictools.common;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemEMTBaubles;
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemEMTItems;
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemElectricScribingTools;
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemLightningSummoner;
@@ -29,6 +29,7 @@ import electricMagicTools.tombenpotter.electricmagictools.common.items.foci.Item
import electricMagicTools.tombenpotter.electricmagictools.common.items.foci.ItemChristmasFocus;
import electricMagicTools.tombenpotter.electricmagictools.common.items.foci.ItemExplosionFocus;
import electricMagicTools.tombenpotter.electricmagictools.common.items.foci.ItemShieldFocus;
import electricMagicTools.tombenpotter.electricmagictools.common.items.foci.ItemWandChargingFocus;
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemDiamondChainsaw;
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemElectricHoeGrowth;
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemOmnitoolDiamond;
@@ -42,8 +43,7 @@ import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ham
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.hammer.ItemTaintedThorHammer;
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.hammer.ItemThorHammer;
public class ItemRegistry
{
public class ItemRegistry {
public static Item thaumiumDrill;
public static Item thaumiumChainsaw;
@@ -72,66 +72,68 @@ public class ItemRegistry
public static Item itemEMTItems;
public static Item electricHoeGrowth;
public static Item chargeFocus;
public static Item emtBauble;
public static Item wandChargeFocus;
public static void registerEMTItems() {
thaumiumDrill = new ItemThaumiumDrill(Config.thaumiumDrillID).setUnlocalizedName("thaumiumdrill");
thaumiumChainsaw = new ItemThaumiumChainsaw(Config.thaumiumChainsawID).setUnlocalizedName("thaumiumchainsaw");
quantumThaumicHelmet = new ItemQuantumThaumicHelmet(Config.quantumThaumicHelmetID, 3, 0).setUnlocalizedName("quantumthaumichelmet");
diamondChainsaw = new ItemDiamondChainsaw(Config.diamondChainsawID).setUnlocalizedName("diamondchainsaw");
ironOmnitool = new ItemOmnitoolIron(Config.ironOmnitoolID).setUnlocalizedName("ironomnitool");
diamondOmnitool = new ItemOmnitoolDiamond(Config.diamondOmnitoolID).setUnlocalizedName("diamondomnitool");
thaumiumOmnitool = new ItemOmnitoolThaumium(Config.thaumiumOmnitoolID).setUnlocalizedName("thaumiumomnitool");
nanoThaumicHelmet = new ItemNanoThaumicHelmet(Config.nanoThaumicHelmetID, 3, 0).setUnlocalizedName("nanothaumichelmet");
explosionFocus = new ItemExplosionFocus(Config.explosionFocusID).setUnlocalizedName("laserfocus");
christmasFocus = new ItemChristmasFocus(Config.christmasFocusID).setUnlocalizedName("christmasfocus");
shieldFocus = new ItemShieldFocus(Config.shieldFocusID).setUnlocalizedName("shieldfocus");
electricGoggles = new ItemElectricGoggles(Config.electricGogglesID, 3, 0).setUnlocalizedName("electricgoggles");
streamChainsaw = new ItemStreamChainsaw(Config.streamChainsawID).setUnlocalizedName("streamchainsaw");
rockbreakerDrill = new ItemRockbreakerDrill(Config.rockbreakerDrillID).setUnlocalizedName("rockbreakerdrill");
thaumiumPlate = new ItemThaumiumPlate(Config.thaumiumPlateID).setUnlocalizedName("thaumiumplate");
solarHelmetRevealing = new ItemSolarHelmetRevealing(Config.solarHelmetRevealingID, 3, 0).setUnlocalizedName("solarhelmetrevealing");
thorHammer = new ItemThorHammer(Config.thorHammerID).setUnlocalizedName("hammerthor");
taintedThorHammer = new ItemTaintedThorHammer(Config.taintedThorHammerID).setUnlocalizedName("taintedthorhammer");
lightningSummoner = new ItemLightningSummoner(Config.lightningSummonerID).setUnlocalizedName("lightningsummoner");
electricThorHammer = new ItemElectricThorHammer(Config.electricThorHammerID).setUnlocalizedName("electricthorhammer");
electricBootsTraveller = new ItemElectricBootsTraveller(Config.electricBootsTravellerID, 3, 3).setUnlocalizedName("electricboots");
nanoBootsTraveller = new ItemNanoBootsTraveller(Config.nanoBootsTravellerID, 3, 3).setUnlocalizedName("nanobootstraveller");
quantumBootsTraveller = new ItemQuantumBootsTraveller(Config.quantumBootsTravellerID, 3, 3).setUnlocalizedName("quantumbootstraveller");
electricScribingTools = new ItemElectricScribingTools(Config.electricScribingToolsID).setUnlocalizedName("electricscribingtools");
itemEMTItems = new ItemEMTItems(Config.itemEMTItemID).setUnlocalizedName("itememtitems");
electricHoeGrowth = new ItemElectricHoeGrowth(Config.electricHoeGrowthID).setUnlocalizedName("electrichoeofgrowth");
chargeFocus = new ItemChargeFocus(Config.chargeFocusID).setUnlocalizedName("chargefocus");
thaumiumDrill = new ItemThaumiumDrill().setUnlocalizedName("thaumiumdrill");
thaumiumChainsaw = new ItemThaumiumChainsaw().setUnlocalizedName("thaumiumchainsaw");
quantumThaumicHelmet = new ItemQuantumThaumicHelmet(3, 0).setUnlocalizedName("quantumthaumichelmet");
diamondChainsaw = new ItemDiamondChainsaw().setUnlocalizedName("diamondchainsaw");
ironOmnitool = new ItemOmnitoolIron().setUnlocalizedName("ironomnitool");
diamondOmnitool = new ItemOmnitoolDiamond().setUnlocalizedName("diamondomnitool");
thaumiumOmnitool = new ItemOmnitoolThaumium().setUnlocalizedName("thaumiumomnitool");
nanoThaumicHelmet = new ItemNanoThaumicHelmet(3, 0).setUnlocalizedName("nanothaumichelmet");
explosionFocus = new ItemExplosionFocus().setUnlocalizedName("laserfocus");
christmasFocus = new ItemChristmasFocus().setUnlocalizedName("christmasfocus");
shieldFocus = new ItemShieldFocus().setUnlocalizedName("shieldfocus");
electricGoggles = new ItemElectricGoggles(3, 0).setUnlocalizedName("electricgoggles");
streamChainsaw = new ItemStreamChainsaw().setUnlocalizedName("streamchainsaw");
rockbreakerDrill = new ItemRockbreakerDrill().setUnlocalizedName("rockbreakerdrill");
thaumiumPlate = new ItemThaumiumPlate().setUnlocalizedName("thaumiumplate");
solarHelmetRevealing = new ItemSolarHelmetRevealing(3, 0).setUnlocalizedName("solarhelmetrevealing");
thorHammer = new ItemThorHammer().setUnlocalizedName("hammerthor");
taintedThorHammer = new ItemTaintedThorHammer().setUnlocalizedName("taintedthorhammer");
lightningSummoner = new ItemLightningSummoner().setUnlocalizedName("lightningsummoner");
electricThorHammer = new ItemElectricThorHammer().setUnlocalizedName("electricthorhammer");
electricBootsTraveller = new ItemElectricBootsTraveller(3, 3).setUnlocalizedName("electricboots");
nanoBootsTraveller = new ItemNanoBootsTraveller(3, 3).setUnlocalizedName("nanobootstraveller");
quantumBootsTraveller = new ItemQuantumBootsTraveller(3, 3).setUnlocalizedName("quantumbootstraveller");
electricScribingTools = new ItemElectricScribingTools().setUnlocalizedName("electricscribingtools");
itemEMTItems = new ItemEMTItems().setUnlocalizedName("itememtitems");
electricHoeGrowth = new ItemElectricHoeGrowth().setUnlocalizedName("electrichoeofgrowth");
chargeFocus = new ItemChargeFocus().setUnlocalizedName("chargefocus");
emtBauble = new ItemEMTBaubles().setUnlocalizedName("emtbauble");
wandChargeFocus = new ItemWandChargingFocus().setUnlocalizedName("wandchargefocus");
LanguageRegistry.addName(thaumiumDrill, "Thaumium Drill");
LanguageRegistry.addName(thaumiumChainsaw, "Thaumium Chainsaw");
LanguageRegistry.addName(quantumThaumicHelmet, "Quantum Goggles of Revealing");
LanguageRegistry.addName(diamondChainsaw, "Diamond Chainsaw");
LanguageRegistry.addName(ironOmnitool, "Omnitool");
LanguageRegistry.addName(diamondOmnitool, "Diamond Omnitool");
LanguageRegistry.addName(thaumiumOmnitool, "Thaumium Omnitool");
LanguageRegistry.addName(nanoThaumicHelmet, "Nanosuit Goggles of Revealing");
LanguageRegistry.addName(explosionFocus, "Wand Focus: Explosion");
LanguageRegistry.addName(christmasFocus, "Wand Focus : Kris-tmas");
LanguageRegistry.addName(shieldFocus, "Wand Focus : Shield");
LanguageRegistry.addName(electricGoggles, "Electric Goggles of Revealing");
LanguageRegistry.addName(streamChainsaw, "Chainsaw of the Stream");
LanguageRegistry.addName(rockbreakerDrill, "Drill of the Rockbreaker");
LanguageRegistry.addName(thaumiumPlate, "Thaumium Plate");
LanguageRegistry.addName(solarHelmetRevealing, "Quantum Solar Helmet of Revealing");
LanguageRegistry.addName(thorHammer, "Mjolnir");
LanguageRegistry.addName(taintedThorHammer, "Broken Relic of Mjolnir");
LanguageRegistry.addName(lightningSummoner, "Lightning Summoner");
LanguageRegistry.addName(electricThorHammer, "Supercharged Mjolnir");
LanguageRegistry.addName(electricBootsTraveller, "Electric Boots of the Traveller");
LanguageRegistry.addName(nanoBootsTraveller, "Nano Boots of the Traveller");
LanguageRegistry.addName(quantumBootsTraveller, "Quantum Boots of the Traveller");
LanguageRegistry.addName(electricScribingTools, "Electric Scribing Tools");
LanguageRegistry.addName(electricHoeGrowth, "Electric Hoe of Growth");
LanguageRegistry.addName(chargeFocus, "Wand Focus: Charging");
LanguageRegistry.addName(new ItemStack(itemEMTItems, 1, 0), "Native Uranium Cluster");
LanguageRegistry.addName(new ItemStack(itemEMTItems, 1, 1), "Crushed Amber Ore");
LanguageRegistry.addName(new ItemStack(itemEMTItems, 1, 2), "Purified Crushed Amber Ore");
LanguageRegistry.addName(new ItemStack(itemEMTItems, 1, 3), "Crushed Cinnabar Ore");
LanguageRegistry.addName(new ItemStack(itemEMTItems, 1, 4), "Purified Crushed Cinnabar Ore");
GameRegistry.registerItem(thaumiumDrill, "Thaumium Drill");
GameRegistry.registerItem(thaumiumChainsaw, "Thaumium Chainsaw");
GameRegistry.registerItem(quantumThaumicHelmet, "Quantum Goggles of Revealing");
GameRegistry.registerItem(diamondChainsaw, "Diamond Chainsaw");
GameRegistry.registerItem(ironOmnitool, "Omnitool");
GameRegistry.registerItem(diamondOmnitool, "Diamond Omnitool");
GameRegistry.registerItem(thaumiumOmnitool, "Thaumium Omnitool");
GameRegistry.registerItem(nanoThaumicHelmet, "Nanosuit Goggles of Revealing");
GameRegistry.registerItem(explosionFocus, "Wand Focus: Explosion");
GameRegistry.registerItem(christmasFocus, "Wand Focus : Kris-tmas");
GameRegistry.registerItem(shieldFocus, "Wand Focus : Shield");
GameRegistry.registerItem(electricGoggles, "Electric Goggles of Revealing");
GameRegistry.registerItem(streamChainsaw, "Chainsaw of the Stream");
GameRegistry.registerItem(rockbreakerDrill, "Drill of the Rockbreaker");
GameRegistry.registerItem(thaumiumPlate, "Thaumium Plate");
GameRegistry.registerItem(solarHelmetRevealing, "Quantum Solar Helmet of Revealing");
GameRegistry.registerItem(thorHammer, "Mjolnir");
GameRegistry.registerItem(taintedThorHammer, "Broken Relic of Mjolnir");
GameRegistry.registerItem(lightningSummoner, "Lightning Summoner");
GameRegistry.registerItem(electricThorHammer, "Supercharged Mjolnir");
GameRegistry.registerItem(electricBootsTraveller, "Electric Boots of the Traveller");
GameRegistry.registerItem(nanoBootsTraveller, "Nano Boots of the Traveller");
GameRegistry.registerItem(quantumBootsTraveller, "Quantum Boots of the Traveller");
GameRegistry.registerItem(electricScribingTools, "Electric Scribing Tools");
GameRegistry.registerItem(electricHoeGrowth, "Electric Hoe of Growth");
GameRegistry.registerItem(chargeFocus, "Wand Focus: Charging");
GameRegistry.registerItem(itemEMTItems, "EMT Items");
GameRegistry.registerItem(emtBauble, "EMT Baubles");
GameRegistry.registerItem(wandChargeFocus, "Wand Focus: Wand Charging");
}
}
@@ -1,57 +1,12 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2014 Tombenpotter.
# All rights reserved.
#
# This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
# which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
#
# This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
# Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
# http://www.minecraftforum.net/topic/1585216-
#-------------------------------------------------------------------------------
This .txt file is here so that I don't randomly forget to add stuff where it is needed.
Anyone that's not a modder or didn't come here on purpose just has to ignore that.
Consider this as a TODO list, that also register what's been done.
Consider this as a TODO list.
Items----------------------------------------------------------------------------------------------------
Thaumium Drill: Item is functional-Research is done
Thaumium Chainsaw: Item is functional-Research is done
Quantum Goggles of Revealing: Item is functional-Research is done
Diamond Chainsaw: Item is functional-Research is done
Omnitool: Item is functional-Research is done
Diamond Omnitool: Item is functional-Research is done
Thaumium Omnitool: Item is functional-Research is done
Nanosuit Goggles of Revealing: Item is functional-Research is done
Wand Focus: Explosion: Item is functional, but need to be ameliorated-Research is done
Wand Focus : Kris-tmas: Item is functional-Research is done
Wand Focus : Shield: Item is functional-Research is done
Electric Goggles of Revealing: Item is functional-Research is done
Chainsaw of the Stream: Item is functional-Research is done
Drill of the Rockbreaker: Item is functional-Research is done
Thaumium Plate: Item is functional (it does nothing)-Research is done
Quantum Solar Helmet of Revealing: Item is functional-Research is done
Mjolnir: Item is functional-Research is done
Broken Relic of Mjolnir: Item is functional-Research is done
Lightning Summoner: Item is functional-Research is done
Supercharged Mjolnir: Item is functional-Research is done
Electric Boots of the Traveller: Item is fully functional-Research is done
Nanosuit Boots of the Traveller: Item is fully functional-Research is done
Quantum Boots of the Traveller: Item is fully functional-Research is done
Iridium Wand cap-- 15% discount for everything
Rubberwood wand core-- Dunno yet
Blocks---------------------------------------------------------------------------------------------------
Potentia Generator: Block is functional-Research is done
Shield Block: Block is functional, but doesn't resist to a wither-Research is done
Ignis Generator: Block is functional-Research is done
Auram Generator: Block is functional-Research is done
Arbor Generator: Block is functional-Research is done
Industrial Wand Charging Station: Block is functional-Research is done
Compressed Solar Panel: Block is functional-Research is done
Double Compressed Solar Panel: Block is functional-Research is done
Ethereal Macerator : Block is functional-Research is done-Need to add a way to speed it up with essentia
Entities-------------------------------------------------------------------------------------------------
Laser: An explosion is created on landing-Texture/Model is all good
Guardian Snowman: Texture is all good
Electric deconstruction table-- A block that will decompose aspects faster, and be able to store more than one.
Unwanted Node Generator-- An advanced version of the generators that basically acts as a "trash can" for unwanted nodes? It accepts a node in a jar and consumes it, adding the power stored (based on aspects) to an internal battery?
Magical Windmillz
@@ -11,26 +11,23 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common;
import ic2.api.item.Items;
import ic2.api.item.IC2Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.api.research.ResearchPage;
import cpw.mods.fml.common.registry.LanguageRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.lib.ResearchAspects;
import electricMagicTools.tombenpotter.electricmagictools.common.recipes.EMTInitRecipes;
import electricMagicTools.tombenpotter.electricmagictools.common.recipes.EMTPostInitRecipes;
import electricMagicTools.tombenpotter.electricmagictools.common.recipes.UuMInfusionRecipes;
public class ThaumonomiconResearch
{
public class ThaumonomiconResearch {
public static void addResearchTab() {
ResourceLocation background = new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png");
ResearchCategories.registerCategory("EMT", new ResourceLocation("electricmagictools:textures/misc/emt.png"), background);
LanguageRegistry.instance().addStringLocalization("tc.research_category.EMT", "Electro-Magic Tools");
}
public static void addResearch() {
@@ -52,7 +49,7 @@ public class ThaumonomiconResearch
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.thaumiumPlate));
text = "1";
research = new EMTResearchItem("Macerating Native Ore Clusters", "EMT", new AspectList(), 5, -7, 0, Items.getItem("smallGoldDust")).setRound().setAutoUnlock().registerResearchItem();
research = new EMTResearchItem("Macerating Native Ore Clusters", "EMT", new AspectList(), 5, -7, 0, IC2Items.getItem("smallGoldDust")).setRound().setAutoUnlock().registerResearchItem();
research.setPages(new ResearchPage(text));
text = "1";
@@ -63,44 +60,40 @@ public class ThaumonomiconResearch
research = new EMTResearchItem("Lightning Summoner", "EMT", new AspectList(), 6, -5, 0, new ItemStack(ItemRegistry.lightningSummoner)).setRound().setAutoUnlock().registerResearchItem();
research.setPages(new ResearchPage(text));
text = "1";
research = new EMTResearchItem("The One Ring", "EMT", new AspectList(), 6, -7, 0, new ItemStack(ItemRegistry.emtBauble, 1, 2)).setRound().setAutoUnlock().registerResearchItem();
research.setPages(new ResearchPage(text));
/** Research that can be disabled **/
if (Config.thaumiumDrillResearch == false)
{
if (Config.thaumiumDrillResearch == false) {
text = "1";
research = new EMTResearchItem("Thaumium Drill", "EMT", ResearchAspects.thaumiumDrillResearch, -1, -2, 1, new ItemStack(ItemRegistry.thaumiumDrill)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.thaumiumDrill));
}
if (Config.thaumiumChainsawResearch == false)
{
if (Config.thaumiumChainsawResearch == false) {
text = "1";
research = new EMTResearchItem("Thaumium Chainsaw", "EMT", ResearchAspects.thaumiumChainsawResearch, -2, -2, 1, new ItemStack(ItemRegistry.thaumiumChainsaw)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.thaumiumChainsaw));
}
if (Config.electricGooglesResearch == false)
{
if (Config.electricGooglesResearch == false) {
text = "1";
research = new EMTResearchItem("Electric Goggles", "EMT", ResearchAspects.electricGogglesResearch, 1, -2, 1, new ItemStack(ItemRegistry.electricGoggles)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.electricGoggles));
}
if (Config.electricGooglesResearch == false)
{
if (Config.nanoGooglesResearch == false)
{
if (Config.electricGooglesResearch == false) {
if (Config.nanoGooglesResearch == false) {
text = "1";
research = new EMTResearchItem("Nanosuit Goggles of Revealing", "EMT", ResearchAspects.thaumicNanoHelmet, 2, -2, 2, new ItemStack(ItemRegistry.nanoThaumicHelmet)).setParents("Electric Goggles").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.thaumicNanoHelmet));
}
}
if (Config.electricGooglesResearch == false)
{
if (Config.nanoGooglesResearch == false)
{
if (Config.quantumGooglesResearch == false)
{
if (Config.electricGooglesResearch == false) {
if (Config.nanoGooglesResearch == false) {
if (Config.quantumGooglesResearch == false) {
text = "1";
research = new EMTResearchItem("Quantum Goggles of Revealing", "EMT", ResearchAspects.thaumicQuantumHelmet, 3, -2, 3, new ItemStack(ItemRegistry.quantumThaumicHelmet)).setParents("Nanosuit Goggles of Revealing").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.thaumicQuantumHelmet));
@@ -108,95 +101,78 @@ public class ThaumonomiconResearch
}
}
if (Config.ironOmnitoolResearch == false)
{
if (Config.ironOmnitoolResearch == false) {
text = "1";
research = new EMTResearchItem("Iron Omnitool", "EMT", new AspectList(), -2, 0, 0, new ItemStack(ItemRegistry.ironOmnitool)).setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTInitRecipes.ironOmnitool));
}
if (Config.ironOmnitoolResearch == false)
{
if (Config.diamondOmnitoolResearch == false)
{
if (Config.ironOmnitoolResearch == false) {
if (Config.diamondOmnitoolResearch == false) {
text = "1";
research = new EMTResearchItem("Diamond Omnitool", "EMT", ResearchAspects.diamondOmnitoolResearch, -4, 0, 1, new ItemStack(ItemRegistry.diamondOmnitool)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.diamondOmnitool), new ResearchPage(EMTPostInitRecipes.ironOmnitoolToDiamond));
}
}
if (Config.thaumiumDrillResearch == false && Config.thaumiumChainsawResearch == false)
{
if (Config.thaumiumOmnitoolResearch == false)
{
if (Config.thaumiumDrillResearch == false && Config.thaumiumChainsawResearch == false) {
if (Config.thaumiumOmnitoolResearch == false) {
text = "1";
research = new EMTResearchItem("Thaumium Omnitool", "EMT", ResearchAspects.thaumiumOmnitoolResearch, -6, 0, 2, new ItemStack(ItemRegistry.thaumiumOmnitool)).setParentsHidden("Thaumium Drill", "Thaumium Chainsaw").setParents("Diamond Omnitool").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.thaumiumOmnitool), new ResearchPage(EMTPostInitRecipes.diamondOmnitoolToThaumium));
}
}
if (Config.explosionFocusResearch == false)
{
if (Config.explosionFocusResearch == false) {
text = "1";
research = new EMTResearchItem("Explosion Focus", "EMT", ResearchAspects.laserFocusResearch, 2, 3, 2, new ItemStack(ItemRegistry.explosionFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.explosionFocus));
}
if (Config.christmasFocusResearch == false)
{
if (Config.christmasFocusResearch == false) {
text = "1";
research = new EMTResearchItem("Kris-tmas Focus", "EMT", ResearchAspects.christmasFocusResearch, 3, 3, 1, new ItemStack(ItemRegistry.christmasFocus)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.christmasFocus));
}
if (Config.shieldFocusResearch == false)
{
if (Config.shieldFocusResearch == false) {
text = "1";
research = new EMTResearchItem("Shield Focus", "EMT", ResearchAspects.shieldFocusResearch, 4, 3, 2, new ItemStack(ItemRegistry.shieldFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.shieldFocus));
}
if (Config.shieldFocusResearch == false)
{
if (Config.shieldBlockResearch == false)
{
if (Config.shieldFocusResearch == false) {
if (Config.shieldBlockResearch == false) {
text = "1";
research = new EMTResearchItem("Shield Block", "EMT", ResearchAspects.shieldBlockResearch, 4, 5, 1, new ItemStack(BlockRegistry.shield)).setSecondary().setParents("Shield Focus").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.shieldBlock));
}
}
if (Config.potentiaGeneratorResearch == false)
{
if (Config.potentiaGeneratorResearch == false) {
text = "1";
research = new EMTResearchItem("Potentia Generator", "EMT", ResearchAspects.potentiaGeneratorResearch, -2, 3, 3, new ItemStack(BlockRegistry.essentiaGens, 1, 0)).setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.potentiaGenerator));
}
if (Config.potentiaGeneratorResearch == false)
{
if (Config.ignisGeneratorResearch == false)
{
if (Config.potentiaGeneratorResearch == false) {
if (Config.ignisGeneratorResearch == false) {
text = "1";
research = new EMTResearchItem("Ignis Generator", "EMT", ResearchAspects.ignisGeneratorResearch, -3, 4, 1, new ItemStack(BlockRegistry.essentiaGens, 1, 1)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.ignisGenerator));
}
}
if (Config.potentiaGeneratorResearch == false)
{
if (Config.auramGeneratorResearch == false)
{
if (Config.potentiaGeneratorResearch == false) {
if (Config.auramGeneratorResearch == false) {
text = "1";
research = new EMTResearchItem("Auram Generator", "EMT", ResearchAspects.auramGeneratorResearch, -1, 4, 1, new ItemStack(BlockRegistry.essentiaGens, 1, 2)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.auramGenerator));
}
}
if (Config.potentiaGeneratorResearch == false)
{
if (Config.arborGeneratorResearch == false)
{
if (Config.potentiaGeneratorResearch == false) {
if (Config.arborGeneratorResearch == false) {
text = "1";
research = new EMTResearchItem("Arbor Generator", "EMT", ResearchAspects.arborGeneratorResearch, -2, 5, 1, new ItemStack(BlockRegistry.essentiaGens, 1, 3)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.arborGenerator));
@@ -211,90 +187,73 @@ public class ThaumonomiconResearch
// }
// }
if (Config.thaumiumChainsawResearch == false)
{
if (Config.streamChainsawResearch == false)
{
if (Config.thaumiumChainsawResearch == false) {
if (Config.streamChainsawResearch == false) {
text = "1";
research = new EMTResearchItem("Chainsaw of the Stream", "EMT", ResearchAspects.streamChainsawResearch, -3, -4, 3, new ItemStack(ItemRegistry.streamChainsaw)).setParents("Thaumium Chainsaw").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.streamChainsaw));
}
}
if (Config.thaumiumDrillResearch == false)
{
if (Config.rockbreakerDrillResearch == false)
{
if (Config.thaumiumDrillResearch == false) {
if (Config.rockbreakerDrillResearch == false) {
text = "1";
research = new EMTResearchItem("Drill of the Rockbreaker", "EMT", ResearchAspects.rockbreakerDrillResearch, 0, -4, 3, new ItemStack(ItemRegistry.rockbreakerDrill)).setParents("Thaumium Drill").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.rockbreakerDrill));
}
}
if (Config.tinyUraniumResearch == false)
{
if (Config.tinyUraniumResearch == false) {
text = "1";
research = new EMTResearchItem("Tiny Uranium", "EMT", ResearchAspects.tinyUraniumResearch, -5, -5, 1, Items.getItem("Uran238")).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem();
research = new EMTResearchItem("Tiny Uranium", "EMT", ResearchAspects.tinyUraniumResearch, -5, -5, 1, IC2Items.getItem("Uran238")).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.tinyUranium));
}
if (Config.thorHammerResearch == false)
{
if (Config.thorHammerResearch == false) {
text = "1";
research = new EMTResearchItem("Mjolnir", "EMT", ResearchAspects.thorHammerResearch, -5, 5, 3, new ItemStack(ItemRegistry.thorHammer)).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.thorHammer));
}
if (Config.thorHammerResearch == false)
{
if (Config.superchargedThorHammerResearch == false)
{
if (Config.thorHammerResearch == false) {
if (Config.superchargedThorHammerResearch == false) {
text = "1";
research = new EMTResearchItem("Supercharged Mjolnir", "EMT", ResearchAspects.superchargedThorHammerResearch, -6, 6, 3, new ItemStack(ItemRegistry.electricThorHammer)).setParents("Mjolnir").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.superchargedThorHammer));
}
}
if (Config.compressedSolarsResearch == false)
{
if (Config.compressedSolarsResearch == false) {
text = "1";
research = new EMTResearchItem("Compressed Solars", "EMT", ResearchAspects.compressedSolars, -4, -5, 2, new ItemStack(BlockRegistry.emtSolars)).setParentsHidden("Potentia Generator").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.compressedSolar), new ResearchPage(EMTPostInitRecipes.doubleCompressedSolar), new ResearchPage(EMTPostInitRecipes.tripleCompressedSolar));
}
if (Config.compressedSolarsResearch == false)
{
if (Config.solarHelmetResearch == false)
{
if (Config.compressedSolarsResearch == false) {
if (Config.solarHelmetResearch == false) {
text = "1";
research = new EMTResearchItem("Solar Helmet of Revealing", "EMT", ResearchAspects.solarHelmetRevealing, -2, -5, 1, new ItemStack(ItemRegistry.solarHelmetRevealing)).setSecondary().setParents("Compressed Solars").setParentsHidden("Quantum Goggles of Revealing").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.solarHelmetRevealing));
}
}
if (Config.electricBootsResearch == false)
{
if (Config.electricBootsResearch == false) {
text = "1";
research = new EMTResearchItem("Electric Boots of the Traveller", "EMT", ResearchAspects.electricBootsTravel, 2, 0, 1, new ItemStack(ItemRegistry.electricBootsTraveller)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.electricBootsTravel));
}
if (Config.electricBootsResearch == false)
{
if (Config.nanoBootsResearch == false)
{
if (Config.electricBootsResearch == false) {
if (Config.nanoBootsResearch == false) {
text = "1";
research = new EMTResearchItem("Nano Boots of the Traveller", "EMT", ResearchAspects.nanoBootsTravel, 4, 0, 2, new ItemStack(ItemRegistry.nanoBootsTraveller)).setParents("Electric Boots of the Traveller").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.nanoBootsTravel));
}
}
if (Config.electricBootsResearch == false)
{
if (Config.nanoBootsResearch == false)
{
if (Config.quantumBootsResearch == false)
{
if (Config.electricBootsResearch == false) {
if (Config.nanoBootsResearch == false) {
if (Config.quantumBootsResearch == false) {
text = "1";
research = new EMTResearchItem("Quantum Boots of the Traveller", "EMT", ResearchAspects.quantumBootsTravel, 6, 0, 3, new ItemStack(ItemRegistry.quantumBootsTraveller)).setParents("Nano Boots of the Traveller").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.quantumBootsTravel));
@@ -302,24 +261,20 @@ public class ThaumonomiconResearch
}
}
if (Config.electricScribingToolsResearch == false)
{
if (Config.electricScribingToolsResearch == false) {
text = "1";
research = new EMTResearchItem("Electric Scribing Tools", "EMT", ResearchAspects.electricScribingTools, -6, -5, 1, new ItemStack(ItemRegistry.electricScribingTools)).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.electricScribingTools));
}
if (Config.etherealProcessorResearch == false)
{
if (Config.etherealProcessorResearch == false) {
text = "1";
research = new EMTResearchItem("Etheral Processor", "EMT", ResearchAspects.etherealProcessor, -1, 2, 2, new ItemStack(BlockRegistry.emtMachines, 1, 1)).setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.etheralProcessor));
}
if (Config.compressedSolarsResearch == false)
{
if (Config.waterSolarsResearch == false)
{
if (Config.compressedSolarsResearch == false) {
if (Config.waterSolarsResearch == false) {
text = "1";
research = new EMTResearchItem("Water Infused Solar Panels", "EMT", ResearchAspects.waterSolars, -7, -7, 1, new ItemStack(BlockRegistry.emtSolars, 1, 3)).setSecondary().setParents("Compressed Solars").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.waterSolar), new ResearchPage(EMTPostInitRecipes.doubleWaterSolar), new ResearchPage(EMTPostInitRecipes.tripleWaterSolar));
@@ -327,92 +282,87 @@ public class ThaumonomiconResearch
}
}
if (Config.compressedSolarsResearch == false)
{
if (Config.darkSolarsResearch == false)
{
if (Config.compressedSolarsResearch == false) {
if (Config.darkSolarsResearch == false) {
text = "1";
research = new EMTResearchItem("Entropy Infused Solar Panels", "EMT", ResearchAspects.darkSolars, -8, -6, 1, new ItemStack(BlockRegistry.emtSolars, 1, 6)).setSecondary().setParents("Compressed Solars").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.darkSolar), new ResearchPage(EMTPostInitRecipes.doubleDarkSolar), new ResearchPage(EMTPostInitRecipes.tripleDarkSolar));
}
}
if (Config.compressedSolarsResearch == false)
{
if (Config.orderSolarsResearch == false)
{
if (Config.compressedSolarsResearch == false) {
if (Config.orderSolarsResearch == false) {
text = "1";
research = new EMTResearchItem("Order Infused Solar Panels", "EMT", ResearchAspects.orderSolars, -6, -8, 1, new ItemStack(BlockRegistry.emtSolars, 1, 9)).setSecondary().setParents("Compressed Solars").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.orderSolar), new ResearchPage(EMTPostInitRecipes.doubleOrderSolar), new ResearchPage(EMTPostInitRecipes.tripleOrderSolar));
}
}
if (Config.compressedSolarsResearch == false)
{
if (Config.fireSolarsResearch == false)
{
if (Config.compressedSolarsResearch == false) {
if (Config.fireSolarsResearch == false) {
text = "1";
research = new EMTResearchItem("Fire Infused Solar Panels", "EMT", ResearchAspects.fireSolars, -5, -7, 1, new ItemStack(BlockRegistry.emtSolars, 1, 12)).setSecondary().setParents("Compressed Solars").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.fireSolar), new ResearchPage(EMTPostInitRecipes.doubleFireSolar), new ResearchPage(EMTPostInitRecipes.tripleFireSolar));
}
}
if (Config.compressedSolarsResearch == false)
{
if (Config.airSolarsResearch == false)
{
if (Config.compressedSolarsResearch == false) {
if (Config.airSolarsResearch == false) {
text = "1";
research = new EMTResearchItem("Air Infused Solar Panels", "EMT", ResearchAspects.airSolars, -4, -6, 1, new ItemStack(BlockRegistry.emtSolars, 1, 15)).setSecondary().setParents("Compressed Solars").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.airSolar), new ResearchPage(EMTPostInitRecipes.doubleAirSolar), new ResearchPage(EMTPostInitRecipes.tripleAirSolar));
}
}
if (Config.compressedSolarsResearch == false)
{
if (Config.earthSolarsResearch == false)
{
if (Config.compressedSolarsResearch == false) {
if (Config.earthSolarsResearch == false) {
text = "1";
research = new EMTResearchItem("Earth Infused Solar Panels", "EMT", ResearchAspects.earthSolars, -6, -7, 1, new ItemStack(BlockRegistry.emtSolars2, 1, 2)).setSecondary().setParents("Compressed Solars").registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.earthSolar), new ResearchPage(EMTPostInitRecipes.doubleEarthSolar), new ResearchPage(EMTPostInitRecipes.tripleEarthSolar));
}
}
if (Config.potentiaGeneratorResearch == false)
{
if (Config.saxumGenResearch == false)
{
text = "1";
research = new EMTResearchItem("Saxum Generator", "EMT", ResearchAspects.saxumGenerator, -3, 5, 1, new ItemStack(BlockRegistry.essentiaGens, 1, 4)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.saxumGenerator));
}
}
if (Config.uuMInfusionResearch == false)
{
if (Config.uuMInfusionResearch == false) {
text = "1";
research = new EMTResearchItem("UU-Matter Infusion", "EMT", ResearchAspects.uuMInfusion, 5, 5, 3, Items.getItem("UuMatterCell")).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(UuMInfusionRecipes.charcoalToCoal), new ResearchPage(UuMInfusionRecipes.glowstoneDustToBlock), new ResearchPage(UuMInfusionRecipes.stoneBricksToIronOre), new ResearchPage(UuMInfusionRecipes.arcaneStoneToCopperOre), new ResearchPage(UuMInfusionRecipes.arcaneStoneBricksToTinOre), new ResearchPage(UuMInfusionRecipes.amberBlockToLeadOre), new ResearchPage(UuMInfusionRecipes.shardToResin), new ResearchPage(UuMInfusionRecipes.shardToRedstone), new ResearchPage(UuMInfusionRecipes.shardToLapis), new ResearchPage(UuMInfusionRecipes.ironToGold), new ResearchPage(UuMInfusionRecipes.goldToDiamond), new ResearchPage(UuMInfusionRecipes.diamondToUranium), new ResearchPage(UuMInfusionRecipes.uraniumToIridium));
research = new EMTResearchItem("UU-Matter Infusion", "EMT", ResearchAspects.uuMInfusion, 5, 5, 3, IC2Items.getItem("UuMatterCell")).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(UuMInfusionRecipes.charcoalToCoal), new ResearchPage(UuMInfusionRecipes.glowstoneDustToBlock), new ResearchPage(UuMInfusionRecipes.stoneBricksToIronOre), new ResearchPage(UuMInfusionRecipes.arcaneStoneToCopperOre), new ResearchPage(UuMInfusionRecipes.arcaneStoneBricksToTinOre), new ResearchPage(UuMInfusionRecipes.amberBlockToLeadOre), new ResearchPage(UuMInfusionRecipes.amberBricksToUraniumOre), new ResearchPage(UuMInfusionRecipes.shardToResin), new ResearchPage(UuMInfusionRecipes.shardToRedstone), new ResearchPage(UuMInfusionRecipes.shardToLapis), new ResearchPage(UuMInfusionRecipes.ironToGold), new ResearchPage(UuMInfusionRecipes.goldToDiamond), new ResearchPage(UuMInfusionRecipes.diamondToUranium), new ResearchPage(
UuMInfusionRecipes.uraniumToIridium));
}
if (Config.portableNodeResarch == false)
{
if (Config.portableNodeResarch == false) {
text = "1";
research = new EMTResearchItem("Portable Node", "EMT", ResearchAspects.portableNode, 2, 5, 3, new ItemStack(BlockRegistry.portableNode)).setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.portableNode));
}
if (Config.electricHoeGrowthResearch == false)
{
if (Config.electricHoeGrowthResearch == false) {
text = "1";
research = new EMTResearchItem("Electric Hoe of Growth", "EMT", ResearchAspects.electricHoeGrowth, -1, -4, 2, new ItemStack(ItemRegistry.electricHoeGrowth)).setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.electricHoeGrowth));
}
if (Config.chargeFocusResearch == false)
{
if (Config.chargeFocusResearch == false) {
text = "1";
research = new EMTResearchItem("Wand Focus: Charging", "EMT", ResearchAspects.chargeFocus, 5, 3, 2, new ItemStack(ItemRegistry.chargeFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.chargeFocus));
}
if (Config.wandChargeFocusResearch == false) {
text = "1";
research = new EMTResearchItem("Wand Focus: Wand Charging", "EMT", ResearchAspects.wandChargeFocus, 7, 3, 3, new ItemStack(ItemRegistry.wandChargeFocus)).setParents("Wand Focus: Charging").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.wandChargeFocus));
}
if (Config.inventoryChargingRing == false) {
text = "1";
research = new EMTResearchItem("Inventory Charging Ring", "EMT", ResearchAspects.inventoryChargingRing, 0, -5, 3, new ItemStack(ItemRegistry.emtBauble, 1, 1)).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.inventoryChargingRing));
}
if (Config.armorChargingRing == false) {
text = "1";
research = new EMTResearchItem("Armor Charging Ring", "EMT", ResearchAspects.armorChargingRing, 0, -7, 3, new ItemStack(ItemRegistry.emtBauble, 1, 0)).setSecondary().setParents("Inventory Charging Ring").setConcealed().registerResearchItem();
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.armorChargingRing));
}
}
}
@@ -13,8 +13,7 @@ package electricMagicTools.tombenpotter.electricmagictools.common;
import cpw.mods.fml.common.registry.GameRegistry;
public class TileEntityRegistry
{
public class TileEntityRegistry {
public static void registerEMTTileEntites() {
@@ -23,29 +22,28 @@ public class TileEntityRegistry
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityAuramGenerator.class, "tileentityauramgenerator");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityArborGenerator.class, "tileentityarborgenerator");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityCompressedSolar.class, "tileentitycompressedsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityCompressedSolar.class, "tileentitycompressedsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleCompressedSolar.class, "tileentitytriplecompressedsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityWaterSolar.class, "tileentitywatersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDarkSolar.class, "tileentitydarksolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleDarkSolar.class, "tileentitytripledarksolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityOrderSolar.class, "tileentityordersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleOrderSolar.class, "tileentitytripleordersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityFireSolar.class, "tileentityfiresolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleFireSolar.class, "tileentitytriplefiresolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityAirSolar.class, "tileentityairsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleAirSolar.class, "tileentitytripleairsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEarthSolar.class, "tileentityearthsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityWaterSolar.class, "tileentitywatersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDarkSolar.class, "tileentitydarksolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleDarkSolar.class, "tileentitytripledarksolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityOrderSolar.class, "tileentityordersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleOrderSolar.class, "tileentitytripleordersolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityFireSolar.class, "tileentityfiresolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleFireSolar.class, "tileentitytriplefiresolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityAirSolar.class, "tileentityairsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleAirSolar.class, "tileentitytripleairsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityEarthSolar.class, "tileentityearthsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar");
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityPortableNode.class, "tileentityportablenode");
}
}
@@ -14,17 +14,19 @@ package electricMagicTools.tombenpotter.electricmagictools.common.blocks;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
@@ -34,70 +36,60 @@ import electricMagicTools.tombenpotter.electricmagictools.common.ElectricMagicTo
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEtherealMacerator;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityIndustrialWandRecharge;
public class BlockEMTMachines extends BlockContainer
{
public class BlockEMTMachines extends BlockContainer {
public Icon[] wandCharger = new Icon[4];
public Icon[] etherealProcessor = new Icon[4];
public IIcon[] wandCharger = new IIcon[4];
public IIcon[] etherealProcessor = new IIcon[4];
public BlockEMTMachines(int id)
{
super(id, Material.iron);
public BlockEMTMachines() {
super(Material.iron);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setHardness(4.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ri) {
this.wandCharger[0] = ri.registerIcon("electricmagictools:machines/top");
this.wandCharger[1] = ri.registerIcon("electricmagictools:machines/bottom");
this.wandCharger[2] = ri.registerIcon("electricmagictools:machines/side");
this.wandCharger[3] = ri.registerIcon("electricmagictools:machines/wandcharger");
public void registerBlockIcons(IIconRegister ir) {
this.wandCharger[0] = ir.registerIcon("electricmagictools:machines/top");
this.wandCharger[1] = ir.registerIcon("electricmagictools:machines/bottom");
this.wandCharger[2] = ir.registerIcon("electricmagictools:machines/side");
this.wandCharger[3] = ir.registerIcon("electricmagictools:machines/wandcharger");
this.etherealProcessor[0] = ri.registerIcon("electricmagictools:machines/etherealmaceratortop");
this.etherealProcessor[1] = ri.registerIcon("electricmagictools:machines/etherealmacerator");
this.etherealProcessor[2] = ri.registerIcon("electricmagictools:machines/etherealmaceratorfront");
this.etherealProcessor[3] = ri.registerIcon("electricmagictools:machines/etherealmaceratorfrontactive");
this.etherealProcessor[0] = ir.registerIcon("electricmagictools:machines/etherealmaceratortop");
this.etherealProcessor[1] = ir.registerIcon("electricmagictools:machines/etherealmacerator");
this.etherealProcessor[2] = ir.registerIcon("electricmagictools:machines/etherealmaceratorfront");
this.etherealProcessor[3] = ir.registerIcon("electricmagictools:machines/etherealmaceratorfrontactive");
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubBlocks(int id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
list.add(new ItemStack(id, 1, 0));
list.add(new ItemStack(id, 1, 1));
}
@Override
public Icon getIcon(int side, int meta) {
if (meta == 0)
{
if (side <= 1)
{
public IIcon getIcon(int side, int meta) {
if (meta == 0) {
if (side <= 1) {
return this.wandCharger[0];
}
if (side > 1)
{
if (side > 1) {
return this.wandCharger[3];
}
}
if (meta == 1)
{
if (side == 0)
{
if (meta == 1) {
if (side == 0) {
return this.etherealProcessor[1];
}
if (side == 1)
{
if (side == 1) {
return this.etherealProcessor[0];
}
if (side == 2)
{
if (side == 2) {
return this.etherealProcessor[3];
}
if (side == 3)
{
if (side == 3) {
return this.etherealProcessor[3];
}
}
@@ -105,25 +97,23 @@ public class BlockEMTMachines extends BlockContainer
}
@Override
public Icon getBlockTexture(IBlockAccess access, int i, int j, int k, int side) {
return super.getBlockTexture(access, i, j, k, side);
public IIcon getIcon(IBlockAccess access, int i, int j, int k, int side) {
return super.getIcon(access, i, j, k, side);
}
@Override
public TileEntity createTileEntity(World world, int meta) {
if (meta == 0)
{
if (meta == 0) {
return new TileEntityIndustrialWandRecharge();
}
if (meta == 1)
{
if (meta == 1) {
return new TileEntityEtherealMacerator();
}
return super.createTileEntity(world, meta);
}
@Override
public TileEntity createNewTileEntity(World world) {
public TileEntity createNewTileEntity(World world, int md) {
return null;
}
@@ -134,47 +124,41 @@ public class BlockEMTMachines extends BlockContainer
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
if (!world.isRemote && world.getBlockTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge)
{
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge) {
player.openGui(ElectricMagicTools.instance, 0, world, x, y, z);
} else if (!world.isRemote && world.getBlockTileEntity(x, y, z) instanceof TileEntityEtherealMacerator)
{
} else if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityEtherealMacerator) {
player.openGui(ElectricMagicTools.instance, 1, world, x, y, z);
}
return true;
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
dropItems(world, x, y, z);
world.removeBlockTileEntity(x, y, z);
world.removeTileEntity(x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
}
private void dropItems(World world, int x, int y, int z) {
Random rand = new Random();
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (!(tileEntity instanceof IInventory))
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (!(tileEntity instanceof IInventory)) {
return;
}
IInventory inventory = (IInventory) tileEntity;
for (int i = 0; i < inventory.getSizeInventory(); i++)
{
for (int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack item = inventory.getStackInSlot(i);
if (item != null && item.stackSize > 0)
{
if (item != null && item.stackSize > 0) {
float rx = rand.nextFloat() * 0.8F + 0.1F;
float ry = rand.nextFloat() * 0.8F + 0.1F;
float rz = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.itemID, item.stackSize, item.getItemDamage()));
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
if (item.hasTagCompound())
{
if (item.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
}
@@ -13,65 +13,64 @@ package electricMagicTools.tombenpotter.electricmagictools.common.blocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityAirSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityCompressedSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDarkSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleCompressedSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleDarkSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleFireSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleOrderSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleWaterSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityFireSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityOrderSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleCompressedSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleDarkSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleFireSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleOrderSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleWaterSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityWaterSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityAirSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityCompressedSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDarkSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleCompressedSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleDarkSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleFireSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleOrderSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleWaterSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityFireSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityOrderSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleCompressedSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleDarkSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleFireSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleOrderSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleWaterSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityWaterSolar;
public class BlockEMTSolars extends BlockContainer
{
public class BlockEMTSolars extends BlockContainer {
public Icon[] compressedSolar = new Icon[3];
public Icon[] doubleCompressedSolar = new Icon[3];
public Icon[] tripleCompressedSolar = new Icon[3];
public Icon[] waterSolar = new Icon[3];
public Icon[] doubleWaterSolar = new Icon[3];
public Icon[] tripleWaterSolar = new Icon[3];
public Icon[] darkSolar = new Icon[3];
public Icon[] doubleDarkSolar = new Icon[3];
public Icon[] tripleDarkSolar = new Icon[3];
public Icon[] orderSolar = new Icon[3];
public Icon[] doubleOrderSolar = new Icon[3];
public Icon[] tripleOrderSolar = new Icon[3];
public Icon[] fireSolar = new Icon[3];
public Icon[] doubleFireSolar = new Icon[3];
public Icon[] tripleFireSolar = new Icon[3];
public Icon[] airSolar = new Icon[3];
public IIcon[] compressedSolar = new IIcon[3];
public IIcon[] doubleCompressedSolar = new IIcon[3];
public IIcon[] tripleCompressedSolar = new IIcon[3];
public IIcon[] waterSolar = new IIcon[3];
public IIcon[] doubleWaterSolar = new IIcon[3];
public IIcon[] tripleWaterSolar = new IIcon[3];
public IIcon[] darkSolar = new IIcon[3];
public IIcon[] doubleDarkSolar = new IIcon[3];
public IIcon[] tripleDarkSolar = new IIcon[3];
public IIcon[] orderSolar = new IIcon[3];
public IIcon[] doubleOrderSolar = new IIcon[3];
public IIcon[] tripleOrderSolar = new IIcon[3];
public IIcon[] fireSolar = new IIcon[3];
public IIcon[] doubleFireSolar = new IIcon[3];
public IIcon[] tripleFireSolar = new IIcon[3];
public IIcon[] airSolar = new IIcon[3];
public BlockEMTSolars(int id)
{
super(id, Material.iron);
public BlockEMTSolars() {
super(Material.iron);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setHardness(4.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ri) {
public void registerBlockIcons(IIconRegister ri) {
this.compressedSolar[0] = ri.registerIcon("electricmagictools:solars/solartop");
this.compressedSolar[1] = ri.registerIcon("electricmagictools:solars/side");
this.compressedSolar[2] = ri.registerIcon("electricmagictools:solars/bottom");
@@ -139,7 +138,7 @@ public class BlockEMTSolars extends BlockContainer
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getSubBlocks(int id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
list.add(new ItemStack(id, 1, 0));
list.add(new ItemStack(id, 1, 1));
list.add(new ItemStack(id, 1, 2));
@@ -159,322 +158,240 @@ public class BlockEMTSolars extends BlockContainer
}
@Override
public Icon getIcon(int side, int meta) {
if (meta == 0)
{
if (side == 1)
{
public IIcon getIcon(int side, int meta) {
if (meta == 0) {
if (side == 1) {
return this.compressedSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.compressedSolar[1];
}
}
if (meta == 1)
{
if (side == 1)
{
if (meta == 1) {
if (side == 1) {
return this.doubleCompressedSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.doubleCompressedSolar[1];
}
}
if (meta == 2)
{
if (side == 1)
{
if (meta == 2) {
if (side == 1) {
return this.tripleCompressedSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.tripleCompressedSolar[1];
}
}
if (meta == 3)
{
if (side == 0)
{
if (meta == 3) {
if (side == 0) {
return this.waterSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.waterSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.waterSolar[1];
}
}
if (meta == 4)
{
if (side == 0)
{
if (meta == 4) {
if (side == 0) {
return this.doubleWaterSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.doubleWaterSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.doubleWaterSolar[1];
}
}
if (meta == 5)
{
if (side == 0)
{
if (meta == 5) {
if (side == 0) {
return this.tripleWaterSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.tripleWaterSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.tripleWaterSolar[1];
}
}
if (meta == 6)
{
if (side == 0)
{
if (meta == 6) {
if (side == 0) {
return this.darkSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.darkSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.darkSolar[1];
}
}
if (meta == 7)
{
if (side == 0)
{
if (meta == 7) {
if (side == 0) {
return this.doubleDarkSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.doubleDarkSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.doubleDarkSolar[1];
}
}
if (meta == 8)
{
if (side == 0)
{
if (meta == 8) {
if (side == 0) {
return this.tripleDarkSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.tripleDarkSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.tripleDarkSolar[1];
}
}
if (meta == 9)
{
if (side == 0)
{
if (meta == 9) {
if (side == 0) {
return this.orderSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.orderSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.orderSolar[1];
}
}
if (meta == 10)
{
if (side == 0)
{
if (meta == 10) {
if (side == 0) {
return this.doubleOrderSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.doubleOrderSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.doubleOrderSolar[1];
}
}
if (meta == 11)
{
if (side == 0)
{
if (meta == 11) {
if (side == 0) {
return this.tripleOrderSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.tripleOrderSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.tripleOrderSolar[1];
}
}
if (meta == 12)
{
if (side == 0)
{
if (meta == 12) {
if (side == 0) {
return this.fireSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.fireSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.fireSolar[1];
}
}
if (meta == 13)
{
if (side == 0)
{
if (meta == 13) {
if (side == 0) {
return this.doubleFireSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.doubleFireSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.doubleFireSolar[1];
}
}
if (meta == 14)
{
if (side == 0)
{
if (meta == 14) {
if (side == 0) {
return this.tripleFireSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.tripleFireSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.tripleFireSolar[1];
}
}
if (meta == 15)
{
if (side == 0)
{
if (meta == 15) {
if (side == 0) {
return this.airSolar[2];
}
if (side == 1)
{
if (side == 1) {
return this.airSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.airSolar[1];
}
}
return this.compressedSolar[2];
}
@Override
public Icon getBlockTexture(IBlockAccess access, int i, int j, int k, int side) {
return super.getBlockTexture(access, i, j, k, side);
}
@Override
public TileEntity createTileEntity(World world, int meta) {
if (meta == 0)
{
if (meta == 0) {
return new TileEntityCompressedSolar();
}
if (meta == 1)
{
if (meta == 1) {
return new TileEntityDoubleCompressedSolar();
}
if (meta == 2)
{
if (meta == 2) {
return new TileEntityTripleCompressedSolar();
}
if (meta == 3)
{
if (meta == 3) {
return new TileEntityWaterSolar();
}
if (meta == 4)
{
if (meta == 4) {
return new TileEntityDoubleWaterSolar();
}
if (meta == 5)
{
if (meta == 5) {
return new TileEntityTripleWaterSolar();
}
if (meta == 6)
{
if (meta == 6) {
return new TileEntityDarkSolar();
}
if (meta == 7)
{
if (meta == 7) {
return new TileEntityDoubleDarkSolar();
}
if (meta == 8)
{
if (meta == 8) {
return new TileEntityTripleDarkSolar();
}
if (meta == 9)
{
if (meta == 9) {
return new TileEntityOrderSolar();
}
if (meta == 10)
{
if (meta == 10) {
return new TileEntityDoubleOrderSolar();
}
if (meta == 11)
{
if (meta == 11) {
return new TileEntityTripleOrderSolar();
}
if (meta == 12)
{
if (meta == 12) {
return new TileEntityFireSolar();
}
if (meta == 13)
{
if (meta == 13) {
return new TileEntityDoubleFireSolar();
}
if (meta == 14)
{
if (meta == 14) {
return new TileEntityTripleFireSolar();
}
if (meta == 15)
{
if (meta == 15) {
return new TileEntityAirSolar();
}
@@ -482,13 +399,8 @@ public class BlockEMTSolars extends BlockContainer
}
@Override
public TileEntity createNewTileEntity(World world) {
return null;
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
world.removeBlockTileEntity(x, y, z);
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
world.removeTileEntity(x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
}
@@ -496,4 +408,9 @@ public class BlockEMTSolars extends BlockContainer
public int damageDropped(int meta) {
return meta;
}
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return null;
}
}
@@ -13,44 +13,43 @@ package electricMagicTools.tombenpotter.electricmagictools.common.blocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleAirSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityDoubleEarthSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEarthSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleAirSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityTripleEarthSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleAirSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleEarthSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityEarthSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleAirSolar;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleEarthSolar;
public class BlockEMTSolars2 extends BlockContainer
{
public class BlockEMTSolars2 extends BlockContainer {
public Icon[] compressedSolar = new Icon[3];
public Icon[] doubleAirSolar = new Icon[3];
public Icon[] tripleAirSolar = new Icon[3];
public Icon[] earthSolar = new Icon[3];
public Icon[] doubleEarthSolar = new Icon[3];
public Icon[] tripleEarthSolar = new Icon[3];
public IIcon[] compressedSolar = new IIcon[3];
public IIcon[] doubleAirSolar = new IIcon[3];
public IIcon[] tripleAirSolar = new IIcon[3];
public IIcon[] earthSolar = new IIcon[3];
public IIcon[] doubleEarthSolar = new IIcon[3];
public IIcon[] tripleEarthSolar = new IIcon[3];
public BlockEMTSolars2(int id)
{
super(id, Material.iron);
public BlockEMTSolars2() {
super(Material.iron);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setHardness(4.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ri) {
public void registerBlockIcons(IIconRegister ri) {
this.compressedSolar[0] = ri.registerIcon("electricmagictools:solars/solartop");
this.compressedSolar[1] = ri.registerIcon("electricmagictools:solars/side");
this.compressedSolar[2] = ri.registerIcon("electricmagictools:solars/bottom");
@@ -78,7 +77,7 @@ public class BlockEMTSolars2 extends BlockContainer
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void getSubBlocks(int id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
list.add(new ItemStack(id, 1, 0));
list.add(new ItemStack(id, 1, 1));
list.add(new ItemStack(id, 1, 2));
@@ -88,107 +87,77 @@ public class BlockEMTSolars2 extends BlockContainer
}
@Override
public Icon getIcon(int side, int meta) {
if (meta == 0)
{
if (side == 1)
{
public IIcon getIcon(int side, int meta) {
if (meta == 0) {
if (side == 1) {
return this.doubleAirSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.doubleAirSolar[1];
}
}
if (meta == 1)
{
if (side == 1)
{
if (meta == 1) {
if (side == 1) {
return this.tripleAirSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.tripleAirSolar[1];
}
}
if (meta == 2)
{
if (side == 1)
{
if (meta == 2) {
if (side == 1) {
return this.earthSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.earthSolar[1];
}
}
if (meta == 3)
{
if (side == 1)
{
if (meta == 3) {
if (side == 1) {
return this.doubleEarthSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.doubleEarthSolar[1];
}
}
if (meta == 4)
{
if (side == 1)
{
if (meta == 4) {
if (side == 1) {
return this.tripleEarthSolar[0];
}
if (side > 1)
{
if (side > 1) {
return this.tripleEarthSolar[1];
}
}
return this.compressedSolar[2];
}
@Override
public Icon getBlockTexture(IBlockAccess access, int i, int j, int k, int side) {
return super.getBlockTexture(access, i, j, k, side);
}
@Override
public TileEntity createTileEntity(World world, int meta) {
if (meta == 0)
{
if (meta == 0) {
return new TileEntityDoubleAirSolar();
}
if (meta == 1)
{
if (meta == 1) {
return new TileEntityTripleAirSolar();
}
if (meta == 2)
{
if (meta == 2) {
return new TileEntityEarthSolar();
}
if (meta == 3)
{
if (meta == 3) {
return new TileEntityDoubleEarthSolar();
}
if (meta == 4)
{
if (meta == 4) {
return new TileEntityTripleEarthSolar();
}
return super.createTileEntity(world, meta);
}
@Override
public TileEntity createNewTileEntity(World world) {
return null;
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
world.removeBlockTileEntity(x, y, z);
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
world.removeTileEntity(x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
}
@@ -196,4 +165,10 @@ public class BlockEMTSolars2 extends BlockContainer
public int damageDropped(int meta) {
return meta;
}
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
// TODO Auto-generated method stub
return null;
}
}
@@ -14,13 +14,15 @@ package electricMagicTools.tombenpotter.electricmagictools.common.blocks;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -29,27 +31,24 @@ import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntity
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityAuramGenerator;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityIgnisGenerator;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityPotentiaGenerator;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntitySaxumGenerator;
public class BlockEssentiaGenerators extends BlockContainer
{
public class BlockEssentiaGenerators extends BlockContainer {
public Icon[] potentiaGen = new Icon[3];
public Icon[] ignisGen = new Icon[3];
public Icon[] auramGen = new Icon[3];
public Icon[] arborGen = new Icon[3];
public Icon[] saxumGen = new Icon[3];
public IIcon[] potentiaGen = new IIcon[3];
public IIcon[] ignisGen = new IIcon[3];
public IIcon[] auramGen = new IIcon[3];
public IIcon[] arborGen = new IIcon[3];
public IIcon[] saxumGen = new IIcon[3];
public BlockEssentiaGenerators(int id)
{
super(id, Material.iron);
public BlockEssentiaGenerators() {
super(Material.iron);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setHardness(4.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ri) {
public void registerBlockIcons(IIconRegister ri) {
this.potentiaGen[0] = ri.registerIcon("electricmagictools:essentiagenerator/potentiafront");
this.potentiaGen[1] = ri.registerIcon("electricmagictools:essentiagenerator/side");
this.potentiaGen[2] = ri.registerIcon("electricmagictools:essentiagenerator/top");
@@ -73,112 +72,73 @@ public class BlockEssentiaGenerators extends BlockContainer
@SuppressWarnings({ "unchecked", "rawtypes" })
@SideOnly(Side.CLIENT)
public void getSubBlocks(int id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
list.add(new ItemStack(id, 1, 0));
list.add(new ItemStack(id, 1, 1));
list.add(new ItemStack(id, 1, 2));
list.add(new ItemStack(id, 1, 3));
list.add(new ItemStack(id, 1, 4));
}
@Override
public Icon getIcon(int side, int meta) {
if (meta == 0)
{
if (side == 1)
{
public IIcon getIcon(int side, int meta) {
if (meta == 0) {
if (side == 1) {
return this.potentiaGen[2];
}
if (side > 1)
{
if (side > 1) {
return this.potentiaGen[0];
}
}
if (meta == 1)
{
if (side == 1)
{
if (meta == 1) {
if (side == 1) {
return this.ignisGen[2];
}
if (side > 1)
{
if (side > 1) {
return this.ignisGen[0];
}
}
if (meta == 2)
{
if (side == 1)
{
if (meta == 2) {
if (side == 1) {
return this.auramGen[2];
}
if (side > 1)
{
if (side > 1) {
return this.auramGen[0];
}
}
if (meta == 3)
{
if (side == 1)
{
if (meta == 3) {
if (side == 1) {
return this.arborGen[2];
}
if (side > 1)
{
if (side > 1) {
return this.arborGen[0];
}
}
if (meta == 4)
{
if (side == 1)
{
return this.saxumGen[2];
}
if (side > 1)
{
return this.saxumGen[0];
}
}
return this.potentiaGen[1];
}
@Override
public TileEntity createTileEntity(World world, int meta) {
if (meta == 0)
{
if (meta == 0) {
return new TileEntityPotentiaGenerator();
}
if (meta == 1)
{
if (meta == 1) {
return new TileEntityIgnisGenerator();
}
if (meta == 2)
{
if (meta == 2) {
return new TileEntityAuramGenerator();
}
if (meta == 3)
{
if (meta == 3) {
return new TileEntityArborGenerator();
}
if (meta == 4)
{
return new TileEntitySaxumGenerator();
}
return super.createTileEntity(world, meta);
}
@Override
public TileEntity createNewTileEntity(World world) {
return null;
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
world.removeBlockTileEntity(x, y, z);
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
world.removeTileEntity(x, y, z);
super.breakBlock(world, x, y, z, par5, par6);
}
@@ -194,4 +154,9 @@ public class BlockEssentiaGenerators extends BlockContainer
float f2 = (float) par4 + 0.5F;
par1World.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
}
@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return null;
}
}
@@ -14,13 +14,14 @@ package electricMagicTools.tombenpotter.electricmagictools.common.blocks;
import java.util.List;
import java.util.Random;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import thaumcraft.common.blocks.BlockAiry;
@@ -29,14 +30,11 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityPortableNode;
public class BlockPortableNode extends BlockAiry
{
public class BlockPortableNode extends BlockAiry {
public Icon[] texture = new Icon[1];
public IIcon[] texture = new IIcon[1];
public BlockPortableNode(int id)
{
super(id);
public BlockPortableNode() {
this.setCreativeTab(CreativeTab.tabTombenpotter);
setBlockUnbreakable();
}
@@ -79,27 +77,26 @@ public class BlockPortableNode extends BlockAiry
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister ri) {
public void registerBlockIcons(IIconRegister ri) {
this.texture[0] = ri.registerIcon("electricmagictools:portablenode");
}
@SideOnly(Side.CLIENT)
public Icon getIcon(int side, int meta) {
public IIcon getIcon(int side, int meta) {
return this.texture[0];
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubBlocks(int id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
list.add(new ItemStack(id, 1, 0));
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null)
{
if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) {
world.setBlockToAir(x, y, z);
world.removeBlockTileEntity(x, y, z);
world.removeTileEntity(x, y, z);
}
return true;
}
@@ -15,7 +15,7 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
@@ -23,12 +23,10 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class BlockShield extends Block
{
public class BlockShield extends Block {
public BlockShield(int id)
{
super(id, Material.rock);
public BlockShield() {
super(Material.rock);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setHardness(1F);
this.setResistance(200000000F);
@@ -47,7 +45,7 @@ public class BlockShield extends Block
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon("electricmagictools:shield");
}
@@ -11,9 +11,9 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.entities;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
@@ -25,16 +25,18 @@ import net.minecraft.entity.monster.EntitySnowman;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.IExtendedEntityProperties;
public class EntityArcher extends EntitySnowman
{
public class EntityArcher extends EntitySnowman implements IExtendedEntityProperties {
public EntityArcher(World par1World)
{
public EntityArcher(World par1World) {
super(par1World);
this.isImmuneToFire = true;
this.tasks.addTask(1, new EntityAISwimming(this));
@@ -46,8 +48,8 @@ public class EntityArcher extends EntitySnowman
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30D);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(40.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
}
@Override
@@ -58,8 +60,8 @@ public class EntityArcher extends EntitySnowman
}
@Override
protected int getDropItemId() {
return Item.arrow.itemID;
protected Item getDropItem() {
return Items.arrow;
}
@Override
@@ -69,47 +71,42 @@ public class EntityArcher extends EntitySnowman
j = this.rand.nextInt(3 + par2);
for (k = 0; k < j; ++k)
{
this.dropItem(Item.arrow.itemID, 1);
for (k = 0; k < j; ++k) {
this.dropItem(Items.arrow, 1);
}
j = this.rand.nextInt(3 + par2);
for (k = 0; k < j; ++k)
{
this.dropItem(Item.bone.itemID, 1);
for (k = 0; k < j; ++k) {
this.dropItem(Items.bone, 1);
}
}
@Override
protected void dropRareDrop(int par1) {
this.entityDropItem(new ItemStack(Block.web.blockID, 1, 1), 0.0F);
this.entityDropItem(new ItemStack(Blocks.web, 1, 1), 0.0F);
}
protected void addRandomArmor() {
super.addRandomArmor();
this.setCurrentItemOrArmor(0, new ItemStack(Item.bow));
this.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) {
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float) (14 - this.worldObj.difficultySetting * 4));
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting * 0.11F));
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
if (i > 0)
{
if (i > 0) {
entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
}
if (j > 0)
{
if (j > 0) {
entityarrow.setKnockbackStrength(j);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0)
{
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) {
entityarrow.setFire(100);
}
@@ -117,4 +114,17 @@ public class EntityArcher extends EntitySnowman
this.worldObj.spawnEntityInWorld(entityarrow);
}
@Override
public void saveNBTData(NBTTagCompound compound) {
}
@Override
public void loadNBTData(NBTTagCompound compound) {
}
@Override
public void init(Entity entity, World world) {
}
}
@@ -14,6 +14,7 @@ package electricMagicTools.tombenpotter.electricmagictools.common.entities;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
@@ -27,12 +28,11 @@ import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EntityLaser extends Entity implements IProjectile
{
public class EntityLaser extends Entity implements IProjectile {
private int xTile = -1;
private int yTile = -1;
private int zTile = -1;
private int inTile;
private Block inTile;
private int inData;
private boolean inGround;
@@ -40,15 +40,13 @@ public class EntityLaser extends Entity implements IProjectile
private int ticksInGround;
private int ticksInAir;
public EntityLaser(World par1World)
{
public EntityLaser(World par1World) {
super(par1World);
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
}
public EntityLaser(World par1World, double par2, double par4, double par6)
{
public EntityLaser(World par1World, double par2, double par4, double par6) {
super(par1World);
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
@@ -56,8 +54,7 @@ public class EntityLaser extends Entity implements IProjectile
this.yOffset = 0.0F;
}
public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5)
{
public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5) {
super(par1World);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = par2EntityLivingBase;
@@ -68,8 +65,7 @@ public class EntityLaser extends Entity implements IProjectile
double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ;
double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);
if (d3 >= 1.0E-7D)
{
if (d3 >= 1.0E-7D) {
float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI));
double d4 = d0 / d3;
@@ -81,8 +77,7 @@ public class EntityLaser extends Entity implements IProjectile
}
}
public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, float par3)
{
public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, float par3) {
super(par1World);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = par2EntityLivingBase;
@@ -136,8 +131,7 @@ public class EntityLaser extends Entity implements IProjectile
this.motionY = par3;
this.motionZ = par5;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
float f = MathHelper.sqrt_double(par1 + par5);
this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, (double) f) / Math.PI);
@@ -152,42 +146,42 @@ public class EntityLaser extends Entity implements IProjectile
public void onUpdate() {
super.onUpdate();
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f) * 180.0D / Math.PI);
}
int i = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
Block block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
if (block.getMaterial() != Material.air) {
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (i > 0)
{
Block.blocksList[i].setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = Block.blocksList[i].getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null && axisalignedbb.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ)))
{
if (axisalignedbb != null && axisalignedbb.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) {
this.inGround = true;
}
}
Block i = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
if (this.inGround)
{
int j = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
i.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = i.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null && axisalignedbb.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) {
this.inGround = true;
}
if (this.inGround) {
Block j = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3, true);
this.setDead();
if (j == this.inTile && k == this.inData)
{
if (j == this.inTile && k == this.inData) {
++this.ticksInGround;
if (this.ticksInGround == 1200)
{
if (this.ticksInGround == 1200) {
this.setDead();
}
} else
{
} else {
this.inGround = false;
this.motionX *= (double) (this.rand.nextFloat() * 0.2F);
this.motionY *= (double) (this.rand.nextFloat() * 0.2F);
@@ -195,17 +189,15 @@ public class EntityLaser extends Entity implements IProjectile
this.ticksInGround = 0;
this.ticksInAir = 0;
}
} else
{
} else {
++this.ticksInAir;
Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks_do_do(vec3, vec31, false, true);
MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31, false);
vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null)
{
if (movingobjectposition != null) {
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
@@ -215,22 +207,18 @@ public class EntityLaser extends Entity implements IProjectile
int l;
float f1;
for (l = 0; l < list.size(); ++l)
{
for (l = 0; l < list.size(); ++l) {
Entity entity1 = (Entity) list.get(l);
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
{
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
f1 = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double) f1, (double) f1, (double) f1);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3, vec31);
if (movingobjectposition1 != null)
{
if (movingobjectposition1 != null) {
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D)
{
if (d1 < d0 || d0 == 0.0D) {
entity = entity1;
d0 = d1;
}
@@ -238,17 +226,14 @@ public class EntityLaser extends Entity implements IProjectile
}
}
if (entity != null)
{
if (entity != null) {
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
{
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer))
{
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) {
movingobjectposition = null;
}
}
@@ -256,11 +241,10 @@ public class EntityLaser extends Entity implements IProjectile
float f2;
float f3;
if (movingobjectposition != null)
{
if (movingobjectposition.entityHit != null)
{
if (movingobjectposition != null) {
if (movingobjectposition.entityHit != null) {
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
{
this.motionX *= -0.10000000149011612D;
this.motionY *= -0.10000000149011612D;
@@ -269,12 +253,11 @@ public class EntityLaser extends Entity implements IProjectile
this.prevRotationYaw += 180.0F;
this.ticksInAir = 0;
}
} else
{
} else {
this.xTile = movingobjectposition.blockX;
this.yTile = movingobjectposition.blockY;
this.zTile = movingobjectposition.blockZ;
this.inTile = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile);
this.inTile = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
this.motionX = (double) ((float) (movingobjectposition.hitVec.xCoord - this.posX));
this.motionY = (double) ((float) (movingobjectposition.hitVec.yCoord - this.posY));
@@ -285,11 +268,6 @@ public class EntityLaser extends Entity implements IProjectile
this.posZ -= this.motionZ / (double) f2 * 0.05000000074505806D;
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
this.inGround = true;
if (this.inTile != 0)
{
Block.blocksList[this.inTile].onEntityCollidedWithBlock(this.worldObj, this.xTile, this.yTile, this.zTile, this);
}
}
}
@@ -299,23 +277,19 @@ public class EntityLaser extends Entity implements IProjectile
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
this.prevRotationYaw += 360.0F;
}
@@ -324,10 +298,8 @@ public class EntityLaser extends Entity implements IProjectile
float f4 = 0.99F;
f1 = 0.05F;
if (this.isInWater())
{
for (int j1 = 0; j1 < 4; ++j1)
{
if (this.isInWater()) {
for (int j1 = 0; j1 < 4; ++j1) {
f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double) f3, this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, this.motionX, this.motionY, this.motionZ);
}
@@ -340,7 +312,6 @@ public class EntityLaser extends Entity implements IProjectile
this.motionZ *= (double) f4;
this.motionY -= (double) f1;
this.setPosition(this.posX, this.posY, this.posZ);
this.doBlockCollisions();
}
}
@@ -348,7 +319,7 @@ public class EntityLaser extends Entity implements IProjectile
par1NBTTagCompound.setShort("xTile", (short) this.xTile);
par1NBTTagCompound.setShort("yTile", (short) this.yTile);
par1NBTTagCompound.setShort("zTile", (short) this.zTile);
par1NBTTagCompound.setByte("inTile", (byte) this.inTile);
par1NBTTagCompound.setByte("inTile", (byte) Block.getIdFromBlock(this.inTile));
par1NBTTagCompound.setByte("inData", (byte) this.inData);
par1NBTTagCompound.setByte("inGround", (byte) (this.inGround ? 1 : 0));
}
@@ -357,13 +328,23 @@ public class EntityLaser extends Entity implements IProjectile
this.xTile = par1NBTTagCompound.getShort("xTile");
this.yTile = par1NBTTagCompound.getShort("yTile");
this.zTile = par1NBTTagCompound.getShort("zTile");
this.inTile = par1NBTTagCompound.getByte("inTile") & 255;
this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255);
this.inData = par1NBTTagCompound.getByte("inData") & 255;
this.inGround = par1NBTTagCompound.getByte("inGround") == 1;
}
public void onCollide(Entity par1Entity) {
if (!this.worldObj.isRemote)
;
{
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3, true);
}
}
@SideOnly(Side.CLIENT)
public float getShadowSize() {
return 0.0F;
}
}
@@ -0,0 +1,158 @@
package electricMagicTools.tombenpotter.electricmagictools.common.items;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemEMTBaubles extends Item implements IBauble {
public IIcon[] icon = new IIcon[16];
public ItemEMTBaubles() {
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(0);
this.setMaxStackSize(1);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage()) {
case 0: {
name = "euMaker.armor";
break;
}
case 1: {
name = "euMaker.inventory";
break;
}
case 2: {
name = "oneRing";
break;
}
default:
name = "nothing";
break;
}
return getUnlocalizedName() + "." + name;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ri) {
this.icon[0] = ri.registerIcon("electricmagictools:armoreumaker");
this.icon[1] = ri.registerIcon("electricmagictools:inventoryeumaker");
this.icon[2] = ri.registerIcon("electricmagictools:onering");
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta) {
return this.icon[meta];
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
list.add(new ItemStack(this, 1, 0));
list.add(new ItemStack(this, 1, 1));
list.add(new ItemStack(this, 1, 2));
}
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack stack) {
if (stack.getItemDamage() == 2) {
return true;
} else {
return false;
}
}
@Override
public BaubleType getBaubleType(ItemStack stack) {
if (stack.getItemDamage() <= 2) {
return BaubleType.RING;
} else {
return null;
}
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
if (stack != null) {
if (stack.getItemDamage() == 0) {
if (player instanceof EntityPlayer) {
int energyLeft = Config.armorBaubleProduction;
for (int i = 0; i < ((EntityPlayer) player).inventory.armorInventory.length; i++) {
if (energyLeft > 0) {
if ((((EntityPlayer) player).inventory.armorInventory[i] != null) && (((EntityPlayer) player).inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
int sentPacket = ElectricItem.manager.charge(((EntityPlayer) player).inventory.armorInventory[i], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
}
}
}
}
}
if (stack != null) {
if (stack.getItemDamage() == 1) {
if (player instanceof EntityPlayer) {
int energyLeft = Config.inventoryBaubleProdution;
for (int i = 0; i < ((EntityPlayer) player).inventory.mainInventory.length; i++) {
if (energyLeft > 0) {
if ((((EntityPlayer) player).inventory.mainInventory[i] != null) && (((EntityPlayer) player).inventory.mainInventory[i].getItem() instanceof IElectricItem)) {
int sentPacket = ElectricItem.manager.charge(((EntityPlayer) player).inventory.mainInventory[i], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
}
}
}
}
}
if (stack != null && stack.getItemDamage() == 2) {
if (player instanceof EntityPlayer) {
((EntityPlayer) player).capabilities.disableDamage = true;
}
}
}
@Override
public void onEquipped(ItemStack stack, EntityLivingBase player) {
if (stack != null && stack.getItemDamage() == 2) {
player.setInvisible(true);
}
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
if (stack != null && stack.getItemDamage() == 2) {
player.setInvisible(false);
if (player instanceof EntityPlayer)
((EntityPlayer) player).capabilities.disableDamage = false;
}
}
@Override
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
return true;
}
@Override
public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
return true;
}
}
@@ -13,23 +13,20 @@ package electricMagicTools.tombenpotter.electricmagictools.common.items;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemEMTItems extends Item
{
public class ItemEMTItems extends Item {
public Icon[] icon = new Icon[16];
public IIcon[] icon = new IIcon[16];
public ItemEMTItems(int id)
{
super(id);
public ItemEMTItems() {
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(0);
this.setMaxStackSize(64);
@@ -39,30 +36,24 @@ public class ItemEMTItems extends Item
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage())
{
case 0:
{
switch (itemstack.getItemDamage()) {
case 0: {
name = "oreClusterUranium";
break;
}
case 1:
{
case 1: {
name = "crushedOreAmber";
break;
}
case 2:
{
case 2: {
name = "purifiedOreAmber";
break;
}
case 3:
{
case 3: {
name = "crushedOreCinnabar";
break;
}
case 4:
{
case 4: {
name = "purifiedOreCinnabar";
break;
}
@@ -74,7 +65,7 @@ public class ItemEMTItems extends Item
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ri) {
public void registerIcons(IIconRegister ri) {
this.icon[0] = ri.registerIcon("electricmagictools:clusteruranium");
this.icon[1] = ri.registerIcon("electricmagictools:crushedamber");
this.icon[2] = ri.registerIcon("electricmagictools:purifiedamber");
@@ -83,13 +74,13 @@ public class ItemEMTItems extends Item
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
public IIcon getIconFromDamage(int meta) {
return this.icon[meta];
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int id, CreativeTabs tabs, List list) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
// list.add(new ItemStack(this, 1, 0));
list.add(new ItemStack(this, 1, 1));
list.add(new ItemStack(this, 1, 2));
@@ -17,6 +17,7 @@ import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import thaumcraft.api.IScribeTools;
import thaumcraft.common.items.ItemInkwell;
@@ -24,14 +25,11 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools
{
public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools {
public static int maxCharge = 400;
public ItemElectricScribingTools(int id)
{
super(id);
public ItemElectricScribingTools() {
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(400);
this.setMaxStackSize(1);
@@ -42,16 +40,6 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -68,17 +56,26 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -11,27 +11,24 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemLightningSummoner extends Item
{
public class ItemLightningSummoner extends Item {
public ItemLightningSummoner(int id)
{
super(id);
public ItemLightningSummoner() {
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(1);
this.setMaxStackSize(64);
@@ -39,7 +36,7 @@ public class ItemLightningSummoner extends Item
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:lightningsummoner");
}
@@ -62,30 +59,25 @@ public class ItemLightningSummoner extends Item
float f9 = f3 * f5;
double d3 = 5000D;
Vec3 vec3d1 = vec3d.addVector(f7 * d3, f8 * d3, f9 * d3);
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3d, vec3d1, false, true);
if (movingobjectposition == null)
{
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(vec3d, vec3d1, true);
if (movingobjectposition == null) {
return itemstack;
}
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
} else if (movingobjectposition.typeOfHit == EnumMovingObjectType.ENTITY)
{
} else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
Entity entityhit = movingobjectposition.entityHit;
double x = entityhit.posX;
double y = entityhit.posY;
double z = entityhit.posZ;
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
}
if (player.capabilities.isCreativeMode)
{
if (player.capabilities.isCreativeMode) {
return itemstack;
} else
{
} else {
itemstack.damageItem(2, player);
return itemstack;
}
@@ -11,19 +11,16 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemThaumiumPlate extends Item
{
public class ItemThaumiumPlate extends Item {
public ItemThaumiumPlate(int id)
{
super(id);
public ItemThaumiumPlate() {
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(0);
this.setMaxStackSize(64);
@@ -32,7 +29,7 @@ public class ItemThaumiumPlate extends Item
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:thaumiumplate");
}
}
@@ -27,40 +27,38 @@ import ic2.api.item.IMetalArmor;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.EventPriority;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.Thaumcraft;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemElectricBootsTraveller extends ItemArmor implements IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor
{
public class ItemElectricBootsTraveller extends ItemArmor implements IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
public int maxCharge = 10000;
@SuppressWarnings({ "unchecked", "rawtypes" })
public static List<String> playersWith1Step = new ArrayList();
public ItemElectricBootsTraveller(int id, int par3, int par4)
{
super(id, EnumArmorMaterial.DIAMOND, par3, par4);
public ItemElectricBootsTraveller(int par3, int par4) {
super(ArmorMaterial.DIAMOND, par3, par4);
this.setMaxDamage(27);
this.setMaxStackSize(1);
this.setCreativeTab(CreativeTab.tabTombenpotter);
@@ -70,26 +68,26 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:electricboots");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "electricmagictools:textures/models/electricboots.png";
}
@@ -97,10 +95,9 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
return true;
}
@ForgeSubscribe
@SubscribeEvent
public void onEntityUpdate(LivingUpdateEvent event) {
if (event.entityLiving instanceof EntityPlayer)
{
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
ItemStack armor = player.getCurrentArmor(3 - armorType);
if (armor != null && armor.getItem() == this)
@@ -117,33 +114,30 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
player.fallDistance = 0F;
}
@ForgeSubscribe
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event) {
if (event.entityLiving instanceof EntityPlayer)
{
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
if (hasArmor)
player.motionY += 0.3;
}
}
@ForgeSubscribe(priority = EventPriority.HIGH)
@SubscribeEvent(priority = EventPriority.HIGH)
public void onLivingUpdate(LivingUpdateEvent event) {
if (event.entityLiving instanceof EntityPlayer && event.entityLiving.worldObj.isRemote)
{
if (event.entityLiving instanceof EntityPlayer && event.entityLiving.worldObj.isRemote) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
boolean highStepListed = playersWith1Step.contains(player.username);
boolean hasHighStep = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
boolean highStepListed = playersWith1Step.contains(player.getCommandSenderName());
boolean hasHighStep = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
if (hasHighStep && !highStepListed)
playersWith1Step.add(player.username);
playersWith1Step.add(player.getCommandSenderName());
if (!hasHighStep && highStepListed)
{
playersWith1Step.remove(player.username);
if (!hasHighStep && highStepListed) {
playersWith1Step.remove(player.getCommandSenderName());
player.stepHeight = 0.5F;
}
}
@@ -159,16 +153,6 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -191,22 +175,18 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
} else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@@ -217,11 +197,9 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
if (source.isUnblockable())
{
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
} else
{
} else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
int damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
@@ -231,11 +209,9 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage())
{
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
} else
{
} else {
return 0;
}
}
@@ -265,12 +241,21 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
}
@Override
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
if (Config.smoke == false && player.onGround == false)
{
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
if (Config.smoke == false && player.onGround == false) {
int miny = (int) (player.boundingBox.minY - 2.0D);
Thaumcraft.proxy.smokeSpiral(player.worldObj, player.posX, player.boundingBox.minY + player.height / 2.0F, player.posZ, 1.5F, player.worldObj.rand.nextInt(620), miny);
}
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -13,7 +13,7 @@ package electricMagicTools.tombenpotter.electricmagictools.common.items.armor;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -22,24 +22,22 @@ import thaumcraft.api.aspects.Aspect;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemElectricGoggles extends ItemQuantumThaumicHelmet
{
public class ItemElectricGoggles extends ItemQuantumThaumicHelmet {
public int maxCharge = 10000;
public ItemElectricGoggles(int id, int par3, int par4)
{
super(id, par3, par4);
public ItemElectricGoggles(int par3, int par4) {
super(par3, par4);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:electricgoggles");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "electricmagictools:textures/models/electricgoggles.png";
}
@@ -58,7 +56,7 @@ public class ItemElectricGoggles extends ItemQuantumThaumicHelmet
}
@Override
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
}
@Override
@@ -22,35 +22,33 @@ package electricMagicTools.tombenpotter.electricmagictools.common.items.armor;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import thaumcraft.api.aspects.Aspect;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller
{
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
public int maxCharge = 500000;
public ItemNanoBootsTraveller(int id, int par3, int par4)
{
super(id, par3, par4);
public ItemNanoBootsTraveller(int par3, int par4) {
super(par3, par4);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:nanobootstravel");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "electricmagictools:textures/models/nanobootstravel.png";
}
@@ -69,16 +67,14 @@ public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller
player.fallDistance = 0F;
}
@ForgeSubscribe
@SubscribeEvent
@Override
public void onPlayerJump(LivingJumpEvent event) {
if (event.entityLiving instanceof EntityPlayer)
{
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
if (hasArmor)
{
if (hasArmor) {
player.motionY += Config.nanoBootsJump;
}
}
@@ -15,7 +15,7 @@ import ic2.api.item.ElectricItem;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -29,14 +29,12 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemNanoThaumicHelmet extends ItemQuantumThaumicHelmet
{
public class ItemNanoThaumicHelmet extends ItemQuantumThaumicHelmet {
public int maxCharge = 100000;
public ItemNanoThaumicHelmet(int id, int par3, int par4)
{
super(id, par3, par4);
public ItemNanoThaumicHelmet(int par3, int par4) {
super(par3, par4);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(27);
this.setMaxStackSize(1);
@@ -44,12 +42,12 @@ public class ItemNanoThaumicHelmet extends ItemQuantumThaumicHelmet
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:nanothaumichelmet");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "electricmagictools:textures/models/thaumicnanohelmet.png";
}
@@ -68,11 +66,9 @@ public class ItemNanoThaumicHelmet extends ItemQuantumThaumicHelmet
}
@Override
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
if (Config.nightVisionOff == false)
{
if (ElectricItem.manager.canUse(itemStack, 1 / 1000))
{
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
if (Config.nightVisionOff == false) {
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
int x = MathHelper.floor_double(player.posX);
int z = MathHelper.floor_double(player.posZ);
@@ -82,8 +78,7 @@ public class ItemNanoThaumicHelmet extends ItemQuantumThaumicHelmet
if (lightlevel >= 0)
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
ElectricItem.manager.use(itemStack, 1 / 1000, player);
} else
{
} else {
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
}
}
@@ -22,35 +22,33 @@ package electricMagicTools.tombenpotter.electricmagictools.common.items.armor;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import thaumcraft.api.aspects.Aspect;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller
{
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
public int maxCharge = 1000000;
public ItemQuantumBootsTraveller(int id, int par3, int par4)
{
super(id, par3, par4);
public ItemQuantumBootsTraveller(int par3, int par4) {
super(par3, par4);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:quantumbootstravel");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "electricmagictools:textures/models/quantumbootstravel.png";
}
@@ -69,16 +67,14 @@ public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller
player.fallDistance = 0F;
}
@ForgeSubscribe
@SubscribeEvent
@Override
public void onPlayerJump(LivingJumpEvent event) {
if (event.entityLiving instanceof EntityPlayer)
{
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
if (hasArmor)
{
if (hasArmor) {
player.motionY += Config.quantumBootsJump;
}
}
@@ -21,12 +21,12 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
@@ -45,14 +45,12 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor
{
public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
@SuppressWarnings({ "unchecked", "rawtypes" })
private static final Map<Integer, Integer> potionCost = new HashMap();
public ItemQuantumThaumicHelmet(int id, int par3, int par4)
{
super(id, EnumArmorMaterial.DIAMOND, par3, par4);
public ItemQuantumThaumicHelmet(int par3, int par4) {
super(ArmorMaterial.DIAMOND, par3, par4);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(27);
this.setMaxStackSize(1);
@@ -66,12 +64,12 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:quantumthaumichelmet");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return "electricmagictools:textures/models/thaumicquantumhelmet.png";
}
@@ -80,16 +78,6 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -102,42 +90,35 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
int refill = player.getAir();
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100)
{
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
player.setAir(refill + 200);
ElectricItem.manager.use(itemStack, 1000, null);
}
Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
do
{
if (!i$.hasNext())
{
do {
if (!i$.hasNext()) {
break;
}
{
PotionEffect effect = (PotionEffect) i$.next();
int id = effect.getPotionID();
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
if (cost != null)
{
if (cost != null) {
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
if (ElectricItem.manager.canUse(itemStack, cost.intValue()))
{
if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
ElectricItem.manager.use(itemStack, cost.intValue(), null);
ItemStack milk = (new ItemStack(Item.bucketMilk));
ItemStack milk = (new ItemStack(Items.milk_bucket));
player.curePotionEffects(milk);
}
}
}
} while (true);
if (Config.nightVisionOff == false)
{
if (ElectricItem.manager.canUse(itemStack, 1 / 1000))
{
if (Config.nightVisionOff == false) {
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
int x = MathHelper.floor_double(player.posX);
int z = MathHelper.floor_double(player.posZ);
int y = MathHelper.floor_double(player.posY);
@@ -145,8 +126,7 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
if (lightlevel >= 0)
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
ElectricItem.manager.use(itemStack, 1 / 1000, player);
} else
{
} else {
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
}
}
@@ -159,18 +139,16 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
@@ -180,22 +158,18 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
} else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@@ -228,11 +202,9 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
if (source.isUnblockable())
{
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
} else
{
} else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
int damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
@@ -242,11 +214,9 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage())
{
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
} else
{
} else {
return 0;
}
}
@@ -267,4 +237,14 @@ public class ItemQuantumThaumicHelmet extends ItemArmor implements IElectricItem
private double getBaseAbsorptionRatio() {
return 0.14999999999999999D;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -20,12 +20,12 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
@@ -44,8 +44,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor, IRevealer, IVisDiscountGear, IGoggles, IElectricItem
{
public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor, IRevealer, IVisDiscountGear, IGoggles, IElectricItem {
public int maxCharge = 10000000;
private int ticker;
@@ -61,9 +60,8 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
private static final Map potionCost = new HashMap();
@SuppressWarnings("unchecked")
public ItemSolarHelmetRevealing(int id, int par3, int par4)
{
super(id, EnumArmorMaterial.IRON, par3, par4);
public ItemSolarHelmetRevealing(int par3, int par4) {
super(ArmorMaterial.IRON, par3, par4);
this.setMaxDamage(27);
this.setMaxStackSize(1);
this.setCreativeTab(CreativeTab.tabTombenpotter);
@@ -83,11 +81,9 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
@SuppressWarnings("unchecked")
@Override
public void onArmorTickUpdate(World worldObj, EntityPlayer player, ItemStack itemStack) {
if (Config.nightVisionOff == false)
{
if (ElectricItem.manager.canUse(itemStack, 1 / 1000))
{
public void onArmorTick(World worldObj, EntityPlayer player, ItemStack itemStack) {
if (Config.nightVisionOff == false) {
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
int x = MathHelper.floor_double(player.posX);
int z = MathHelper.floor_double(player.posZ);
@@ -97,77 +93,61 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
if (lightlevel >= 0)
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
ElectricItem.manager.use(itemStack, 1 / 1000, player);
} else
{
} else {
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
}
}
int refill = player.getAir();
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100)
{
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
player.setAir(refill + 200);
ElectricItem.manager.use(itemStack, 1000, null);
}
@SuppressWarnings("rawtypes")
Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
do
{
if (!i$.hasNext())
{
do {
if (!i$.hasNext()) {
break;
}
{
PotionEffect effect = (PotionEffect) i$.next();
int id = effect.getPotionID();
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
if (cost != null)
{
if (cost != null) {
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
if (ElectricItem.manager.canUse(itemStack, cost.intValue()))
{
if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
ElectricItem.manager.use(itemStack, cost.intValue(), null);
ItemStack milk = (new ItemStack(Item.bucketMilk));
ItemStack milk = (new ItemStack(Items.milk_bucket));
player.curePotionEffects(milk);
}
}
}
} while (true);
if (worldObj.isRemote)
{
if (worldObj.isRemote) {
return;
}
checkForSun(player);
if (this.generating > 0)
{
if (this.generating > 0) {
int energyLeft = this.generating;
for (int i = 0; i < player.inventory.armorInventory.length; i++)
{
if (energyLeft > 0)
{
if ((player.inventory.armorInventory[i] != null) && ((Item.itemsList[player.inventory.armorInventory[i].itemID] instanceof IElectricItem)))
{
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
if (energyLeft > 0) {
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
int sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
} else
{
} else {
return;
}
}
for (int j = 0; j < player.inventory.mainInventory.length; j++)
{
if (energyLeft > 0)
{
if ((player.inventory.mainInventory[j] != null) && ((Item.itemsList[player.inventory.mainInventory[j].itemID] instanceof IElectricItem)))
{
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
if (energyLeft > 0) {
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
int sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
} else
{
} else {
return;
}
}
@@ -175,17 +155,14 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
}
public int checkForSun(EntityPlayer player) {
if (this.ticker++ % tickRate() == 0)
{
if (this.ticker++ % tickRate() == 0) {
updateVisibility(player);
}
if ((this.sunIsUp) && (this.skyIsVisible))
{
if ((this.sunIsUp) && (this.skyIsVisible)) {
this.generating = (0 + this.genDay);
return this.generating;
}
if (this.skyIsVisible)
{
if (this.skyIsVisible) {
this.generating = (0 + this.genNight);
return this.generating;
}
@@ -197,18 +174,14 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
this.dampPlace = (player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ).getIntRainfall() > 0);
this.noSunWorld = player.worldObj.provider.hasNoSky;
Boolean rainWeather = Boolean.valueOf((this.dampPlace) && ((player.worldObj.isRaining()) || (player.worldObj.isThundering())));
if ((!player.worldObj.isDaytime()) || (rainWeather.booleanValue()))
{
if ((!player.worldObj.isDaytime()) || (rainWeather.booleanValue())) {
this.sunIsUp = false;
} else
{
} else {
this.sunIsUp = true;
}
if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld))
{
if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld)) {
this.skyIsVisible = false;
} else
{
} else {
this.skyIsVisible = true;
}
}
@@ -219,7 +192,7 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:solarrevealinghelmet");
}
@@ -246,11 +219,9 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
if (source.isUnblockable())
{
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
} else
{
} else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
int damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
@@ -260,11 +231,9 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage())
{
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
} else
{
} else {
return 0;
}
}
@@ -288,18 +257,16 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
@@ -307,16 +274,6 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
return true;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -334,23 +291,29 @@ public class ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
} else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -9,35 +9,35 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items;
package electricMagicTools.tombenpotter.electricmagictools.common.items.blocks;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockEMTMachines extends ItemBlock
{
public class ItemBlockEMTMachines extends ItemBlock {
public ItemBlockEMTMachines(int par1)
{
super(par1);
public ItemBlockEMTMachines(Block id) {
super(id);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage())
{
case 0:
{
switch (itemstack.getItemDamage()) {
case 0: {
name = "wandrecharge";
break;
}
case 1:
{
case 1: {
name = "etheralprocessor";
break;
}
case 2: {
name = "raindispeller";
break;
}
default:
name = "nothing";
}
@@ -9,106 +9,88 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items;
package electricMagicTools.tombenpotter.electricmagictools.common.items.blocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class ItemBlockEMTSolars extends ItemBlock
{
public class ItemBlockEMTSolars extends ItemBlock {
public ItemBlockEMTSolars(int par1)
{
super(par1);
public ItemBlockEMTSolars(Block id) {
super(id);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage())
{
case 0:
{
switch (itemstack.getItemDamage()) {
case 0: {
name = "compressed";
break;
}
case 1:
{
case 1: {
name = "doublecompressed";
break;
}
case 2:
{
case 2: {
name = "triplecompressed";
break;
}
case 3:
{
case 3: {
name = "water";
break;
}
case 4:
{
case 4: {
name = "doublewater";
break;
}
case 5:
{
case 5: {
name = "triplewater";
break;
}
case 6:
{
case 6: {
name = "dark";
break;
}
case 7:
{
case 7: {
name = "doubledark";
break;
}
case 8:
{
case 8: {
name = "tripledark";
break;
}
case 9:
{
case 9: {
name = "order";
break;
}
case 10:
{
case 10: {
name = "doubleorder";
break;
}
case 11:
{
case 11: {
name = "tripleorder";
break;
}
case 12:
{
case 12: {
name = "fire";
break;
}
case 13:
{
case 13: {
name = "doublefire";
break;
}
case 14:
{
case 14: {
name = "triplefire";
break;
}
case 15:
{
case 15: {
name = "air";
break;
}
@@ -127,92 +109,75 @@ public class ItemBlockEMTSolars extends ItemBlock
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
switch (itemstack.getItemDamage())
{
case 0:
{
switch (itemstack.getItemDamage()) {
case 0: {
list.add(Config.compressedSolarOutput + " EU/T");
break;
}
case 1:
{
case 1: {
list.add(Config.doubleCompressedSolarOutput + " EU/T");
break;
}
case 2:
{
case 2: {
list.add(Config.tripleCompressedSolarOutput + " EU/T");
break;
}
case 3:
{
case 3: {
list.add("Special Effect: " + Config.compressedSolarOutput + " EU/T when raining");
break;
}
case 4:
{
case 4: {
list.add("Special Effect: " + Config.doubleCompressedSolarOutput + " EU/T when raining");
break;
}
case 5:
{
case 5: {
list.add("Special Effect: " + Config.tripleCompressedSolarOutput + " EU/T when raining");
break;
}
case 6:
{
case 6: {
list.add("Special Effect: " + Config.compressedSolarOutput + " EU/T at night");
break;
}
case 7:
{
case 7: {
list.add("Special Effect: " + Config.doubleCompressedSolarOutput + " EU/T at night");
break;
}
case 8:
{
case 8: {
list.add("Special Effect: " + Config.tripleCompressedSolarOutput + " EU/T at night");
break;
}
case 9:
{
case 9: {
list.add("Normal Conditions: " + Config.compressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 3");
break;
}
case 10:
{
case 10: {
list.add("Normal Conditions: " + Config.doubleCompressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 3");
break;
}
case 11:
{
case 11: {
list.add("Normal Conditions: " + Config.tripleCompressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 3");
break;
}
case 12:
{
case 12: {
list.add("Normal Conditions: " + Config.compressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2 when located in the nether");
break;
}
case 13:
{
case 13: {
list.add("Normal Conditions: " + Config.doubleCompressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2 when located in the nether");
break;
}
case 14:
{
case 14: {
list.add("Normal Conditions: " + Config.tripleCompressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2 when lava is on top");
list.add("Special Effect: Output multiplied by 2 when located in the nether");
}
case 15:
{
case 15: {
list.add("Normal Conditions: " + Config.compressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2.5 when the block is over Y = 160");
break;
@@ -9,51 +9,44 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items;
package electricMagicTools.tombenpotter.electricmagictools.common.items.blocks;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class ItemBlockEMTSolars2 extends ItemBlock
{
public class ItemBlockEMTSolars2 extends ItemBlock {
public ItemBlockEMTSolars2(int par1)
{
super(par1);
public ItemBlockEMTSolars2(Block id) {
super(id);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage())
{
case 0:
{
switch (itemstack.getItemDamage()) {
case 0: {
name = "doubleair";
break;
}
case 1:
{
case 1: {
name = "tripleair";
break;
}
case 2:
{
case 2: {
name = "earth";
break;
}
case 3:
{
case 3: {
name = "doubleearth";
break;
}
case 4:
{
case 4: {
name = "tripleearth";
break;
}
@@ -72,34 +65,28 @@ public class ItemBlockEMTSolars2 extends ItemBlock
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
switch (itemstack.getItemDamage())
{
case 0:
{
switch (itemstack.getItemDamage()) {
case 0: {
list.add("Normal Conditions: " + Config.doubleCompressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2.5 when the block is over Y = 160");
break;
}
case 1:
{
case 1: {
list.add("Normal Conditions: " + Config.tripleCompressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2.5 when the block is over Y = 160");
break;
}
case 2:
{
case 2: {
list.add("Normal Conditions: " + Config.compressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2.5 when the block is under Y = 10");
break;
}
case 3:
{
case 3: {
list.add("Normal Conditions: " + Config.doubleCompressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2.5 when the block is under Y = 10");
break;
}
case 4:
{
case 4: {
list.add("Normal Conditions: " + Config.tripleCompressedSolarOutput + " EU/T");
list.add("Special Effect: Output multiplied by 2.5 when the block is under Y = 10");
break;
@@ -9,50 +9,39 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items;
package electricMagicTools.tombenpotter.electricmagictools.common.items.blocks;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockEssentiaGenerators extends ItemBlock
{
public class ItemBlockEssentiaGenerators extends ItemBlock {
public ItemBlockEssentiaGenerators(int par1)
{
super(par1);
public ItemBlockEssentiaGenerators(Block id) {
super(id);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage())
{
case 0:
{
switch (itemstack.getItemDamage()) {
case 0: {
name = "potentia";
break;
}
case 1:
{
case 1: {
name = "ignis";
break;
}
case 2:
{
case 2: {
name = "auram";
break;
}
case 3:
{
case 3: {
name = "arbor";
break;
}
case 4:
{
name = "saxum";
break;
}
default:
name = "nothing";
}
@@ -60,7 +49,7 @@ public class ItemBlockEssentiaGenerators extends ItemBlock
}
@Override
public int getMetadata(int par1) {
return par1;
public int getMetadata(int meta) {
return meta;
}
}
@@ -17,7 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@@ -26,14 +26,12 @@ import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.IWandFocus;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public abstract class ItemBaseFocus extends Item implements IWandFocus
{
public abstract class ItemBaseFocus extends Item implements IWandFocus {
private Icon ornament, depth;
private IIcon ornament, depth;
public ItemBaseFocus(int id)
{
super(id);
public ItemBaseFocus() {
super();
this.setMaxDamage(1);
this.setNoRepair();
this.setMaxStackSize(1);
@@ -64,12 +62,12 @@ public abstract class ItemBaseFocus extends Item implements IWandFocus
}
@Override
public Icon getFocusDepthLayerIcon() {
public IIcon getFocusDepthLayerIcon() {
return depth;
}
@Override
public Icon getOrnament() {
public IIcon getOrnament() {
return ornament;
}
@@ -132,11 +130,9 @@ public abstract class ItemBaseFocus extends Item implements IWandFocus
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
AspectList cost = getVisCost();
if (cost != null && cost.size() > 0)
{
if (cost != null && cost.size() > 0) {
list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
for (Aspect aspect : cost.getAspectsSorted())
{
for (Aspect aspect : cost.getAspectsSorted()) {
float amount = cost.getAmount(aspect) / 100.0F;
list.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount);
}
@@ -13,9 +13,8 @@ package electricMagicTools.tombenpotter.electricmagictools.common.items.foci;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
@@ -26,19 +25,17 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class ItemChargeFocus extends ItemBaseFocus
{
public class ItemChargeFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
public ItemChargeFocus(int id)
{
super(id);
public ItemChargeFocus() {
super();
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:chargefocus");
}
@@ -60,37 +57,27 @@ public class ItemChargeFocus extends ItemBaseFocus
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (wand.consumeAllVis(itemstack, player, getVisCost(), true))
{
if (!world.isRemote)
{
if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) {
if (!world.isRemote) {
int energyLeft = Config.chargeFocusProduction;
for (int i = 0; i < player.inventory.armorInventory.length; i++)
{
if (energyLeft > 0)
{
if ((player.inventory.armorInventory[i] != null) && ((Item.itemsList[player.inventory.armorInventory[i].itemID] instanceof IElectricItem)))
{
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
if (energyLeft > 0) {
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
int sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
} else
{
} else {
return itemstack;
}
}
for (int j = 0; j < player.inventory.mainInventory.length; j++)
{
if (energyLeft > 0)
{
if ((player.inventory.mainInventory[j] != null) && ((Item.itemsList[player.inventory.mainInventory[j].itemID] instanceof IElectricItem)))
{
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
if (energyLeft > 0) {
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
int sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
} else
{
} else {
return itemstack;
}
}
@@ -11,7 +11,7 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items.foci;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.monster.EntitySnowman;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -23,14 +23,12 @@ import thaumcraft.common.items.wands.ItemWandCasting;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemChristmasFocus extends ItemBaseFocus
{
public class ItemChristmasFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500);
public ItemChristmasFocus(int id)
{
super(id);
public ItemChristmasFocus() {
super();
}
@Override
@@ -40,7 +38,7 @@ public class ItemChristmasFocus extends ItemBaseFocus
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:christmasfocus");
}
@@ -57,10 +55,8 @@ public class ItemChristmasFocus extends ItemBaseFocus
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (wand.consumeAllVis(itemstack, player, getVisCost(), true))
{
if (!world.isRemote)
{
if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) {
if (!world.isRemote) {
EntitySnowman snowman;
snowman = new EntitySnowman(world);
snowman.setPosition(player.posX + 2, player.posY + 1, player.posZ + 2);
@@ -11,7 +11,7 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items.foci;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
@@ -23,19 +23,17 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.entities.EntityLaser;
public class ItemExplosionFocus extends ItemBaseFocus
{
public class ItemExplosionFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200);
public ItemExplosionFocus(int id)
{
super(id);
public ItemExplosionFocus() {
super();
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:explosionfocus");
}
@@ -57,10 +55,8 @@ public class ItemExplosionFocus extends ItemBaseFocus
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (wand.consumeAllVis(itemstack, player, getVisCost(), true))
{
if (!world.isRemote)
{
if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) {
if (!world.isRemote) {
EntityLaser laser;
laser = new EntityLaser(world, player, 2);
world.spawnEntityInWorld(laser);
@@ -11,9 +11,9 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.items.foci;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@@ -24,19 +24,17 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
public class ItemShieldFocus extends ItemBaseFocus
{
public class ItemShieldFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10);
public ItemShieldFocus(int id)
{
super(id);
public ItemShieldFocus() {
super();
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:shieldfocus");
}
@@ -67,34 +65,28 @@ public class ItemShieldFocus extends ItemBaseFocus
player.motionZ = 0.0D;
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (wand.consumeAllVis(itemstack, player, getVisCost(), true))
{
if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) {
int x = MathHelper.floor_double(player.posX);
int y = MathHelper.floor_double(player.posY);
int z = MathHelper.floor_double(player.posZ);
if (wand.consumeAllVis(itemstack, player, getVisCost(), true))
{
// Player Level
if (player.worldObj.isAirBlock(x + 1, y, z) && player.worldObj.isAirBlock(x - 1, y, z) && player.worldObj.isAirBlock(x, y, z + 1) && player.worldObj.isAirBlock(x, y, z - 1))
{
player.worldObj.setBlock(x + 1, y, z, BlockRegistry.shield.blockID);
player.worldObj.setBlock(x - 1, y, z, BlockRegistry.shield.blockID);
player.worldObj.setBlock(x, y, z + 1, BlockRegistry.shield.blockID);
player.worldObj.setBlock(x, y, z - 1, BlockRegistry.shield.blockID);
}
// Above the player
if (player.worldObj.isAirBlock(x + 1, y + 1, z) && player.worldObj.isAirBlock(x - 1, y + 1, z) && player.worldObj.isAirBlock(x, y + 1, z + 1) && player.worldObj.isAirBlock(x, y + 1, z - 1))
{
player.worldObj.setBlock(x + 1, y + 1, z, BlockRegistry.shield.blockID);
player.worldObj.setBlock(x - 1, y + 1, z, BlockRegistry.shield.blockID);
player.worldObj.setBlock(x, y + 1, z + 1, BlockRegistry.shield.blockID);
player.worldObj.setBlock(x, y + 1, z - 1, BlockRegistry.shield.blockID);
}
// Player Level
if (player.worldObj.isAirBlock(x + 1, y, z) && player.worldObj.isAirBlock(x - 1, y, z) && player.worldObj.isAirBlock(x, y, z + 1) && player.worldObj.isAirBlock(x, y, z - 1)) {
player.worldObj.setBlock(x + 1, y, z, BlockRegistry.shield);
player.worldObj.setBlock(x - 1, y, z, BlockRegistry.shield);
player.worldObj.setBlock(x, y, z + 1, BlockRegistry.shield);
player.worldObj.setBlock(x, y, z - 1, BlockRegistry.shield);
}
// Above the player
if (player.worldObj.isAirBlock(x + 1, y + 1, z) && player.worldObj.isAirBlock(x - 1, y + 1, z) && player.worldObj.isAirBlock(x, y + 1, z + 1) && player.worldObj.isAirBlock(x, y + 1, z - 1)) {
player.worldObj.setBlock(x + 1, y + 1, z, BlockRegistry.shield);
player.worldObj.setBlock(x - 1, y + 1, z, BlockRegistry.shield);
player.worldObj.setBlock(x, y + 1, z + 1, BlockRegistry.shield);
player.worldObj.setBlock(x, y + 1, z - 1, BlockRegistry.shield);
}
}
}
@Override
@@ -104,24 +96,22 @@ public class ItemShieldFocus extends ItemBaseFocus
int z = MathHelper.floor_double(player.posZ);
// Player Level
if ((player.worldObj.getBlockId(x + 1, y, z) == BlockRegistry.shield.blockID) && (player.worldObj.getBlockId(x - 1, y, z) == BlockRegistry.shield.blockID) && (player.worldObj.getBlockId(x, y, z + 1) == BlockRegistry.shield.blockID) && (player.worldObj.getBlockId(x, y, z - 1) == BlockRegistry.shield.blockID))
{
player.worldObj.setBlock(x + 1, y, z, 0);
player.worldObj.setBlock(x - 1, y, z, 0);
player.worldObj.setBlock(x, y, z + 1, 0);
player.worldObj.setBlock(x, y, z - 1, 0);
if ((player.worldObj.getBlock(x + 1, y, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y, z + 1) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y, z - 1) == BlockRegistry.shield)) {
player.worldObj.setBlockToAir(x + 1, y, z);
player.worldObj.setBlockToAir(x - 1, y, z);
player.worldObj.setBlockToAir(x, y, z + 1);
player.worldObj.setBlockToAir(x, y, z - 1);
}
// Above the player
if ((player.worldObj.getBlockId(x + 1, y + 1, z) == BlockRegistry.shield.blockID) && (player.worldObj.getBlockId(x - 1, y + 1, z) == BlockRegistry.shield.blockID) && (player.worldObj.getBlockId(x, y + 1, z + 1) == BlockRegistry.shield.blockID) && (player.worldObj.getBlockId(x, y + 1, z - 1) == BlockRegistry.shield.blockID))
{
player.worldObj.setBlock(x + 1, y + 1, z, 0);
player.worldObj.setBlock(x - 1, y + 1, z, 0);
player.worldObj.setBlock(x, y + 1, z + 1, 0);
player.worldObj.setBlock(x, y + 1, z - 1, 0);
if ((player.worldObj.getBlock(x + 1, y + 1, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y + 1, z) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z + 1) == BlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z - 1) == BlockRegistry.shield)) {
player.worldObj.setBlockToAir(x + 1, y + 1, z);
player.worldObj.setBlockToAir(x - 1, y + 1, z);
player.worldObj.setBlockToAir(x, y + 1, z + 1);
player.worldObj.setBlockToAir(x, y + 1, z - 1);
}
ItemStack milk = (new ItemStack(Item.bucketMilk));
ItemStack milk = (new ItemStack(Items.milk_bucket));
player.curePotionEffects(milk);
}
}
@@ -0,0 +1,67 @@
package electricMagicTools.tombenpotter.electricmagictools.common.items.foci;
import ic2.api.item.ElectricItem;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.items.wands.ItemWandCasting;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class ItemWandChargingFocus extends ItemBaseFocus {
AspectList visCost = new AspectList();
public ItemWandChargingFocus() {
super();
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:wandchargefocus");
}
@Override
public int getFocusColor() {
return 0xFFFF450;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "CHARGING";
}
@Override
public boolean isVisCostPerTick() {
return true;
}
@Override
public AspectList getVisCost() {
return visCost;
}
@Override
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int integer) {
if (!player.worldObj.isRemote) {
ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem();
ItemStack armor = player.inventory.armorInventory[1];
if (armor != null) {
if ((ElectricItem.manager.use(armor, Config.wandChargeFocusCost / 4, player) && (ElectricItem.manager.use(armor, Config.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, Config.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, Config.wandChargeFocusCost / 4, player)))) {
wandItem.addVis(itemstack, Aspect.ORDER, 1, true);
wandItem.addVis(itemstack, Aspect.FIRE, 1, true);
wandItem.addVis(itemstack, Aspect.ENTROPY, 1, true);
wandItem.addVis(itemstack, Aspect.WATER, 1, true);
wandItem.addVis(itemstack, Aspect.EARTH, 1, true);
wandItem.addVis(itemstack, Aspect.AIR, 1, true);
}
}
}
}
}
@@ -12,10 +12,15 @@
package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
import ic2.api.item.ElectricItem;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
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.ItemStack;
import net.minecraft.util.DamageSource;
@@ -24,16 +29,14 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemDiamondChainsaw extends ItemThaumiumChainsaw
{
public class ItemDiamondChainsaw extends ItemThaumiumChainsaw {
public int maxCharge = 40000;
private final int cost = 200;
private final int hitCost = 300;
public ItemDiamondChainsaw(int id)
{
super(id);
public ItemDiamondChainsaw() {
super();
this.efficiencyOnProperMaterial = 16F;
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(27);
@@ -42,7 +45,7 @@ public class ItemDiamondChainsaw extends ItemThaumiumChainsaw
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:diamondchainsaw");
}
@@ -57,38 +60,48 @@ public class ItemDiamondChainsaw extends ItemThaumiumChainsaw
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Item.axeDiamond.canHarvestBlock(block) || Item.swordDiamond.canHarvestBlock(block);
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Item.axeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.swordWood.getStrVsBlock(stack, block, meta) > 1.0F)
{
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
} else
{
return super.getStrVsBlock(stack, block, meta);
} else {
return super.getDigSpeed(stack, block, meta);
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
}
return false;
}
@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()));
}
}
}
@@ -16,26 +16,25 @@ import ic2.api.item.IElectricItem;
import java.util.List;
import javax.swing.Icon;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import thaumcraft.common.items.equipment.ItemElementalHoe;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectricItem
{
public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectricItem {
public Icon icon;
public int maxCharge = 1000000;
public int growthCost = 1000;
public int tillCost = 100;
public ItemElectricHoeGrowth(int id)
{
super(id, EnumToolMaterial.EMERALD);
public ItemElectricHoeGrowth() {
super(ToolMaterial.EMERALD);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxStackSize(1);
}
@@ -46,18 +45,16 @@ public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectric
**/
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
@@ -65,16 +62,6 @@ public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectric
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return this.itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return this.itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -94,4 +81,14 @@ public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectric
public boolean isRepairable() {
return false;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -12,10 +12,15 @@
package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
import ic2.api.item.ElectricItem;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
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.ItemStack;
import net.minecraft.util.DamageSource;
@@ -25,31 +30,27 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemOmnitoolDiamond extends ItemOmnitoolIron
{
public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
public int maxCharge = 70000;
private int cost;
private final int hitCost = 250;
public ItemOmnitoolDiamond(int id)
{
super(id);
public ItemOmnitoolDiamond() {
super();
this.efficiencyOnProperMaterial = 16F;
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxStackSize(1);
if (Config.toolsInBore == false)
{
if (Config.toolsInBore == false) {
this.setMaxDamage(27);
} else
{
} else {
this.setMaxDamage(350);
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:diamondomnitool");
}
@@ -64,46 +65,53 @@ public class ItemOmnitoolDiamond extends ItemOmnitoolIron
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
if (Config.toolsInBore == false)
{
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
if (Config.toolsInBore == false) {
cost = 200;
} else
{
} else {
cost = 1;
}
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Item.axeDiamond.canHarvestBlock(block) || Item.swordDiamond.canHarvestBlock(block) || Item.pickaxeDiamond.canHarvestBlock(block) || Item.shovelDiamond.canHarvestBlock(block) || Item.shears.canHarvestBlock(block);
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Item.axeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.swordWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.pickaxeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.shovelWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.shears.getStrVsBlock(stack, block, meta) > 1.0F)
{
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
} else
{
return super.getStrVsBlock(stack, block, meta);
} else {
return super.getDigSpeed(stack, block, meta);
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
}
return false;
}
@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()));
}
}
}
@@ -17,11 +17,11 @@ import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemPickaxe;
@@ -34,31 +34,27 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem
{
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
public int maxCharge = 20000;
private int cost;
private final int hitCost = 125;
public ItemOmnitoolIron(int id)
{
super(id, EnumToolMaterial.EMERALD);
public ItemOmnitoolIron() {
super(ToolMaterial.EMERALD);
this.efficiencyOnProperMaterial = 13F;
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxStackSize(1);
if (Config.toolsInBore == false)
{
if (Config.toolsInBore == false) {
this.setMaxDamage(27);
} else
{
} else {
this.setMaxDamage(200);
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:ironomnitool");
}
@@ -67,16 +63,6 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return this.itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return this.itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -94,51 +80,46 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
if (Config.toolsInBore == false)
{
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving)
{
if (Config.toolsInBore == false) {
cost = 100;
} else
{
} else {
cost = 1;
}
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Item.axeIron.canHarvestBlock(block) || Item.swordIron.canHarvestBlock(block) || Item.pickaxeIron.canHarvestBlock(block) || Item.shovelIron.canHarvestBlock(block) || Item.shears.canHarvestBlock(block);
return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Item.axeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.swordWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.pickaxeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.shovelWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.shears.getStrVsBlock(stack, block, meta) > 1.0F)
{
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
} else
{
return super.getStrVsBlock(stack, block, meta);
} else {
return super.getDigSpeed(stack, block, meta);
}
}
@@ -149,30 +130,25 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
} else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F);
}
return false;
@@ -180,36 +156,40 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem
@Override
public boolean onItemUse(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++)
{
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch"))
{
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) {
continue;
}
Item item = torchStack.getItem();
if (!(item instanceof ItemBlock))
{
if (!(item instanceof ItemBlock)) {
continue;
}
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;
}
if (result)
{
if (result) {
return true;
}
}
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -12,10 +12,15 @@
package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
import ic2.api.item.ElectricItem;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
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.ItemStack;
import net.minecraft.util.DamageSource;
@@ -25,31 +30,27 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond
{
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
public int maxCharge = 140000;
private int cost;
private final int hitCost = 650;
public ItemOmnitoolThaumium(int id)
{
super(id);
public ItemOmnitoolThaumium() {
super();
this.efficiencyOnProperMaterial = 21F;
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxStackSize(1);
if (Config.toolsInBore == false)
{
if (Config.toolsInBore == false) {
this.setMaxDamage(27);
} else
{
} else {
this.setMaxDamage(467);
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:thaumiumomnitool");
}
@@ -64,46 +65,53 @@ public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
if (Config.toolsInBore == false)
{
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
if (Config.toolsInBore == false) {
cost = 300;
} else
{
} else {
cost = 1;
}
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Item.axeDiamond.canHarvestBlock(block) || Item.swordDiamond.canHarvestBlock(block) || Item.pickaxeDiamond.canHarvestBlock(block) || Item.shovelDiamond.canHarvestBlock(block) || Item.shears.canHarvestBlock(block);
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Item.axeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.swordWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.pickaxeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.shovelWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.shears.getStrVsBlock(stack, block, meta) > 1.0F)
{
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
} else
{
return super.getStrVsBlock(stack, block, meta);
} else {
return super.getDigSpeed(stack, block, meta);
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
}
return false;
}
@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()));
}
}
}
@@ -20,25 +20,26 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.Icon;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.event.ForgeEventFactory;
@@ -50,24 +51,20 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
{
public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem {
private static final Block[] isEffective = { Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone, Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block, Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass, Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, Blocks.diamond_ore, Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay, Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay, Blocks.stained_hardened_clay, Blocks.mossy_cobblestone };
public Icon icon;
int side;
public ItemRockbreakerDrill(int id)
{
super(id, EnumToolMaterial.EMERALD);
public ItemRockbreakerDrill() {
super(ToolMaterial.EMERALD);
side = 0;
setCreativeTab(CreativeTab.tabTombenpotter);
this.efficiencyOnProperMaterial = 25F;
this.setMaxStackSize(1);
if (Config.toolsInBore == false)
{
if (Config.toolsInBore == false) {
this.setMaxDamage(27);
} else
{
} else {
this.setMaxDamage(2571);
}
}
@@ -79,45 +76,29 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:rockbreakerdrill");
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@SuppressWarnings("unused")
private boolean isEffectiveAgainst(Block block) {
label0:
{
int var3 = 0;
do
{
ItemRockbreakerDrill _tmp = this;
if (var3 >= ItemPickaxe.blocksEffectiveAgainst.length && var3 >= ItemSpade.blocksEffectiveAgainst.length)
{
break label0;
}
ItemRockbreakerDrill _tmp1 = this;
if (ItemPickaxe.blocksEffectiveAgainst[var3] == block)
{
return true;
}
var3++;
} while (true);
for (int var3 = 0; var3 < isEffective.length; var3++) {
if (isEffective[var3] == block) {
return true;
}
}
return false;
}
@@ -125,8 +106,7 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
@Override
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
MovingObjectPosition movingobjectposition = Utils.getTargetBlock(((Entity) (player)).worldObj, player, true);
if (movingobjectposition != null && movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
side = movingobjectposition.sideHit;
}
return super.onBlockStartBreak(itemstack, X, Y, Z, player);
@@ -134,70 +114,52 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
@SuppressWarnings("rawtypes")
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, int bi, int x, int y, int z, EntityLivingBase ent) {
if (Config.toolsInBore == false)
{
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) {
if (Config.toolsInBore == false) {
cost = 350;
} else
{
} else {
cost = 1;
}
if (ent.isSneaking())
{
return super.onBlockDestroyed(stack, world, bi, x, y, z, ent);
if (entityLiving.isSneaking()) {
return super.onBlockDestroyed(stack, world, block, x, y, z, entityLiving);
}
int md = world.getBlockMetadata(x, y, z);
if (ForgeHooks.isToolEffective(stack, Block.blocksList[bi], md) || isEffectiveAgainst(Block.blocksList[bi]))
{
for (int aa = -1; aa <= 1; aa++)
{
for (int bb = -1; bb <= 1; bb++)
{
if (ForgeHooks.isToolEffective(stack, block, md) || isEffectiveAgainst(block)) {
for (int aa = -1; aa <= 1; aa++) {
for (int bb = -1; bb <= 1; bb++) {
int xx = 0;
int yy = 0;
int zz = 0;
if (side <= 1)
{
if (side <= 1) {
xx = aa;
zz = bb;
} else if (side <= 3)
{
} else if (side <= 3) {
xx = aa;
yy = bb;
} else
{
} else {
zz = aa;
yy = bb;
}
int bl = world.getBlockId(x + xx, y + yy, z + zz);
Block bl = world.getBlock(x + xx, y + yy, z + zz);
md = world.getBlockMetadata(x + xx, y + yy, z + zz);
if (!ForgeHooks.isToolEffective(stack, Block.blocksList[bl], md) && !isEffectiveAgainst(Block.blocksList[bl]))
{
if (!ForgeHooks.isToolEffective(stack, bl, md) && !isEffectiveAgainst(bl)) {
continue;
}
if (ElectricItem.manager.canUse(stack, cost))
{
ElectricItem.manager.use(stack, cost, ent);
if (ElectricItem.manager.canUse(stack, cost)) {
ElectricItem.manager.use(stack, cost, entityLiving);
}
if (((Entity) (ent)).worldObj.isRemote)
{
world.playAuxSFX(2001, x + xx, y + yy, z + zz, bl + (md << 12));
}
int fortune = EnchantmentHelper.getFortuneModifier(ent);
world.setBlock(x + xx, y + yy, z + zz, 0, 0, 3);
ArrayList ret = Block.blocksList[bl].getBlockDropped(world, x + xx, y + yy, z + zz, md, fortune);
int fortune = EnchantmentHelper.getFortuneModifier(entityLiving);
world.setBlockToAir(x + xx, y + yy, z + zz);
ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
boolean creative = false;
if ((ent instanceof EntityPlayer) && ((EntityPlayer) ent).capabilities.isCreativeMode)
{
if ((entityLiving instanceof EntityPlayer) && ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
creative = true;
}
if (ret.size() <= 0 || creative || ((Entity) (ent)).worldObj.isRemote)
{
if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) {
continue;
}
ItemStack is;
for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, ent, 3)))
{
for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, entityLiving, 3))) {
is = (ItemStack) i$.next();
}
}
@@ -209,42 +171,33 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
@SuppressWarnings("unused")
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
if (!player.isSneaking())
{
for (int i = 0; i < player.inventory.mainInventory.length; i++)
{
if (!player.isSneaking()) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch"))
{
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) {
continue;
}
Item item = torchStack.getItem();
if (!(item instanceof ItemBlock))
{
if (!(item instanceof ItemBlock)) {
continue;
}
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;
}
if (result)
{
if (result) {
return true;
}
}
} else
{
} else {
ElectricItem.manager.use(stack, searchCost, player);
if (!world.isRemote)
{
if (!world.isRemote) {
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
}
@@ -259,8 +212,7 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
}
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled()))
{
if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) {
entity.setFire(2);
}
return super.onLeftClickEntity(stack, player, entity);
@@ -268,8 +220,7 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
}
return false;
@@ -280,16 +231,6 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -307,22 +248,19 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Item.pickaxeDiamond.canHarvestBlock(block) || Item.shovelDiamond.canHarvestBlock(block);
return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Item.pickaxeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.shovelWood.getStrVsBlock(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.getStrVsBlock(stack, block, meta);
} else {
return super.getDigSpeed(stack, block, meta);
}
}
@@ -333,23 +271,29 @@ public class ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
return 4;
} else {
return 6;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -16,31 +16,32 @@ package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumAction;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import thaumcraft.common.lib.PacketHandler;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.lib.Utils;
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemStreamChainsaw extends ItemAxe implements IElectricItem
{
public class ItemStreamChainsaw extends ItemAxe implements IElectricItem {
boolean alternateServer;
boolean alternateClient;
@@ -50,9 +51,8 @@ public class ItemStreamChainsaw extends ItemAxe implements IElectricItem
private final int cost = 400;
private final int hitCost = 500;
public ItemStreamChainsaw(int id)
{
super(id, EnumToolMaterial.EMERALD);
public ItemStreamChainsaw() {
super(ToolMaterial.EMERALD);
this.efficiencyOnProperMaterial = 25F;
alternateServer = false;
alternateClient = false;
@@ -66,48 +66,37 @@ public class ItemStreamChainsaw extends ItemAxe implements IElectricItem
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) {
int brokenID = world.getBlockId(x, y, z);
if (!player.isSneaking() && brokenID > 0 && Utils.isWoodLog(world, x, y, z))
{
if (!world.isRemote)
{
Utils.breakFurthestBlock(world, x, y, z, brokenID, player);
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
ElectricItem.manager.use(itemstack, cost, player);
alternateServer = !alternateServer;
} else
{
Block bi = world.getBlock(x, y, z);
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
if (!world.isRemote) {
if (Utils.breakFurthestBlock(world, x, y, z, bi, player)) {
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
ElectricItem.manager.use(itemstack, cost, player);
this.alternateServer = (!this.alternateServer);
}
} else {
player.swingItem();
ElectricItem.manager.use(itemstack, cost, player);
alternateClient = !alternateClient;
this.alternateClient = (!this.alternateClient);
}
}
return super.onItemUse(itemstack, player, world, x, y, z, par7, par8, par9, par10);
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
return true;
}
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
World world = ((Entity) (player)).worldObj;
int brokenID = world.getBlockId(x, y, z);
if (!player.isSneaking() && brokenID > 0 && Utils.isWoodLog(world, x, y, z))
{
if (!world.isRemote)
{
Utils.breakFurthestBlock(world, x, y, z, brokenID, player);
PacketHandler.sendBlockBoilFXPacket(x, y, z, 0.33F, 0.33F, 1.0F, player);
World world = player.worldObj;
Block bi = world.getBlock(x, y, z);
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
if (!world.isRemote) {
Utils.breakFurthestBlock(world, x, y, z, bi, player);
Thaumcraft.packetPipeline.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
}
ElectricItem.manager.use(itemstack, cost, player);
return true;
} else
{
return super.onBlockStartBreak(itemstack, x, y, z, player);
}
return super.onBlockStartBreak(itemstack, x, y, z, player);
}
@Override
@@ -115,16 +104,6 @@ public class ItemStreamChainsaw extends ItemAxe implements IElectricItem
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -142,44 +121,39 @@ public class ItemStreamChainsaw extends ItemAxe implements IElectricItem
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:streamchainsaw");
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Item.axeDiamond.canHarvestBlock(block) || Item.swordDiamond.canHarvestBlock(block);
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Item.axeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.swordWood.getStrVsBlock(stack, block, meta) > 1.0F)
{
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
} else
{
return super.getStrVsBlock(stack, block, meta);
} else {
return super.getDigSpeed(stack, block, meta);
}
}
@@ -190,32 +164,37 @@ public class ItemStreamChainsaw extends ItemAxe implements IElectricItem
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
} else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
}
return false;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -17,11 +17,11 @@ import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemBlock;
@@ -34,16 +34,14 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemThaumiumChainsaw extends ItemAxe implements IElectricItem
{
public class ItemThaumiumChainsaw extends ItemAxe implements IElectricItem {
public int maxCharge = 60000;
private final int cost = 250;
private final int hitCost = 350;
public ItemThaumiumChainsaw(int id)
{
super(id, EnumToolMaterial.EMERALD);
public ItemThaumiumChainsaw() {
super(ToolMaterial.EMERALD);
this.efficiencyOnProperMaterial = 21F;
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(27);
@@ -52,7 +50,7 @@ public class ItemThaumiumChainsaw extends ItemAxe implements IElectricItem
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:thaumiumchainsaw");
}
@@ -61,16 +59,6 @@ public class ItemThaumiumChainsaw extends ItemAxe implements IElectricItem
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return this.itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return this.itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -88,44 +76,39 @@ public class ItemThaumiumChainsaw extends ItemAxe implements IElectricItem
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Item.axeDiamond.canHarvestBlock(block) || Item.swordDiamond.canHarvestBlock(block);
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Item.axeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.swordWood.getStrVsBlock(stack, block, meta) > 1.0F)
{
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
} else
{
return super.getStrVsBlock(stack, block, meta);
} else {
return super.getDigSpeed(stack, block, meta);
}
}
@@ -136,30 +119,25 @@ public class ItemThaumiumChainsaw extends ItemAxe implements IElectricItem
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
} else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
}
return false;
@@ -167,36 +145,40 @@ public class ItemThaumiumChainsaw extends ItemAxe implements IElectricItem
@Override
public boolean onItemUse(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++)
{
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch"))
{
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) {
continue;
}
Item item = torchStack.getItem();
if (!(item instanceof ItemBlock))
{
if (!(item instanceof ItemBlock)) {
continue;
}
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;
}
if (result)
{
if (result) {
return true;
}
}
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -17,11 +17,11 @@ import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemPickaxe;
@@ -33,20 +33,16 @@ import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem
{
public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
public ItemThaumiumDrill(int id)
{
super(id, EnumToolMaterial.EMERALD);
public ItemThaumiumDrill() {
super(ToolMaterial.EMERALD);
this.efficiencyOnProperMaterial = 20F;
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxStackSize(1);
if (Config.toolsInBore == false)
{
if (Config.toolsInBore == false) {
this.setMaxDamage(27);
} else
{
} else {
this.setMaxDamage(240);
}
}
@@ -56,7 +52,7 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:thaumiumdrill");
}
@@ -65,16 +61,6 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return this.itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return this.itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -92,51 +78,44 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
if (Config.toolsInBore == false)
{
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
if (Config.toolsInBore == false) {
cost = 250;
} else
{
} else {
cost = 1;
}
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Item.pickaxeDiamond.canHarvestBlock(block) || Item.shovelDiamond.canHarvestBlock(block);
return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack);
}
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost))
{
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Item.pickaxeWood.getStrVsBlock(stack, block, meta) > 1.0F || Item.shovelWood.getStrVsBlock(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.getStrVsBlock(stack, block, meta);
} else {
return super.getDigSpeed(stack, block, meta);
}
}
@@ -147,22 +126,18 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
} else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@@ -174,36 +149,40 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem
@Override
public boolean onItemUse(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++)
{
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch"))
{
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) {
continue;
}
Item item = torchStack.getItem();
if (!(item instanceof ItemBlock))
{
if (!(item instanceof ItemBlock)) {
continue;
}
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;
}
if (result)
{
if (result) {
return true;
}
}
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -16,12 +16,12 @@ import ic2.api.item.IElectricItem;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.Potion;
@@ -34,16 +34,14 @@ import electricMagicTools.tombenpotter.electricmagictools.common.Config;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
import electricMagicTools.tombenpotter.electricmagictools.common.entities.EntityArcher;
public class ItemElectricThorHammer extends ItemSword implements IElectricItem
{
public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
public int maxCharge = 1000000;
private final int hitCost = 5000;
private final int lightningCost = 75000;
public ItemElectricThorHammer(int id)
{
super(id, EnumToolMaterial.EMERALD);
public ItemElectricThorHammer() {
super(ToolMaterial.EMERALD);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxDamage(27);
this.setMaxStackSize(1);
@@ -55,16 +53,6 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem
return false;
}
@Override
public int getChargedItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getEmptyItemId(ItemStack itemStack) {
return itemID;
}
@Override
public int getMaxCharge(ItemStack itemStack) {
return maxCharge;
@@ -82,24 +70,22 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:hammer/electricthorhammer");
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItemId(itemStack) == this.itemID)
{
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItemId(itemStack) == this.itemID)
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
@@ -109,30 +95,25 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem
@Override
public int getItemEnchantability() {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return 0;
} else
{
} else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (Config.enchanting == false)
{
if (Config.enchanting == false) {
return false;
} else
{
} else {
return true;
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
{
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 19F);
}
return false;
@@ -141,16 +122,14 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
list.add(player.username + "'s Hammer");
list.add(player.getCommandSenderName() + "'s Hammer");
}
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
if (player.capabilities.isCreativeMode)
{
if (player.capabilities.isCreativeMode) {
return itemstack;
} else if (ElectricItem.manager.canUse(itemstack, lightningCost))
{
} else if (ElectricItem.manager.canUse(itemstack, lightningCost)) {
player.swingItem();
// Corners
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 8));
@@ -206,11 +185,20 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem
world.spawnEntityInWorld(archer3);
ElectricItem.manager.use(itemstack, lightningCost, player);
return itemstack;
} else
{
} else {
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ));
player.addPotionEffect(new PotionEffect(Potion.harm.getId(), 1, 1));
return itemstack;
}
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -13,7 +13,7 @@ package electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ha
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -23,19 +23,17 @@ import thaumcraft.common.entities.projectile.EntityAlumentum;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemTaintedThorHammer extends ItemThorHammer
{
public class ItemTaintedThorHammer extends ItemThorHammer {
public ItemTaintedThorHammer(int id)
{
super(id);
public ItemTaintedThorHammer() {
super();
this.setMaxDamage(1000);
// OreDictionary.registerOre("craftingToolForgeHammer", this);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:hammer/taintedthorhammer");
}
@@ -49,11 +47,9 @@ public class ItemTaintedThorHammer extends ItemThorHammer
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 4, player.posZ));
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 8, player.posZ));
if (player.capabilities.isCreativeMode)
{
if (player.capabilities.isCreativeMode) {
return itemstack;
} else
{
} else {
itemstack.damageItem(40, player);
return itemstack;
}
@@ -13,18 +13,17 @@ package electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ha
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import thaumcraft.api.IRepairable;
@@ -32,12 +31,10 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
public class ItemThorHammer extends ItemSword implements IRepairable
{
public class ItemThorHammer extends ItemSword implements IRepairable {
public ItemThorHammer(int id)
{
super(id, EnumToolMaterial.EMERALD);
public ItemThorHammer() {
super(ToolMaterial.EMERALD);
this.setCreativeTab(CreativeTab.tabTombenpotter);
this.setMaxStackSize(1);
this.setMaxDamage(2000);
@@ -46,7 +43,7 @@ public class ItemThorHammer extends ItemSword implements IRepairable
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconRegister) {
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("electricmagictools:hammer/thorhammer");
}
@@ -69,30 +66,25 @@ public class ItemThorHammer extends ItemSword implements IRepairable
float f9 = f3 * f5;
double d3 = 5000D;
Vec3 vec3d1 = vec3d.addVector(f7 * d3, f8 * d3, f9 * d3);
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3d, vec3d1, false, true);
if (movingobjectposition == null)
{
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(vec3d, vec3d1, true);
if (movingobjectposition == null) {
return itemstack;
}
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
} else if (movingobjectposition.typeOfHit == EnumMovingObjectType.ENTITY)
{
} else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
Entity entityhit = movingobjectposition.entityHit;
double x = entityhit.posX;
double y = entityhit.posY;
double z = entityhit.posZ;
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
}
if (player.capabilities.isCreativeMode)
{
if (player.capabilities.isCreativeMode) {
return itemstack;
} else
{
} else {
itemstack.damageItem(20, player);
return itemstack;
}
@@ -14,8 +14,7 @@ package electricMagicTools.tombenpotter.electricmagictools.common.lib;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
public class CraftingAspects
{
public class CraftingAspects {
public static AspectList thaumiumDrillCrafting = new AspectList().add(Aspect.TOOL, 16).add(Aspect.MINE, 16).add(Aspect.ENERGY, 16);
public static AspectList thaumiumChainsawCrafting = new AspectList().add(Aspect.TOOL, 16).add(Aspect.WEAPON, 16).add(Aspect.ENERGY, 16);
@@ -31,14 +30,13 @@ public class CraftingAspects
public static AspectList ignisGeneratorCrafting = new AspectList().add(Aspect.FIRE, 16).add(Aspect.EXCHANGE, 8);
public static AspectList auramGeneratorCrafting = new AspectList().add(Aspect.AURA, 16).add(Aspect.EXCHANGE, 8);
public static AspectList arborGeneratorCrafting = new AspectList().add(Aspect.TREE, 16).add(Aspect.EXCHANGE, 8);
public static AspectList saxumGenerator = new AspectList().add(Aspect.STONE, 16).add(Aspect.EXCHANGE, 8);
public static AspectList streamChaisnawCrafting = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.TREE, 48).add(Aspect.TOOL, 32).add(Aspect.WATER, 32);
public static AspectList rockbreakerDrillCrafting = new AspectList().add(Aspect.TOOL, 32).add(Aspect.STONE, 48).add(Aspect.ENERGY, 48).add(Aspect.MINE, 32);
public static AspectList rockbreakerDrillCrafting = new AspectList().add(Aspect.TOOL, 32).add(Aspect.ENERGY, 48).add(Aspect.MINE, 32);
public static AspectList shieldBlockCrafting = new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1);
public static AspectList tinyUraniumCrafting = new AspectList().add(Aspect.FIRE, 1).add(Aspect.WATER, 1).add(Aspect.AIR, 1).add(Aspect.EARTH, 1).add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1);
public static AspectList thorHammerCrafting = new AspectList().add(Aspect.WEAPON, 48).add(Aspect.WEATHER, 48).add(Aspect.ELDRITCH, 32);
public static AspectList superchargedThorHammerCrafting = new AspectList().add(Aspect.WEAPON, 48).add(Aspect.ENERGY, 64).add(Aspect.BEAST, 32);
public static AspectList wandCharger = new AspectList().add(Aspect.ENERGY, 322).add(Aspect.CRAFT, 48).add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64);
public static AspectList wandCharger = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.CRAFT, 48).add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64);
public static AspectList compressedSolars = new AspectList().add(Aspect.FIRE, 8).add(Aspect.WATER, 8).add(Aspect.AIR, 8).add(Aspect.EARTH, 8).add(Aspect.ORDER, 8).add(Aspect.ENTROPY, 8);
public static AspectList solarHelmetRevealing = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.AIR, 32).add(Aspect.LIGHT, 25);
public static AspectList electricBootsTravel = new AspectList().add(Aspect.ENERGY, 16).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 32);
@@ -59,5 +57,8 @@ public class CraftingAspects
public static AspectList portableNode = new AspectList().add(Aspect.MAGIC, 32).add(Aspect.AURA, 32).add(Aspect.GREED, 32);
public static AspectList electricHoeGrowth = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.PLANT, 25).add(Aspect.CROP, 32).add(Aspect.MAGIC, 48);
public static AspectList chargeFocus = new AspectList().add(Aspect.EXCHANGE, 25).add(Aspect.ENERGY, 32).add(Aspect.MECHANISM, 32);
public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.AURA, 32).add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64);
public static AspectList inventoryChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.CRYSTAL, 32).add(Aspect.MAGIC, 48);
public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.ARMOR, 32).add(Aspect.MAGIC, 48);
}
@@ -14,8 +14,7 @@ package electricMagicTools.tombenpotter.electricmagictools.common.lib;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
public class ResearchAspects
{
public class ResearchAspects {
public static AspectList thaumiumDrillResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.TOOL, 6).add(Aspect.MINE, 4);
public static AspectList thaumiumChainsawResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.WEAPON, 6).add(Aspect.TOOL, 4);
@@ -24,17 +23,16 @@ public class ResearchAspects
public static AspectList thaumiumOmnitoolResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.TOOL, 6).add(Aspect.MINE, 4).add(Aspect.WEAPON, 6);
public static AspectList thaumicNanoHelmet = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.SENSES, 8).add(Aspect.ARMOR, 6);
public static AspectList laserFocusResearch = new AspectList().add(Aspect.FIRE, 3).add(Aspect.DEATH, 2).add(Aspect.WEAPON, 3);
public static AspectList christmasFocusResearch = new AspectList().add(Aspect.ICE, 2).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6);
public static AspectList christmasFocusResearch = new AspectList().add(Aspect.COLD, 2).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6);
public static AspectList shieldFocusResearch = new AspectList().add(Aspect.ARMOR, 5).add(Aspect.AIR, 2).add(Aspect.CRYSTAL, 3).add(Aspect.TRAP, 2);
public static AspectList electricGogglesResearch = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 5).add(Aspect.SENSES, 6);
public static AspectList potentiaGeneratorResearch = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.EXCHANGE, 4).add(Aspect.METAL, 3);
public static AspectList ignisGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.FIRE, 3);
public static AspectList auramGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AURA, 3);
public static AspectList arborGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.TREE, 3);
public static AspectList saxumGenerator = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.STONE, 3);
public static AspectList streamChainsawResearch = new AspectList().add(Aspect.TOOL, 3).add(Aspect.TREE, 3).add(Aspect.WATER, 6).add(Aspect.ENERGY, 4);
public static AspectList rockbreakerDrillResearch = new AspectList().add(Aspect.STONE, 2).add(Aspect.ENERGY, 3).add(Aspect.FIRE, 2).add(Aspect.MINE, 3);
public static AspectList shieldBlockResearch = new AspectList().add(Aspect.ARMOR, 3).add(Aspect.STONE, 2).add(Aspect.TRAP, 2);
public static AspectList rockbreakerDrillResearch = new AspectList().add(Aspect.ENERGY, 3).add(Aspect.FIRE, 2).add(Aspect.MINE, 3);
public static AspectList shieldBlockResearch = new AspectList().add(Aspect.ARMOR, 3).add(Aspect.TRAP, 2);
public static AspectList tinyUraniumResearch = new AspectList().add(Aspect.POISON, 4).add(Aspect.DEATH, 3).add(Aspect.EXCHANGE, 3);
public static AspectList thorHammerResearch = new AspectList().add(Aspect.WEAPON, 3).add(Aspect.WEATHER, 4).add(Aspect.ELDRITCH, 3);
public static AspectList superchargedThorHammerResearch = new AspectList().add(Aspect.WEAPON, 4).add(Aspect.ENERGY, 6).add(Aspect.BEAST, 4);
@@ -56,5 +54,8 @@ public class ResearchAspects
public static AspectList portableNode = new AspectList().add(Aspect.MAGIC, 5).add(Aspect.AURA, 5).add(Aspect.GREED, 5);
public static AspectList electricHoeGrowth = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.PLANT, 4).add(Aspect.CROP, 5).add(Aspect.MAGIC, 4);
public static AspectList chargeFocus = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 4);
public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.AURA, 4).add(Aspect.EXCHANGE, 4).add(Aspect.GREED, 5);
public static AspectList inventoryChargingRing = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.CRYSTAL, 4).add(Aspect.MAGIC, 4);
public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.ARMOR, 4).add(Aspect.MAGIC, 4);
}
@@ -11,11 +11,10 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.recipes;
import ic2.api.item.Items;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import ic2.api.item.IC2Items;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.common.config.ConfigItems;
@@ -23,35 +22,32 @@ import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.ItemRegistry;
public class EMTInitRecipes
{
public class EMTInitRecipes {
public static void add() {
/** Crafting Recipes **/
ironOmnitool = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ironOmnitool), "X", "Z", "Y", 'X', new ItemStack(Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', new ItemStack(Items.getItem("miningDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', Items.getItem("plateiron"));
ironOmnitool = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ironOmnitool), "X", "Z", "Y", 'X', new ItemStack(IC2Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', new ItemStack(IC2Items.getItem("miningDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', IC2Items.getItem("plateiron"));
diamondChainsaw = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.diamondChainsaw), " X ", "XYX", 'X', new ItemStack(Item.diamond), 'Y', new ItemStack(Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE));
diamondChainsaw = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.diamondChainsaw), " X ", "XYX", 'X', new ItemStack(Items.diamond), 'Y', new ItemStack(IC2Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE));
if (Loader.isModLoaded("gregtech_addon") == false)
{
GameRegistry.addShapedRecipe(Items.getItem("diamondDrill"), " Y ", "YXY", 'Y', new ItemStack(Item.diamond), 'X', new ItemStack(Items.getItem("miningDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE));
} else
{
if (Loader.isModLoaded("gregtech_addon") == false) {
GameRegistry.addShapedRecipe(IC2Items.getItem("diamondDrill"), " Y ", "YXY", 'Y', new ItemStack(Items.diamond), 'X', new ItemStack(IC2Items.getItem("miningDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE));
} else {
System.out.println("[EMT] Gregtech Addon detected. Disabling the fix for the Diamond Drill recipe.");
}
GameRegistry.addRecipe(Items.getItem("nanoHelmet"), "XYX", "XZX", 'X', Items.getItem("carbonPlate"), 'Y', new ItemStack(Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(Items.getItem("nightvisionGoggles").getItem(), 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addRecipe(IC2Items.getItem("nanoHelmet"), "XYX", "XZX", 'X', IC2Items.getItem("carbonPlate"), 'Y', new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(IC2Items.getItem("nightvisionGoggles").getItem(), 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addShapedRecipe(Items.getItem("generator"), "X", "Y", "Z", 'X', new ItemStack(Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', Items.getItem("machine"), 'Z', new ItemStack(Block.furnaceIdle));
GameRegistry.addShapedRecipe(IC2Items.getItem("generator"), "X", "Y", "Z", 'X', new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', IC2Items.getItem("machine"), 'Z', new ItemStack(Blocks.furnace));
GameRegistry.addShapedRecipe(Items.getItem("generator"), "X", "Y", "Z", 'X', Items.getItem("reBattery"), 'Y', Items.getItem("machine"), 'Z', new ItemStack(Block.furnaceIdle));
GameRegistry.addShapedRecipe(IC2Items.getItem("generator"), "X", "Y", "Z", 'X', IC2Items.getItem("reBattery"), 'Y', IC2Items.getItem("machine"), 'Z', new ItemStack(Blocks.furnace));
/** Smelting Recipes **/
FurnaceRecipes.smelting().addSmelting(ItemRegistry.itemEMTItems.itemID, 1, new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
FurnaceRecipes.smelting().addSmelting(ItemRegistry.itemEMTItems.itemID, 2, new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
FurnaceRecipes.smelting().addSmelting(ItemRegistry.itemEMTItems.itemID, 3, new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
FurnaceRecipes.smelting().addSmelting(ItemRegistry.itemEMTItems.itemID, 4, new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 3), new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
GameRegistry.addSmelting(new ItemStack(ItemRegistry.itemEMTItems, 1, 4), new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
}
@@ -11,13 +11,13 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.recipes;
import ic2.api.item.Items;
import ic2.api.item.IC2Items;
import ic2.api.recipe.RecipeInputItemStack;
import ic2.api.recipe.Recipes;
import ic2.core.Ic2Items;
import ic2.core.util.StackUtil;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagCompound;
@@ -34,76 +34,81 @@ import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.ItemRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.lib.CraftingAspects;
public class EMTPostInitRecipes
{
public class EMTPostInitRecipes {
public static void add() {
/** Infusion Recipes **/
thaumiumDrill = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Drill", new ItemStack(ItemRegistry.thaumiumDrill), 5, CraftingAspects.thaumiumDrillCrafting, new ItemStack(Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Item.diamond), new ItemStack(Item.diamond), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), Items.getItem("denseplateiron") });
thaumiumDrill = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Drill", new ItemStack(ItemRegistry.thaumiumDrill), 5, CraftingAspects.thaumiumDrillCrafting, new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), IC2Items.getItem("denseplateiron") });
thaumiumChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Chainsaw", new ItemStack(ItemRegistry.thaumiumChainsaw), 5, CraftingAspects.thaumiumChainsawCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Item.diamond), new ItemStack(Item.diamond), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), Items.getItem("denseplateiron") });
thaumiumChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Chainsaw", new ItemStack(ItemRegistry.thaumiumChainsaw), 5, CraftingAspects.thaumiumChainsawCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), IC2Items.getItem("denseplateiron") });
thaumicQuantumHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Goggles of Revealing", new ItemStack(ItemRegistry.quantumThaumicHelmet), 6, CraftingAspects.thaumicQuantumHelmetCrafting, new ItemStack(ItemRegistry.nanoThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Item.diamond), new ItemStack(Item.bucketMilk), new ItemStack(Items.getItem("quantumHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), Items.getItem("iridiumPlate"), Items.getItem("advancedCircuit") });
thaumicQuantumHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Goggles of Revealing", new ItemStack(ItemRegistry.quantumThaumicHelmet), 6, CraftingAspects.thaumicQuantumHelmetCrafting, new ItemStack(ItemRegistry.nanoThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.milk_bucket), new ItemStack(IC2Items.getItem("quantumHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("advancedCircuit") });
thaumicNanoHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Goggles of Revealing", new ItemStack(ItemRegistry.nanoThaumicHelmet), 5, CraftingAspects.thaumicNanoHelmetCrafting, new ItemStack(ItemRegistry.electricGoggles, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Item.diamond), new ItemStack(Item.ingotGold), new ItemStack(Items.getItem("nanoHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), Items.getItem("carbonPlate"), Items.getItem("electronicCircuit") });
thaumicNanoHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Goggles of Revealing", new ItemStack(ItemRegistry.nanoThaumicHelmet), 5, CraftingAspects.thaumicNanoHelmetCrafting, new ItemStack(ItemRegistry.electricGoggles, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.gold_ingot), new ItemStack(IC2Items.getItem("nanoHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), IC2Items.getItem("carbonPlate"), IC2Items.getItem("electronicCircuit") });
thaumiumOmnitool = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(ItemRegistry.thaumiumOmnitool), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), Items.getItem("carbonPlate"), Items.getItem("plateobsidian") });
thaumiumOmnitool = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(ItemRegistry.thaumiumOmnitool), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), IC2Items.getItem("carbonPlate"), IC2Items.getItem("plateobsidian") });
diamondOmnitoolToThaumium = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(ItemRegistry.thaumiumOmnitool), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.diamondOmnitool, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Block.blockDiamond), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), Items.getItem("carbonPlate"), Items.getItem("advancedCircuit") });
diamondOmnitoolToThaumium = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(ItemRegistry.thaumiumOmnitool), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.diamondOmnitool, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Blocks.diamond_block), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("carbonPlate"), IC2Items.getItem("advancedCircuit") });
explosionFocus = ThaumcraftApi.addInfusionCraftingRecipe("Explosion Focus", new ItemStack(ItemRegistry.explosionFocus), 6, CraftingAspects.laserFocusCrafting, new ItemStack(ConfigItems.itemFocusHellbat, 1), new ItemStack[] { new ItemStack(Items.getItem("miningLaser").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Item.arrow), new ItemStack(Item.gunpowder), new ItemStack(Item.fireworkCharge), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemWispEssence, 1) });
explosionFocus = ThaumcraftApi.addInfusionCraftingRecipe("Explosion Focus", new ItemStack(ItemRegistry.explosionFocus), 6, CraftingAspects.laserFocusCrafting, new ItemStack(ConfigItems.itemFocusHellbat, 1), new ItemStack[] { new ItemStack(IC2Items.getItem("miningLaser").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.arrow), new ItemStack(Items.gunpowder), new ItemStack(Items.firework_charge), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemWispEssence, 1) });
shieldFocus = ThaumcraftApi.addInfusionCraftingRecipe("Shield Focus", new ItemStack(ItemRegistry.shieldFocus), 4, CraftingAspects.shieldFocusCrafting, new ItemStack(ConfigItems.itemFocusPortableHole, 1), new ItemStack[] { Items.getItem("reinforcedStone"), Items.getItem("reinforcedGlass"), Items.getItem("reinforcedStone"), Items.getItem("reinforcedGlass"), new ItemStack(Block.slowSand), new ItemStack(Block.obsidian), new ItemStack(Block.obsidian) });
shieldFocus = ThaumcraftApi.addInfusionCraftingRecipe("Shield Focus", new ItemStack(ItemRegistry.shieldFocus), 4, CraftingAspects.shieldFocusCrafting, new ItemStack(ConfigItems.itemFocusPortableHole, 1), new ItemStack[] { IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.obsidian), new ItemStack(Blocks.obsidian) });
potentiaGenerator = ThaumcraftApi.addInfusionCraftingRecipe("Potentia Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 0), 6, CraftingAspects.potentiaGeneratorCrafting, Items.getItem("semifluidGenerator"), new ItemStack[] { new ItemStack(Item.diamond), new ItemStack(ConfigItems.itemFocusTrade), new ItemStack(Block.hopperBlock), new ItemStack(ConfigBlocks.blockJar), Items.getItem("mvTransformer"), Items.getItem("advancedMachine"), Items.getItem("orewashingplant"), Items.getItem("scrap") });
potentiaGenerator = ThaumcraftApi.addInfusionCraftingRecipe("Potentia Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 0), 6, CraftingAspects.potentiaGeneratorCrafting, IC2Items.getItem("semifluidGenerator"), new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(ConfigItems.itemFocusTrade), new ItemStack(Blocks.hopper), new ItemStack(ConfigBlocks.blockJar), IC2Items.getItem("mvTransformer"), IC2Items.getItem("advancedMachine"), IC2Items.getItem("orewashingplant"), IC2Items.getItem("scrap") });
streamChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Chainsaw of the Stream", new ItemStack(ItemRegistry.streamChainsaw), 6, CraftingAspects.streamChaisnawCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Item.bucketWater), new ItemStack(ConfigItems.itemAxeElemental), new ItemStack(ConfigBlocks.blockMagicalLog), new ItemStack(Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), Items.getItem("compressedPlantBall"), Items.getItem("iridiumPlate"), Items.getItem("overclockerUpgrade") });
streamChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Chainsaw of the Stream", new ItemStack(ItemRegistry.streamChainsaw), 6, CraftingAspects.streamChaisnawCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.water_bucket), new ItemStack(ConfigItems.itemAxeElemental), new ItemStack(ConfigBlocks.blockMagicalLog), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("compressedPlantBall"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade") });
rockbreakerDrill = ThaumcraftApi.addInfusionCraftingRecipe("Drill of the Rockbreaker", new ItemStack(ItemRegistry.rockbreakerDrill), 6, CraftingAspects.rockbreakerDrillCrafting, new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Item.flintAndSteel), new ItemStack(Item.fireballCharge), new ItemStack(ConfigItems.itemPickElemental), new ItemStack(ConfigItems.itemShovelElemental), new ItemStack(Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), Items.getItem("reinforcedStone"), Items.getItem("iridiumPlate"), Items.getItem("overclockerUpgrade") });
rockbreakerDrill = ThaumcraftApi.addInfusionCraftingRecipe("Drill of the Rockbreaker", new ItemStack(ItemRegistry.rockbreakerDrill), 6, CraftingAspects.rockbreakerDrillCrafting, new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.flint_and_steel), new ItemStack(Items.fire_charge), new ItemStack(ConfigItems.itemPickElemental), new ItemStack(ConfigItems.itemShovelElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade") });
thorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Mjolnir", new ItemStack(ItemRegistry.thorHammer), 7, CraftingAspects.thorHammerCrafting, new ItemStack(ItemRegistry.taintedThorHammer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(ItemRegistry.lightningSummoner), new ItemStack(ItemRegistry.lightningSummoner), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemFocusShock), Items.getItem("rubber") });
thorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Mjolnir", new ItemStack(ItemRegistry.thorHammer), 7, CraftingAspects.thorHammerCrafting, new ItemStack(ItemRegistry.taintedThorHammer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(ItemRegistry.lightningSummoner), new ItemStack(ItemRegistry.lightningSummoner), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemFocusShock), IC2Items.getItem("rubber") });
superchargedThorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Supercharged Mjolnir", new ItemStack(ItemRegistry.electricThorHammer), 10, CraftingAspects.superchargedThorHammerCrafting, new ItemStack(ItemRegistry.thorHammer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(ItemRegistry.lightningSummoner), new ItemStack(ItemRegistry.lightningSummoner), new ItemStack(Block.web), new ItemStack(ConfigItems.itemFocusHellbat), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), Items.getItem("iridiumPlate"), Items.getItem("iridiumPlate"), new ItemStack(Items.getItem("nanoSaber").getItem(), 1, OreDictionary.WILDCARD_VALUE) });
superchargedThorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Supercharged Mjolnir", new ItemStack(ItemRegistry.electricThorHammer), 10, CraftingAspects.superchargedThorHammerCrafting, new ItemStack(ItemRegistry.thorHammer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(ItemRegistry.lightningSummoner), new ItemStack(ItemRegistry.lightningSummoner), new ItemStack(Blocks.web), new ItemStack(ConfigItems.itemFocusHellbat), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("nanoSaber").getItem(), 1, OreDictionary.WILDCARD_VALUE) });
wandRecharger = ThaumcraftApi.addInfusionCraftingRecipe("Industrial Wand Charging Station", new ItemStack(BlockRegistry.emtMachines, 1, 0), 6, CraftingAspects.wandCharger, new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5), new ItemStack[] { Items.getItem("replicator"), Items.getItem("iridiumPlate"), new ItemStack(Block.blockDiamond), new ItemStack(ConfigItems.itemShard, 1, 5), new ItemStack(ConfigBlocks.blockJar) });
wandRecharger = ThaumcraftApi.addInfusionCraftingRecipe("Industrial Wand Charging Station", new ItemStack(BlockRegistry.emtMachines, 1, 0), 6, CraftingAspects.wandCharger, new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5), new ItemStack[] { IC2Items.getItem("replicator"), IC2Items.getItem("iridiumPlate"), new ItemStack(Blocks.diamond_block), new ItemStack(ConfigItems.itemShard, 1, 5), new ItemStack(ConfigBlocks.blockJar) });
solarHelmetRevealing = ThaumcraftApi.addInfusionCraftingRecipe("Solar Helmet of Revealing", new ItemStack(ItemRegistry.solarHelmetRevealing), 5, CraftingAspects.solarHelmetRevealing, new ItemStack(ItemRegistry.quantumThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(BlockRegistry.emtSolars, 1, 1), Items.getItem("glassFiberCableItem"), new ItemStack(Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, 4) });
solarHelmetRevealing = ThaumcraftApi.addInfusionCraftingRecipe("Solar Helmet of Revealing", new ItemStack(ItemRegistry.solarHelmetRevealing), 5, CraftingAspects.solarHelmetRevealing, new ItemStack(ItemRegistry.quantumThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(BlockRegistry.emtSolars, 1, 1), IC2Items.getItem("glassFiberCableItems"), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, 4) });
electricBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Electric Boots of the Traveller", new ItemStack(ItemRegistry.electricBootsTraveller), 2, CraftingAspects.electricBootsTravel, new ItemStack(ConfigItems.itemBootsTraveller), new ItemStack[] { new ItemStack(Item.diamond), Items.getItem("elemotor"), Items.getItem("coil"), Items.getItem("hazmatBoots"), new ItemStack(Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemWispEssence) });
electricBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Electric Boots of the Traveller", new ItemStack(ItemRegistry.electricBootsTraveller), 2, CraftingAspects.electricBootsTravel, new ItemStack(ConfigItems.itemBootsTraveller), new ItemStack[] { new ItemStack(Items.diamond), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), IC2Items.getItem("hazmatBoots"), new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemWispEssence) });
nanoBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Nano Boots of the Traveller", new ItemStack(ItemRegistry.nanoBootsTraveller), 2, CraftingAspects.nanoBootsTravel, new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Item.diamond), new ItemStack(Items.getItem("nanoBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemWispEssence), new ItemStack(ConfigItems.itemWispEssence) });
nanoBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Nano Boots of the Traveller", new ItemStack(ItemRegistry.nanoBootsTraveller), 2, CraftingAspects.nanoBootsTravel, new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(IC2Items.getItem("nanoBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemWispEssence), new ItemStack(ConfigItems.itemWispEssence) });
quantumBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Boots of the Traveller", new ItemStack(ItemRegistry.quantumBootsTraveller), 2, CraftingAspects.quantumBootsTravel, new ItemStack(ItemRegistry.nanoBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Block.blockDiamond), new ItemStack(Items.getItem("quantumBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), Items.getItem("iridiumPlate"), new ItemStack(ConfigItems.itemWispEssence), new ItemStack(ConfigItems.itemWispEssence), new ItemStack(ConfigItems.itemWispEssence) });
quantumBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Boots of the Traveller", new ItemStack(ItemRegistry.quantumBootsTraveller), 2, CraftingAspects.quantumBootsTravel, new ItemStack(ItemRegistry.nanoBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Blocks.diamond_block), new ItemStack(IC2Items.getItem("quantumBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), new ItemStack(ConfigItems.itemWispEssence), new ItemStack(ConfigItems.itemWispEssence), new ItemStack(ConfigItems.itemWispEssence) });
etheralProcessor = ThaumcraftApi.addInfusionCraftingRecipe("Etheral Processor", new ItemStack(BlockRegistry.emtMachines, 1, 1), 3, CraftingAspects.etherealProcessor, Items.getItem("macerator"), new ItemStack[] { Items.getItem("electroFurnace"), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(Block.whiteStone), new ItemStack(Block.whiteStone), new ItemStack(Block.blockIron), new ItemStack(Block.blockIron), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate) });
etheralProcessor = ThaumcraftApi.addInfusionCraftingRecipe("Etheral Processor", new ItemStack(BlockRegistry.emtMachines, 1, 1), 3, CraftingAspects.etherealProcessor, IC2Items.getItem("macerator"), new ItemStack[] { IC2Items.getItem("electroFurnace"), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.iron_block), new ItemStack(Blocks.iron_block), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate) });
tripleCompressedSolar = ThaumcraftApi.addInfusionCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 2), 2, CraftingAspects.compressedSolars, new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack[] { new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 1) });
electricHoeGrowth = ThaumcraftApi.addInfusionCraftingRecipe("Electric Hoe of Growth", new ItemStack(ItemRegistry.electricHoeGrowth), 4, CraftingAspects.electricHoeGrowth, new ItemStack(ConfigItems.itemHoeElemental), new ItemStack[] { new ItemStack(Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.getItem("electricHoe").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Item.dyePowder, 1, 15), Items.getItem("elemotor"), Items.getItem("coil"), new ItemStack(Block.sapling, 1, OreDictionary.WILDCARD_VALUE) });
electricHoeGrowth = ThaumcraftApi.addInfusionCraftingRecipe("Electric Hoe of Growth", new ItemStack(ItemRegistry.electricHoeGrowth), 4, CraftingAspects.electricHoeGrowth, new ItemStack(ConfigItems.itemHoeElemental), new ItemStack[] { new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("electricHoe").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.dye, 1, 15), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), new ItemStack(Blocks.sapling, 1, OreDictionary.WILDCARD_VALUE) });
chargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Charging", new ItemStack(ItemRegistry.chargeFocus), 4, CraftingAspects.chargeFocus, new ItemStack(Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { Items.getItem("generator"), Items.getItem("batBox"), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE) });
chargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Charging", new ItemStack(ItemRegistry.chargeFocus), 4, CraftingAspects.chargeFocus, new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { IC2Items.getItem("generator"), IC2Items.getItem("batBox"), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ItemRegistry.thaumiumPlate), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE) });
wandChargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Wand Charging", new ItemStack(ItemRegistry.wandChargeFocus), 5, CraftingAspects.wandChargeFocus, new ItemStack(BlockRegistry.emtMachines, 1, 0), new ItemStack[] { new ItemStack(ItemRegistry.chargeFocus), new ItemStack(IC2Items.getItem("energyPack").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate") });
inventoryChargingRing = ThaumcraftApi.addInfusionCraftingRecipe("Inventory Charging Ring", new ItemStack(ItemRegistry.emtBauble, 1, 1), 6, CraftingAspects.inventoryChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), new ItemStack[] { new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("waterMill"), IC2Items.getItem("solarPanel"), IC2Items.getItem("windMill"), IC2Items.getItem("nuclearReactor") });
armorChargingRing = ThaumcraftApi.addInfusionCraftingRecipe("Armor Charging Ring", new ItemStack(ItemRegistry.emtBauble, 1, 0), 6, CraftingAspects.armorChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), new ItemStack[] { new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("waterMill"), IC2Items.getItem("solarPanel"), IC2Items.getItem("windMill"), IC2Items.getItem("nuclearReactor") });
/** Arcane Worktable Recipes **/
diamondOmnitool = ThaumcraftApi.addShapelessArcaneCraftingRecipe("Diamond Omnitool", new ItemStack(ItemRegistry.diamondOmnitool), CraftingAspects.diamondOmnitoolCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE));
diamondOmnitool = ThaumcraftApi.addShapelessArcaneCraftingRecipe("Diamond Omnitool", new ItemStack(ItemRegistry.diamondOmnitool), CraftingAspects.diamondOmnitoolCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE));
ironOmnitoolToDiamond = ThaumcraftApi.addArcaneCraftingRecipe("Diamond Omnitool", new ItemStack(ItemRegistry.diamondOmnitool), CraftingAspects.diamondOmnitoolCrafting, "XAX", "XBX", "XAX", 'X', new ItemStack(Item.diamond), 'A', Items.getItem("advancedCircuit"), 'B', new ItemStack(ItemRegistry.ironOmnitool, 1, OreDictionary.WILDCARD_VALUE));
ironOmnitoolToDiamond = ThaumcraftApi.addArcaneCraftingRecipe("Diamond Omnitool", new ItemStack(ItemRegistry.diamondOmnitool), CraftingAspects.diamondOmnitoolCrafting, "XAX", "XBX", "XAX", 'X', new ItemStack(Items.diamond), 'A', IC2Items.getItem("advancedCircuit"), 'B', new ItemStack(ItemRegistry.ironOmnitool, 1, OreDictionary.WILDCARD_VALUE));
christmasFocus = ThaumcraftApi.addArcaneCraftingRecipe("Kris-tmas Focus", new ItemStack(ItemRegistry.christmasFocus), CraftingAspects.christmasFocusCrafting, "XYX", "YZY", "XYX", 'X', new ItemStack(Block.blockSnow), 'Y', new ItemStack(Block.pumpkin), 'Z', new ItemStack(ConfigItems.itemFocusFrost));
christmasFocus = ThaumcraftApi.addArcaneCraftingRecipe("Kris-tmas Focus", new ItemStack(ItemRegistry.christmasFocus), CraftingAspects.christmasFocusCrafting, "XYX", "YZY", "XYX", 'X', new ItemStack(Blocks.snow), 'Y', new ItemStack(Blocks.pumpkin), 'Z', new ItemStack(ConfigItems.itemFocusFrost));
electricGoggles = ThaumcraftApi.addArcaneCraftingRecipe("Electric Goggles", new ItemStack(ItemRegistry.electricGoggles), CraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', Items.getItem("electronicCircuit"), 'Y', new ItemStack(Item.helmetDiamond), 'A', new ItemStack(Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'B', Item.redstoneRepeater);
electricGoggles = ThaumcraftApi.addArcaneCraftingRecipe("Electric Goggles", new ItemStack(ItemRegistry.electricGoggles), CraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', IC2Items.getItem("electronicCircuit"), 'Y', new ItemStack(Items.diamond_helmet), 'A', new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'B', Items.repeater);
shieldBlock = ThaumcraftApi.addArcaneCraftingRecipe("Shield Block", new ItemStack(BlockRegistry.shield, 8), CraftingAspects.shieldBlockCrafting, "XYX", "X X", "XYX", 'X', new ItemStack(Block.glass), 'Y', new ItemStack(Block.obsidian));
shieldBlock = ThaumcraftApi.addArcaneCraftingRecipe("Shield Blocks", new ItemStack(BlockRegistry.shield, 8), CraftingAspects.shieldBlockCrafting, "XYX", "X X", "XYX", 'X', new ItemStack(Blocks.glass), 'Y', new ItemStack(Blocks.obsidian));
tinyUranium = ThaumcraftApi.addShapelessArcaneCraftingRecipe("Tiny Uranium", new ItemStack(Items.getItem("smallUran235").getItem(), 7), CraftingAspects.tinyUraniumCrafting, Items.getItem("Uran238"));
tinyUranium = ThaumcraftApi.addShapelessArcaneCraftingRecipe("Tiny Uranium", new ItemStack(IC2Items.getItem("smallUran235").getItem(), 7), CraftingAspects.tinyUraniumCrafting, IC2Items.getItem("Uran238"));
compressedSolar = ThaumcraftApi.addArcaneCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', Items.getItem("solarPanel"));
compressedSolar = ThaumcraftApi.addArcaneCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', IC2Items.getItem("solarPanel"));
doubleCompressedSolar = ThaumcraftApi.addArcaneCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', new ItemStack(BlockRegistry.emtSolars, 1, 0));
electricScribingTools = ThaumcraftApi.addArcaneCraftingRecipe("Electric Scribing Tools", new ItemStack(ItemRegistry.electricScribingTools), CraftingAspects.electricScribingTools, "YXY", "XZX", "YXY", 'Y', Items.getItem("electronicCircuit"), 'X', new ItemStack(ConfigItems.itemInkwell), 'Z', new ItemStack(Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE));
electricScribingTools = ThaumcraftApi.addArcaneCraftingRecipe("Electric Scribing Tools", new ItemStack(ItemRegistry.electricScribingTools), CraftingAspects.electricScribingTools, "YXY", "XZX", "YXY", 'Y', IC2Items.getItem("electronicCircuit"), 'X', new ItemStack(ConfigItems.itemInkwell), 'Z', new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE));
/** Crucible Recipes **/
@@ -113,8 +118,6 @@ public class EMTPostInitRecipes
arborGenerator = ThaumcraftApi.addCrucibleRecipe("Arbor Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 3), new ItemStack(BlockRegistry.essentiaGens, 1, 0), CraftingAspects.arborGeneratorCrafting);
saxumGenerator = ThaumcraftApi.addCrucibleRecipe("Saxum Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 4), new ItemStack(BlockRegistry.essentiaGens, 1, 0), CraftingAspects.saxumGenerator);
waterSolar = ThaumcraftApi.addCrucibleRecipe("Water Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 3), new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.waterSolars);
doubleWaterSolar = ThaumcraftApi.addCrucibleRecipe("Water Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 4), new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.waterSolars);
@@ -156,32 +159,32 @@ public class EMTPostInitRecipes
/** IC2 Stuff related recipes **/
/* Ore Clusters Macerator Recipes */
ItemStack ironClusterRecipe = Items.getItem("smallIronDust").copy();
ItemStack ironClusterRecipe = IC2Items.getItem("smallIronDust").copy();
ironClusterRecipe.stackSize = 22;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 16)), null, ironClusterRecipe);
ItemStack goldClusterRecipe = Items.getItem("smallGoldDust").copy();
ItemStack goldClusterRecipe = IC2Items.getItem("smallGoldDust").copy();
goldClusterRecipe.stackSize = 22;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 31)), null, goldClusterRecipe);
ItemStack copperClusterRecipe = Items.getItem("smallCopperDust").copy();
ItemStack copperClusterRecipe = IC2Items.getItem("smallCopperDust").copy();
copperClusterRecipe.stackSize = 22;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 17)), null, copperClusterRecipe);
ItemStack tinClusterRecipe = Items.getItem("smallTinDust").copy();
ItemStack tinClusterRecipe = IC2Items.getItem("smallTinDust").copy();
tinClusterRecipe.stackSize = 22;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 18)), null, tinClusterRecipe);
ItemStack silverClusterRecipe = Items.getItem("smallSilverDust").copy();
ItemStack silverClusterRecipe = IC2Items.getItem("smallSilverDust").copy();
silverClusterRecipe.stackSize = 22;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 19)), null, silverClusterRecipe);
ItemStack leadClusterRecipe = Items.getItem("smallLeadDust").copy();
ItemStack leadClusterRecipe = IC2Items.getItem("smallLeadDust").copy();
leadClusterRecipe.stackSize = 22;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 20)), null, leadClusterRecipe);
/* Thaumium Plates Recipes */
thaumiumPlate = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.thaumiumPlate), "X", "Y", "Z", 'Y', new ItemStack(ConfigItems.itemResource, 1, 2), 'X', new ItemStack(Items.getItem("ForgeHammer").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(Block.obsidian));
thaumiumPlate = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.thaumiumPlate), "X", "Y", "Z", 'Y', new ItemStack(ConfigItems.itemResource, 1, 2), 'X', new ItemStack(IC2Items.getItem("ForgeHammer").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(Blocks.obsidian));
Recipes.metalformerRolling.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemResource, 1, 2)), null, new ItemStack(ItemRegistry.thaumiumPlate));
/* Ore Processing for Amber and Cinnabar */
@@ -228,6 +231,9 @@ public class EMTPostInitRecipes
public static InfusionRecipe tripleCompressedSolar;
public static InfusionRecipe electricHoeGrowth;
public static InfusionRecipe chargeFocus;
public static InfusionRecipe wandChargeFocus;
public static InfusionRecipe inventoryChargingRing;
public static InfusionRecipe armorChargingRing;
public static ShapelessArcaneRecipe diamondOmnitool;
public static ShapelessArcaneRecipe tinyUranium;
@@ -242,7 +248,6 @@ public class EMTPostInitRecipes
public static CrucibleRecipe ignisGenerator;
public static CrucibleRecipe auramGenerator;
public static CrucibleRecipe arborGenerator;
public static CrucibleRecipe saxumGenerator;
public static CrucibleRecipe waterSolar;
public static CrucibleRecipe doubleWaterSolar;
public static CrucibleRecipe tripleWaterSolar;
@@ -11,9 +11,9 @@
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.recipes;
import ic2.api.item.Items;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import ic2.api.item.IC2Items;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApi;
@@ -22,72 +22,75 @@ import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.config.ConfigItems;
import electricMagicTools.tombenpotter.electricmagictools.common.lib.CraftingAspects;
public class UuMInfusionRecipes
{
public static ItemStack uuMCell = Items.getItem("UuMatterCell");
public class UuMInfusionRecipes {
public static ItemStack uuMCell = IC2Items.getItem("UuMatterCell");
public static void add() {
ItemStack iridium = Items.getItem("iridiumOre").copy();
ItemStack iridium = IC2Items.getItem("iridiumOre").copy();
iridium.stackSize = 2;
uraniumToIridium = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", iridium, 4, CraftingAspects.uuMatterInfusions, Items.getItem("Uran238"), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell });
uraniumToIridium = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", iridium, 4, CraftingAspects.uuMatterInfusions, IC2Items.getItem("Uran238"), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell });
ItemStack uranium = Items.getItem("Uran238").copy();
ItemStack uranium = IC2Items.getItem("Uran238").copy();
uranium.stackSize = 2;
diamondToUranium = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", uranium, 4, CraftingAspects.lesserUUMInfusions, new ItemStack(Item.diamond), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell });
diamondToUranium = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", uranium, 4, CraftingAspects.lesserUUMInfusions, new ItemStack(Items.diamond), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell });
ItemStack diamond = new ItemStack(Item.diamond).copy();
ItemStack diamond = new ItemStack(Items.diamond).copy();
diamond.stackSize = 1;
goldToDiamond = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", diamond, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Item.ingotGold), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell });
goldToDiamond = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", diamond, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Items.gold_ingot), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell });
ItemStack gold = new ItemStack(Item.ingotGold).copy();
ItemStack gold = new ItemStack(Items.gold_ingot).copy();
gold.stackSize = 2;
ironToGold = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", gold, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Item.ingotIron), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ironToGold = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", gold, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Items.iron_ingot), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack ironOre = new ItemStack(Block.oreIron).copy();
ItemStack ironOre = new ItemStack(Blocks.iron_ore).copy();
ironOre.stackSize = 16;
stoneBricksToIronOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", ironOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Block.stoneBrick), new ItemStack[] { uuMCell, uuMCell });
stoneBricksToIronOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", ironOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Blocks.stonebrick), new ItemStack[] { uuMCell, uuMCell });
/**
* ItemStack copperOre = Items.getItem("copperOre").copy(); BUGGED IN 1.6 IF IC2 OREGEN IS DISABLED
**/
ItemStack copperOre = Items.getItem("crushedCopperOre").copy();
ItemStack copperOre = IC2Items.getItem("crushedCopperOre").copy();
copperOre.stackSize = 32;
arcaneStoneToCopperOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", copperOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), new ItemStack[] { uuMCell, uuMCell });
/**
* ItemStack tinOre = Items.getItem("tinOre").copy(); BUGGED IN 1.6 IF IC2 OREGEN IS DISABLED
**/
ItemStack tinOre = Items.getItem("crushedTinOre").copy();
ItemStack tinOre = IC2Items.getItem("crushedTinOre").copy();
tinOre.stackSize = 32;
arcaneStoneBricksToTinOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", tinOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 7), new ItemStack[] { uuMCell, uuMCell });
/**
* ItemStack leadOre = Items.getItem("leadOre").copy(); BUGGED IN 1.6 IF IC2 OREGEN IS DISABLED
**/
ItemStack leadOre = Items.getItem("crushedLeadOre").copy();
ItemStack leadOre = IC2Items.getItem("crushedLeadOre").copy();
leadOre.stackSize = 32;
amberBlockToLeadOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", leadOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 0), new ItemStack[] { uuMCell, uuMCell });
ItemStack coal = new ItemStack(Item.coal, 1, 0).copy();
coal.stackSize = 16;
charcoalToCoal = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", coal, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Item.coal, 1, 1), new ItemStack[] { uuMCell, uuMCell });
ItemStack uraniumOre = IC2Items.getItem("uraniumOre").copy();
uraniumOre.stackSize = 8;
amberBricksToUraniumOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", uraniumOre, 4, CraftingAspects.lesserUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 1), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack stickyResin = Items.getItem("resin").copy();
ItemStack coal = new ItemStack(Items.coal, 1, 0).copy();
coal.stackSize = 16;
charcoalToCoal = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", coal, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Items.coal, 1, 1), new ItemStack[] { uuMCell, uuMCell });
ItemStack stickyResin = IC2Items.getItem("resin").copy();
stickyResin.stackSize = 21;
shardToResin = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", stickyResin, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack redstone = new ItemStack(Item.redstone).copy();
ItemStack redstone = new ItemStack(Items.redstone).copy();
redstone.stackSize = 24;
shardToRedstone = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", redstone, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack lapisLazuli = new ItemStack(Item.dyePowder, 1, 4).copy();
ItemStack lapisLazuli = new ItemStack(Items.dye, 1, 4).copy();
lapisLazuli.stackSize = 8;
shardToLapis = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", lapisLazuli, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack glowstone = new ItemStack(Block.glowStone).copy();
ItemStack glowstone = new ItemStack(Blocks.glowstone).copy();
glowstone.stackSize = 1;
glowstoneDustToBlock = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", glowstone, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Item.glowstone), new ItemStack[] { uuMCell });
glowstoneDustToBlock = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", glowstone, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Items.glowstone_dust), new ItemStack[] { uuMCell });
}
@@ -99,6 +102,7 @@ public class UuMInfusionRecipes
public static InfusionRecipe arcaneStoneToCopperOre;
public static InfusionRecipe arcaneStoneBricksToTinOre;
public static InfusionRecipe amberBlockToLeadOre;
public static InfusionRecipe amberBricksToUraniumOre;
public static InfusionRecipe charcoalToCoal;
public static InfusionRecipe shardToResin;
public static InfusionRecipe shardToRedstone;
@@ -13,21 +13,19 @@ package electricMagicTools.tombenpotter.electricmagictools.common.tile;
import ic2.api.energy.prefab.BasicSource;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.lib.EssentiaHandler;
import thaumcraft.common.lib.events.EssentiaHandler;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityArborGenerator extends TileEntity
{
public class TileEntityArborGenerator extends TileEntity {
int x;
int y;
int z;
public ForgeDirection orientation;
public static int waitTime;
public TileEntityArborGenerator()
{
public TileEntityArborGenerator() {
orientation = ForgeDirection.getOrientation(1);
waitTime = 30;
}
@@ -38,15 +36,12 @@ public class TileEntityArborGenerator extends TileEntity
public void updateEntity() {
energySource.updateEntity();
if (waitTime > 0)
{
if (waitTime > 0) {
waitTime--;
}
if (waitTime <= 0)
{
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.TREE, ForgeDirection.UNKNOWN, 8)))
{
if (waitTime <= 0) {
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.TREE, ForgeDirection.UNKNOWN, 8))) {
energySource.addEnergy(Config.arborGenOutput);
}
waitTime = Config.essentiaGeneratorsDelay;
@@ -14,13 +14,12 @@ package electricMagicTools.tombenpotter.electricmagictools.common.tile;
import ic2.api.energy.prefab.BasicSource;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.lib.EssentiaHandler;
import thaumcraft.common.lib.events.EssentiaHandler;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityAuramGenerator extends TileEntity
{
public class TileEntityAuramGenerator extends TileEntity {
int x;
int y;
int z;
@@ -28,8 +27,7 @@ public class TileEntityAuramGenerator extends TileEntity
public static int waitTime;
private BasicSource energySource = new BasicSource(this, 1000000000, 3);
public TileEntityAuramGenerator()
{
public TileEntityAuramGenerator() {
orientation = ForgeDirection.getOrientation(1);
waitTime = 30;
}
@@ -38,15 +36,12 @@ public class TileEntityAuramGenerator extends TileEntity
public void updateEntity() {
energySource.updateEntity();
if (waitTime > 0)
{
if (waitTime > 0) {
waitTime--;
}
if (waitTime <= 0)
{
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.AURA, ForgeDirection.UNKNOWN, 8)))
{
if (waitTime <= 0) {
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.AURA, ForgeDirection.UNKNOWN, 8))) {
energySource.addEnergy(Config.auramGenOutput);
}
waitTime = Config.essentiaGeneratorsDelay;
@@ -13,8 +13,9 @@ package electricMagicTools.tombenpotter.electricmagictools.common.tile;
import ic2.api.tile.IWrenchable;
import ic2.core.Ic2Items;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -24,13 +25,10 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.common.config.ConfigItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityEtherealMacerator extends TileEntity implements ISidedInventory, IWrenchable
{
public class TileEntityEtherealMacerator extends TileEntity implements ISidedInventory, IWrenchable {
private static final int[] slots_top = new int[] { 0 };
private static final int[] slots_bottom = new int[] { 2, 1 };
private static final int[] slots_sides = new int[] { 1 };
@@ -66,28 +64,23 @@ public class TileEntityEtherealMacerator extends TileEntity implements ISidedInv
* Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack.
*/
public ItemStack decrStackSize(int par1, int par2) {
if (this.slots[par1] != null)
{
if (this.slots[par1] != null) {
ItemStack itemstack;
if (this.slots[par1].stackSize <= par2)
{
if (this.slots[par1].stackSize <= par2) {
itemstack = this.slots[par1];
this.slots[par1] = null;
return itemstack;
} else
{
} else {
itemstack = this.slots[par1].splitStack(par2);
if (this.slots[par1].stackSize == 0)
{
if (this.slots[par1].stackSize == 0) {
this.slots[par1] = null;
}
return itemstack;
}
} else
{
} else {
return null;
}
}
@@ -96,13 +89,11 @@ public class TileEntityEtherealMacerator extends TileEntity implements ISidedInv
* When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.
*/
public ItemStack getStackInSlotOnClosing(int par1) {
if (this.slots[par1] != null)
{
if (this.slots[par1] != null) {
ItemStack itemstack = this.slots[par1];
this.slots[par1] = null;
return itemstack;
} else
{
} else {
return null;
}
}
@@ -113,130 +104,72 @@ public class TileEntityEtherealMacerator extends TileEntity implements ISidedInv
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
this.slots[par1] = par2ItemStack;
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit())
{
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) {
par2ItemStack.stackSize = this.getInventoryStackLimit();
}
}
/**
* Returns the name of the inventory.
*/
public String getInvName() {
return "Ethereal Processor";
}
/**
* If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's language. Otherwise it will be used directly.
*/
public boolean isInvNameLocalized() {
return false;
}
/**
* Reads a tile entity from NBT.
*/
public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
super.readFromNBT(par1NBTTagCompound);
NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items");
public void readFromNBT(NBTTagCompound p_145839_1_) {
super.readFromNBT(p_145839_1_);
NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
this.slots = new ItemStack[this.getSizeInventory()];
for (int i = 0; i < nbttaglist.tagCount(); ++i)
{
NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.tagAt(i);
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
byte b0 = nbttagcompound1.getByte("Slot");
if (b0 >= 0 && b0 < this.slots.length)
{
if (b0 >= 0 && b0 < this.slots.length) {
this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
}
}
this.cookTime = par1NBTTagCompound.getShort("CookTime");
this.cookTime = p_145839_1_.getShort("CookTime");
}
/**
* Writes a tile entity to NBT.
*/
public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setShort("CookTime", (short) this.cookTime);
public void writeToNBT(NBTTagCompound p_145841_1_) {
super.writeToNBT(p_145841_1_);
p_145841_1_.setShort("CookTime", (short) this.cookTime);
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < this.slots.length; ++i)
{
if (this.slots[i] != null)
{
for (int i = 0; i < this.slots.length; ++i) {
if (this.slots[i] != null) {
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setByte("Slot", (byte) i);
this.slots[i].writeToNBT(nbttagcompound1);
nbttaglist.appendTag(nbttagcompound1);
}
}
par1NBTTagCompound.setTag("Items", nbttaglist);
p_145841_1_.setTag("Items", nbttaglist);
}
/**
* Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this more of a set than a get?*
*/
public int getInventoryStackLimit() {
return 64;
}
@SideOnly(Side.CLIENT)
/**
* Returns an integer between 0 and the passed value representing how close the current item is to being completely
* cooked
*/
public int getCookProgressScaled(int par1) {
return this.cookTime * par1 / this.maceratingSpeed;
}
public boolean isMacerating() {
return this.cookTime > 0;
}
/**
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks and creates a new spawn inside its implementation.
*/
public void updateEntity() {
boolean flag1 = false;
if (!this.worldObj.isRemote)
{
flag1 = true;
}
if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false)
{
if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false) {
++this.cookTime;
if (this.cookTime == this.maceratingSpeed)
{
if (this.cookTime == this.maceratingSpeed) {
this.cookTime = 0;
this.smeltItem();
flag1 = true;
}
} else
{
} else {
this.cookTime = 0;
}
if (flag1)
{
this.onInventoryChanged();
}
}
/**
* Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc.
*/
private boolean canSmelt() {
if (this.slots[0] == null)
{
if (this.slots[0] == null) {
return false;
} else
{
} else {
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
if (itemstack == null)
return false;
@@ -249,27 +182,20 @@ public class TileEntityEtherealMacerator extends TileEntity implements ISidedInv
}
}
/**
* Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack
*/
public void smeltItem() {
if (this.canSmelt())
{
if (this.canSmelt()) {
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
if (this.slots[2] == null)
{
if (this.slots[2] == null) {
this.slots[2] = itemstack.copy();
this.slots[2].stackSize *= 2;
} else if (this.slots[2].isItemEqual(itemstack))
{
} else if (this.slots[2].isItemEqual(itemstack)) {
slots[2].stackSize += (itemstack.stackSize * 2);
}
--this.slots[0].stackSize;
if (this.slots[0].stackSize <= 0)
{
if (this.slots[0].stackSize <= 0) {
this.slots[0] = null;
}
this.addBonus();
@@ -277,26 +203,19 @@ public class TileEntityEtherealMacerator extends TileEntity implements ISidedInv
}
public void addBonus() {
if (this.canSmelt())
{
if (this.worldObj.rand.nextInt(Config.etherealProcessorBonus) == 0)
{
if (this.slots[1] == null)
{
if (this.canSmelt()) {
if (this.worldObj.rand.nextInt(Config.etherealProcessorBonus) == 0) {
if (this.slots[1] == null) {
this.setInventorySlotContents(1, new ItemStack(ConfigItems.itemNugget, 1, 6));
} else if (this.slots[1].isItemEqual(new ItemStack(ConfigItems.itemNugget, 1, 6)) && this.isOverLimit(1) == false && this.isOverLimit(2) == false)
{
} else if (this.slots[1].isItemEqual(new ItemStack(ConfigItems.itemNugget, 1, 6)) && this.isOverLimit(1) == false && this.isOverLimit(2) == false) {
slots[1] = new ItemStack(getStackInSlot(1).getItem(), slots[1].stackSize + 1, 2);
}
}
}
}
/**
* Do not make give this method the name canInteractWith because it clashes with Container
*/
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D;
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D;
}
public void openChest() {
@@ -305,45 +224,31 @@ public class TileEntityEtherealMacerator extends TileEntity implements ISidedInv
public void closeChest() {
}
/**
* Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
*/
public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) {
return true;
}
/**
* Returns an array containing the indices of the slots that can be accessed by automation on the given side of this block.
*/
public int[] getAccessibleSlotsFromSide(int par1) {
return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);
}
/**
* Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, side
*/
public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) {
return this.isItemValidForSlot(par1, par2ItemStack);
}
/**
* Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, side
*/
public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) {
return true;
}
public boolean isOverLimit(int i) {
if (slots[i] != null)
{
if (slots[i] != null) {
if (slots[i].stackSize >= 63)
return true;
else if (slots[i].stackSize < 63)
return false;
else
return false;
} else
{
} else {
return false;
}
}
@@ -351,11 +256,9 @@ public class TileEntityEtherealMacerator extends TileEntity implements ISidedInv
public boolean isOP() {
final int cobblestoneId = OreDictionary.getOreID("blockCobble");
if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].itemID == Block.sand.blockID || this.slots[0].itemID == Item.potato.itemID || this.slots[0].itemID == Item.porkRaw.itemID || this.slots[0].itemID == Item.beefRaw.itemID || this.slots[0].itemID == Item.chickenRaw.itemID || this.slots[0].itemID == Item.fishRaw.itemID || this.slots[0].itemID == Ic2Items.hydratedCoalDust.itemID || (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).contains("dust")))
{
if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].getItem() == Item.getItemFromBlock(Blocks.sand) || this.slots[0].getItem() == Items.potato || this.slots[0].getItem() == Items.porkchop || this.slots[0].getItem() == Items.beef || this.slots[0].getItem() == Items.chicken || this.slots[0].getItem() == Items.fish || this.slots[0].getItem() == Ic2Items.hydratedCoalDust.getItem() || (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).contains("dust"))) {
return true;
} else
{
} else {
return false;
}
}
@@ -389,4 +292,24 @@ public class TileEntityEtherealMacerator extends TileEntity implements ISidedInv
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
return new ItemStack(BlockRegistry.emtMachines, 1, 1);
}
@Override
public String getInventoryName() {
return "Ethereal Macerator";
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
@Override
public void openInventory() {
}
@Override
public void closeInventory() {
}
}
@@ -14,13 +14,12 @@ package electricMagicTools.tombenpotter.electricmagictools.common.tile;
import ic2.api.energy.prefab.BasicSource;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.lib.EssentiaHandler;
import thaumcraft.common.lib.events.EssentiaHandler;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityIgnisGenerator extends TileEntity
{
public class TileEntityIgnisGenerator extends TileEntity {
int x;
int y;
int z;
@@ -28,8 +27,7 @@ public class TileEntityIgnisGenerator extends TileEntity
public static int waitTime;
private BasicSource energySource = new BasicSource(this, 1000000000, 3);
public TileEntityIgnisGenerator()
{
public TileEntityIgnisGenerator() {
orientation = ForgeDirection.getOrientation(1);
waitTime = 30;
}
@@ -38,15 +36,12 @@ public class TileEntityIgnisGenerator extends TileEntity
public void updateEntity() {
energySource.updateEntity();
if (waitTime > 0)
{
if (waitTime > 0) {
waitTime--;
}
if (waitTime <= 0)
{
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.FIRE, ForgeDirection.UNKNOWN, 8)))
{
if (waitTime <= 0) {
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.FIRE, ForgeDirection.UNKNOWN, 8))) {
energySource.addEnergy(6000);
}
waitTime = Config.essentiaGeneratorsDelay;
@@ -17,23 +17,17 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.tileentity.TileEntity;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.items.wands.ItemWandCasting;
import cpw.mods.fml.common.network.PacketDispatcher;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityIndustrialWandRecharge extends TileEntity implements IInventory
{
public class TileEntityIndustrialWandRecharge extends TileEntity implements IInventory {
private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4);
ItemStack ItemStacks[];
public TileEntityIndustrialWandRecharge()
{
public TileEntityIndustrialWandRecharge() {
ItemStacks = new ItemStack[1];
}
@@ -49,40 +43,33 @@ public class TileEntityIndustrialWandRecharge extends TileEntity implements IInv
@Override
public ItemStack decrStackSize(int i, int j) {
if (ItemStacks[i] != null)
{
if (ItemStacks[i] != null) {
if (ItemStacks[i].stackSize <= j)
{
if (ItemStacks[i].stackSize <= j) {
ItemStack itemstack = ItemStacks[i];
ItemStacks[i] = null;
return itemstack;
} else
{
} else {
ItemStack itemstack1 = ItemStacks[i].splitStack(j);
if (ItemStacks[i].stackSize == 0)
{
if (ItemStacks[i].stackSize == 0) {
ItemStacks[i] = null;
}
return itemstack1;
}
} else
{
} else {
return null;
}
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
if (ItemStacks[i] != null)
{
if (ItemStacks[i] != null) {
ItemStack itemstack = ItemStacks[i];
ItemStacks[i] = null;
return itemstack;
} else
{
} else {
return null;
}
}
@@ -90,17 +77,13 @@ public class TileEntityIndustrialWandRecharge extends TileEntity implements IInv
@Override
public void updateEntity() {
ic2EnergySink.updateEntity();
if (!this.worldObj.isRemote)
{
if (getStackInSlot(0) != null)
{
if (!this.worldObj.isRemote) {
if (getStackInSlot(0) != null) {
ItemStack wand = getStackInSlot(0);
if (ic2EnergySink.useEnergy(Config.wandChargerConsumption))
{
if (wand != null && wand.getItem() instanceof ItemWandCasting)
{
if (ic2EnergySink.useEnergy(Config.wandChargerConsumption)) {
if (wand != null && wand.getItem() instanceof ItemWandCasting) {
ItemWandCasting wandItem = (ItemWandCasting) wand.getItem();
wandItem.addVis(wand, Aspect.ORDER, 1, true);
wandItem.addVis(wand, Aspect.FIRE, 1, true);
@@ -119,91 +102,40 @@ public class TileEntityIndustrialWandRecharge extends TileEntity implements IInv
public void setInventorySlotContents(int i, ItemStack itemstack) {
ItemStacks[i] = itemstack;
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit())
{
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) {
itemstack.stackSize = getInventoryStackLimit();
}
}
@Override
public String getInvName() {
return "Industrial Wand Charging Station";
}
public void readFromNBT(NBTTagCompound p_145839_1_) {
super.readFromNBT(p_145839_1_);
NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10);
this.ItemStacks = new ItemStack[this.getSizeInventory()];
@Override
public boolean isInvNameLocalized() {
return false;
}
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
byte b0 = nbttagcompound1.getByte("Slot");
@Override
public void openChest() {
}
@Override
public void closeChest() {
}
@Override
public void readFromNBT(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
ic2EnergySink.readFromNBT(tagCompound);
NBTTagList tagList = tagCompound.getTagList("Inventory");
for (int i = 0; i < tagList.tagCount(); i++)
{
NBTTagCompound tag = (NBTTagCompound) tagList.tagAt(i);
byte slot = tag.getByte("Slot");
if (slot >= 0 && slot < ItemStacks.length)
{
ItemStacks[slot] = ItemStack.loadItemStackFromNBT(tag);
if (b0 >= 0 && b0 < this.ItemStacks.length) {
this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
}
}
}
@Override
public void writeToNBT(NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
public void writeToNBT(NBTTagCompound p_145841_1_) {
super.writeToNBT(p_145841_1_);
NBTTagList nbttaglist = new NBTTagList();
ic2EnergySink.writeToNBT(tagCompound);
NBTTagList itemList = new NBTTagList();
for (int i = 0; i < ItemStacks.length; i++)
{
ItemStack stack = ItemStacks[i];
if (stack != null)
{
NBTTagCompound tag = new NBTTagCompound();
tag.setByte("Slot", (byte) i);
stack.writeToNBT(tag);
itemList.appendTag(tag);
for (int i = 0; i < this.ItemStacks.length; ++i) {
if (this.ItemStacks[i] != null) {
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
nbttagcompound1.setByte("Slot", (byte) i);
this.ItemStacks[i].writeToNBT(nbttagcompound1);
nbttaglist.appendTag(nbttagcompound1);
}
}
tagCompound.setTag("Inventory", itemList);
}
@Override
public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
return new Packet132TileEntityData(xCoord, yCoord, zCoord, -999, nbttagcompound);
}
@Override
public void onDataPacket(INetworkManager manager, Packet132TileEntityData packet) {
super.onDataPacket(manager, packet);
readFromNBT(packet.data);
}
@Override
public void onInventoryChanged() {
super.onInventoryChanged();
if (!worldObj.isRemote)
{
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
}
p_145841_1_.setTag("Items", nbttaglist);
}
@Override
@@ -213,8 +145,7 @@ public class TileEntityIndustrialWandRecharge extends TileEntity implements IInv
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
if (worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this)
{
if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
return false;
}
@@ -236,4 +167,22 @@ public class TileEntityIndustrialWandRecharge extends TileEntity implements IInv
public void onChunkUnload() {
ic2EnergySink.onChunkUnload();
}
@Override
public String getInventoryName() {
return "Industrial Wand Charging Station";
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
@Override
public void openInventory() {
}
@Override
public void closeInventory() {
}
}
@@ -15,11 +15,9 @@ import thaumcraft.api.nodes.NodeModifier;
import thaumcraft.api.nodes.NodeType;
import thaumcraft.common.tiles.TileNode;
public class TileEntityPortableNode extends TileNode
{
public class TileEntityPortableNode extends TileNode {
public TileEntityPortableNode()
{
public TileEntityPortableNode() {
super();
}
@@ -14,21 +14,19 @@ package electricMagicTools.tombenpotter.electricmagictools.common.tile;
import ic2.api.energy.prefab.BasicSource;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.lib.EssentiaHandler;
import thaumcraft.common.lib.events.EssentiaHandler;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityPotentiaGenerator extends TileEntity
{
public class TileEntityPotentiaGenerator extends TileEntity {
int x;
int y;
int z;
public ForgeDirection orientation;
public static int waitTime;
public TileEntityPotentiaGenerator()
{
public TileEntityPotentiaGenerator() {
orientation = ForgeDirection.getOrientation(1);
waitTime = 30;
}
@@ -39,15 +37,12 @@ public class TileEntityPotentiaGenerator extends TileEntity
public void updateEntity() {
energySource.updateEntity();
if (waitTime > 0)
{
if (waitTime > 0) {
waitTime--;
}
if (waitTime <= 0)
{
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.ENERGY, ForgeDirection.UNKNOWN, 8)))
{
if (waitTime <= 0) {
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.ENERGY, ForgeDirection.UNKNOWN, 8))) {
energySource.addEnergy(Config.potentiaGenOutput);
}
waitTime = Config.essentiaGeneratorsDelay;
@@ -1,68 +0,0 @@
/*******************************************************************************
* Copyright (c) 2014 Tombenpotter.
* All rights reserved.
*
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
*
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
import ic2.api.energy.prefab.BasicSource;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.lib.EssentiaHandler;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntitySaxumGenerator extends TileEntity
{
int x;
int y;
int z;
public ForgeDirection orientation;
public static int waitTime;
public TileEntitySaxumGenerator()
{
orientation = ForgeDirection.getOrientation(1);
waitTime = 30;
}
private BasicSource energySource = new BasicSource(this, 1000000000, 3);
@Override
public void updateEntity() {
energySource.updateEntity();
if (waitTime > 0)
{
waitTime--;
}
if (waitTime <= 0)
{
if ((!this.worldObj.isRemote) && (EssentiaHandler.drainEssentia(this, Aspect.STONE, ForgeDirection.UNKNOWN, 8)))
{
energySource.addEnergy(Config.arborGenOutput);
}
waitTime = Config.essentiaGeneratorsDelay;
}
}
@Override
public void onChunkUnload() {
energySource.onChunkUnload();
}
@Override
public void invalidate() {
energySource.invalidate();
super.invalidate();
onChunkUnload();
}
}
@@ -26,26 +26,21 @@ import net.minecraft.tileentity.TileEntity;
import thaumcraft.common.container.SlotOutput;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEtherealMacerator;
public class ContainerEtheralMacerator extends Container
{
public class ContainerEtheralMacerator extends Container {
TileEntityEtherealMacerator te;
public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te)
{
public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te) {
this.te = ((TileEntityEtherealMacerator) te);
addSlotToContainer(new Slot(this.te, 0, 56, 26));
addSlotToContainer(new SlotOutput(this.te, 2, 116, 26));
addSlotToContainer(new SlotOutput(this.te, 1, 116, 53));
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 9; j++)
{
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (int i = 0; i < 9; i++)
{
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
}
}
@@ -60,26 +55,19 @@ public class ContainerEtheralMacerator extends Container
public final ItemStack transferStackInSlot(EntityPlayer player, int sourceSlotIndex) {
Slot sourceSlot = (Slot) inventorySlots.get(sourceSlotIndex);
if (sourceSlot != null && sourceSlot.getHasStack())
{
if (sourceSlot != null && sourceSlot.getHasStack()) {
ItemStack sourceItemStack = sourceSlot.getStack();
int oldSourceItemStackSize = sourceItemStack.stackSize;
if (sourceSlot.inventory == player.inventory)
{ // player inventory
// clicked
// 0: fill input existing stacks, 1: fill input empty stacks, 2:
// fill existing stacks, 3: fill empty stacks
for (int run = 0; run < 4 && sourceItemStack.stackSize > 0; run++)
{
if (run < 2)
{
for (Slot targetSlot : (List<Slot>) inventorySlots)
{
if (targetSlot instanceof SlotInvSlot && ((SlotInvSlot) targetSlot).invSlot.canInput() && targetSlot.isItemValid(sourceItemStack))
{
if (targetSlot.getStack() != null || run == 1)
{
if (sourceSlot.inventory == player.inventory) { // player inventory
// clicked
// 0: fill input existing stacks, 1: fill input empty stacks, 2:
// fill existing stacks, 3: fill empty stacks
for (int run = 0; run < 4 && sourceItemStack.stackSize > 0; run++) {
if (run < 2) {
for (Slot targetSlot : (List<Slot>) inventorySlots) {
if (targetSlot instanceof SlotInvSlot && ((SlotInvSlot) targetSlot).invSlot.canInput() && targetSlot.isItemValid(sourceItemStack)) {
if (targetSlot.getStack() != null || run == 1) {
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
if (sourceItemStack.stackSize == 0)
@@ -87,14 +75,10 @@ public class ContainerEtheralMacerator extends Container
}
}
}
} else
{
for (Slot targetSlot : (List<Slot>) inventorySlots)
{
if (targetSlot.inventory != player.inventory && targetSlot.isItemValid(sourceItemStack))
{
if (targetSlot.getStack() != null || run == 3)
{
} else {
for (Slot targetSlot : (List<Slot>) inventorySlots) {
if (targetSlot.inventory != player.inventory && targetSlot.isItemValid(sourceItemStack)) {
if (targetSlot.getStack() != null || run == 3) {
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
if (sourceItemStack.stackSize == 0)
@@ -104,18 +88,13 @@ public class ContainerEtheralMacerator extends Container
}
}
}
} else
{ // Shift-Click on a GUIslot of the container
for (int run = 0; run < 2 && sourceItemStack.stackSize > 0; run++)
{
for (ListIterator<Slot> it = ((List<Slot>) inventorySlots).listIterator(inventorySlots.size()); it.hasPrevious();)
{
} else { // Shift-Click on a GUIslot of the container
for (int run = 0; run < 2 && sourceItemStack.stackSize > 0; run++) {
for (ListIterator<Slot> it = ((List<Slot>) inventorySlots).listIterator(inventorySlots.size()); it.hasPrevious();) {
Slot targetSlot = it.previous();
if (targetSlot.inventory == player.inventory && targetSlot.isItemValid(sourceItemStack))
{
if (targetSlot.getStack() != null || run == 1)
{
if (targetSlot.inventory == player.inventory && targetSlot.isItemValid(sourceItemStack)) {
if (targetSlot.getStack() != null || run == 1) {
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
if (sourceItemStack.stackSize == 0)
@@ -126,13 +105,10 @@ public class ContainerEtheralMacerator extends Container
}
}
if (sourceItemStack.stackSize != oldSourceItemStackSize)
{
if (sourceItemStack.stackSize == 0)
{
if (sourceItemStack.stackSize != oldSourceItemStackSize) {
if (sourceItemStack.stackSize == 0) {
sourceSlot.putStack(null);
} else
{
} else {
sourceSlot.onPickupFromSlot(player, sourceItemStack);
}
@@ -141,8 +117,7 @@ public class ContainerEtheralMacerator extends Container
// causing a race condition of the client received an old state
// through packet delay after the slot click
// this forces a proper sync
if (IC2.platform.isSimulating())
{
if (IC2.platform.isSimulating()) {
detectAndSendChanges();
}
}
@@ -25,25 +25,20 @@ import net.minecraft.item.ItemStack;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityIndustrialWandRecharge;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.slot.SlotWandOnly;
public class ContainerIndustrialWandRecharge extends Container
{
public class ContainerIndustrialWandRecharge extends Container {
TileEntityIndustrialWandRecharge charger;
SlotWandOnly wandSlot;
public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity)
{
public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity) {
this.charger = entity;
for (int x = 0; x < 9; x++)
{
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(invPlayer, x, 8 + x * 18, 142));
}
for (int y = 0; y < 3; y++)
{
for (int x = 0; x < 9; x++)
{
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18));
}
}
@@ -61,26 +56,19 @@ public class ContainerIndustrialWandRecharge extends Container
public final ItemStack transferStackInSlot(EntityPlayer player, int sourceSlotIndex) {
Slot sourceSlot = (Slot) inventorySlots.get(sourceSlotIndex);
if (sourceSlot != null && sourceSlot.getHasStack())
{
if (sourceSlot != null && sourceSlot.getHasStack()) {
ItemStack sourceItemStack = sourceSlot.getStack();
int oldSourceItemStackSize = sourceItemStack.stackSize;
if (sourceSlot.inventory == player.inventory)
{ // player inventory
// clicked
// 0: fill input existing stacks, 1: fill input empty stacks, 2:
// fill existing stacks, 3: fill empty stacks
for (int run = 0; run < 4 && sourceItemStack.stackSize > 0; run++)
{
if (run < 2)
{
for (Slot targetSlot : (List<Slot>) inventorySlots)
{
if (targetSlot instanceof SlotInvSlot && ((SlotInvSlot) targetSlot).invSlot.canInput() && targetSlot.isItemValid(sourceItemStack))
{
if (targetSlot.getStack() != null || run == 1)
{
if (sourceSlot.inventory == player.inventory) { // player inventory
// clicked
// 0: fill input existing stacks, 1: fill input empty stacks, 2:
// fill existing stacks, 3: fill empty stacks
for (int run = 0; run < 4 && sourceItemStack.stackSize > 0; run++) {
if (run < 2) {
for (Slot targetSlot : (List<Slot>) inventorySlots) {
if (targetSlot instanceof SlotInvSlot && ((SlotInvSlot) targetSlot).invSlot.canInput() && targetSlot.isItemValid(sourceItemStack)) {
if (targetSlot.getStack() != null || run == 1) {
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
if (sourceItemStack.stackSize == 0)
@@ -88,14 +76,10 @@ public class ContainerIndustrialWandRecharge extends Container
}
}
}
} else
{
for (Slot targetSlot : (List<Slot>) inventorySlots)
{
if (targetSlot.inventory != player.inventory && targetSlot.isItemValid(sourceItemStack))
{
if (targetSlot.getStack() != null || run == 3)
{
} else {
for (Slot targetSlot : (List<Slot>) inventorySlots) {
if (targetSlot.inventory != player.inventory && targetSlot.isItemValid(sourceItemStack)) {
if (targetSlot.getStack() != null || run == 3) {
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
if (sourceItemStack.stackSize == 0)
@@ -105,18 +89,13 @@ public class ContainerIndustrialWandRecharge extends Container
}
}
}
} else
{ // Shift-Click on a GUIslot of the container
for (int run = 0; run < 2 && sourceItemStack.stackSize > 0; run++)
{
for (ListIterator<Slot> it = ((List<Slot>) inventorySlots).listIterator(inventorySlots.size()); it.hasPrevious();)
{
} else { // Shift-Click on a GUIslot of the container
for (int run = 0; run < 2 && sourceItemStack.stackSize > 0; run++) {
for (ListIterator<Slot> it = ((List<Slot>) inventorySlots).listIterator(inventorySlots.size()); it.hasPrevious();) {
Slot targetSlot = it.previous();
if (targetSlot.inventory == player.inventory && targetSlot.isItemValid(sourceItemStack))
{
if (targetSlot.getStack() != null || run == 1)
{
if (targetSlot.inventory == player.inventory && targetSlot.isItemValid(sourceItemStack)) {
if (targetSlot.getStack() != null || run == 1) {
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
if (sourceItemStack.stackSize == 0)
@@ -127,13 +106,10 @@ public class ContainerIndustrialWandRecharge extends Container
}
}
if (sourceItemStack.stackSize != oldSourceItemStackSize)
{
if (sourceItemStack.stackSize == 0)
{
if (sourceItemStack.stackSize != oldSourceItemStackSize) {
if (sourceItemStack.stackSize == 0) {
sourceSlot.putStack(null);
} else
{
} else {
sourceSlot.onPickupFromSlot(player, sourceItemStack);
}
@@ -142,8 +118,7 @@ public class ContainerIndustrialWandRecharge extends Container
// causing a race condition of the client received an old state
// through packet delay after the slot click
// this forces a proper sync
if (IC2.platform.isSimulating())
{
if (IC2.platform.isSimulating()) {
detectAndSendChanges();
}
}
@@ -17,12 +17,10 @@ import net.minecraft.item.ItemStack;
import thaumcraft.common.items.wands.ItemWandCasting;
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerIndustrialWandRecharge;
public class SlotWandOnly extends Slot
{
public class SlotWandOnly extends Slot {
final ContainerIndustrialWandRecharge charger;
public SlotWandOnly(ContainerIndustrialWandRecharge indCharger, IInventory inv, int par3, int par4, int par5)
{
public SlotWandOnly(ContainerIndustrialWandRecharge indCharger, IInventory inv, int par3, int par4, int par5) {
super(inv, par3, par4, par5);
this.charger = indCharger;
}
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityAirSolar extends TileEntity implements IWrenchable
{
public class TileEntityAirSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 1);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityAirSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityAirSolar()
{
public TileEntityAirSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,28 +41,23 @@ public class TileEntityAirSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible && this.yCoord >= 160)
{
if (theSunIsVisible && this.yCoord >= 160) {
energySource.addEnergy(Config.compressedSolarOutput * 2.5);
} else if (theSunIsVisible)
{
} else if (theSunIsVisible) {
energySource.addEnergy(Config.compressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityCompressedSolar extends TileEntity implements IWrenchable
{
public class TileEntityCompressedSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 1);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityCompressedSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityCompressedSolar()
{
public TileEntityCompressedSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityCompressedSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.compressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityDarkSolar extends TileEntity implements IWrenchable
{
public class TileEntityDarkSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 1);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityDarkSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityDarkSolar()
{
public TileEntityDarkSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,24 +41,20 @@ public class TileEntityDarkSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false)
{
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false) {
energySource.addEnergy(Config.compressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityDoubleAirSolar extends TileEntity implements IWrenchable
{
public class TileEntityDoubleAirSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 2);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityDoubleAirSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityDoubleAirSolar()
{
public TileEntityDoubleAirSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,28 +41,23 @@ public class TileEntityDoubleAirSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible && this.yCoord >= 160)
{
if (theSunIsVisible && this.yCoord >= 160) {
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2.5);
} else if (theSunIsVisible)
{
} else if (theSunIsVisible) {
energySource.addEnergy(Config.doubleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityDoubleCompressedSolar extends TileEntity implements IWrenchable
{
public class TileEntityDoubleCompressedSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 2);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityDoubleCompressedSolar extends TileEntity implements IWren
private boolean canRain;
private boolean noSunlight;
public TileEntityDoubleCompressedSolar()
{
public TileEntityDoubleCompressedSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityDoubleCompressedSolar extends TileEntity implements IWren
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.doubleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityDoubleDarkSolar extends TileEntity implements IWrenchable
{
public class TileEntityDoubleDarkSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 2);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityDoubleDarkSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityDoubleDarkSolar()
{
public TileEntityDoubleDarkSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,24 +41,20 @@ public class TileEntityDoubleDarkSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false)
{
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false) {
energySource.addEnergy(Config.doubleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityDoubleEarthSolar extends TileEntity implements IWrenchable
{
public class TileEntityDoubleEarthSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 2);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityDoubleEarthSolar extends TileEntity implements IWrenchabl
private boolean canRain;
private boolean noSunlight;
public TileEntityDoubleEarthSolar()
{
public TileEntityDoubleEarthSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,28 +41,23 @@ public class TileEntityDoubleEarthSolar extends TileEntity implements IWrenchabl
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible && this.yCoord <= 10)
{
if (theSunIsVisible && this.yCoord <= 10) {
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2.5);
} else if (theSunIsVisible)
{
} else if (theSunIsVisible) {
energySource.addEnergy(Config.doubleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityDoubleFireSolar extends TileEntity implements IWrenchable
{
public class TileEntityDoubleFireSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 3);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityDoubleFireSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityDoubleFireSolar()
{
public TileEntityDoubleFireSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,29 +41,24 @@ public class TileEntityDoubleFireSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.doubleCompressedSolarOutput);
}
if (worldObj.provider.dimensionId == -1)
{
if (worldObj.provider.dimensionId == -1) {
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityDoubleOrderSolar extends TileEntity implements IWrenchable
{
public class TileEntityDoubleOrderSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 3);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityDoubleOrderSolar extends TileEntity implements IWrenchabl
private boolean canRain;
private boolean noSunlight;
public TileEntityDoubleOrderSolar()
{
public TileEntityDoubleOrderSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityDoubleOrderSolar extends TileEntity implements IWrenchabl
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.doubleCompressedSolarOutput * 3);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityDoubleWaterSolar extends TileEntity implements IWrenchable
{
public class TileEntityDoubleWaterSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 2);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityDoubleWaterSolar extends TileEntity implements IWrenchabl
private boolean canRain;
private boolean noSunlight;
public TileEntityDoubleWaterSolar()
{
public TileEntityDoubleWaterSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityDoubleWaterSolar extends TileEntity implements IWrenchabl
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord))
{
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) {
energySource.addEnergy(Config.doubleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityEarthSolar extends TileEntity implements IWrenchable
{
public class TileEntityEarthSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 1);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityEarthSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityEarthSolar()
{
public TileEntityEarthSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,28 +41,23 @@ public class TileEntityEarthSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible && this.yCoord <= 10)
{
if (theSunIsVisible && this.yCoord <= 10) {
energySource.addEnergy(Config.compressedSolarOutput * 2.5);
} else if (theSunIsVisible)
{
} else if (theSunIsVisible) {
energySource.addEnergy(Config.compressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityFireSolar extends TileEntity implements IWrenchable
{
public class TileEntityFireSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 1);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityFireSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityFireSolar()
{
public TileEntityFireSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,29 +41,24 @@ public class TileEntityFireSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.compressedSolarOutput);
}
if (worldObj.provider.dimensionId == -1)
{
if (worldObj.provider.dimensionId == -1) {
energySource.addEnergy(Config.compressedSolarOutput * 2);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityOrderSolar extends TileEntity implements IWrenchable
{
public class TileEntityOrderSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 2);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityOrderSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityOrderSolar()
{
public TileEntityOrderSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityOrderSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.compressedSolarOutput * 3);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityTripleAirSolar extends TileEntity implements IWrenchable
{
public class TileEntityTripleAirSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 1000000, 5);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityTripleAirSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityTripleAirSolar()
{
public TileEntityTripleAirSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,28 +41,23 @@ public class TileEntityTripleAirSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible && this.yCoord >= 160)
{
if (theSunIsVisible && this.yCoord >= 160) {
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2.5);
} else if (theSunIsVisible)
{
} else if (theSunIsVisible) {
energySource.addEnergy(Config.tripleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityTripleCompressedSolar extends TileEntity implements IWrenchable
{
public class TileEntityTripleCompressedSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 1000000, 3);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityTripleCompressedSolar extends TileEntity implements IWren
private boolean canRain;
private boolean noSunlight;
public TileEntityTripleCompressedSolar()
{
public TileEntityTripleCompressedSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityTripleCompressedSolar extends TileEntity implements IWren
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.tripleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityTripleDarkSolar extends TileEntity implements IWrenchable
{
public class TileEntityTripleDarkSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 1000000, 3);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityTripleDarkSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityTripleDarkSolar()
{
public TileEntityTripleDarkSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,24 +41,20 @@ public class TileEntityTripleDarkSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false)
{
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false) {
energySource.addEnergy(Config.tripleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityTripleEarthSolar extends TileEntity implements IWrenchable
{
public class TileEntityTripleEarthSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 1000000, 5);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityTripleEarthSolar extends TileEntity implements IWrenchabl
private boolean canRain;
private boolean noSunlight;
public TileEntityTripleEarthSolar()
{
public TileEntityTripleEarthSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,28 +41,23 @@ public class TileEntityTripleEarthSolar extends TileEntity implements IWrenchabl
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible && this.yCoord <= 10)
{
if (theSunIsVisible && this.yCoord <= 10) {
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2.5);
} else if (theSunIsVisible)
{
} else if (theSunIsVisible) {
energySource.addEnergy(Config.tripleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityTripleFireSolar extends TileEntity implements IWrenchable
{
public class TileEntityTripleFireSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 1000000, 5);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityTripleFireSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityTripleFireSolar()
{
public TileEntityTripleFireSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,29 +41,24 @@ public class TileEntityTripleFireSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.tripleCompressedSolarOutput);
}
if (worldObj.provider.dimensionId == -1)
{
if (worldObj.provider.dimensionId == -1) {
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityTripleOrderSolar extends TileEntity implements IWrenchable
{
public class TileEntityTripleOrderSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 1000000, 5);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityTripleOrderSolar extends TileEntity implements IWrenchabl
private boolean canRain;
private boolean noSunlight;
public TileEntityTripleOrderSolar()
{
public TileEntityTripleOrderSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityTripleOrderSolar extends TileEntity implements IWrenchabl
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (theSunIsVisible)
{
if (theSunIsVisible) {
energySource.addEnergy(Config.tripleCompressedSolarOutput * 3);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityTripleWaterSolar extends TileEntity implements IWrenchable
{
public class TileEntityTripleWaterSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 1000000, 3);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityTripleWaterSolar extends TileEntity implements IWrenchabl
private boolean canRain;
private boolean noSunlight;
public TileEntityTripleWaterSolar()
{
public TileEntityTripleWaterSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityTripleWaterSolar extends TileEntity implements IWrenchabl
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord))
{
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) {
energySource.addEnergy(Config.tripleCompressedSolarOutput);
}
energySource.addEnergy(energyProduction);
@@ -9,7 +9,7 @@
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
* http://www.minecraftforum.net/topic/1585216-
******************************************************************************/
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
import ic2.api.energy.prefab.BasicSource;
import ic2.api.tile.IWrenchable;
@@ -23,8 +23,7 @@ import net.minecraft.tileentity.TileEntity;
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
public class TileEntityWaterSolar extends TileEntity implements IWrenchable
{
public class TileEntityWaterSolar extends TileEntity implements IWrenchable {
private BasicSource energySource = new BasicSource(this, 10000, 1);
private static Random random = new Random();
@@ -34,8 +33,7 @@ public class TileEntityWaterSolar extends TileEntity implements IWrenchable
private boolean canRain;
private boolean noSunlight;
public TileEntityWaterSolar()
{
public TileEntityWaterSolar() {
super();
this.tick = random.nextInt(64);
}
@@ -43,25 +41,21 @@ public class TileEntityWaterSolar extends TileEntity implements IWrenchable
@Override
public void updateEntity() {
energySource.updateEntity();
if (!initialized && worldObj != null)
{
if (!initialized && worldObj != null) {
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
noSunlight = worldObj.provider.hasNoSky;
initialized = true;
}
if (noSunlight)
{
if (noSunlight) {
return;
}
if (tick-- == 0)
{
if (tick-- == 0) {
updateSunState();
tick = 64;
}
int energyProduction = 0;
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord))
{
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) {
energySource.addEnergy(Config.compressedSolarOutput);
}
energySource.addEnergy(energyProduction);