mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-18 19:29:29 +00:00
Commiting for repo fix
This commit is contained in:
1 parent
06140c48c1
commit
22f5fe3ce5
258 files changed
+18269
-3
No files matched your search
+176
@@ -0,0 +1,176 @@
|
||||
/*******************************************************************************
|
||||
* 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.client;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
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.relauncher.ReflectionHelper;
|
||||
|
||||
public class CapeEventHandler
|
||||
{
|
||||
private final String serverLocation = "https://raw.github.com/Tombenpotter/ElectricMagicTools/master/capes.txt";
|
||||
private final int timeout = 1000;
|
||||
|
||||
private static final Graphics TEST_GRAPHICS = new BufferedImage(128, 128, BufferedImage.TYPE_INT_RGB).getGraphics();
|
||||
private HashMap<String, String> cloaks = new HashMap<String, String>();
|
||||
private ArrayList<AbstractClientPlayer> capePlayers = new ArrayList<AbstractClientPlayer>();
|
||||
|
||||
public static CapeEventHandler instance;
|
||||
|
||||
public CapeEventHandler()
|
||||
{
|
||||
buildCloakURLDatabase();
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
public void onPreRenderSpecials(RenderPlayerEvent.Specials.Pre event) {
|
||||
if (Loader.isModLoaded("shadersmod"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (event.entityPlayer instanceof AbstractClientPlayer)
|
||||
{
|
||||
AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) event.entityPlayer;
|
||||
|
||||
if (!capePlayers.contains(abstractClientPlayer))
|
||||
{
|
||||
String cloakURL = cloaks.get(event.entityPlayer.username);
|
||||
|
||||
if (cloakURL == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
capePlayers.add(abstractClientPlayer);
|
||||
|
||||
ReflectionHelper.setPrivateValue(ThreadDownloadImageData.class, abstractClientPlayer.getTextureCape(), false, new String[] { "textureUploaded", "field_110559_g" });
|
||||
|
||||
new Thread(new CloakThread(abstractClientPlayer, cloakURL)).start();
|
||||
event.renderCape = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void buildCloakURLDatabase() {
|
||||
URL url;
|
||||
try
|
||||
{
|
||||
url = new URL(serverLocation);
|
||||
URLConnection con = url.openConnection();
|
||||
con.setConnectTimeout(timeout);
|
||||
con.setReadTimeout(timeout);
|
||||
InputStream io = con.getInputStream();
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(io));
|
||||
|
||||
String str;
|
||||
int linetracker = 1;
|
||||
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
|
||||
{
|
||||
System.err.println("[Electro-Magic Tools] [skins.txt] Syntax error on line " + linetracker + ": " + str);
|
||||
}
|
||||
}
|
||||
linetracker++;
|
||||
}
|
||||
|
||||
br.close();
|
||||
} catch (MalformedURLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
} catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private class CloakThread implements Runnable
|
||||
{
|
||||
AbstractClientPlayer abstractClientPlayer;
|
||||
String cloakURL;
|
||||
|
||||
public CloakThread(AbstractClientPlayer player, String cloak)
|
||||
{
|
||||
abstractClientPlayer = player;
|
||||
cloakURL = cloak;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
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)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class CloakPreload implements Runnable
|
||||
{
|
||||
String cloakURL;
|
||||
|
||||
public CloakPreload(String link)
|
||||
{
|
||||
cloakURL = link;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try
|
||||
{
|
||||
TEST_GRAPHICS.drawImage(new ImageIcon(new URL(cloakURL)).getImage(), 0, 0, null);
|
||||
} catch (MalformedURLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshCapes() {
|
||||
cloaks.clear();
|
||||
capePlayers.clear();
|
||||
buildCloakURLDatabase();
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*******************************************************************************
|
||||
* 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.client;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
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
|
||||
{
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
registerRenders();
|
||||
}
|
||||
|
||||
public void registerRenders() {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityArcher.class, new RenderArcher());
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/*******************************************************************************
|
||||
* 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.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;
|
||||
|
||||
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 GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te)
|
||||
{
|
||||
super(new ContainerEtheralMacerator(inventory, te));
|
||||
xSize = 176;
|
||||
ySize = 165;
|
||||
}
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("electricmagictools", "textures/guis/etherealmacerator.png");
|
||||
|
||||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/*******************************************************************************
|
||||
* 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.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;
|
||||
|
||||
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 GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te)
|
||||
{
|
||||
super(new ContainerIndustrialWandRecharge(inventory, te));
|
||||
xSize = 176;
|
||||
ySize = 165;
|
||||
}
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("electricmagictools", "textures/guis/wandcharger.png");
|
||||
|
||||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
/*******************************************************************************
|
||||
* 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.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
|
||||
{
|
||||
|
||||
public static Block essentiaGens;
|
||||
public static Block shield;
|
||||
public static Block emtSolars;
|
||||
public static Block emtMachines;
|
||||
public static Block emtSolars2;
|
||||
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");
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/*******************************************************************************
|
||||
* 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.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.client.gui.GuiEtherealMacerator;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.client.gui.GuiIndustrialWandRecharger;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEtherealMacerator;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityIndustrialWandRecharge;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerEtheralMacerator;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerIndustrialWandRecharge;
|
||||
|
||||
public class CommonProxy implements IGuiHandler
|
||||
{
|
||||
|
||||
public void load() {
|
||||
registerRenders();
|
||||
}
|
||||
|
||||
public void registerRenders() {
|
||||
/* Empty in common proxy */
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity entity = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
switch (ID)
|
||||
{
|
||||
case 0:
|
||||
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge)
|
||||
{
|
||||
return new ContainerIndustrialWandRecharge(player.inventory, (TileEntityIndustrialWandRecharge) entity);
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
case 1:
|
||||
if (entity != null && entity instanceof TileEntityEtherealMacerator)
|
||||
{
|
||||
return new ContainerEtheralMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity entity = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
switch (ID)
|
||||
{
|
||||
case 0:
|
||||
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge)
|
||||
{
|
||||
return new GuiIndustrialWandRecharger(player.inventory, (TileEntityIndustrialWandRecharge) entity);
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
case 1:
|
||||
if (entity != null && entity instanceof TileEntityEtherealMacerator)
|
||||
{
|
||||
return new GuiEtherealMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
/*******************************************************************************
|
||||
* 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.minecraftforge.common.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 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 double potentiaGenOutput;
|
||||
public static double arborGenOutput;
|
||||
public static double auramGenOutput;
|
||||
public static double ignisGenOutput;
|
||||
public static double saxumGenOutput;
|
||||
public static double wandChargerConsumption;
|
||||
public static double compressedSolarOutput;
|
||||
public static double doubleCompressedSolarOutput;
|
||||
public static double nanoBootsSpeed;
|
||||
public static double quantumBootsSpeed;
|
||||
public static double nanoBootsJump;
|
||||
public static double quantumBootsJump;
|
||||
public static double tripleCompressedSolarOutput;
|
||||
|
||||
public static boolean capesOn;
|
||||
public static boolean toolsInBore;
|
||||
public static boolean nightVisionOff;
|
||||
public static boolean enchanting;
|
||||
public static boolean smoke;
|
||||
|
||||
public static boolean thaumiumDrillResearch;
|
||||
public static boolean thaumiumChainsawResearch;
|
||||
public static boolean thaumiumOmnitoolResearch;
|
||||
public static boolean rockbreakerDrillResearch;
|
||||
public static boolean streamChainsawResearch;
|
||||
public static boolean electricGooglesResearch;
|
||||
public static boolean nanoGooglesResearch;
|
||||
public static boolean quantumGooglesResearch;
|
||||
public static boolean ironOmnitoolResearch;
|
||||
public static boolean diamondOmnitoolResearch;
|
||||
public static boolean explosionFocusResearch;
|
||||
public static boolean christmasFocusResearch;
|
||||
public static boolean shieldFocusResearch;
|
||||
public static boolean shieldBlockResearch;
|
||||
public static boolean potentiaGeneratorResearch;
|
||||
public static boolean ignisGeneratorResearch;
|
||||
public static boolean auramGeneratorResearch;
|
||||
public static boolean arborGeneratorResearch;
|
||||
public static boolean wandChargingSationResearch;
|
||||
public static boolean tinyUraniumResearch;
|
||||
public static boolean thorHammerResearch;
|
||||
public static boolean superchargedThorHammerResearch;
|
||||
public static boolean compressedSolarsResearch;
|
||||
public static boolean solarHelmetResearch;
|
||||
public static boolean electricBootsResearch;
|
||||
public static boolean nanoBootsResearch;
|
||||
public static boolean quantumBootsResearch;
|
||||
public static boolean electricScribingToolsResearch;
|
||||
public static boolean etherealProcessorResearch;
|
||||
public static boolean waterSolarsResearch;
|
||||
public static boolean darkSolarsResearch;
|
||||
public static boolean orderSolarsResearch;
|
||||
public static boolean fireSolarsResearch;
|
||||
public static boolean airSolarsResearch;
|
||||
public static boolean earthSolarsResearch;
|
||||
public static boolean saxumGenResearch;
|
||||
public static boolean uuMInfusionResearch;
|
||||
public static boolean portableNodeResarch;
|
||||
public static boolean electricHoeGrowthResearch;
|
||||
public static boolean chargeFocusResearch;
|
||||
|
||||
public static String CATEGORY_RESEARCH = "Research";
|
||||
public static String CATEGORY_VALUES = "Numeric Values";
|
||||
|
||||
public static void create(FMLPreInitializationEvent event) {
|
||||
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
|
||||
config.addCustomCategoryComment(CATEGORY_VALUES, "The only way to change some numbers that my machines uses.");
|
||||
config.addCustomCategoryComment(CATEGORY_RESEARCH, "The only way to disable some researches. " + "Be careful, if you disable some researches, " + "all researches linked to it will be removed too. " + "Really, don't touch that unless you know exactly what you are doing.");
|
||||
|
||||
config.load();
|
||||
|
||||
// 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);
|
||||
smoke = config.get(Configuration.CATEGORY_GENERAL, "Disable the smoke effect for the Electric/Nano/Quantum Boots of the Traveller", false).getBoolean(smoke);
|
||||
|
||||
// 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
|
||||
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();
|
||||
|
||||
// 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);
|
||||
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/*******************************************************************************
|
||||
* 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.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
/*******************************************************************************
|
||||
* 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) {
|
||||
}
|
||||
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/*******************************************************************************
|
||||
* 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.Entity;
|
||||
import net.minecraft.entity.EntityEggInfo;
|
||||
import net.minecraft.entity.EntityList;
|
||||
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
|
||||
{
|
||||
|
||||
private static int startEID = 300;
|
||||
private static int entityIDs = 0;
|
||||
private static final Class<? extends EntityLiving> ARCHER_CLASS = EntityArcher.class;
|
||||
|
||||
private static int getUniqueEntityID() {
|
||||
|
||||
do
|
||||
{
|
||||
startEID++;
|
||||
} while (EntityList.getStringFromID(startEID) != null);
|
||||
return startEID;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void registerEntityEgg(Class<? extends Entity> entity, int colPrim, int colSec) {
|
||||
int id = getUniqueEntityID();
|
||||
EntityList.IDtoClassMapping.put(id, entity);
|
||||
EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec));
|
||||
return;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
/*******************************************************************************
|
||||
* 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-
|
||||
*
|
||||
* Attention: this class originally belongs to the ThaumicTinkerer mod.
|
||||
* All I did was modifying it to fulfill my needs.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* http://www.minecraftforum.net/topic/1813058-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.api.research.ResearchPage.PageType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EMTResearchItem extends ResearchItem
|
||||
{
|
||||
|
||||
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)
|
||||
{
|
||||
super(par1, par2, tags, par3, par4, par5, 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getName() {
|
||||
return StatCollector.translateToLocal(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getText() {
|
||||
return StatCollector.translateToLocal("[EMT] ") + StatCollector.translateToLocal("emt.tag." + key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResearchItem setPages(ResearchPage... par) {
|
||||
for (ResearchPage page : par)
|
||||
{
|
||||
if (page.type == PageType.TEXT)
|
||||
page.text = "emt.text." + key;
|
||||
|
||||
if (page.type == PageType.INFUSION_CRAFTING)
|
||||
{
|
||||
if (parentsHidden == null || parentsHidden.length == 0)
|
||||
parentsHidden = new String[] { "INFUSION" };
|
||||
else
|
||||
{
|
||||
String[] newParents = new String[parentsHidden.length + 1];
|
||||
newParents[0] = "INFUSION";
|
||||
for (int i = 0; i < parentsHidden.length; i++)
|
||||
newParents[i + 1] = parentsHidden[i];
|
||||
parentsHidden = newParents;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.setPages(par);
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
/*******************************************************************************
|
||||
* 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.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
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;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.recipes.EMTInitRecipes;
|
||||
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
|
||||
{
|
||||
|
||||
@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";
|
||||
|
||||
@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());
|
||||
|
||||
System.out.println("[EMT] Electro-Magic Tools : Successful PreInit");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent event) {
|
||||
/** Loading the proxies **/
|
||||
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();
|
||||
|
||||
/** Tile entities registry **/
|
||||
TileEntityRegistry.registerEMTTileEntites();
|
||||
|
||||
/** Generating in dungeon chests **/
|
||||
if (Config.thorHammerResearch == false)
|
||||
{
|
||||
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(ItemRegistry.taintedThorHammer), 1, 1, 5));
|
||||
}
|
||||
|
||||
/** Adding the recipes that go in Init **/
|
||||
EMTInitRecipes.add();
|
||||
|
||||
/** Entities Registry **/
|
||||
EMTEntityRegistry.registerEMTEntities();
|
||||
|
||||
/** GUI Handler Registry **/
|
||||
NetworkRegistry.instance().registerGuiHandler(this, proxy);
|
||||
|
||||
/** Adds Capes **/
|
||||
if (event.getSide() == Side.CLIENT && Config.capesOn == true)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(new CapeEventHandler());
|
||||
}
|
||||
|
||||
System.out.println("[EMT] Electro-Magic Tools : Successful Init");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
/** Adding the recipes that go in PostInit **/
|
||||
EMTPostInitRecipes.add();
|
||||
|
||||
/** Adding the UU-Matter Infusion recipes **/
|
||||
UuMInfusionRecipes.add();
|
||||
|
||||
/** Adding the EMT research tab to the Thaumonomicon **/
|
||||
ThaumonomiconResearch.addResearchTab();
|
||||
|
||||
/** Adding the actual research to the game **/
|
||||
ThaumonomiconResearch.addResearch();
|
||||
|
||||
System.out.println("[EMT] Electro-Magic Tools : Successful PostInit");
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*******************************************************************************
|
||||
* 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.monster.EntityCreeper;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
|
||||
public class EntityLivingHandler
|
||||
{
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
/*******************************************************************************
|
||||
* 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.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemEMTItems;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemElectricScribingTools;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemLightningSummoner;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.ItemThaumiumPlate;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.armor.ItemElectricBootsTraveller;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.armor.ItemElectricGoggles;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.armor.ItemNanoBootsTraveller;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.armor.ItemNanoThaumicHelmet;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.armor.ItemQuantumBootsTraveller;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.armor.ItemQuantumThaumicHelmet;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.armor.ItemSolarHelmetRevealing;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.foci.ItemChargeFocus;
|
||||
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.tools.ItemDiamondChainsaw;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemElectricHoeGrowth;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemOmnitoolDiamond;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemOmnitoolIron;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemOmnitoolThaumium;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemRockbreakerDrill;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemStreamChainsaw;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemThaumiumChainsaw;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.ItemThaumiumDrill;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.hammer.ItemElectricThorHammer;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.hammer.ItemTaintedThorHammer;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.items.tools.hammer.ItemThorHammer;
|
||||
|
||||
public class ItemRegistry
|
||||
{
|
||||
|
||||
public static Item thaumiumDrill;
|
||||
public static Item thaumiumChainsaw;
|
||||
public static Item quantumThaumicHelmet;
|
||||
public static Item diamondChainsaw;
|
||||
public static Item ironOmnitool;
|
||||
public static Item diamondOmnitool;
|
||||
public static Item thaumiumOmnitool;
|
||||
public static Item nanoThaumicHelmet;
|
||||
public static Item explosionFocus;
|
||||
public static Item christmasFocus;
|
||||
public static Item shieldFocus;
|
||||
public static Item electricGoggles;
|
||||
public static Item streamChainsaw;
|
||||
public static Item rockbreakerDrill;
|
||||
public static Item thaumiumPlate;
|
||||
public static Item solarHelmetRevealing;
|
||||
public static Item thorHammer;
|
||||
public static Item taintedThorHammer;
|
||||
public static Item electricThorHammer;
|
||||
public static Item lightningSummoner;
|
||||
public static Item electricBootsTraveller;
|
||||
public static Item quantumBootsTraveller;
|
||||
public static Item nanoBootsTraveller;
|
||||
public static Item electricScribingTools;
|
||||
public static Item itemEMTItems;
|
||||
public static Item electricHoeGrowth;
|
||||
public static Item chargeFocus;
|
||||
|
||||
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");
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
# 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.
|
||||
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
+418
@@ -0,0 +1,418 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.item.Items;
|
||||
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 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() {
|
||||
ResearchItem research;
|
||||
String text;
|
||||
// String text2;
|
||||
|
||||
/** Research that can't be disabled **/
|
||||
text = "1";
|
||||
research = new EMTResearchItem("Electric Magic Tools", "EMT", new AspectList(), 0, 0, 0, new ResourceLocation("electricmagictools:textures/misc/emt.png")).setRound().setAutoUnlock().registerResearchItem();
|
||||
research.setPages(new ResearchPage(text));
|
||||
|
||||
text = "1";
|
||||
research = new EMTResearchItem("Diamond Chainsaw", "EMT", new AspectList(), 5, -6, 0, new ItemStack(ItemRegistry.diamondChainsaw)).setRound().setAutoUnlock().registerResearchItem();
|
||||
research.setPages(new ResearchPage(text), new ResearchPage(EMTInitRecipes.diamondChainsaw));
|
||||
|
||||
text = "1";
|
||||
research = new EMTResearchItem("Thaumium Plate", "EMT", new AspectList(), 6, -6, 0, new ItemStack(ItemRegistry.thaumiumPlate)).setRound().setAutoUnlock().registerResearchItem();
|
||||
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.setPages(new ResearchPage(text));
|
||||
|
||||
text = "1";
|
||||
research = new EMTResearchItem("The Legend", "EMT", new AspectList(), 5, -5, 0, new ItemStack(ItemRegistry.taintedThorHammer)).setRound().setAutoUnlock().registerResearchItem();
|
||||
research.setPages(new ResearchPage(text));
|
||||
|
||||
text = "1";
|
||||
research = new EMTResearchItem("Lightning Summoner", "EMT", new AspectList(), 6, -5, 0, new ItemStack(ItemRegistry.lightningSummoner)).setRound().setAutoUnlock().registerResearchItem();
|
||||
research.setPages(new ResearchPage(text));
|
||||
|
||||
/** Research that can be disabled **/
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
// if(Config.potentiaGeneratorResearch == false) {
|
||||
// if(Config.wandChargingSationResearch = false) {
|
||||
text = "1";
|
||||
research = new EMTResearchItem("Industrial Wand Charging Station", "EMT", ResearchAspects.wandCharger, -4, 2, 3, new ItemStack(BlockRegistry.emtMachines, 1, 0)).setParents("Potentia Generator").registerResearchItem();
|
||||
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.wandRecharger));
|
||||
// }
|
||||
// }
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
text = "1";
|
||||
research = new EMTResearchItem("Tiny Uranium", "EMT", ResearchAspects.tinyUraniumResearch, -5, -5, 1, Items.getItem("Uran238")).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem();
|
||||
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.tinyUranium));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
text = "1";
|
||||
research = new EMTResearchItem("Solar Helmet of Revealing", "EMT", ResearchAspects.solarHelmetRevealing, -2, -5, 1, new ItemStack(ItemRegistry.solarHelmetRevealing)).setSecondary().setParents("Compressed Solars").registerResearchItem();
|
||||
research.setPages(new ResearchPage(text), new ResearchPage(EMTPostInitRecipes.solarHelmetRevealing));
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*******************************************************************************
|
||||
* 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 cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class TileEntityRegistry
|
||||
{
|
||||
|
||||
public static void registerEMTTileEntites() {
|
||||
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityPotentiaGenerator.class, "tileentityessentiagenerator");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityIgnisGenerator.class, "tileentityignisgenerator");
|
||||
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.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.TileEntityPortableNode.class, "tileentityportablenode");
|
||||
}
|
||||
|
||||
}
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
/*******************************************************************************
|
||||
* 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.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
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.ElectricMagicTools;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEtherealMacerator;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityIndustrialWandRecharge;
|
||||
|
||||
public class BlockEMTMachines extends BlockContainer
|
||||
{
|
||||
|
||||
public Icon[] wandCharger = new Icon[4];
|
||||
public Icon[] etherealProcessor = new Icon[4];
|
||||
|
||||
public BlockEMTMachines(int id)
|
||||
{
|
||||
super(id, 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");
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int 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)
|
||||
{
|
||||
return this.wandCharger[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.wandCharger[3];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 1)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.etherealProcessor[1];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.etherealProcessor[0];
|
||||
}
|
||||
if (side == 2)
|
||||
{
|
||||
return this.etherealProcessor[3];
|
||||
}
|
||||
if (side == 3)
|
||||
{
|
||||
return this.etherealProcessor[3];
|
||||
}
|
||||
}
|
||||
return this.etherealProcessor[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)
|
||||
{
|
||||
return new TileEntityIndustrialWandRecharge();
|
||||
}
|
||||
if (meta == 1)
|
||||
{
|
||||
return new TileEntityEtherealMacerator();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
player.openGui(ElectricMagicTools.instance, 0, world, x, y, z);
|
||||
} else if (!world.isRemote && world.getBlockTileEntity(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) {
|
||||
dropItems(world, x, y, z);
|
||||
world.removeBlockTileEntity(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))
|
||||
{
|
||||
return;
|
||||
}
|
||||
IInventory inventory = (IInventory) tileEntity;
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack item = inventory.getStackInSlot(i);
|
||||
|
||||
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()));
|
||||
|
||||
if (item.hasTagCompound())
|
||||
{
|
||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float factor = 0.05F;
|
||||
entityItem.motionX = rand.nextGaussian() * factor;
|
||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
item.stackSize = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+499
@@ -0,0 +1,499 @@
|
||||
/*******************************************************************************
|
||||
* 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.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
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;
|
||||
|
||||
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 BlockEMTSolars(int id)
|
||||
{
|
||||
super(id, Material.iron);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setHardness(4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister 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");
|
||||
|
||||
this.doubleCompressedSolar[0] = ri.registerIcon("electricmagictools:solars/doublesolartop");
|
||||
this.doubleCompressedSolar[1] = ri.registerIcon("electricmagictools:solars/side");
|
||||
this.doubleCompressedSolar[2] = ri.registerIcon("electricmagictools:solars/bottom");
|
||||
|
||||
this.tripleCompressedSolar[0] = ri.registerIcon("electricmagictools:solars/triplesolartop");
|
||||
this.tripleCompressedSolar[1] = ri.registerIcon("electricmagictools:solars/side");
|
||||
this.tripleCompressedSolar[2] = ri.registerIcon("electricmagictools:solars/bottom");
|
||||
|
||||
this.waterSolar[0] = ri.registerIcon("electricmagictools:solars/solartop");
|
||||
this.waterSolar[1] = ri.registerIcon("electricmagictools:solars/waterside");
|
||||
this.waterSolar[2] = ri.registerIcon("electricmagictools:solars/waterbottom");
|
||||
|
||||
this.doubleWaterSolar[0] = ri.registerIcon("electricmagictools:solars/doublesolartop");
|
||||
this.doubleWaterSolar[1] = ri.registerIcon("electricmagictools:solars/waterside");
|
||||
this.doubleWaterSolar[2] = ri.registerIcon("electricmagictools:solars/waterbottom");
|
||||
|
||||
this.tripleWaterSolar[0] = ri.registerIcon("electricmagictools:solars/triplesolartop");
|
||||
this.tripleWaterSolar[1] = ri.registerIcon("electricmagictools:solars/waterside");
|
||||
this.tripleWaterSolar[2] = ri.registerIcon("electricmagictools:solars/waterbottom");
|
||||
|
||||
this.darkSolar[0] = ri.registerIcon("electricmagictools:solars/solartop");
|
||||
this.darkSolar[1] = ri.registerIcon("electricmagictools:solars/darkside");
|
||||
this.darkSolar[2] = ri.registerIcon("electricmagictools:solars/darkbottom");
|
||||
|
||||
this.doubleDarkSolar[0] = ri.registerIcon("electricmagictools:solars/doublesolartop");
|
||||
this.doubleDarkSolar[1] = ri.registerIcon("electricmagictools:solars/darkside");
|
||||
this.doubleDarkSolar[2] = ri.registerIcon("electricmagictools:solars/darkbottom");
|
||||
|
||||
this.tripleDarkSolar[0] = ri.registerIcon("electricmagictools:solars/triplesolartop");
|
||||
this.tripleDarkSolar[1] = ri.registerIcon("electricmagictools:solars/darkside");
|
||||
this.tripleDarkSolar[2] = ri.registerIcon("electricmagictools:solars/darkbottom");
|
||||
|
||||
this.orderSolar[0] = ri.registerIcon("electricmagictools:solars/solartop");
|
||||
this.orderSolar[1] = ri.registerIcon("electricmagictools:solars/orderside");
|
||||
this.orderSolar[2] = ri.registerIcon("electricmagictools:solars/orderbottom");
|
||||
|
||||
this.doubleOrderSolar[0] = ri.registerIcon("electricmagictools:solars/doublesolartop");
|
||||
this.doubleOrderSolar[1] = ri.registerIcon("electricmagictools:solars/orderside");
|
||||
this.doubleOrderSolar[2] = ri.registerIcon("electricmagictools:solars/orderbottom");
|
||||
|
||||
this.tripleOrderSolar[0] = ri.registerIcon("electricmagictools:solars/triplesolartop");
|
||||
this.tripleOrderSolar[1] = ri.registerIcon("electricmagictools:solars/orderside");
|
||||
this.tripleOrderSolar[2] = ri.registerIcon("electricmagictools:solars/orderbottom");
|
||||
|
||||
this.fireSolar[0] = ri.registerIcon("electricmagictools:solars/solartop");
|
||||
this.fireSolar[1] = ri.registerIcon("electricmagictools:solars/fireside");
|
||||
this.fireSolar[2] = ri.registerIcon("electricmagictools:solars/firebottom");
|
||||
|
||||
this.doubleFireSolar[0] = ri.registerIcon("electricmagictools:solars/doublesolartop");
|
||||
this.doubleFireSolar[1] = ri.registerIcon("electricmagictools:solars/fireside");
|
||||
this.doubleFireSolar[2] = ri.registerIcon("electricmagictools:solars/firebottom");
|
||||
|
||||
this.tripleFireSolar[0] = ri.registerIcon("electricmagictools:solars/triplesolartop");
|
||||
this.tripleFireSolar[1] = ri.registerIcon("electricmagictools:solars/fireside");
|
||||
this.tripleFireSolar[2] = ri.registerIcon("electricmagictools:solars/firebottom");
|
||||
|
||||
this.airSolar[0] = ri.registerIcon("electricmagictools:solars/solartop");
|
||||
this.airSolar[1] = ri.registerIcon("electricmagictools:solars/airside");
|
||||
this.airSolar[2] = ri.registerIcon("electricmagictools:solars/airbottom");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubBlocks(int 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));
|
||||
list.add(new ItemStack(id, 1, 5));
|
||||
list.add(new ItemStack(id, 1, 6));
|
||||
list.add(new ItemStack(id, 1, 7));
|
||||
list.add(new ItemStack(id, 1, 8));
|
||||
list.add(new ItemStack(id, 1, 9));
|
||||
list.add(new ItemStack(id, 1, 10));
|
||||
list.add(new ItemStack(id, 1, 11));
|
||||
list.add(new ItemStack(id, 1, 12));
|
||||
list.add(new ItemStack(id, 1, 13));
|
||||
list.add(new ItemStack(id, 1, 14));
|
||||
list.add(new ItemStack(id, 1, 15));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int side, int meta) {
|
||||
if (meta == 0)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.compressedSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.compressedSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 1)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.doubleCompressedSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.doubleCompressedSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 2)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.tripleCompressedSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.tripleCompressedSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 3)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.waterSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.waterSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.waterSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 4)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.doubleWaterSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.doubleWaterSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.doubleWaterSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 5)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.tripleWaterSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.tripleWaterSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.tripleWaterSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 6)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.darkSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.darkSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.darkSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 7)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.doubleDarkSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.doubleDarkSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.doubleDarkSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 8)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.tripleDarkSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.tripleDarkSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.tripleDarkSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 9)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.orderSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.orderSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.orderSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 10)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.doubleOrderSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.doubleOrderSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.doubleOrderSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 11)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.tripleOrderSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.tripleOrderSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.tripleOrderSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 12)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.fireSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.fireSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.fireSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 13)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.doubleFireSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.doubleFireSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.doubleFireSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 14)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.tripleFireSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.tripleFireSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.tripleFireSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 15)
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
return this.airSolar[2];
|
||||
}
|
||||
if (side == 1)
|
||||
{
|
||||
return this.airSolar[0];
|
||||
}
|
||||
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)
|
||||
{
|
||||
return new TileEntityCompressedSolar();
|
||||
}
|
||||
if (meta == 1)
|
||||
{
|
||||
return new TileEntityDoubleCompressedSolar();
|
||||
}
|
||||
if (meta == 2)
|
||||
{
|
||||
return new TileEntityTripleCompressedSolar();
|
||||
}
|
||||
if (meta == 3)
|
||||
{
|
||||
return new TileEntityWaterSolar();
|
||||
}
|
||||
if (meta == 4)
|
||||
{
|
||||
return new TileEntityDoubleWaterSolar();
|
||||
}
|
||||
if (meta == 5)
|
||||
{
|
||||
return new TileEntityTripleWaterSolar();
|
||||
}
|
||||
if (meta == 6)
|
||||
{
|
||||
return new TileEntityDarkSolar();
|
||||
}
|
||||
if (meta == 7)
|
||||
{
|
||||
return new TileEntityDoubleDarkSolar();
|
||||
}
|
||||
if (meta == 8)
|
||||
{
|
||||
return new TileEntityTripleDarkSolar();
|
||||
}
|
||||
if (meta == 9)
|
||||
{
|
||||
return new TileEntityOrderSolar();
|
||||
}
|
||||
if (meta == 10)
|
||||
{
|
||||
return new TileEntityDoubleOrderSolar();
|
||||
}
|
||||
if (meta == 11)
|
||||
{
|
||||
return new TileEntityTripleOrderSolar();
|
||||
}
|
||||
if (meta == 12)
|
||||
{
|
||||
return new TileEntityFireSolar();
|
||||
}
|
||||
if (meta == 13)
|
||||
{
|
||||
return new TileEntityDoubleFireSolar();
|
||||
}
|
||||
if (meta == 14)
|
||||
{
|
||||
return new TileEntityTripleFireSolar();
|
||||
}
|
||||
if (meta == 15)
|
||||
{
|
||||
return new TileEntityAirSolar();
|
||||
}
|
||||
|
||||
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);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
/*******************************************************************************
|
||||
* 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.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
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;
|
||||
|
||||
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 BlockEMTSolars2(int id)
|
||||
{
|
||||
super(id, Material.iron);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setHardness(4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister 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");
|
||||
|
||||
this.doubleAirSolar[0] = ri.registerIcon("electricmagictools:solars/doublesolartop");
|
||||
this.doubleAirSolar[1] = ri.registerIcon("electricmagictools:solars/airside");
|
||||
this.doubleAirSolar[2] = ri.registerIcon("electricmagictools:solars/airbottom");
|
||||
|
||||
this.tripleAirSolar[0] = ri.registerIcon("electricmagictools:solars/triplesolartop");
|
||||
this.tripleAirSolar[1] = ri.registerIcon("electricmagictools:solars/airside");
|
||||
this.tripleAirSolar[2] = ri.registerIcon("electricmagictools:solars/airbottom");
|
||||
|
||||
this.earthSolar[0] = ri.registerIcon("electricmagictools:solars/solartop");
|
||||
this.earthSolar[1] = ri.registerIcon("electricmagictools:solars/earthside");
|
||||
this.earthSolar[2] = ri.registerIcon("electricmagictools:solars/earthbottom");
|
||||
|
||||
this.doubleEarthSolar[0] = ri.registerIcon("electricmagictools:solars/doublesolartop");
|
||||
this.doubleEarthSolar[1] = ri.registerIcon("electricmagictools:solars/earthside");
|
||||
this.doubleEarthSolar[2] = ri.registerIcon("electricmagictools:solars/earthbottom");
|
||||
|
||||
this.tripleEarthSolar[0] = ri.registerIcon("electricmagictools:solars/triplesolartop");
|
||||
this.tripleEarthSolar[1] = ri.registerIcon("electricmagictools:solars/earthside");
|
||||
this.tripleEarthSolar[2] = ri.registerIcon("electricmagictools:solars/earthbottom");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void getSubBlocks(int 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)
|
||||
{
|
||||
return this.doubleAirSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.doubleAirSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 1)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.tripleAirSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.tripleAirSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 2)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.earthSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.earthSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 3)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.doubleEarthSolar[0];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.doubleEarthSolar[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 4)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.tripleEarthSolar[0];
|
||||
}
|
||||
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)
|
||||
{
|
||||
return new TileEntityDoubleAirSolar();
|
||||
}
|
||||
if (meta == 1)
|
||||
{
|
||||
return new TileEntityTripleAirSolar();
|
||||
}
|
||||
if (meta == 2)
|
||||
{
|
||||
return new TileEntityEarthSolar();
|
||||
}
|
||||
if (meta == 3)
|
||||
{
|
||||
return new TileEntityDoubleEarthSolar();
|
||||
}
|
||||
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);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
/*******************************************************************************
|
||||
* 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.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
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.TileEntityArborGenerator;
|
||||
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 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 BlockEssentiaGenerators(int id)
|
||||
{
|
||||
super(id, Material.iron);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setHardness(4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister 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");
|
||||
|
||||
this.ignisGen[0] = ri.registerIcon("electricmagictools:essentiagenerator/ignisfront");
|
||||
this.ignisGen[1] = ri.registerIcon("electricmagictools:essentiagenerator/side");
|
||||
this.ignisGen[2] = ri.registerIcon("electricmagictools:essentiagenerator/top");
|
||||
|
||||
this.auramGen[0] = ri.registerIcon("electricmagictools:essentiagenerator/auramfront");
|
||||
this.auramGen[1] = ri.registerIcon("electricmagictools:essentiagenerator/side");
|
||||
this.auramGen[2] = ri.registerIcon("electricmagictools:essentiagenerator/top");
|
||||
|
||||
this.arborGen[0] = ri.registerIcon("electricmagictools:essentiagenerator/arborfront");
|
||||
this.arborGen[1] = ri.registerIcon("electricmagictools:essentiagenerator/side");
|
||||
this.arborGen[2] = ri.registerIcon("electricmagictools:essentiagenerator/top");
|
||||
|
||||
this.saxumGen[0] = ri.registerIcon("electricmagictools:essentiagenerator/saxumfront");
|
||||
this.saxumGen[1] = ri.registerIcon("electricmagictools:essentiagenerator/side");
|
||||
this.saxumGen[2] = ri.registerIcon("electricmagictools:essentiagenerator/top");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int 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)
|
||||
{
|
||||
return this.potentiaGen[2];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.potentiaGen[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 1)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.ignisGen[2];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.ignisGen[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 2)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.auramGen[2];
|
||||
}
|
||||
if (side > 1)
|
||||
{
|
||||
return this.auramGen[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == 3)
|
||||
{
|
||||
if (side == 1)
|
||||
{
|
||||
return this.arborGen[2];
|
||||
}
|
||||
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)
|
||||
{
|
||||
return new TileEntityPotentiaGenerator();
|
||||
}
|
||||
if (meta == 1)
|
||||
{
|
||||
return new TileEntityIgnisGenerator();
|
||||
}
|
||||
if (meta == 2)
|
||||
{
|
||||
return new TileEntityAuramGenerator();
|
||||
}
|
||||
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);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
|
||||
float f = (float) par2 + 0.5F;
|
||||
float f1 = (float) par3 + 1.0F;
|
||||
float f2 = (float) par4 + 0.5F;
|
||||
par1World.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
/*******************************************************************************
|
||||
* 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.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.blocks.BlockAiry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
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 Icon[] texture = new Icon[1];
|
||||
|
||||
public BlockPortableNode(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
setBlockUnbreakable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int meta) {
|
||||
return new TileEntityPortableNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean canEntityDestroy(World world, int x, int y, int z, Entity entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
|
||||
}
|
||||
|
||||
public boolean canDragonDestroy(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister ri) {
|
||||
this.texture[0] = ri.registerIcon("electricmagictools:portablenode");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int side, int meta) {
|
||||
return this.texture[0];
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int 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)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.removeBlockTileEntity(x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*******************************************************************************
|
||||
* 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.blocks;
|
||||
|
||||
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.entity.Entity;
|
||||
import net.minecraft.world.Explosion;
|
||||
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 BlockShield extends Block
|
||||
{
|
||||
|
||||
public BlockShield(int id)
|
||||
{
|
||||
super(id, Material.rock);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setHardness(1F);
|
||||
this.setResistance(200000000F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon("electricmagictools:shield");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean canEntityDestroy(World world, int x, int y, int z, Entity entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
|
||||
}
|
||||
|
||||
public boolean canDragonDestroy(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
/*******************************************************************************
|
||||
* 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.entities;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
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.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityArcher extends EntitySnowman
|
||||
{
|
||||
|
||||
public EntityArcher(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
this.isImmuneToFire = true;
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
|
||||
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(40.0D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource par1DamageSource) {
|
||||
super.onDeath(par1DamageSource);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true);
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDropItemId() {
|
||||
return Item.arrow.itemID;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropFewItems(boolean par1, int par2) {
|
||||
int j;
|
||||
int k;
|
||||
|
||||
j = this.rand.nextInt(3 + par2);
|
||||
|
||||
for (k = 0; k < j; ++k)
|
||||
{
|
||||
this.dropItem(Item.arrow.itemID, 1);
|
||||
}
|
||||
j = this.rand.nextInt(3 + par2);
|
||||
|
||||
for (k = 0; k < j; ++k)
|
||||
{
|
||||
this.dropItem(Item.bone.itemID, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dropRareDrop(int par1) {
|
||||
this.entityDropItem(new ItemStack(Block.web.blockID, 1, 1), 0.0F);
|
||||
}
|
||||
|
||||
protected void addRandomArmor() {
|
||||
super.addRandomArmor();
|
||||
this.setCurrentItemOrArmor(0, new ItemStack(Item.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));
|
||||
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));
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D);
|
||||
}
|
||||
|
||||
if (j > 0)
|
||||
{
|
||||
entityarrow.setKnockbackStrength(j);
|
||||
}
|
||||
|
||||
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0)
|
||||
{
|
||||
entityarrow.setFire(100);
|
||||
}
|
||||
|
||||
this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
|
||||
this.worldObj.spawnEntityInWorld(entityarrow);
|
||||
}
|
||||
|
||||
}
|
||||
+369
@@ -0,0 +1,369 @@
|
||||
/*******************************************************************************
|
||||
* 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.entities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EntityLaser extends Entity implements IProjectile
|
||||
{
|
||||
private int xTile = -1;
|
||||
private int yTile = -1;
|
||||
private int zTile = -1;
|
||||
private int inTile;
|
||||
private int inData;
|
||||
private boolean inGround;
|
||||
|
||||
public Entity shootingEntity;
|
||||
private int ticksInGround;
|
||||
private int ticksInAir;
|
||||
|
||||
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)
|
||||
{
|
||||
super(par1World);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setPosition(par2, par4, par6);
|
||||
this.yOffset = 0.0F;
|
||||
}
|
||||
|
||||
public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5)
|
||||
{
|
||||
super(par1World);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = par2EntityLivingBase;
|
||||
|
||||
this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D;
|
||||
double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX;
|
||||
double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 3.0F) - this.posY;
|
||||
double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ;
|
||||
double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);
|
||||
|
||||
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;
|
||||
double d5 = d2 / d3;
|
||||
this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3);
|
||||
this.yOffset = 0.0F;
|
||||
float f4 = (float) d3 * 0.2F;
|
||||
this.setThrowableHeading(d0, d1 + (double) f4, d2, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, float par3)
|
||||
{
|
||||
super(par1World);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = par2EntityLivingBase;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch);
|
||||
this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
|
||||
this.posY -= 0.10000000149011612D;
|
||||
this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.yOffset = 0.0F;
|
||||
this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||
this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||
this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) {
|
||||
float f2 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5);
|
||||
par1 /= (double) f2;
|
||||
par3 /= (double) f2;
|
||||
par5 /= (double) f2;
|
||||
par1 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8;
|
||||
par3 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8;
|
||||
par5 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8;
|
||||
par1 *= (double) par7;
|
||||
par3 *= (double) par7;
|
||||
par5 *= (double) par7;
|
||||
this.motionX = par1;
|
||||
this.motionY = par3;
|
||||
this.motionZ = par5;
|
||||
float f3 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
|
||||
this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, (double) f3) * 180.0D / Math.PI);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) {
|
||||
this.setPosition(par1, par3, par5);
|
||||
this.setRotation(par7, par8);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setVelocity(double par1, double par3, double par5) {
|
||||
this.motionX = par1;
|
||||
this.motionY = par3;
|
||||
this.motionZ = par5;
|
||||
|
||||
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);
|
||||
this.prevRotationPitch = this.rotationPitch;
|
||||
this.prevRotationYaw = this.rotationYaw;
|
||||
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
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);
|
||||
|
||||
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)))
|
||||
{
|
||||
this.inGround = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.inGround)
|
||||
{
|
||||
int j = this.worldObj.getBlockId(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)
|
||||
{
|
||||
++this.ticksInGround;
|
||||
|
||||
if (this.ticksInGround == 1200)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
} else
|
||||
{
|
||||
this.inGround = false;
|
||||
this.motionX *= (double) (this.rand.nextFloat() * 0.2F);
|
||||
this.motionY *= (double) (this.rand.nextFloat() * 0.2F);
|
||||
this.motionZ *= (double) (this.rand.nextFloat() * 0.2F);
|
||||
this.ticksInGround = 0;
|
||||
this.ticksInAir = 0;
|
||||
}
|
||||
} 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);
|
||||
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)
|
||||
{
|
||||
vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
double d0 = 0.0D;
|
||||
int l;
|
||||
float f1;
|
||||
|
||||
for (l = 0; l < list.size(); ++l)
|
||||
{
|
||||
Entity entity1 = (Entity) list.get(l);
|
||||
|
||||
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)
|
||||
{
|
||||
double d1 = vec3.distanceTo(movingobjectposition1.hitVec);
|
||||
|
||||
if (d1 < d0 || d0 == 0.0D)
|
||||
{
|
||||
entity = entity1;
|
||||
d0 = d1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
movingobjectposition = new MovingObjectPosition(entity);
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
movingobjectposition = null;
|
||||
}
|
||||
}
|
||||
|
||||
float f2;
|
||||
float f3;
|
||||
|
||||
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;
|
||||
this.motionZ *= -0.10000000149011612D;
|
||||
this.rotationYaw += 180.0F;
|
||||
this.prevRotationYaw += 180.0F;
|
||||
this.ticksInAir = 0;
|
||||
}
|
||||
} 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.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));
|
||||
this.motionZ = (double) ((float) (movingobjectposition.hitVec.zCoord - this.posZ));
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||
this.posX -= this.motionX / (double) f2 * 0.05000000074505806D;
|
||||
this.posY -= this.motionY / (double) f2 * 0.05000000074505806D;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
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)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
|
||||
{
|
||||
this.prevRotationPitch += 360.0F;
|
||||
}
|
||||
|
||||
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
|
||||
{
|
||||
this.prevRotationYaw -= 360.0F;
|
||||
}
|
||||
|
||||
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
|
||||
{
|
||||
this.prevRotationYaw += 360.0F;
|
||||
}
|
||||
|
||||
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
|
||||
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
|
||||
float f4 = 0.99F;
|
||||
f1 = 0.05F;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
f4 = 0.8F;
|
||||
}
|
||||
|
||||
this.motionX *= (double) f4;
|
||||
this.motionY *= (double) f4;
|
||||
this.motionZ *= (double) f4;
|
||||
this.motionY -= (double) f1;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.doBlockCollisions();
|
||||
}
|
||||
}
|
||||
|
||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
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("inData", (byte) this.inData);
|
||||
par1NBTTagCompound.setByte("inGround", (byte) (this.inGround ? 1 : 0));
|
||||
}
|
||||
|
||||
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
this.xTile = par1NBTTagCompound.getShort("xTile");
|
||||
this.yTile = par1NBTTagCompound.getShort("yTile");
|
||||
this.zTile = par1NBTTagCompound.getShort("zTile");
|
||||
this.inTile = par1NBTTagCompound.getByte("inTile") & 255;
|
||||
this.inData = par1NBTTagCompound.getByte("inData") & 255;
|
||||
this.inGround = par1NBTTagCompound.getByte("inGround") == 1;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize() {
|
||||
return 0.0F;
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/*******************************************************************************
|
||||
* 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.entities;
|
||||
|
||||
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
|
||||
{
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
/*******************************************************************************
|
||||
* 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.entities;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class RenderLaser extends Render
|
||||
{
|
||||
|
||||
private static final ResourceLocation laserTexture = new ResourceLocation("electricmagictools:textures/models/lasermodel.png");
|
||||
|
||||
public void renderArrow(EntityLaser entityLaser, double par2, double par4, double par6, float par8, float par9) {
|
||||
|
||||
this.bindEntityTexture(entityLaser);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) par2, (float) par4, (float) par6);
|
||||
GL11.glRotatef(entityLaser.prevRotationYaw + (entityLaser.rotationYaw - entityLaser.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(entityLaser.prevRotationPitch + (entityLaser.rotationPitch - entityLaser.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
byte b0 = 0;
|
||||
float f2 = 0.4F;
|
||||
float f3 = 0.7F;
|
||||
float f4 = (float) (0 + b0 * 10) / 32.0F;
|
||||
float f5 = (float) (5 + b0 * 10) / 32.0F;
|
||||
float f6 = 0.0F;
|
||||
float f7 = 0.15625F;
|
||||
float f8 = (float) (5 + b0 * 10) / 32.0F;
|
||||
float f9 = (float) (10 + b0 * 10) / 32.0F;
|
||||
float f10 = 0.05625F;
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glScalef(f10, f10, f10);
|
||||
GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f9);
|
||||
tessellator.draw();
|
||||
GL11.glNormal3f(-f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f9);
|
||||
tessellator.draw();
|
||||
|
||||
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();
|
||||
tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double) f2, (double) f4);
|
||||
tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double) f3, (double) f4);
|
||||
tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double) f3, (double) f5);
|
||||
tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double) f2, (double) f5);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
protected ResourceLocation getArrowTextures(EntityLaser entityLaser) {
|
||||
return laserTexture;
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
return this.getArrowTextures((EntityLaser) par1Entity);
|
||||
}
|
||||
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
|
||||
this.renderArrow((EntityLaser) par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemBlockEMTMachines extends ItemBlock
|
||||
{
|
||||
|
||||
public ItemBlockEMTMachines(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "wandrecharge";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "etheralprocessor";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
}
|
||||
+225
@@ -0,0 +1,225 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 ItemBlockEMTSolars(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "compressed";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "doublecompressed";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "triplecompressed";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "water";
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
name = "doublewater";
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
name = "triplewater";
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
name = "dark";
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
name = "doubledark";
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
name = "tripledark";
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
name = "order";
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
name = "doubleorder";
|
||||
break;
|
||||
}
|
||||
case 11:
|
||||
{
|
||||
name = "tripleorder";
|
||||
break;
|
||||
}
|
||||
case 12:
|
||||
{
|
||||
name = "fire";
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
name = "doublefire";
|
||||
break;
|
||||
}
|
||||
case 14:
|
||||
{
|
||||
name = "triplefire";
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
name = "air";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
list.add(Config.compressedSolarOutput + " EU/T");
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
list.add(Config.doubleCompressedSolarOutput + " EU/T");
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
list.add(Config.tripleCompressedSolarOutput + " EU/T");
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
list.add("Special Effect: " + Config.compressedSolarOutput + " EU/T when raining");
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
list.add("Special Effect: " + Config.doubleCompressedSolarOutput + " EU/T when raining");
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
list.add("Special Effect: " + Config.tripleCompressedSolarOutput + " EU/T when raining");
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
list.add("Special Effect: " + Config.compressedSolarOutput + " EU/T at night");
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
list.add("Special Effect: " + Config.doubleCompressedSolarOutput + " EU/T at night");
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
list.add("Special Effect: " + Config.tripleCompressedSolarOutput + " EU/T at night");
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
{
|
||||
list.add("Normal Conditions: " + Config.compressedSolarOutput + " EU/T");
|
||||
list.add("Special Effect: Output multiplied by 3");
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
list.add("Normal Conditions: " + Config.doubleCompressedSolarOutput + " EU/T");
|
||||
list.add("Special Effect: Output multiplied by 3");
|
||||
break;
|
||||
}
|
||||
|
||||
case 11:
|
||||
{
|
||||
list.add("Normal Conditions: " + Config.tripleCompressedSolarOutput + " EU/T");
|
||||
list.add("Special Effect: Output multiplied by 3");
|
||||
break;
|
||||
}
|
||||
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:
|
||||
{
|
||||
list.add("Normal Conditions: " + Config.doubleCompressedSolarOutput + " EU/T");
|
||||
list.add("Special Effect: Output multiplied by 2 when located in the nether");
|
||||
break;
|
||||
}
|
||||
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:
|
||||
{
|
||||
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;
|
||||
}
|
||||
default:
|
||||
list.add("Didn't I forget a tooltip?");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 ItemBlockEMTSolars2(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "doubleair";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "tripleair";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "earth";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "doubleearth";
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
name = "tripleearth";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) {
|
||||
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:
|
||||
{
|
||||
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:
|
||||
{
|
||||
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:
|
||||
{
|
||||
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:
|
||||
{
|
||||
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;
|
||||
}
|
||||
default:
|
||||
list.add("Didn't I forget a tooltip?");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemBlockEssentiaGenerators extends ItemBlock
|
||||
{
|
||||
|
||||
public ItemBlockEssentiaGenerators(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "potentia";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "ignis";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "auram";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "arbor";
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
name = "saxum";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
|
||||
|
||||
public class ItemEMTItems extends Item
|
||||
{
|
||||
|
||||
public Icon[] icon = new Icon[16];
|
||||
|
||||
public ItemEMTItems(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(64);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
String name = "";
|
||||
switch (itemstack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "oreClusterUranium";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "crushedOreAmber";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "purifiedOreAmber";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "crushedOreCinnabar";
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
name = "purifiedOreCinnabar";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
name = "nothing";
|
||||
break;
|
||||
}
|
||||
return getUnlocalizedName() + "." + name;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister ri) {
|
||||
this.icon[0] = ri.registerIcon("electricmagictools:clusteruranium");
|
||||
this.icon[1] = ri.registerIcon("electricmagictools:crushedamber");
|
||||
this.icon[2] = ri.registerIcon("electricmagictools:purifiedamber");
|
||||
this.icon[3] = ri.registerIcon("electricmagictools:crushedcinnabar");
|
||||
this.icon[4] = ri.registerIcon("electricmagictools:purifiedcinnabar");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int meta) {
|
||||
return this.icon[meta];
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int id, CreativeTabs tabs, List list) {
|
||||
// list.add(new ItemStack(this, 1, 0));
|
||||
list.add(new ItemStack(this, 1, 1));
|
||||
list.add(new ItemStack(this, 1, 2));
|
||||
list.add(new ItemStack(this, 1, 3));
|
||||
list.add(new ItemStack(this, 1, 4));
|
||||
}
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.IScribeTools;
|
||||
import thaumcraft.common.items.ItemInkwell;
|
||||
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 static int maxCharge = 400;
|
||||
|
||||
public ItemElectricScribingTools(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(400);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.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 ItemLightningSummoner(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(1);
|
||||
this.setMaxStackSize(64);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:lightningsummoner");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
player.swingItem();
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
|
||||
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
|
||||
double d = player.prevPosX + ((player.posX - player.prevPosX) * f);
|
||||
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
||||
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f6;
|
||||
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)
|
||||
{
|
||||
return itemstack;
|
||||
}
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return itemstack;
|
||||
} else
|
||||
{
|
||||
itemstack.damageItem(2, player);
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/*******************************************************************************
|
||||
* 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.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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 ItemThaumiumPlate(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(64);
|
||||
OreDictionary.registerOre("plateThaumium", this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:thaumiumplate");
|
||||
}
|
||||
}
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
/*******************************************************************************
|
||||
* 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-
|
||||
*
|
||||
* Attention: this class originally belongs to the ThaumicTinkerer mod.
|
||||
* All I did was modifying it to fulfill my needs.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* http://www.minecraftforum.net/topic/1813058-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.armor;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.api.item.IMetalArmor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.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.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 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);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
if (ticks())
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:electricboots");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||
return "electricmagictools:textures/models/electricboots.png";
|
||||
}
|
||||
|
||||
boolean ticks() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
public void onEntityUpdate(LivingUpdateEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack armor = player.getCurrentArmor(3 - armorType);
|
||||
if (armor != null && armor.getItem() == this)
|
||||
tickPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
void tickPlayer(EntityPlayer player) {
|
||||
if (player.worldObj.isRemote)
|
||||
player.stepHeight = player.isSneaking() ? 0.5F : 1F;
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)
|
||||
player.moveFlying(0F, 1F, player.capabilities.isFlying ? 0.075F : 0.15F);
|
||||
player.jumpMovementFactor = player.isSprinting() ? 0.05F : 0.04F;
|
||||
player.fallDistance = 0F;
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
public void onPlayerJump(LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
|
||||
|
||||
if (hasArmor)
|
||||
player.motionY += 0.3;
|
||||
}
|
||||
}
|
||||
|
||||
@ForgeSubscribe(priority = EventPriority.HIGH)
|
||||
public void onLivingUpdate(LivingUpdateEvent event) {
|
||||
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;
|
||||
|
||||
if (hasHighStep && !highStepListed)
|
||||
playersWith1Step.add(player.username);
|
||||
|
||||
if (!hasHighStep && highStepListed)
|
||||
{
|
||||
playersWith1Step.remove(player.username);
|
||||
player.stepHeight = 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable())
|
||||
{
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
} else
|
||||
{
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
int damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage())
|
||||
{
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("Vis discount: 2%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTickUpdate(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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemElectricGoggles extends ItemQuantumThaumicHelmet
|
||||
{
|
||||
|
||||
public int maxCharge = 10000;
|
||||
|
||||
public ItemElectricGoggles(int id, int par3, int par4)
|
||||
{
|
||||
super(id, par3, par4);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:electricgoggles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||
return "electricmagictools:textures/models/electricgoggles.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("Vis discount: 5%");
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
/*******************************************************************************
|
||||
* 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-
|
||||
*
|
||||
* Attention: this class originally belongs to the ThaumicTinkerer mod.
|
||||
* All I did was modifying it to fulfill my needs.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* http://www.minecraftforum.net/topic/1813058-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller
|
||||
{
|
||||
|
||||
public int maxCharge = 500000;
|
||||
|
||||
public ItemNanoBootsTraveller(int id, int par3, int par4)
|
||||
{
|
||||
super(id, par3, par4);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:nanobootstravel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||
return "electricmagictools:textures/models/nanobootstravel.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
void tickPlayer(EntityPlayer player) {
|
||||
if (player.worldObj.isRemote)
|
||||
player.stepHeight = player.isSneaking() ? 0.5F : 1F;
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)
|
||||
player.moveFlying(0F, 1F, (float) (player.capabilities.isFlying ? 0.075F : Config.nanoBootsSpeed));
|
||||
player.jumpMovementFactor = player.isSprinting() ? 0.05F : 0.04F;
|
||||
player.fallDistance = 0F;
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@Override
|
||||
public void onPlayerJump(LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
|
||||
|
||||
if (hasArmor)
|
||||
{
|
||||
player.motionY += Config.nanoBootsJump;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return 200;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("Vis discount: 4%");
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.armor;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
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 ItemNanoThaumicHelmet extends ItemQuantumThaumicHelmet
|
||||
{
|
||||
|
||||
public int maxCharge = 100000;
|
||||
|
||||
public ItemNanoThaumicHelmet(int id, int par3, int par4)
|
||||
{
|
||||
super(id, par3, par4);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:nanothaumichelmet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||
return "electricmagictools:textures/models/thaumicnanohelmet.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTickUpdate(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);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
} else
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("Vis discount: 6%");
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
/*******************************************************************************
|
||||
* 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-
|
||||
*
|
||||
* Attention: this class originally belongs to the ThaumicTinkerer mod.
|
||||
* All I did was modifying it to fulfill my needs.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* http://www.minecraftforum.net/topic/1813058-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller
|
||||
{
|
||||
|
||||
public int maxCharge = 1000000;
|
||||
|
||||
public ItemQuantumBootsTraveller(int id, int par3, int par4)
|
||||
{
|
||||
super(id, par3, par4);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:quantumbootstravel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||
return "electricmagictools:textures/models/quantumbootstravel.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
void tickPlayer(EntityPlayer player) {
|
||||
if (player.worldObj.isRemote)
|
||||
player.stepHeight = player.isSneaking() ? 0.5F : 1F;
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)
|
||||
player.moveFlying(0F, 1F, (float) (player.capabilities.isFlying ? 0.075F : Config.quantumBootsSpeed));
|
||||
player.jumpMovementFactor = player.isSprinting() ? 0.05F : 0.04F;
|
||||
player.fallDistance = 0F;
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@Override
|
||||
public void onPlayerJump(LivingJumpEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
|
||||
|
||||
if (hasArmor)
|
||||
{
|
||||
player.motionY += Config.quantumBootsJump;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return 200;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("Vis discount: 5%");
|
||||
}
|
||||
}
|
||||
+270
@@ -0,0 +1,270 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.armor;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.api.item.IMetalArmor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
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 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);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
|
||||
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
|
||||
}
|
||||
|
||||
public int maxCharge = 10000000;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:quantumthaumichelmet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {
|
||||
return "electricmagictools:textures/models/thaumicquantumhelmet.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
int refill = player.getAir();
|
||||
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())
|
||||
{
|
||||
break;
|
||||
}
|
||||
{
|
||||
PotionEffect effect = (PotionEffect) i$.next();
|
||||
int id = effect.getPotionID();
|
||||
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
|
||||
if (cost != null)
|
||||
{
|
||||
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
|
||||
if (ElectricItem.manager.canUse(itemStack, cost.intValue()))
|
||||
{
|
||||
ElectricItem.manager.use(itemStack, cost.intValue(), null);
|
||||
ItemStack milk = (new ItemStack(Item.bucketMilk));
|
||||
player.curePotionEffects(milk);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (true);
|
||||
|
||||
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);
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
} else
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 10000;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("Vis discount: 8%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showNodes(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable())
|
||||
{
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
|
||||
} else
|
||||
{
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
int damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage())
|
||||
{
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return 10000;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
}
|
||||
+356
@@ -0,0 +1,356 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.armor;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
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 ItemSolarHelmetRevealing extends ItemArmor implements ISpecialArmor, IRevealer, IVisDiscountGear, IGoggles, IElectricItem
|
||||
{
|
||||
|
||||
public int maxCharge = 10000000;
|
||||
private int ticker;
|
||||
private int generating;
|
||||
private int genDay;
|
||||
private int genNight;
|
||||
private boolean sunIsUp;
|
||||
private boolean skyIsVisible;
|
||||
private boolean noSunWorld;
|
||||
private boolean dampPlace;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static final Map potionCost = new HashMap();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ItemSolarHelmetRevealing(int id, int par3, int par4)
|
||||
{
|
||||
super(id, EnumArmorMaterial.IRON, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.maxCharge = 1000000;
|
||||
this.genDay = 256;
|
||||
this.genNight = 128;
|
||||
|
||||
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layerType) {
|
||||
return "electricmagictools:textures/models/solarrevealinghelmet.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void onArmorTickUpdate(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);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
} else
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
|
||||
int refill = player.getAir();
|
||||
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())
|
||||
{
|
||||
break;
|
||||
}
|
||||
{
|
||||
PotionEffect effect = (PotionEffect) i$.next();
|
||||
int id = effect.getPotionID();
|
||||
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
|
||||
if (cost != null)
|
||||
{
|
||||
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
|
||||
if (ElectricItem.manager.canUse(itemStack, cost.intValue()))
|
||||
{
|
||||
ElectricItem.manager.use(itemStack, cost.intValue(), null);
|
||||
ItemStack milk = (new ItemStack(Item.bucketMilk));
|
||||
player.curePotionEffects(milk);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (true);
|
||||
|
||||
if (worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
checkForSun(player);
|
||||
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)))
|
||||
{
|
||||
int sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
} 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)))
|
||||
{
|
||||
int sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int checkForSun(EntityPlayer player) {
|
||||
if (this.ticker++ % tickRate() == 0)
|
||||
{
|
||||
updateVisibility(player);
|
||||
}
|
||||
if ((this.sunIsUp) && (this.skyIsVisible))
|
||||
{
|
||||
this.generating = (0 + this.genDay);
|
||||
return this.generating;
|
||||
}
|
||||
if (this.skyIsVisible)
|
||||
{
|
||||
this.generating = (0 + this.genNight);
|
||||
return this.generating;
|
||||
}
|
||||
this.generating = 0;
|
||||
return this.generating;
|
||||
}
|
||||
|
||||
public void updateVisibility(EntityPlayer player) {
|
||||
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()))
|
||||
{
|
||||
this.sunIsUp = false;
|
||||
} else
|
||||
{
|
||||
this.sunIsUp = true;
|
||||
}
|
||||
if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld))
|
||||
{
|
||||
this.skyIsVisible = false;
|
||||
} else
|
||||
{
|
||||
this.skyIsVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static int tickRate() {
|
||||
return 128;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:solarrevealinghelmet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("Vis discount: 7%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
return 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showNodes(ItemStack itemstack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable())
|
||||
{
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
|
||||
} else
|
||||
{
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
int damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
|
||||
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage())
|
||||
{
|
||||
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
|
||||
} else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
|
||||
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false);
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
return 10000;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.foci;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.IWandFocus;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
|
||||
|
||||
public abstract class ItemBaseFocus extends Item implements IWandFocus
|
||||
{
|
||||
|
||||
private Icon ornament, depth;
|
||||
|
||||
public ItemBaseFocus(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setMaxDamage(1);
|
||||
this.setNoRepair();
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
}
|
||||
|
||||
boolean hasOrnament() {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean hasDepth() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemTool(ItemStack par1ItemStack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack itemstack) {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getFocusDepthLayerIcon() {
|
||||
return depth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getOrnament() {
|
||||
return ornament;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WandFocusAnimation getAnimation() {
|
||||
return WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isUseItem() {
|
||||
return isVisCostPerTick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition) {
|
||||
if (isUseItem())
|
||||
paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
|
||||
return paramItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "00";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsEnchant(int id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
AspectList cost = getVisCost();
|
||||
if (cost != null && cost.size() > 0)
|
||||
{
|
||||
list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
|
||||
for (Aspect aspect : cost.getAspectsSorted())
|
||||
{
|
||||
float amount = cost.getAmount(aspect) / 100.0F;
|
||||
list.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.foci;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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;
|
||||
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 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);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:chargefocus");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor() {
|
||||
return 0xFFFF00;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost() {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "CHARGING";
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
|
||||
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)))
|
||||
{
|
||||
int sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
} 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)))
|
||||
{
|
||||
int sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.foci;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.monster.EntitySnowman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor() {
|
||||
return 99999999;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:christmasfocus");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost() {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "CHRISTMAS";
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
EntitySnowman snowman;
|
||||
snowman = new EntitySnowman(world);
|
||||
snowman.setPosition(player.posX + 2, player.posY + 1, player.posZ + 2);
|
||||
world.spawnEntityInWorld(snowman);
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.foci;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
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.entities.EntityLaser;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:explosionfocus");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor() {
|
||||
return 9990;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost() {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "EXPLOSION";
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
EntityLaser laser;
|
||||
laser = new EntityLaser(world, player, 2);
|
||||
world.spawnEntityInWorld(laser);
|
||||
}
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.foci;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
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.BlockRegistry;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:shieldfocus");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor() {
|
||||
return 555555555;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseItem() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost() {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "SHIELD";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int time) {
|
||||
player.motionX = 0.0D;
|
||||
player.motionY = 0.0D;
|
||||
player.motionZ = 0.0D;
|
||||
|
||||
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
|
||||
if (wand.consumeAllVis(itemstack, player, getVisCost(), 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) {
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
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);
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
ItemStack milk = (new ItemStack(Item.bucketMilk));
|
||||
player.curePotionEffects(milk);
|
||||
}
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.DamageSource;
|
||||
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 ItemDiamondChainsaw extends ItemThaumiumChainsaw
|
||||
{
|
||||
|
||||
public int maxCharge = 40000;
|
||||
private final int cost = 200;
|
||||
private final int hitCost = 300;
|
||||
|
||||
public ItemDiamondChainsaw(int id)
|
||||
{
|
||||
super(id);
|
||||
this.efficiencyOnProperMaterial = 16F;
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:diamondchainsaw");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 300;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Item.axeDiamond.canHarvestBlock(block) || Item.swordDiamond.canHarvestBlock(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(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)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
return super.getStrVsBlock(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
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 Icon icon;
|
||||
public int maxCharge = 1000000;
|
||||
public int growthCost = 1000;
|
||||
public int tillCost = 100;
|
||||
|
||||
public ItemElectricHoeGrowth(int id)
|
||||
{
|
||||
super(id, EnumToolMaterial.EMERALD);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @SideOnly(Side.CLIENT)
|
||||
* @Override public void registerIcons(IconRegister iconRegister) { this.icon = iconRegister .registerIcon("electricmagictools:electrichoegrowth"); }
|
||||
**/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
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 ItemOmnitoolDiamond extends ItemOmnitoolIron
|
||||
{
|
||||
|
||||
public int maxCharge = 70000;
|
||||
private int cost;
|
||||
private final int hitCost = 250;
|
||||
|
||||
public ItemOmnitoolDiamond(int id)
|
||||
{
|
||||
super(id);
|
||||
this.efficiencyOnProperMaterial = 16F;
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxStackSize(1);
|
||||
if (Config.toolsInBore == false)
|
||||
{
|
||||
this.setMaxDamage(27);
|
||||
} else
|
||||
{
|
||||
this.setMaxDamage(350);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:diamondomnitool");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 400;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
|
||||
if (Config.toolsInBore == false)
|
||||
{
|
||||
cost = 200;
|
||||
} else
|
||||
{
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(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)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
return super.getStrVsBlock(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import 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 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);
|
||||
this.efficiencyOnProperMaterial = 13F;
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxStackSize(1);
|
||||
if (Config.toolsInBore == false)
|
||||
{
|
||||
this.setMaxDamage(27);
|
||||
} else
|
||||
{
|
||||
this.setMaxDamage(200);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:ironomnitool");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 200;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
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)
|
||||
{
|
||||
cost = 100;
|
||||
} else
|
||||
{
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(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)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
return super.getStrVsBlock(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean 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++)
|
||||
{
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
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)
|
||||
{
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
} else if (torchStack.stackSize <= 0)
|
||||
{
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
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 ItemOmnitoolThaumium extends ItemOmnitoolDiamond
|
||||
{
|
||||
|
||||
public int maxCharge = 140000;
|
||||
private int cost;
|
||||
private final int hitCost = 650;
|
||||
|
||||
public ItemOmnitoolThaumium(int id)
|
||||
{
|
||||
super(id);
|
||||
this.efficiencyOnProperMaterial = 21F;
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxStackSize(1);
|
||||
if (Config.toolsInBore == false)
|
||||
{
|
||||
this.setMaxDamage(27);
|
||||
} else
|
||||
{
|
||||
this.setMaxDamage(467);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:thaumiumomnitool");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 800;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
|
||||
if (Config.toolsInBore == false)
|
||||
{
|
||||
cost = 300;
|
||||
} else
|
||||
{
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(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)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
return super.getStrVsBlock(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+355
@@ -0,0 +1,355 @@
|
||||
/*******************************************************************************
|
||||
* 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 class originally belongs to Azanor, but with his permission I took it, and modified it to make it work as I wanted to.
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.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.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.entities.EntityFollowingItem;
|
||||
import thaumcraft.common.lib.Utils;
|
||||
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 ItemRockbreakerDrill extends ItemPickaxe implements IElectricItem
|
||||
{
|
||||
|
||||
public Icon icon;
|
||||
int side;
|
||||
|
||||
public ItemRockbreakerDrill(int id)
|
||||
{
|
||||
super(id, EnumToolMaterial.EMERALD);
|
||||
side = 0;
|
||||
setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.efficiencyOnProperMaterial = 25F;
|
||||
this.setMaxStackSize(1);
|
||||
if (Config.toolsInBore == false)
|
||||
{
|
||||
this.setMaxDamage(27);
|
||||
} else
|
||||
{
|
||||
this.setMaxDamage(2571);
|
||||
}
|
||||
}
|
||||
|
||||
public int maxCharge = 900000;
|
||||
private int cost;
|
||||
private final int searchCost = 1000;
|
||||
private final int hitCost = 400;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:rockbreakerdrill");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
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);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
side = movingobjectposition.sideHit;
|
||||
}
|
||||
return super.onBlockStartBreak(itemstack, X, Y, Z, player);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, int bi, int x, int y, int z, EntityLivingBase ent) {
|
||||
if (Config.toolsInBore == false)
|
||||
{
|
||||
cost = 350;
|
||||
} else
|
||||
{
|
||||
cost = 1;
|
||||
}
|
||||
if (ent.isSneaking())
|
||||
{
|
||||
return super.onBlockDestroyed(stack, world, bi, x, y, z, ent);
|
||||
}
|
||||
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++)
|
||||
{
|
||||
int xx = 0;
|
||||
int yy = 0;
|
||||
int zz = 0;
|
||||
if (side <= 1)
|
||||
{
|
||||
xx = aa;
|
||||
zz = bb;
|
||||
} else if (side <= 3)
|
||||
{
|
||||
xx = aa;
|
||||
yy = bb;
|
||||
} else
|
||||
{
|
||||
zz = aa;
|
||||
yy = bb;
|
||||
}
|
||||
int bl = world.getBlockId(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]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (ElectricItem.manager.canUse(stack, cost))
|
||||
{
|
||||
ElectricItem.manager.use(stack, cost, ent);
|
||||
}
|
||||
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);
|
||||
boolean creative = false;
|
||||
if ((ent instanceof EntityPlayer) && ((EntityPlayer) ent).capabilities.isCreativeMode)
|
||||
{
|
||||
creative = true;
|
||||
}
|
||||
if (ret.size() <= 0 || creative || ((Entity) (ent)).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)))
|
||||
{
|
||||
is = (ItemStack) i$.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@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++)
|
||||
{
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
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)
|
||||
{
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
} else if (torchStack.stackSize <= 0)
|
||||
{
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
ElectricItem.manager.use(stack, searchCost, player);
|
||||
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);
|
||||
}
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L);
|
||||
|
||||
player.swingItem();
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
|
||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||
if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled()))
|
||||
{
|
||||
entity.setFire(2);
|
||||
}
|
||||
return super.onLeftClickEntity(stack, player, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 900;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Item.pickaxeDiamond.canHarvestBlock(block) || Item.shovelDiamond.canHarvestBlock(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(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)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
return super.getStrVsBlock(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
/*******************************************************************************
|
||||
* 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 class originally belongs to Azanor, but with his permission I took it, and modified it to make it work as I wanted to.
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.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.lib.Utils;
|
||||
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
|
||||
{
|
||||
|
||||
boolean alternateServer;
|
||||
boolean alternateClient;
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static ArrayList oreDictLogs = new ArrayList();
|
||||
public int maxCharge = 900000;
|
||||
private final int cost = 400;
|
||||
private final int hitCost = 500;
|
||||
|
||||
public ItemStreamChainsaw(int id)
|
||||
{
|
||||
super(id, EnumToolMaterial.EMERALD);
|
||||
this.efficiencyOnProperMaterial = 25F;
|
||||
alternateServer = false;
|
||||
alternateClient = false;
|
||||
setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(27);
|
||||
}
|
||||
|
||||
public EnumAction getItemUseAction(ItemStack itemstack) {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
player.swingItem();
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
alternateClient = !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.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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 900;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:streamchainsaw");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Item.axeDiamond.canHarvestBlock(block) || Item.swordDiamond.canHarvestBlock(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(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)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
return super.getStrVsBlock(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
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 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);
|
||||
this.efficiencyOnProperMaterial = 21F;
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:thaumiumchainsaw");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 600;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
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);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Item.axeDiamond.canHarvestBlock(block) || Item.swordDiamond.canHarvestBlock(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(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)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
return super.getStrVsBlock(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++)
|
||||
{
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
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)
|
||||
{
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
} else if (torchStack.stackSize <= 0)
|
||||
{
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
}
|
||||
+209
@@ -0,0 +1,209 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumToolMaterial;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import 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 ItemThaumiumDrill extends ItemPickaxe implements IElectricItem
|
||||
{
|
||||
|
||||
public ItemThaumiumDrill(int id)
|
||||
{
|
||||
super(id, EnumToolMaterial.EMERALD);
|
||||
this.efficiencyOnProperMaterial = 20F;
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxStackSize(1);
|
||||
if (Config.toolsInBore == false)
|
||||
{
|
||||
this.setMaxDamage(27);
|
||||
} else
|
||||
{
|
||||
this.setMaxDamage(240);
|
||||
}
|
||||
}
|
||||
|
||||
public int maxCharge = 60000;
|
||||
private int cost;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:thaumiumdrill");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
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)
|
||||
{
|
||||
cost = 250;
|
||||
} else
|
||||
{
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(par1ItemStack, cost, par7EntityLivingBase);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Item.pickaxeDiamond.canHarvestBlock(block) || Item.shovelDiamond.canHarvestBlock(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(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)
|
||||
{
|
||||
return efficiencyOnProperMaterial;
|
||||
} else
|
||||
{
|
||||
return super.getStrVsBlock(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
|
||||
for (int i = 0; i < player.inventory.mainInventory.length; i++)
|
||||
{
|
||||
ItemStack torchStack = player.inventory.mainInventory[i];
|
||||
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Item item = torchStack.getItem();
|
||||
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)
|
||||
{
|
||||
torchStack.setItemDamage(oldMeta);
|
||||
torchStack.stackSize = oldSize;
|
||||
} else if (torchStack.stackSize <= 0)
|
||||
{
|
||||
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
|
||||
player.inventory.mainInventory[i] = null;
|
||||
}
|
||||
if (result)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
|
||||
}
|
||||
}
|
||||
+216
@@ -0,0 +1,216 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools.hammer;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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 int maxCharge = 1000000;
|
||||
private final int hitCost = 5000;
|
||||
private final int lightningCost = 75000;
|
||||
|
||||
public ItemElectricThorHammer(int id)
|
||||
{
|
||||
super(id, EnumToolMaterial.EMERALD);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
// OreDictionary.registerOre("craftingToolForgeHammer", this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:hammer/electricthorhammer");
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
|
||||
if (getChargedItemId(itemStack) == this.itemID)
|
||||
{
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
|
||||
if (getEmptyItemId(itemStack) == this.itemID)
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return 0;
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
if (Config.enchanting == false)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
if (ElectricItem.manager.use(itemstack, hitCost, attacker))
|
||||
{
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 19F);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
list.add(player.username + "'s Hammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
if (player.capabilities.isCreativeMode)
|
||||
{
|
||||
return itemstack;
|
||||
} else if (ElectricItem.manager.canUse(itemstack, lightningCost))
|
||||
{
|
||||
player.swingItem();
|
||||
// Corners
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 8));
|
||||
|
||||
// Fronts
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ + 8));
|
||||
|
||||
// Others
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 1));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 2));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 3));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 4));
|
||||
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 1));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 2));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 3));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 4));
|
||||
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 1, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 2, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 3, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 4, player.posY, player.posZ - 8));
|
||||
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 1, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 2, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 3, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 4, player.posY, player.posZ - 8));
|
||||
|
||||
EntityArcher archer;
|
||||
archer = new EntityArcher(world);
|
||||
archer.setPosition(player.posX + 8, player.posY + 2, player.posZ - 8);
|
||||
world.spawnEntityInWorld(archer);
|
||||
|
||||
EntityArcher archer1;
|
||||
archer1 = new EntityArcher(world);
|
||||
archer1.setPosition(player.posX - 8, player.posY + 2, player.posZ + 8);
|
||||
world.spawnEntityInWorld(archer1);
|
||||
|
||||
EntityArcher archer2;
|
||||
archer2 = new EntityArcher(world);
|
||||
archer2.setPosition(player.posX - 8, player.posY + 2, player.posZ - 8);
|
||||
world.spawnEntityInWorld(archer2);
|
||||
|
||||
EntityArcher archer3;
|
||||
archer3 = new EntityArcher(world);
|
||||
archer3.setPosition(player.posX + 8, player.posY + 2, player.posZ + 8);
|
||||
world.spawnEntityInWorld(archer3);
|
||||
ElectricItem.manager.use(itemstack, lightningCost, player);
|
||||
return itemstack;
|
||||
} else
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ));
|
||||
player.addPotionEffect(new PotionEffect(Potion.harm.getId(), 1, 1));
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools.hammer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.entities.projectile.EntityAlumentum;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemTaintedThorHammer extends ItemThorHammer
|
||||
{
|
||||
|
||||
public ItemTaintedThorHammer(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setMaxDamage(1000);
|
||||
// OreDictionary.registerOre("craftingToolForgeHammer", this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:hammer/taintedthorhammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
player.swingItem();
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ + 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ - 8));
|
||||
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ + 8));
|
||||
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)
|
||||
{
|
||||
return itemstack;
|
||||
} else
|
||||
{
|
||||
itemstack.damageItem(40, player);
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 2F);
|
||||
itemstack.damageItem(1, attacker);
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("It was, once the Hammer of Thor.");
|
||||
list.add("It is now very dangerous.");
|
||||
list.add("Do NOT right-click.");
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
/*******************************************************************************
|
||||
* 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.items.tools.hammer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
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.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.IRepairable;
|
||||
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 ItemThorHammer(int id)
|
||||
{
|
||||
super(id, EnumToolMaterial.EMERALD);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(2000);
|
||||
// OreDictionary.registerOre("craftingToolForgeHammer", this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon("electricmagictools:hammer/thorhammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
player.swingItem();
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
|
||||
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
|
||||
double d = player.prevPosX + ((player.posX - player.prevPosX) * f);
|
||||
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
|
||||
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
|
||||
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
|
||||
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.01745329F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f6;
|
||||
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)
|
||||
{
|
||||
return itemstack;
|
||||
}
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return itemstack;
|
||||
} else
|
||||
{
|
||||
itemstack.damageItem(20, player);
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
|
||||
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
|
||||
itemstack.damageItem(1, attacker);
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
list.add("The Hammer of Thor");
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/*******************************************************************************
|
||||
* 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.lib;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
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);
|
||||
public static AspectList thaumicQuantumHelmetCrafting = new AspectList().add(Aspect.ARMOR, 25).add(Aspect.SENSES, 25).add(Aspect.ENERGY, 25);
|
||||
public static AspectList diamondOmnitoolCrafting = new AspectList().add(Aspect.ORDER, 15).add(Aspect.AIR, 15);
|
||||
public static AspectList thaumiumOmnitoolCrafting = new AspectList().add(Aspect.TOOL, 25).add(Aspect.MINE, 25).add(Aspect.ENERGY, 25).add(Aspect.WEAPON, 25);
|
||||
public static AspectList thaumicNanoHelmetCrafting = new AspectList().add(Aspect.ARMOR, 16).add(Aspect.SENSES, 16).add(Aspect.ENERGY, 16);
|
||||
public static AspectList laserFocusCrafting = new AspectList().add(Aspect.FIRE, 30).add(Aspect.MOTION, 16).add(Aspect.WEAPON, 30).add(Aspect.DEATH, 16);
|
||||
public static AspectList christmasFocusCrafting = new AspectList().add(Aspect.ORDER, 20).add(Aspect.AIR, 20);
|
||||
public static AspectList shieldFocusCrafting = new AspectList().add(Aspect.AIR, 16).add(Aspect.ARMOR, 20).add(Aspect.CRYSTAL, 16).add(Aspect.TRAP, 20).add(Aspect.LIFE, 16);
|
||||
public static AspectList electricGogglesCrafting = new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 20).add(Aspect.WATER, 20);
|
||||
public static AspectList potentiaGeneratorCrafting = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.MAGIC, 32).add(Aspect.METAL, 32).add(Aspect.EXCHANGE, 32);
|
||||
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 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 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);
|
||||
public static AspectList nanoBootsTravel = new AspectList().add(Aspect.ENERGY, 25).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 48);
|
||||
public static AspectList quantumBootsTravel = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 64);
|
||||
public static AspectList electricScribingTools = new AspectList().add(Aspect.AIR, 16).add(Aspect.ORDER, 16).add(Aspect.ENTROPY, 16);
|
||||
public static AspectList etherealProcessor = new AspectList().add(Aspect.MECHANISM, 16).add(Aspect.MAGIC, 16).add(Aspect.CRAFT, 16);
|
||||
public static AspectList waterSolars = new AspectList().add(Aspect.WATER, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16);
|
||||
public static AspectList darkSolars = new AspectList().add(Aspect.ENTROPY, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16);
|
||||
public static AspectList orderSolars = new AspectList().add(Aspect.ORDER, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16);
|
||||
public static AspectList fireSolars = new AspectList().add(Aspect.FIRE, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16);
|
||||
public static AspectList airSolars = new AspectList().add(Aspect.AIR, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16);
|
||||
public static AspectList earthSolars = new AspectList().add(Aspect.EARTH, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16);
|
||||
public static AspectList uuMatterInfusions = new AspectList().add(Aspect.FIRE, 32).add(Aspect.WATER, 32).add(Aspect.AIR, 32).add(Aspect.EARTH, 32).add(Aspect.ORDER, 32).add(Aspect.ENTROPY, 32);
|
||||
public static AspectList lesserUUMInfusions = new AspectList().add(Aspect.FIRE, 16).add(Aspect.WATER, 16).add(Aspect.AIR, 16).add(Aspect.EARTH, 16).add(Aspect.ORDER, 16).add(Aspect.ENTROPY, 16);
|
||||
public static AspectList cheapUUMInfusions = 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 cheapestUUMInfusions = new AspectList().add(Aspect.FIRE, 4).add(Aspect.WATER, 4).add(Aspect.AIR, 4).add(Aspect.EARTH, 4).add(Aspect.ORDER, 4).add(Aspect.ENTROPY, 4);
|
||||
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);
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*******************************************************************************
|
||||
* 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.lib;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
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);
|
||||
public static AspectList thaumicQuantumHelmet = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 4).add(Aspect.SENSES, 6);
|
||||
public static AspectList diamondOmnitoolResearch = new AspectList().add(Aspect.ENERGY, 2).add(Aspect.TOOL, 3).add(Aspect.MINE, 2).add(Aspect.WEAPON, 2);
|
||||
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 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 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);
|
||||
public static AspectList wandCharger = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.CRAFT, 2).add(Aspect.EXCHANGE, 3).add(Aspect.GREED, 5);
|
||||
public static AspectList compressedSolars = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.LIGHT, 3).add(Aspect.METAL, 2);
|
||||
public static AspectList solarHelmetRevealing = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.AIR, 2).add(Aspect.LIGHT, 4);
|
||||
public static AspectList electricBootsTravel = new AspectList().add(Aspect.ENERGY, 2).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 2);
|
||||
public static AspectList nanoBootsTravel = new AspectList().add(Aspect.ENERGY, 3).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 3);
|
||||
public static AspectList quantumBootsTravel = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 4);
|
||||
public static AspectList electricScribingTools = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.DARKNESS, 3).add(Aspect.CRAFT, 1);
|
||||
public static AspectList etherealProcessor = new AspectList().add(Aspect.MECHANISM, 3).add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 5);
|
||||
public static AspectList waterSolars = new AspectList().add(Aspect.WATER, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
|
||||
public static AspectList darkSolars = new AspectList().add(Aspect.ENTROPY, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
|
||||
public static AspectList orderSolars = new AspectList().add(Aspect.ORDER, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
|
||||
public static AspectList fireSolars = new AspectList().add(Aspect.FIRE, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
|
||||
public static AspectList airSolars = new AspectList().add(Aspect.AIR, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
|
||||
public static AspectList earthSolars = new AspectList().add(Aspect.EARTH, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4);
|
||||
public static AspectList uuMInfusion = new AspectList().add(Aspect.ELDRITCH, 4).add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 5);
|
||||
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);
|
||||
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*******************************************************************************
|
||||
* 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.recipes;
|
||||
|
||||
import ic2.api.item.Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
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;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.ItemRegistry;
|
||||
|
||||
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"));
|
||||
|
||||
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));
|
||||
|
||||
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
|
||||
{
|
||||
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.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(Items.getItem("generator"), "X", "Y", "Z", 'X', Items.getItem("reBattery"), 'Y', Items.getItem("machine"), 'Z', new ItemStack(Block.furnaceIdle));
|
||||
|
||||
/** 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);
|
||||
|
||||
}
|
||||
|
||||
public static IRecipe ironOmnitool;
|
||||
public static IRecipe diamondChainsaw;
|
||||
}
|
||||
+267
@@ -0,0 +1,267 @@
|
||||
/*******************************************************************************
|
||||
* 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.recipes;
|
||||
|
||||
import ic2.api.item.Items;
|
||||
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.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.crafting.CrucibleRecipe;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.crafting.ShapedArcaneRecipe;
|
||||
import thaumcraft.api.crafting.ShapelessArcaneRecipe;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.ItemRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.lib.CraftingAspects;
|
||||
|
||||
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") });
|
||||
|
||||
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") });
|
||||
|
||||
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") });
|
||||
|
||||
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") });
|
||||
|
||||
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") });
|
||||
|
||||
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") });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
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") });
|
||||
|
||||
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") });
|
||||
|
||||
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") });
|
||||
|
||||
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") });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
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) });
|
||||
|
||||
/** 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));
|
||||
|
||||
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));
|
||||
|
||||
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));
|
||||
|
||||
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);
|
||||
|
||||
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));
|
||||
|
||||
tinyUranium = ThaumcraftApi.addShapelessArcaneCraftingRecipe("Tiny Uranium", new ItemStack(Items.getItem("smallUran235").getItem(), 7), CraftingAspects.tinyUraniumCrafting, Items.getItem("Uran238"));
|
||||
|
||||
compressedSolar = ThaumcraftApi.addArcaneCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', Items.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));
|
||||
|
||||
/** Crucible Recipes **/
|
||||
|
||||
ignisGenerator = ThaumcraftApi.addCrucibleRecipe("Ignis Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 1), new ItemStack(BlockRegistry.essentiaGens, 1, 0), CraftingAspects.ignisGeneratorCrafting);
|
||||
|
||||
auramGenerator = ThaumcraftApi.addCrucibleRecipe("Auram Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 2), new ItemStack(BlockRegistry.essentiaGens, 1, 0), CraftingAspects.auramGeneratorCrafting);
|
||||
|
||||
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);
|
||||
|
||||
tripleWaterSolar = ThaumcraftApi.addCrucibleRecipe("Water Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 5), new ItemStack(BlockRegistry.emtSolars, 1, 2), CraftingAspects.waterSolars);
|
||||
|
||||
darkSolar = ThaumcraftApi.addCrucibleRecipe("Entropy Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 6), new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.darkSolars);
|
||||
|
||||
doubleDarkSolar = ThaumcraftApi.addCrucibleRecipe("Entropy Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 7), new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.darkSolars);
|
||||
|
||||
tripleDarkSolar = ThaumcraftApi.addCrucibleRecipe("Entropy Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 8), new ItemStack(BlockRegistry.emtSolars, 1, 2), CraftingAspects.darkSolars);
|
||||
|
||||
orderSolar = ThaumcraftApi.addCrucibleRecipe("Order Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 9), new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.orderSolars);
|
||||
|
||||
doubleOrderSolar = ThaumcraftApi.addCrucibleRecipe("Order Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 10), new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.orderSolars);
|
||||
|
||||
tripleOrderSolar = ThaumcraftApi.addCrucibleRecipe("Order Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 11), new ItemStack(BlockRegistry.emtSolars, 1, 2), CraftingAspects.orderSolars);
|
||||
|
||||
fireSolar = ThaumcraftApi.addCrucibleRecipe("Fire Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 12), new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.fireSolars);
|
||||
|
||||
doubleFireSolar = ThaumcraftApi.addCrucibleRecipe("Fire Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 13), new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.fireSolars);
|
||||
|
||||
tripleFireSolar = ThaumcraftApi.addCrucibleRecipe("Fire Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 14), new ItemStack(BlockRegistry.emtSolars, 1, 2), CraftingAspects.fireSolars);
|
||||
|
||||
airSolar = ThaumcraftApi.addCrucibleRecipe("Air Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars, 1, 15), new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.airSolars);
|
||||
|
||||
doubleAirSolar = ThaumcraftApi.addCrucibleRecipe("Air Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars2, 1, 0), new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.airSolars);
|
||||
|
||||
tripleAirSolar = ThaumcraftApi.addCrucibleRecipe("Air Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars2, 1, 1), new ItemStack(BlockRegistry.emtSolars, 1, 2), CraftingAspects.airSolars);
|
||||
|
||||
earthSolar = ThaumcraftApi.addCrucibleRecipe("Earth Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars2, 1, 2), new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.earthSolars);
|
||||
|
||||
doubleEarthSolar = ThaumcraftApi.addCrucibleRecipe("Earth Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars2, 1, 3), new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.earthSolars);
|
||||
|
||||
tripleEarthSolar = ThaumcraftApi.addCrucibleRecipe("Earth Infused Solar Panels", new ItemStack(BlockRegistry.emtSolars2, 1, 4), new ItemStack(BlockRegistry.emtSolars, 1, 2), CraftingAspects.earthSolars);
|
||||
|
||||
portableNode = ThaumcraftApi.addCrucibleRecipe("Portable Node", new ItemStack(BlockRegistry.portableNode), new ItemStack(ConfigItems.itemJarFilled), CraftingAspects.portableNode);
|
||||
|
||||
/** IC2 Stuff related recipes **/
|
||||
|
||||
/* Ore Clusters Macerator Recipes */
|
||||
ItemStack ironClusterRecipe = Items.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();
|
||||
goldClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 31)), null, goldClusterRecipe);
|
||||
|
||||
ItemStack copperClusterRecipe = Items.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();
|
||||
tinClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 18)), null, tinClusterRecipe);
|
||||
|
||||
ItemStack silverClusterRecipe = Items.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();
|
||||
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));
|
||||
Recipes.metalformerRolling.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemResource, 1, 2)), null, new ItemStack(ItemRegistry.thaumiumPlate));
|
||||
|
||||
/* Ore Processing for Amber and Cinnabar */
|
||||
ItemStack crushedAmberRecipe = new ItemStack(ItemRegistry.itemEMTItems, 1, 1);
|
||||
crushedAmberRecipe.stackSize = 2;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7)), null, crushedAmberRecipe);
|
||||
|
||||
ItemStack crushedCinnabarRecipe = new ItemStack(ItemRegistry.itemEMTItems, 1, 3);
|
||||
crushedCinnabarRecipe.stackSize = 2;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0)), null, crushedCinnabarRecipe);
|
||||
|
||||
NBTTagCompound waterAmount = new NBTTagCompound();
|
||||
waterAmount.setInteger("amount", 1000);
|
||||
|
||||
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 1)), waterAmount, new ItemStack[] { new ItemStack(ItemRegistry.itemEMTItems, 1, 2), StackUtil.copyWithSize(Ic2Items.smallCopperDust, 2), Ic2Items.stoneDust });
|
||||
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 3)), waterAmount, new ItemStack[] { new ItemStack(ItemRegistry.itemEMTItems, 1, 4), StackUtil.copyWithSize(Ic2Items.smallTinDust, 2), Ic2Items.stoneDust });
|
||||
|
||||
NBTTagCompound heatAmount = new NBTTagCompound();
|
||||
heatAmount.setInteger("minHeat", 1000);
|
||||
|
||||
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 2)), heatAmount, new ItemStack[] { Ic2Items.smallCopperDust, new ItemStack(ConfigItems.itemResource, 1, 6) });
|
||||
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 4)), heatAmount, new ItemStack[] { Ic2Items.smallTinDust, new ItemStack(ConfigItems.itemResource, 1, 3) });
|
||||
}
|
||||
|
||||
public static InfusionRecipe thaumiumDrill;
|
||||
public static InfusionRecipe thaumiumChainsaw;
|
||||
public static InfusionRecipe thaumicQuantumHelmet;
|
||||
public static InfusionRecipe thaumiumOmnitool;
|
||||
public static InfusionRecipe thaumicNanoHelmet;
|
||||
public static InfusionRecipe explosionFocus;
|
||||
public static InfusionRecipe shieldFocus;
|
||||
public static InfusionRecipe potentiaGenerator;
|
||||
public static InfusionRecipe streamChainsaw;
|
||||
public static InfusionRecipe rockbreakerDrill;
|
||||
public static InfusionRecipe thorHammer;
|
||||
public static InfusionRecipe superchargedThorHammer;
|
||||
public static InfusionRecipe wandRecharger;
|
||||
public static InfusionRecipe solarHelmetRevealing;
|
||||
public static InfusionRecipe electricBootsTravel;
|
||||
public static InfusionRecipe nanoBootsTravel;
|
||||
public static InfusionRecipe quantumBootsTravel;
|
||||
public static InfusionRecipe diamondOmnitoolToThaumium;
|
||||
public static InfusionRecipe etheralProcessor;
|
||||
public static InfusionRecipe tripleCompressedSolar;
|
||||
public static InfusionRecipe electricHoeGrowth;
|
||||
public static InfusionRecipe chargeFocus;
|
||||
|
||||
public static ShapelessArcaneRecipe diamondOmnitool;
|
||||
public static ShapelessArcaneRecipe tinyUranium;
|
||||
public static ShapedArcaneRecipe christmasFocus;
|
||||
public static ShapedArcaneRecipe electricGoggles;
|
||||
public static ShapedArcaneRecipe shieldBlock;
|
||||
public static ShapedArcaneRecipe compressedSolar;
|
||||
public static ShapedArcaneRecipe doubleCompressedSolar;
|
||||
public static ShapedArcaneRecipe ironOmnitoolToDiamond;
|
||||
public static ShapedArcaneRecipe electricScribingTools;
|
||||
|
||||
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;
|
||||
public static CrucibleRecipe darkSolar;
|
||||
public static CrucibleRecipe doubleDarkSolar;
|
||||
public static CrucibleRecipe tripleDarkSolar;
|
||||
public static CrucibleRecipe orderSolar;
|
||||
public static CrucibleRecipe doubleOrderSolar;
|
||||
public static CrucibleRecipe tripleOrderSolar;
|
||||
public static CrucibleRecipe fireSolar;
|
||||
public static CrucibleRecipe doubleFireSolar;
|
||||
public static CrucibleRecipe tripleFireSolar;
|
||||
public static CrucibleRecipe airSolar;
|
||||
public static CrucibleRecipe doubleAirSolar;
|
||||
public static CrucibleRecipe tripleAirSolar;
|
||||
public static CrucibleRecipe earthSolar;
|
||||
public static CrucibleRecipe doubleEarthSolar;
|
||||
public static CrucibleRecipe tripleEarthSolar;
|
||||
public static CrucibleRecipe portableNode;
|
||||
|
||||
public static IRecipe thaumiumPlate;
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
/*******************************************************************************
|
||||
* 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.recipes;
|
||||
|
||||
import ic2.api.item.Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
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 static void add() {
|
||||
|
||||
ItemStack iridium = Items.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 });
|
||||
|
||||
ItemStack uranium = Items.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 });
|
||||
|
||||
ItemStack diamond = new ItemStack(Item.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 });
|
||||
|
||||
ItemStack gold = new ItemStack(Item.ingotGold).copy();
|
||||
gold.stackSize = 2;
|
||||
ironToGold = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", gold, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Item.ingotIron), new ItemStack[] { uuMCell, uuMCell, uuMCell });
|
||||
|
||||
ItemStack ironOre = new ItemStack(Block.oreIron).copy();
|
||||
ironOre.stackSize = 16;
|
||||
stoneBricksToIronOre = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", ironOre, 4, CraftingAspects.cheapUUMInfusions, new ItemStack(Block.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();
|
||||
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();
|
||||
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();
|
||||
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 stickyResin = Items.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();
|
||||
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();
|
||||
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();
|
||||
glowstone.stackSize = 1;
|
||||
glowstoneDustToBlock = ThaumcraftApi.addInfusionCraftingRecipe("UU-Matter Infusion", glowstone, 4, CraftingAspects.cheapestUUMInfusions, new ItemStack(Item.glowstone), new ItemStack[] { uuMCell });
|
||||
|
||||
}
|
||||
|
||||
public static InfusionRecipe uraniumToIridium;
|
||||
public static InfusionRecipe diamondToUranium;
|
||||
public static InfusionRecipe goldToDiamond;
|
||||
public static InfusionRecipe ironToGold;
|
||||
public static InfusionRecipe stoneBricksToIronOre;
|
||||
public static InfusionRecipe arcaneStoneToCopperOre;
|
||||
public static InfusionRecipe arcaneStoneBricksToTinOre;
|
||||
public static InfusionRecipe amberBlockToLeadOre;
|
||||
public static InfusionRecipe charcoalToCoal;
|
||||
public static InfusionRecipe shardToResin;
|
||||
public static InfusionRecipe shardToRedstone;
|
||||
public static InfusionRecipe shardToLapis;
|
||||
public static InfusionRecipe glowstoneDustToBlock;
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityAirSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 1);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityAirSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible && this.yCoord >= 160)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 15);
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*******************************************************************************
|
||||
* 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 TileEntityArborGenerator extends TileEntity
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
public ForgeDirection orientation;
|
||||
public static int waitTime;
|
||||
|
||||
public TileEntityArborGenerator()
|
||||
{
|
||||
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 (EssentiaHandler.drainEssentia(this, Aspect.TREE, 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();
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*******************************************************************************
|
||||
* 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.nbt.NBTTagCompound;
|
||||
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 TileEntityAuramGenerator extends TileEntity
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
public ForgeDirection orientation;
|
||||
public static int waitTime;
|
||||
private BasicSource energySource = new BasicSource(this, 1000000000, 3);
|
||||
|
||||
public TileEntityAuramGenerator()
|
||||
{
|
||||
orientation = ForgeDirection.getOrientation(1);
|
||||
waitTime = 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
|
||||
if (waitTime > 0)
|
||||
{
|
||||
waitTime--;
|
||||
}
|
||||
|
||||
if (waitTime <= 0)
|
||||
{
|
||||
if (EssentiaHandler.drainEssentia(this, Aspect.AURA, ForgeDirection.UNKNOWN, 8))
|
||||
{
|
||||
energySource.addEnergy(Config.auramGenOutput);
|
||||
}
|
||||
waitTime = Config.essentiaGeneratorsDelay;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
energySource.readFromNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
energySource.writeToNBT(tag);
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityCompressedSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 1);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityCompressedSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 0);
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityDarkSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 1);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityDarkSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
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)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 6);
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityDoubleAirSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 2);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityDoubleAirSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible && this.yCoord >= 160)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 0);
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityDoubleCompressedSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 2);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityDoubleCompressedSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 1);
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityDoubleDarkSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 2);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityDoubleDarkSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
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)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 7);
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityDoubleEarthSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 2);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityDoubleEarthSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible && this.yCoord <= 10)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 3);
|
||||
}
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityDoubleFireSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 3);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityDoubleFireSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
if (worldObj.provider.dimensionId == -1)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 13);
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityDoubleOrderSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 3);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityDoubleOrderSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput * 3);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 10);
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityDoubleWaterSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 2);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityDoubleWaterSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
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))
|
||||
{
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 4);
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityEarthSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 1);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityEarthSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible && this.yCoord <= 10)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 2);
|
||||
}
|
||||
}
|
||||
+392
@@ -0,0 +1,392 @@
|
||||
/*******************************************************************************
|
||||
* 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.tile.IWrenchable;
|
||||
import ic2.core.Ic2Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.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
|
||||
{
|
||||
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 };
|
||||
|
||||
/**
|
||||
* The ItemStacks that hold the items currently being used in the furnace
|
||||
*/
|
||||
private ItemStack[] slots = new ItemStack[3];
|
||||
|
||||
/**
|
||||
* the speed of this furnace, 200 is normal / how many ticks it takes : 30 ticks = 1 second
|
||||
*/
|
||||
public int maceratingSpeed = Config.etherealProcessorBaseSpeed;
|
||||
|
||||
/** The number of ticks that the current item has been cooking for */
|
||||
public int cookTime;
|
||||
|
||||
/**
|
||||
* Returns the number of slots in the inventory.
|
||||
*/
|
||||
public int getSizeInventory() {
|
||||
return this.slots.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the stack in slot i
|
||||
*/
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
return this.slots[par1];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
ItemStack itemstack;
|
||||
|
||||
if (this.slots[par1].stackSize <= par2)
|
||||
{
|
||||
itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
} else
|
||||
{
|
||||
itemstack = this.slots[par1].splitStack(par2);
|
||||
|
||||
if (this.slots[par1].stackSize == 0)
|
||||
{
|
||||
this.slots[par1] = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
ItemStack itemstack = this.slots[par1];
|
||||
this.slots[par1] = null;
|
||||
return itemstack;
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
|
||||
*/
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
this.slots[par1] = par2ItemStack;
|
||||
|
||||
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");
|
||||
this.slots = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.tagAt(i);
|
||||
byte b0 = nbttagcompound1.getByte("Slot");
|
||||
|
||||
if (b0 >= 0 && b0 < this.slots.length)
|
||||
{
|
||||
this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
this.cookTime = par1NBTTagCompound.getShort("CookTime");
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
super.writeToNBT(par1NBTTagCompound);
|
||||
par1NBTTagCompound.setShort("CookTime", (short) this.cookTime);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
++this.cookTime;
|
||||
|
||||
if (this.cookTime == this.maceratingSpeed)
|
||||
{
|
||||
this.cookTime = 0;
|
||||
this.smeltItem();
|
||||
flag1 = true;
|
||||
}
|
||||
} 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)
|
||||
{
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
if (itemstack == null)
|
||||
return false;
|
||||
if (this.slots[2] == null)
|
||||
return true;
|
||||
if (!this.slots[2].isItemEqual(itemstack))
|
||||
return false;
|
||||
int result = slots[2].stackSize + (itemstack.stackSize * 2);
|
||||
return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack
|
||||
*/
|
||||
public void smeltItem() {
|
||||
if (this.canSmelt())
|
||||
{
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]);
|
||||
|
||||
if (this.slots[2] == null)
|
||||
{
|
||||
this.slots[2] = itemstack.copy();
|
||||
this.slots[2].stackSize *= 2;
|
||||
} else if (this.slots[2].isItemEqual(itemstack))
|
||||
{
|
||||
slots[2].stackSize += (itemstack.stackSize * 2);
|
||||
}
|
||||
|
||||
--this.slots[0].stackSize;
|
||||
|
||||
if (this.slots[0].stackSize <= 0)
|
||||
{
|
||||
this.slots[0] = null;
|
||||
}
|
||||
this.addBonus();
|
||||
}
|
||||
}
|
||||
|
||||
public void addBonus() {
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
public void openChest() {
|
||||
}
|
||||
|
||||
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].stackSize >= 63)
|
||||
return true;
|
||||
else if (slots[i].stackSize < 63)
|
||||
return false;
|
||||
else
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
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")))
|
||||
{
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtMachines, 1, 1);
|
||||
}
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityFireSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 1);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityFireSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
if (worldObj.provider.dimensionId == -1)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput * 2);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 12);
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*******************************************************************************
|
||||
* 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.nbt.NBTTagCompound;
|
||||
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 TileEntityIgnisGenerator extends TileEntity
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
public ForgeDirection orientation;
|
||||
public static int waitTime;
|
||||
private BasicSource energySource = new BasicSource(this, 1000000000, 3);
|
||||
|
||||
public TileEntityIgnisGenerator()
|
||||
{
|
||||
orientation = ForgeDirection.getOrientation(1);
|
||||
waitTime = 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
|
||||
if (waitTime > 0)
|
||||
{
|
||||
waitTime--;
|
||||
}
|
||||
|
||||
if (waitTime <= 0)
|
||||
{
|
||||
if (EssentiaHandler.drainEssentia(this, Aspect.FIRE, ForgeDirection.UNKNOWN, 8))
|
||||
{
|
||||
energySource.addEnergy(6000);
|
||||
}
|
||||
waitTime = Config.essentiaGeneratorsDelay;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
energySource.readFromNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
energySource.writeToNBT(tag);
|
||||
}
|
||||
}
|
||||
+239
@@ -0,0 +1,239 @@
|
||||
/*******************************************************************************
|
||||
* 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.BasicSink;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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
|
||||
{
|
||||
private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4);
|
||||
|
||||
ItemStack ItemStacks[];
|
||||
|
||||
public TileEntityIndustrialWandRecharge()
|
||||
{
|
||||
ItemStacks = new ItemStack[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return ItemStacks[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if (ItemStacks[i] != null)
|
||||
{
|
||||
|
||||
if (ItemStacks[i].stackSize <= j)
|
||||
{
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
} else
|
||||
{
|
||||
ItemStack itemstack1 = ItemStacks[i].splitStack(j);
|
||||
|
||||
if (ItemStacks[i].stackSize == 0)
|
||||
{
|
||||
ItemStacks[i] = null;
|
||||
}
|
||||
|
||||
return itemstack1;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if (ItemStacks[i] != null)
|
||||
{
|
||||
ItemStack itemstack = ItemStacks[i];
|
||||
ItemStacks[i] = null;
|
||||
return itemstack;
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
ic2EnergySink.updateEntity();
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if (getStackInSlot(0) != null)
|
||||
{
|
||||
|
||||
ItemStack wand = getStackInSlot(0);
|
||||
|
||||
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);
|
||||
wandItem.addVis(wand, Aspect.ENTROPY, 1, true);
|
||||
wandItem.addVis(wand, Aspect.WATER, 1, true);
|
||||
wandItem.addVis(wand, Aspect.EARTH, 1, true);
|
||||
wandItem.addVis(wand, Aspect.AIR, 1, true);
|
||||
}
|
||||
}
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
ItemStacks[i] = itemstack;
|
||||
|
||||
if (itemstack != null && itemstack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemstack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName() {
|
||||
return "Industrial Wand Charging Station";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if (worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <= 64D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
ic2EnergySink.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
ic2EnergySink.onChunkUnload();
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityOrderSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 2);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityOrderSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput * 3);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 9);
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/*******************************************************************************
|
||||
* 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 thaumcraft.api.nodes.NodeModifier;
|
||||
import thaumcraft.api.nodes.NodeType;
|
||||
import thaumcraft.common.tiles.TileNode;
|
||||
|
||||
public class TileEntityPortableNode extends TileNode
|
||||
{
|
||||
|
||||
public TileEntityPortableNode()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NodeModifier getNodeModifier() {
|
||||
return NodeModifier.FADING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NodeType getNodeType() {
|
||||
return NodeType.UNSTABLE;
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/*******************************************************************************
|
||||
* 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.nbt.NBTTagCompound;
|
||||
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 TileEntityPotentiaGenerator extends TileEntity
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
public ForgeDirection orientation;
|
||||
public static int waitTime;
|
||||
|
||||
public TileEntityPotentiaGenerator()
|
||||
{
|
||||
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 (EssentiaHandler.drainEssentia(this, Aspect.ENERGY, ForgeDirection.UNKNOWN, 8))
|
||||
{
|
||||
energySource.addEnergy(Config.potentiaGenOutput);
|
||||
}
|
||||
waitTime = Config.essentiaGeneratorsDelay;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
energySource.readFromNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
energySource.writeToNBT(tag);
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
/*******************************************************************************
|
||||
* 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 (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();
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityTripleAirSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 1000000, 5);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityTripleAirSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible && this.yCoord >= 160)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 1);
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityTripleCompressedSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 1000000, 3);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityTripleCompressedSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 2);
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityTripleDarkSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 1000000, 3);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityTripleDarkSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
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)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 8);
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityTripleEarthSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 1000000, 5);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityTripleEarthSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible && this.yCoord <= 10)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars2, 1, 4);
|
||||
}
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityTripleFireSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 1000000, 5);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityTripleFireSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
if (worldObj.provider.dimensionId == -1)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 14);
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityTripleOrderSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 1000000, 5);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityTripleOrderSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (tick-- == 0)
|
||||
{
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
int energyProduction = 0;
|
||||
|
||||
if (theSunIsVisible)
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput * 3);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 11);
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityTripleWaterSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 1000000, 3);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityTripleWaterSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
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))
|
||||
{
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 5);
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*******************************************************************************
|
||||
* 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 ic2.api.tile.IWrenchable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
|
||||
public class TileEntityWaterSolar extends TileEntity implements IWrenchable
|
||||
{
|
||||
|
||||
private BasicSource energySource = new BasicSource(this, 10000, 1);
|
||||
private static Random random = new Random();
|
||||
private boolean initialized;
|
||||
public boolean theSunIsVisible;
|
||||
private int tick;
|
||||
private boolean canRain;
|
||||
private boolean noSunlight;
|
||||
|
||||
public TileEntityWaterSolar()
|
||||
{
|
||||
super();
|
||||
this.tick = random.nextInt(64);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
energySource.updateEntity();
|
||||
if (!initialized && worldObj != null)
|
||||
{
|
||||
canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0;
|
||||
noSunlight = worldObj.provider.hasNoSky;
|
||||
initialized = true;
|
||||
}
|
||||
if (noSunlight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
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))
|
||||
{
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
energySource.addEnergy(energyProduction);
|
||||
}
|
||||
|
||||
private void updateSunState() {
|
||||
boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering());
|
||||
theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
energySource.writeToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
energySource.readFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public short getFacing() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacing(short facing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(BlockRegistry.emtSolars, 1, 3);
|
||||
}
|
||||
}
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
/*******************************************************************************
|
||||
* 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.container;
|
||||
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.slot.SlotInvSlot;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import thaumcraft.common.container.SlotOutput;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEtherealMacerator;
|
||||
|
||||
public class ContainerEtheralMacerator extends Container
|
||||
{
|
||||
|
||||
TileEntityEtherealMacerator 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++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return this.te.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public final ItemStack transferStackInSlot(EntityPlayer player, int sourceSlotIndex) {
|
||||
Slot sourceSlot = (Slot) inventorySlots.get(sourceSlotIndex);
|
||||
|
||||
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)
|
||||
{
|
||||
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
|
||||
|
||||
if (sourceItemStack.stackSize == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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)
|
||||
{
|
||||
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
|
||||
|
||||
if (sourceItemStack.stackSize == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceItemStack.stackSize != oldSourceItemStackSize)
|
||||
{
|
||||
if (sourceItemStack.stackSize == 0)
|
||||
{
|
||||
sourceSlot.putStack(null);
|
||||
} else
|
||||
{
|
||||
sourceSlot.onPickupFromSlot(player, sourceItemStack);
|
||||
}
|
||||
|
||||
// vanilla doesn't fully re-sync after processing the slot click
|
||||
// packet,
|
||||
// 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())
|
||||
{
|
||||
detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
/*******************************************************************************
|
||||
* 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.container;
|
||||
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.slot.SlotInvSlot;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
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
|
||||
{
|
||||
|
||||
TileEntityIndustrialWandRecharge charger;
|
||||
SlotWandOnly wandSlot;
|
||||
|
||||
public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity)
|
||||
{
|
||||
this.charger = entity;
|
||||
|
||||
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++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18));
|
||||
}
|
||||
}
|
||||
|
||||
this.addSlotToContainer(this.wandSlot = new SlotWandOnly(this, entity, 0, 80, 35));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return charger.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public final ItemStack transferStackInSlot(EntityPlayer player, int sourceSlotIndex) {
|
||||
Slot sourceSlot = (Slot) inventorySlots.get(sourceSlotIndex);
|
||||
|
||||
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)
|
||||
{
|
||||
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
|
||||
|
||||
if (sourceItemStack.stackSize == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} 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)
|
||||
{
|
||||
mergeItemStack(sourceItemStack, targetSlot.slotNumber, targetSlot.slotNumber + 1, false);
|
||||
|
||||
if (sourceItemStack.stackSize == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceItemStack.stackSize != oldSourceItemStackSize)
|
||||
{
|
||||
if (sourceItemStack.stackSize == 0)
|
||||
{
|
||||
sourceSlot.putStack(null);
|
||||
} else
|
||||
{
|
||||
sourceSlot.onPickupFromSlot(player, sourceItemStack);
|
||||
}
|
||||
|
||||
// vanilla doesn't fully re-sync after processing the slot click
|
||||
// packet,
|
||||
// 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())
|
||||
{
|
||||
detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*******************************************************************************
|
||||
* 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.slot;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerIndustrialWandRecharge;
|
||||
|
||||
public class SlotWandOnly extends Slot
|
||||
{
|
||||
final ContainerIndustrialWandRecharge charger;
|
||||
|
||||
public SlotWandOnly(ContainerIndustrialWandRecharge indCharger, IInventory inv, int par3, int par4, int par5)
|
||||
{
|
||||
super(inv, par3, par4, par5);
|
||||
this.charger = indCharger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
if (!(par1ItemStack.getItem() instanceof ItemWandCasting))
|
||||
return false;
|
||||
|
||||
ItemWandCasting wand = (ItemWandCasting) par1ItemStack.getItem();
|
||||
return wand.getCap(par1ItemStack).getBaseCostModifier() <= 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user