mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-20 03:59:36 +00:00
991 files modified. GG ME. Still not done though
This is the first commit of the rewrite. A lot has been done, but it's not over.
This commit is contained in:
1 parent
621fb17840
commit
766aa180ae
569 files changed
+4065
-6321
No files matched your search
@@ -1,6 +1,19 @@
|
||||
Changelog of the mod : Electric Magic Tools, a Thaumcraft 4/Industrial-Craft 2 addon
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Version 1.1.4 :
|
||||
Updated to Minecraft version 1.7.10.
|
||||
Rewrote and improved the Essentia Generator code. It's now very easy to add new ones.
|
||||
Rewrote and improved the Solar Panel code. It's now very easy to add new ones.
|
||||
Rewrote and improved the Drill, Chainsaw, Omnitool, Boot, Goggle and Wing code. It's now very easy to add new ones, as well as way more efficient.
|
||||
Refractored a lot of the code in preparation for the modules.
|
||||
Added a new Essentia Generator, the Aer Generator.
|
||||
Added a tooltip to the current Essentia Generators, saying they will be removed in future versions.
|
||||
Added an Essentia Generator, alongisde with a dynamic system calculating outputs linked to different essentias. Change the values of the primals in the config, and there is even a maximum cap!
|
||||
|
||||
Version 1.1.3 :
|
||||
Added a logo to the mcmod.info, and fixed the version tag.
|
||||
|
||||
Version 1.1.2 :
|
||||
Fixed the Shield Block being broken by the wither.
|
||||
Added Config GUIs. Regenerating the config file is HIGLY reccomended.
|
||||
|
||||
+2
-2
@@ -17,12 +17,12 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.1.2"
|
||||
version = "1.7.10-1.1.4Beta3"
|
||||
group= ""
|
||||
archivesBaseName = "ElectroMagicTools"
|
||||
|
||||
minecraft {
|
||||
version = "1.7.2-10.12.2.1147"
|
||||
version = "1.7.10-10.13.0.1208"
|
||||
assetDir = "eclipse/assets"
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Vendored
BIN
Binary file not shown.
+2
-2
@@ -1,6 +1,6 @@
|
||||
#Tue Oct 29 18:00:54 CDT 2013
|
||||
#Wed Jul 02 15:54:47 CDT 2014
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,108 +0,0 @@
|
||||
package ic2.api.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Allows for charging, discharging and using electric items (IElectricItem).
|
||||
*
|
||||
* The charge or remaining capacity of an item can be determined by calling charge/discharge with
|
||||
* ignoreTransferLimit and simulate set to true.
|
||||
*/
|
||||
public final class ElectricItem {
|
||||
/**
|
||||
* IElectricItemManager to use for interacting with IElectricItem ItemStacks.
|
||||
*
|
||||
* This manager will act as a gateway and delegate the tasks to the final implementation
|
||||
* (rawManager or a custom one) as necessary.
|
||||
*/
|
||||
public static IElectricItemManager manager;
|
||||
|
||||
/**
|
||||
* Standard IElectricItemManager implementation, only call it directly from another
|
||||
* IElectricItemManager. Use manager instead.
|
||||
*/
|
||||
public static IElectricItemManager rawManager;
|
||||
|
||||
/**
|
||||
* Charge an item with a specified amount of energy
|
||||
*
|
||||
* @param itemStack electric item's stack
|
||||
* @param amount amount of energy to charge in EU
|
||||
* @param tier tier of the charging device, has to be at least as high as the item to charge
|
||||
* @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
|
||||
* @param simulate don't actually change the item, just determine the return value
|
||||
* @return Energy transferred into the electric item
|
||||
*
|
||||
* @deprecated use manager.charge() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static int charge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate) {
|
||||
return manager.charge(itemStack, amount, tier, ignoreTransferLimit, simulate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Discharge an item by a specified amount of energy
|
||||
*
|
||||
* @param itemStack electric item's stack
|
||||
* @param amount amount of energy to charge in EU
|
||||
* @param tier tier of the discharging device, has to be at least as high as the item to discharge
|
||||
* @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
|
||||
* @param simulate don't actually discharge the item, just determine the return value
|
||||
* @return Energy retrieved from the electric item
|
||||
*
|
||||
* @deprecated use manager.discharge() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static int discharge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate) {
|
||||
return manager.discharge(itemStack, amount, tier, ignoreTransferLimit, simulate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the specified electric item has at least a specific amount of EU.
|
||||
* This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
|
||||
* BatPacks are not taken into account.
|
||||
*
|
||||
* @param itemStack electric item's stack
|
||||
* @param amount minimum amount of energy required
|
||||
* @return true if there's enough energy
|
||||
*
|
||||
* @deprecated use manager.canUse() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean canUse(ItemStack itemStack, int amount) {
|
||||
return manager.canUse(itemStack, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack.
|
||||
* This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
|
||||
*
|
||||
* @param itemStack electric item's stack
|
||||
* @param amount amount of energy to discharge in EU
|
||||
* @param player player holding the item
|
||||
* @return true if the operation succeeded
|
||||
*
|
||||
* @deprecated use manager.use() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean use(ItemStack itemStack, int amount, EntityPlayer player) {
|
||||
return manager.use(itemStack, amount, player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge an item from the BatPack a player is wearing.
|
||||
* This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
|
||||
* use() already contains this functionality.
|
||||
*
|
||||
* @param itemStack electric item's stack
|
||||
* @param player player holding the item
|
||||
*
|
||||
* @deprecated use manager.chargeFromArmor() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static void chargeFromArmor(ItemStack itemStack, EntityPlayer player) {
|
||||
manager.chargeFromArmor(itemStack, player);
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,67 +0,0 @@
|
||||
package ic2.api.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Provides the ability to store energy on the implementing item.
|
||||
*
|
||||
* This interface is a special version of IElectricItem which delegates the implementation of
|
||||
* charge(), discharge() and canUse() to the implementing Item.
|
||||
*
|
||||
* The default implementation (when not using ICustomElectricItem) does the following:
|
||||
* - store and retrieve the charge
|
||||
* - handle charging, taking amount, tier, transfer limit, canProvideEnergy and simulate into account
|
||||
* - replace item IDs if appropriate (getChargedItemId() and getEmptyItemId())
|
||||
* - update and manage the damage value for the visual charge indicator
|
||||
*
|
||||
* @note ICustomElectricItem must not call the ElectricItem methods charge, discharge or canUse
|
||||
*
|
||||
* @deprecated Use ISpecialElectricItem instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ICustomElectricItem extends IElectricItem {
|
||||
/**
|
||||
* Charge an item with a specified amount of energy
|
||||
*
|
||||
* @param itemStack electric item's stack
|
||||
* @param amount amount of energy to charge in EU
|
||||
* @param tier tier of the charging device, has to be at least as high as the item to charge
|
||||
* @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
|
||||
* @param simulate don't actually change the item, just determine the return value
|
||||
* @return Energy transferred into the electric item
|
||||
*/
|
||||
public int charge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate);
|
||||
|
||||
/**
|
||||
* Discharge an item by a specified amount of energy
|
||||
*
|
||||
* @param itemStack electric item's stack
|
||||
* @param amount amount of energy to charge in EU
|
||||
* @param tier tier of the discharging device, has to be at least as high as the item to discharge
|
||||
* @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
|
||||
* @param simulate don't actually discharge the item, just determine the return value
|
||||
* @return Energy retrieved from the electric item
|
||||
*/
|
||||
public int discharge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate);
|
||||
|
||||
/**
|
||||
* Determine if the specified electric item has at least a specific amount of EU.
|
||||
* This is supposed to be used in the item code during operation, for example if you want to implement your own electric item.
|
||||
* BatPacks are not taken into account.
|
||||
*
|
||||
* @param itemStack electric item's stack
|
||||
* @param amount minimum amount of energy required
|
||||
* @return true if there's enough energy
|
||||
*/
|
||||
public boolean canUse(ItemStack itemStack, int amount);
|
||||
|
||||
/**
|
||||
* Determine whether to show the charge tool tip with NEI or other means.
|
||||
*
|
||||
* Return false if IC2's handler is incompatible, you want to implement your own or you don't
|
||||
* want to display the charge at all.
|
||||
*
|
||||
* @return true to show the tool tip (x/y EU)
|
||||
*/
|
||||
public boolean canShowChargeToolTip(ItemStack itemStack);
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,34 +0,0 @@
|
||||
package ic2.api.reactor;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class IC2Reactor {
|
||||
private static Field energyGeneratorNuclear;
|
||||
|
||||
public static int getEUOutput() {
|
||||
try {
|
||||
if (energyGeneratorNuclear == null) energyGeneratorNuclear = Class.forName(getPackage() + ".core.IC2").getDeclaredField("energyGeneratorNuclear");
|
||||
|
||||
return energyGeneratorNuclear.getInt(null);
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the base IC2 package name, used internally.
|
||||
*
|
||||
* @return IC2 package name, if unable to be determined defaults to ic2
|
||||
*/
|
||||
private static String getPackage() {
|
||||
Package pkg = IC2Reactor.class.getPackage();
|
||||
|
||||
if (pkg != null) {
|
||||
String packageName = pkg.getName();
|
||||
|
||||
return packageName.substring(0, packageName.length() - ".baubles.api.reactor".length());
|
||||
}
|
||||
|
||||
return "ic2";
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,33 +1,40 @@
|
||||
package baubles.api;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
*/
|
||||
public class BaublesApi {
|
||||
|
||||
public class BaublesApi
|
||||
{
|
||||
static Method getBaubles;
|
||||
|
||||
/**
|
||||
* Retrieves the baubles inventory for the supplied player
|
||||
*/
|
||||
public static IInventory getBaubles(EntityPlayer player) {
|
||||
public static IInventory getBaubles(EntityPlayer player)
|
||||
{
|
||||
IInventory ot = null;
|
||||
try {
|
||||
if(getBaubles == null) {
|
||||
Class fake = Class.forName("baubles.common.lib.PlayerHandler");
|
||||
|
||||
try
|
||||
{
|
||||
if(getBaubles == null)
|
||||
{
|
||||
Class<?> fake = Class.forName("baubles.common.lib.PlayerHandler");
|
||||
getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class);
|
||||
}
|
||||
|
||||
ot = (IInventory) getBaubles.invoke(null, player);
|
||||
} catch(Exception ex) {
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles");
|
||||
}
|
||||
|
||||
return ot;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
@API(apiVersion = "1.0.0.16", owner = "Baubles", provides = "Baubles|API")
|
||||
@API(apiVersion = "1.7.10-1.0.1.5", owner = "Baubles", provides = "Baubles|API")
|
||||
package baubles.api;
|
||||
import cpw.mods.fml.common.API;
|
||||
-147
@@ -1,147 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.client;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.ThreadDownloadImageData;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
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;
|
||||
|
||||
public class CapeEventHandler {
|
||||
private final String serverLocation = "https://raw.github.com/Tombenpotter/Electro-Magic-Tools/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;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
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.getCommandSenderName());
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common;
|
||||
|
||||
import 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.solars.TileEntityCompressedSolar.class, "tileentitycompressedsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleCompressedSolar.class, "tileentitytriplecompressedsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityWaterSolar.class, "tileentitywatersolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDarkSolar.class, "tileentitydarksolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleDarkSolar.class, "tileentitytripledarksolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityOrderSolar.class, "tileentityordersolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleOrderSolar.class, "tileentitytripleordersolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityFireSolar.class, "tileentityfiresolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleFireSolar.class, "tileentitytriplefiresolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityAirSolar.class, "tileentityairsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleAirSolar.class, "tileentitytripleairsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityEarthSolar.class, "tileentityearthsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.solars.TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar");
|
||||
GameRegistry.registerTileEntity(electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityPortableNode.class, "tileentityportablenode");
|
||||
}
|
||||
}
|
||||
-176
@@ -1,176 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.blocks;
|
||||
|
||||
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.solars.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockEMTSolars extends BlockEMT {
|
||||
|
||||
public BlockEMTSolars() {
|
||||
super(Material.iron);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setHardness(4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.top[0] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/solartop");
|
||||
this.top[1] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/doublesolartop");
|
||||
this.top[2] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/triplesolartop");
|
||||
this.top[3] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/solartop");
|
||||
this.top[4] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/doublesolartop");
|
||||
this.top[5] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/triplesolartop");
|
||||
this.top[6] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/solartop");
|
||||
this.top[7] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/doublesolartop");
|
||||
this.top[8] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/triplesolartop");
|
||||
this.top[9] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/solartop");
|
||||
this.top[10] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/doublesolartop");
|
||||
this.top[11] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/triplesolartop");
|
||||
this.top[12] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/solartop");
|
||||
this.top[13] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/doublesolartop");
|
||||
this.top[14] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/triplesolartop");
|
||||
this.top[15] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/solartop");
|
||||
|
||||
this.bottom[0] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/bottom");
|
||||
this.bottom[1] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/bottom");
|
||||
this.bottom[2] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/bottom");
|
||||
this.bottom[3] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterbottom");
|
||||
this.bottom[4] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterbottom");
|
||||
this.bottom[5] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterbottom");
|
||||
this.bottom[6] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkbottom");
|
||||
this.bottom[7] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkbottom");
|
||||
this.bottom[8] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkbottom");
|
||||
this.bottom[9] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderbottom");
|
||||
this.bottom[10] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderbottom");
|
||||
this.bottom[11] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderbottom");
|
||||
this.bottom[12] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/firebottom");
|
||||
this.bottom[13] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/firebottom");
|
||||
this.bottom[14] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/firebottom");
|
||||
this.bottom[15] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airbottom");
|
||||
|
||||
this.frontOff[0] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/side");
|
||||
this.frontOff[1] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/side");
|
||||
this.frontOff[2] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/side");
|
||||
this.frontOff[3] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[4] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[5] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterside");
|
||||
this.frontOff[6] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[7] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[8] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkside");
|
||||
this.frontOff[9] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[10] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[11] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderside");
|
||||
this.frontOff[12] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[13] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[14] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/fireside");
|
||||
this.frontOff[15] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airside");
|
||||
|
||||
this.side[0] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/side");
|
||||
this.side[1] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/side");
|
||||
this.side[2] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/side");
|
||||
this.side[3] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterside");
|
||||
this.side[4] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterside");
|
||||
this.side[5] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/water/waterside");
|
||||
this.side[6] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkside");
|
||||
this.side[7] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkside");
|
||||
this.side[8] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/dark/darkside");
|
||||
this.side[9] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderside");
|
||||
this.side[10] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderside");
|
||||
this.side[11] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/order/orderside");
|
||||
this.side[12] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/fireside");
|
||||
this.side[13] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/fireside");
|
||||
this.side[14] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/fire/fireside");
|
||||
this.side[15] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airside");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 15; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@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 void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
}
|
||||
-99
@@ -1,99 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.blocks;
|
||||
|
||||
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.solars.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockEMTSolars2 extends BlockEMT {
|
||||
|
||||
public BlockEMTSolars2() {
|
||||
super(Material.iron);
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setHardness(4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ri) {
|
||||
this.top[0] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/doublesolartop");
|
||||
this.top[1] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/triplesolartop");
|
||||
this.top[2] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/solartop");
|
||||
this.top[3] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/doublesolartop");
|
||||
this.top[4] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/triplesolartop");
|
||||
|
||||
this.bottom[0] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airbottom");
|
||||
this.bottom[1] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airbottom");
|
||||
this.bottom[2] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthbottom");
|
||||
this.bottom[3] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthbottom");
|
||||
this.bottom[4] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthbottom");
|
||||
|
||||
this.frontOff[0] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airside");
|
||||
this.frontOff[1] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airside");
|
||||
this.frontOff[2] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthside");
|
||||
this.frontOff[3] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthside");
|
||||
this.frontOff[4] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthside");
|
||||
|
||||
this.side[0] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airside");
|
||||
this.side[1] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/air/airside");
|
||||
this.side[2] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthside");
|
||||
this.side[3] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthside");
|
||||
this.side[4] = ri.registerIcon(ElectricMagicTools.texturePath + ":solars/earth/earthside");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@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 void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
}
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
*
|
||||
* 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.boots;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.ElectricMagicTools;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public int maxCharge = 500000;
|
||||
|
||||
public ItemNanoBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":nanobootstravel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ElectricMagicTools.texturePath + ":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;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@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).getItem() == this;
|
||||
|
||||
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%");
|
||||
}
|
||||
}
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
*
|
||||
* 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.boots;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.ElectricMagicTools;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public int maxCharge = 1000000;
|
||||
|
||||
public ItemQuantumBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":quantumbootstravel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ElectricMagicTools.texturePath + ":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;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@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).getItem() == this;
|
||||
|
||||
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%");
|
||||
}
|
||||
}
|
||||
-73
@@ -1,73 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.armor.goggles;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.ElectricMagicTools;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemElectricGoggles extends ItemQuantumThaumicHelmet {
|
||||
|
||||
public int maxCharge = 10000;
|
||||
|
||||
public ItemElectricGoggles(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":electricgoggles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ElectricMagicTools.texturePath + ":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 onArmorTick(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%");
|
||||
}
|
||||
}
|
||||
-246
@@ -1,246 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.armor.goggles;
|
||||
|
||||
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.ElectricMagicTools;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.api.item.IMetalArmor;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.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 java.util.*;
|
||||
|
||||
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 par3, int par4) {
|
||||
super(ArmorMaterial.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(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":quantumthaumichelmet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
return ElectricMagicTools.texturePath + ":textures/models/thaumicquantumhelmet.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void onArmorTick(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(Items.milk_bucket));
|
||||
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(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
-107
@@ -1,107 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
|
||||
|
||||
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 ic2.api.item.ElectricItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemDiamondChainsaw extends ItemThaumiumChainsaw {
|
||||
|
||||
public int maxCharge = 40000;
|
||||
private final int cost = 200;
|
||||
private final int hitCost = 300;
|
||||
|
||||
public ItemDiamondChainsaw() {
|
||||
super();
|
||||
this.efficiencyOnProperMaterial = 16F;
|
||||
this.setCreativeTab(CreativeTab.tabTombenpotter);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":diamondchainsaw");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 300;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||
return efficiencyOnProperMaterial;
|
||||
} else {
|
||||
return super.getDigSpeed(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;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
|
||||
|
||||
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.ElectricMagicTools;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
|
||||
|
||||
public int maxCharge = 70000;
|
||||
private int cost;
|
||||
private final int hitCost = 250;
|
||||
|
||||
public ItemOmnitoolDiamond() {
|
||||
super();
|
||||
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(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":diamondomnitool");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 400;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
if (Config.toolsInBore == false) {
|
||||
cost = 200;
|
||||
} else {
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||
return efficiencyOnProperMaterial;
|
||||
} else {
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.items.tools;
|
||||
|
||||
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.ElectricMagicTools;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
|
||||
|
||||
public int maxCharge = 140000;
|
||||
private int cost;
|
||||
private final int hitCost = 650;
|
||||
|
||||
public ItemOmnitoolThaumium() {
|
||||
super();
|
||||
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(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":thaumiumomnitool");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransferLimit(ItemStack itemStack) {
|
||||
return 800;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
|
||||
if (Config.toolsInBore == false) {
|
||||
cost = 300;
|
||||
} else {
|
||||
cost = 1;
|
||||
}
|
||||
ElectricItem.manager.use(stack, cost, entityLiving);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||
return efficiencyOnProperMaterial;
|
||||
} else {
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
-200
@@ -1,200 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
*
|
||||
* 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 cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.CreativeTab;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.ElectricMagicTools;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumAction;
|
||||
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.Thaumcraft;
|
||||
import thaumcraft.common.lib.Utils;
|
||||
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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() {
|
||||
super(ToolMaterial.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) {
|
||||
Block bi = world.getBlock(x, y, z);
|
||||
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
|
||||
if (!world.isRemote) {
|
||||
if (Utils.breakFurthestBlock(world, x, y, z, bi, player)) {
|
||||
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
this.alternateServer = (!this.alternateServer);
|
||||
}
|
||||
} else {
|
||||
player.swingItem();
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
this.alternateClient = (!this.alternateClient);
|
||||
}
|
||||
}
|
||||
return super.onItemUse(itemstack, player, world, x, y, z, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
Block bi = world.getBlock(x, y, z);
|
||||
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
|
||||
if (!world.isRemote) {
|
||||
Utils.breakFurthestBlock(world, x, y, z, bi, player);
|
||||
Thaumcraft.packetPipeline.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
|
||||
|
||||
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
|
||||
}
|
||||
ElectricItem.manager.use(itemstack, cost, player);
|
||||
return true;
|
||||
}
|
||||
return super.onBlockStartBreak(itemstack, x, y, z, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@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(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(ElectricMagicTools.texturePath + ":streamchainsaw");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
ItemStack itemStack = new ItemStack(this, 1);
|
||||
if (getChargedItem(itemStack) == this) {
|
||||
ItemStack charged = new ItemStack(this, 1);
|
||||
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
|
||||
itemList.add(charged);
|
||||
}
|
||||
if (getEmptyItem(itemStack) == this) {
|
||||
itemList.add(new ItemStack(this, 1, getMaxDamage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack stack) {
|
||||
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed(ItemStack stack, Block block, int meta) {
|
||||
if (!ElectricItem.manager.canUse(stack, cost)) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
|
||||
return efficiencyOnProperMaterial;
|
||||
} else {
|
||||
return super.getDigSpeed(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 Item getChargedItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.lib;
|
||||
|
||||
public class TextHelper {
|
||||
|
||||
/**
|
||||
* Color Coding *
|
||||
*/
|
||||
public static String black = "�0";
|
||||
public static String darkBlue = "�1";
|
||||
public static String darkGreen = "�2";
|
||||
public static String darkAqua = "�3";
|
||||
public static String darkRed = "�4";
|
||||
public static String darkPurple = "�5";
|
||||
public static String gold = "�6";
|
||||
public static String gray = "�7";
|
||||
public static String darkGray = "�8";
|
||||
public static String blue = "�9";
|
||||
public static String green = "�a";
|
||||
public static String aqua = "�b";
|
||||
public static String red = "�c";
|
||||
public static String lightPurple = "�d";
|
||||
public static String yellow = "�e";
|
||||
public static String white = "�f";
|
||||
|
||||
/**
|
||||
* Text Formating *
|
||||
*/
|
||||
public static String obfuscated = "�k";
|
||||
public static String bold = "�l";
|
||||
public static String strikethrough = "�m";
|
||||
public static String underline = "�n";
|
||||
public static String italics = "�o";
|
||||
public static String resetFormatting = "�r";
|
||||
|
||||
/**
|
||||
* Useful Tooltips *
|
||||
*/
|
||||
public static String shiftForMoreInfo = darkGreen + italics + "Press Shift for more information";
|
||||
|
||||
}
|
||||
-312
@@ -1,312 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.recipes;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.ItemRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.lib.CraftingAspects;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.recipe.IRecipeInput;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import ic2.api.recipe.Recipes;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
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 java.util.Iterator;
|
||||
|
||||
public class EMTPostInitRecipes {
|
||||
|
||||
public static void add() {
|
||||
|
||||
/** Infusion Recipes **/
|
||||
|
||||
thaumiumDrill = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Drill", new ItemStack(ItemRegistry.thaumiumDrill), 5, CraftingAspects.thaumiumDrillCrafting, new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron")});
|
||||
|
||||
thaumiumChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Chainsaw", new ItemStack(ItemRegistry.thaumiumChainsaw), 5, CraftingAspects.thaumiumChainsawCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron")});
|
||||
|
||||
thaumicQuantumHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Goggles of Revealing", new ItemStack(ItemRegistry.quantumThaumicHelmet), 6, CraftingAspects.thaumicQuantumHelmetCrafting, new ItemStack(ItemRegistry.nanoThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.milk_bucket), new ItemStack(IC2Items.getItem("quantumHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("advancedCircuit")});
|
||||
|
||||
thaumicNanoHelmet = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Goggles of Revealing", new ItemStack(ItemRegistry.nanoThaumicHelmet), 5, CraftingAspects.thaumicNanoHelmetCrafting, new ItemStack(ItemRegistry.electricGoggles, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(Items.gold_ingot), new ItemStack(IC2Items.getItem("nanoHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("carbonPlate"), IC2Items.getItem("electronicCircuit")});
|
||||
|
||||
thaumiumOmnitool = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(ItemRegistry.thaumiumOmnitool), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), IC2Items.getItem("carbonPlate"), IC2Items.getItem("plateobsidian")});
|
||||
|
||||
diamondOmnitoolToThaumium = ThaumcraftApi.addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(ItemRegistry.thaumiumOmnitool), 6, CraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(ItemRegistry.diamondOmnitool, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Blocks.diamond_block), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("carbonPlate"), IC2Items.getItem("advancedCircuit")});
|
||||
|
||||
explosionFocus = ThaumcraftApi.addInfusionCraftingRecipe("Explosion Focus", new ItemStack(ItemRegistry.explosionFocus), 6, CraftingAspects.laserFocusCrafting, new ItemStack(ConfigItems.itemFocusHellbat, 1), new ItemStack[]{new ItemStack(IC2Items.getItem("miningLaser").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.arrow), new ItemStack(Items.gunpowder), new ItemStack(Items.firework_charge), new ItemStack(ConfigItems.itemResource, 1, 1)});
|
||||
|
||||
shieldFocus = ThaumcraftApi.addInfusionCraftingRecipe("Shield Focus", new ItemStack(ItemRegistry.shieldFocus), 4, CraftingAspects.shieldFocusCrafting, new ItemStack(ConfigItems.itemFocusPortableHole, 1), new ItemStack[]{IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.obsidian), new ItemStack(Blocks.obsidian)});
|
||||
|
||||
potentiaGenerator = ThaumcraftApi.addInfusionCraftingRecipe("Potentia Generator", new ItemStack(BlockRegistry.essentiaGens, 1, 0), 6, CraftingAspects.potentiaGeneratorCrafting, IC2Items.getItem("semifluidGenerator"), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(ConfigItems.itemFocusTrade), new ItemStack(Blocks.hopper), new ItemStack(ConfigBlocks.blockJar), IC2Items.getItem("mvTransformer"), IC2Items.getItem("advancedMachine"), IC2Items.getItem("orewashingplant"), IC2Items.getItem("scrap")});
|
||||
|
||||
streamChainsaw = ThaumcraftApi.addInfusionCraftingRecipe("Chainsaw of the Stream", new ItemStack(ItemRegistry.streamChainsaw), 6, CraftingAspects.streamChaisnawCrafting, new ItemStack(ItemRegistry.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.water_bucket), new ItemStack(ConfigItems.itemAxeElemental), new ItemStack(ConfigBlocks.blockMagicalLog), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("compressedPlantBall"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade")});
|
||||
|
||||
rockbreakerDrill = ThaumcraftApi.addInfusionCraftingRecipe("Drill of the Rockbreaker", new ItemStack(ItemRegistry.rockbreakerDrill), 6, CraftingAspects.rockbreakerDrillCrafting, new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.flint_and_steel), new ItemStack(Items.fire_charge), new ItemStack(ConfigItems.itemPickElemental), new ItemStack(ConfigItems.itemShovelElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade")});
|
||||
|
||||
thorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Mjolnir", new ItemStack(ItemRegistry.thorHammer), 7, CraftingAspects.thorHammerCrafting, new ItemStack(ItemRegistry.taintedThorHammer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemFocusShock), IC2Items.getItem("rubber")});
|
||||
|
||||
superchargedThorHammer = ThaumcraftApi.addInfusionCraftingRecipe("Supercharged Mjolnir", new ItemStack(ItemRegistry.electricThorHammer), 10, CraftingAspects.superchargedThorHammerCrafting, new ItemStack(ItemRegistry.thorHammer, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(ItemRegistry.itemEMTItems, 1, 6), new ItemStack(Blocks.web), new ItemStack(ConfigItems.itemFocusHellbat), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("nanoSaber").getItem(), 1, OreDictionary.WILDCARD_VALUE)});
|
||||
|
||||
wandRecharger = ThaumcraftApi.addInfusionCraftingRecipe("Industrial Wand Charging Station", new ItemStack(BlockRegistry.emtMachines, 1, 0), 6, CraftingAspects.wandCharger, new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5), new ItemStack[]{IC2Items.getItem("replicator"), IC2Items.getItem("iridiumPlate"), new ItemStack(Blocks.diamond_block), new ItemStack(ConfigItems.itemShard, 1, 5), new ItemStack(ConfigBlocks.blockJar)});
|
||||
|
||||
solarHelmetRevealing = ThaumcraftApi.addInfusionCraftingRecipe("Solar Helmet of Revealing", new ItemStack(ItemRegistry.solarHelmetRevealing), 5, CraftingAspects.solarHelmetRevealing, new ItemStack(ItemRegistry.quantumThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(BlockRegistry.emtSolars, 1, 1), IC2Items.getItem("glassFiberCableItem"), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, 4)});
|
||||
|
||||
electricBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Electric Boots of the Traveller", new ItemStack(ItemRegistry.electricBootsTraveller), 2, CraftingAspects.electricBootsTravel, new ItemStack(ConfigItems.itemBootsTraveller), new ItemStack[]{new ItemStack(Items.diamond), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), IC2Items.getItem("hazmatBoots"), new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE)});
|
||||
|
||||
nanoBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Nano Boots of the Traveller", new ItemStack(ItemRegistry.nanoBootsTraveller), 2, CraftingAspects.nanoBootsTravel, new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Items.diamond), new ItemStack(IC2Items.getItem("nanoBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE)});
|
||||
|
||||
quantumBootsTravel = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Boots of the Traveller", new ItemStack(ItemRegistry.quantumBootsTraveller), 2, CraftingAspects.quantumBootsTravel, new ItemStack(ItemRegistry.nanoBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{new ItemStack(Blocks.diamond_block), new ItemStack(IC2Items.getItem("quantumBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate")});
|
||||
|
||||
etheralProcessor = ThaumcraftApi.addInfusionCraftingRecipe("Etheral Processor", new ItemStack(BlockRegistry.emtMachines, 1, 1), 3, CraftingAspects.etherealProcessor, IC2Items.getItem("macerator"), new ItemStack[]{IC2Items.getItem("electroFurnace"), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.iron_block), new ItemStack(Blocks.iron_block), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5)});
|
||||
|
||||
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(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("electricHoe").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.dye, 1, 15), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), new ItemStack(Blocks.sapling, 1, OreDictionary.WILDCARD_VALUE)});
|
||||
|
||||
chargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Charging", new ItemStack(ItemRegistry.chargeFocus), 4, CraftingAspects.chargeFocus, new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{IC2Items.getItem("generator"), IC2Items.getItem("batBox"), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ItemRegistry.itemEMTItems, 1, 5), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE)});
|
||||
|
||||
wandChargeFocus = ThaumcraftApi.addInfusionCraftingRecipe("Wand Focus: Wand Charging", new ItemStack(ItemRegistry.wandChargeFocus), 5, CraftingAspects.wandChargeFocus, new ItemStack(BlockRegistry.emtMachines, 1, 0), new ItemStack[]{new ItemStack(ItemRegistry.chargeFocus), new ItemStack(IC2Items.getItem("energyPack").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate")});
|
||||
|
||||
inventoryChargingRing = ThaumcraftApi.addInfusionCraftingRecipe("Inventory Charging Ring", new ItemStack(ItemRegistry.emtBauble, 1, 1), 6, CraftingAspects.inventoryChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), new ItemStack[]{new ItemStack(ItemRegistry.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("waterMill"), IC2Items.getItem("solarPanel"), IC2Items.getItem("windMill"), IC2Items.getItem("nuclearReactor")});
|
||||
|
||||
armorChargingRing = ThaumcraftApi.addInfusionCraftingRecipe("Armor Charging Ring", new ItemStack(ItemRegistry.emtBauble, 1, 0), 6, CraftingAspects.armorChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), new ItemStack[]{new ItemStack(ItemRegistry.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("waterMill"), IC2Items.getItem("solarPanel"), IC2Items.getItem("windMill"), IC2Items.getItem("nuclearReactor")});
|
||||
|
||||
nanoWings = ThaumcraftApi.addInfusionCraftingRecipe("Nanosuit Wings", new ItemStack(ItemRegistry.nanoWing), 4, CraftingAspects.nanoWing, new ItemStack(ItemRegistry.thaumiumWing), new ItemStack[]{IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), new ItemStack(IC2Items.getItem("nanoBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1)});
|
||||
|
||||
quantumWings = ThaumcraftApi.addInfusionCraftingRecipe("Quantum Wings", new ItemStack(ItemRegistry.quantumWing), 6, CraftingAspects.quantumWing, new ItemStack(ItemRegistry.nanoWing, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[]{IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1)});
|
||||
|
||||
/** Arcane Worktable Recipes **/
|
||||
|
||||
diamondOmnitool = ThaumcraftApi.addShapelessArcaneCraftingRecipe("Diamond Omnitool", new ItemStack(ItemRegistry.diamondOmnitool), CraftingAspects.diamondOmnitoolCrafting, new ItemStack(ItemRegistry.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
ironOmnitoolToDiamond = ThaumcraftApi.addArcaneCraftingRecipe("Diamond Omnitool", new ItemStack(ItemRegistry.diamondOmnitool), CraftingAspects.diamondOmnitoolCrafting, "XAX", "XBX", "XAX", 'X', new ItemStack(Items.diamond), 'A', IC2Items.getItem("advancedCircuit"), 'B', new ItemStack(ItemRegistry.ironOmnitool, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
christmasFocus = ThaumcraftApi.addArcaneCraftingRecipe("Kris-tmas Focus", new ItemStack(ItemRegistry.christmasFocus), CraftingAspects.christmasFocusCrafting, "XYX", "YZY", "XYX", 'X', new ItemStack(Blocks.snow), 'Y', new ItemStack(Blocks.pumpkin), 'Z', new ItemStack(ConfigItems.itemFocusFrost));
|
||||
|
||||
electricGoggles = ThaumcraftApi.addArcaneCraftingRecipe("Electric Goggles", new ItemStack(ItemRegistry.electricGoggles), CraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', IC2Items.getItem("electronicCircuit"), 'Y', new ItemStack(Items.diamond_helmet), 'A', new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'B', Items.repeater);
|
||||
|
||||
shieldBlock = ThaumcraftApi.addArcaneCraftingRecipe("Shield Blocks", new ItemStack(BlockRegistry.shield, 8), CraftingAspects.shieldBlockCrafting, "XYX", "X X", "XYX", 'X', new ItemStack(Blocks.glass), 'Y', new ItemStack(Blocks.obsidian));
|
||||
|
||||
tinyUranium = ThaumcraftApi.addShapelessArcaneCraftingRecipe("Tiny Uranium", new ItemStack(IC2Items.getItem("smallUran235").getItem(), 7), CraftingAspects.tinyUraniumCrafting, IC2Items.getItem("Uran238"));
|
||||
|
||||
compressedSolar = ThaumcraftApi.addArcaneCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 0), CraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', IC2Items.getItem("solarPanel"));
|
||||
|
||||
doubleCompressedSolar = ThaumcraftApi.addArcaneCraftingRecipe("Compressed Solars", new ItemStack(BlockRegistry.emtSolars, 1, 1), CraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', new ItemStack(BlockRegistry.emtSolars, 1, 0));
|
||||
|
||||
electricScribingTools = ThaumcraftApi.addArcaneCraftingRecipe("Electric Scribing Tools", new ItemStack(ItemRegistry.electricScribingTools), CraftingAspects.electricScribingTools, "YXY", "XZX", "YXY", 'Y', IC2Items.getItem("electronicCircuit"), 'X', new ItemStack(ConfigItems.itemInkwell), 'Z', new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
thaumiumWing = ThaumcraftApi.addArcaneCraftingRecipe("Thaumium Reinforced Wings", new ItemStack(ItemRegistry.itemEMTItems, 1, 15), CraftingAspects.thaumiumWing, "XYZ", "XYZ", "XYZ", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 14), 'Y', new ItemStack(ItemRegistry.itemEMTItems, 1, 5), 'Z', new ItemStack(ItemRegistry.itemEMTItems, 1, 13));
|
||||
|
||||
thaumiumWings = ThaumcraftApi.addArcaneCraftingRecipe("Thaumium Reinforced Wings", new ItemStack(ItemRegistry.thaumiumWing), CraftingAspects.thaumiumWing, "XX", 'X', new ItemStack(ItemRegistry.itemEMTItems, 1, 15));
|
||||
|
||||
/** 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);
|
||||
|
||||
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 = IC2Items.getItem("smallIronDust").copy();
|
||||
ironClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 16)), null, ironClusterRecipe);
|
||||
|
||||
ItemStack goldClusterRecipe = IC2Items.getItem("smallGoldDust").copy();
|
||||
goldClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 31)), null, goldClusterRecipe);
|
||||
|
||||
ItemStack copperClusterRecipe = IC2Items.getItem("smallCopperDust").copy();
|
||||
copperClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 17)), null, copperClusterRecipe);
|
||||
|
||||
ItemStack tinClusterRecipe = IC2Items.getItem("smallTinDust").copy();
|
||||
tinClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 18)), null, tinClusterRecipe);
|
||||
|
||||
ItemStack silverClusterRecipe = IC2Items.getItem("smallSilverDust").copy();
|
||||
silverClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 19)), null, silverClusterRecipe);
|
||||
|
||||
ItemStack leadClusterRecipe = IC2Items.getItem("smallLeadDust").copy();
|
||||
leadClusterRecipe.stackSize = 22;
|
||||
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 20)), null, leadClusterRecipe);
|
||||
|
||||
/* Thaumium Plates Recipes */
|
||||
thaumiumPlate = GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.itemEMTItems, 1, 5), "X", "Y", "Z", 'Y', new ItemStack(ConfigItems.itemResource, 1, 2), 'X', new ItemStack(IC2Items.getItem("ForgeHammer").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(Blocks.obsidian));
|
||||
Recipes.metalformerRolling.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemResource, 1, 2)), null, new ItemStack(ItemRegistry.itemEMTItems, 1, 5));
|
||||
|
||||
/* Iron Sheet Recipe */
|
||||
Recipes.metalformerRolling.addRecipe(new RecipeInputItemStack(IC2Items.getItem("denseplateiron")), null, new ItemStack(ItemRegistry.itemEMTItems, 1, 13));
|
||||
|
||||
/* Ore Processing for Amber and Cinnabar */
|
||||
if (Config.removeAmberAndCinnabarMacerating == true) {
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext(); ) {
|
||||
IRecipeInput input = it.next();
|
||||
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7))) {
|
||||
it.remove();
|
||||
FMLLog.info("[EMT] Electro-Magic Tools : Removing conflicting amber macerating recipe(s)");
|
||||
}
|
||||
}
|
||||
|
||||
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext(); ) {
|
||||
IRecipeInput input = it.next();
|
||||
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0))) {
|
||||
it.remove();
|
||||
FMLLog.info("[EMT] Electro-Magic Tools : Removing Conflicting cinnabar macerating recipe(s)");
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
ItemStack smallCopperDust = IC2Items.getItem("smallCopperDust");
|
||||
smallCopperDust.stackSize = 2;
|
||||
ItemStack smallTinDust = IC2Items.getItem("smallTinDust");
|
||||
smallCopperDust.stackSize = 2;
|
||||
|
||||
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 1)), waterAmount, new ItemStack[]{new ItemStack(ItemRegistry.itemEMTItems, 1, 2), smallCopperDust, IC2Items.getItem("stoneDust")});
|
||||
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 3)), waterAmount, new ItemStack[]{new ItemStack(ItemRegistry.itemEMTItems, 1, 4), smallTinDust, IC2Items.getItem("stoneDust")});
|
||||
|
||||
NBTTagCompound heatAmount = new NBTTagCompound();
|
||||
heatAmount.setInteger("minHeat", 1000);
|
||||
|
||||
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 2)), heatAmount, new ItemStack[]{IC2Items.getItem("smallCopperDust"), new ItemStack(ConfigItems.itemResource, 1, 6)});
|
||||
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(ItemRegistry.itemEMTItems, 1, 4)), heatAmount, new ItemStack[]{IC2Items.getItem("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 InfusionRecipe wandChargeFocus;
|
||||
public static InfusionRecipe inventoryChargingRing;
|
||||
public static InfusionRecipe armorChargingRing;
|
||||
public static InfusionRecipe nanoWings;
|
||||
public static InfusionRecipe quantumWings;
|
||||
|
||||
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 ShapedArcaneRecipe thaumiumWing;
|
||||
public static ShapedArcaneRecipe thaumiumWings;
|
||||
|
||||
public static CrucibleRecipe ignisGenerator;
|
||||
public static CrucibleRecipe auramGenerator;
|
||||
public static CrucibleRecipe arborGenerator;
|
||||
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;
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.lib.events.EssentiaHandler;
|
||||
|
||||
public class TileEntityArborGenerator extends TileEntityEMT {
|
||||
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 ((!this.worldObj.isRemote) && (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();
|
||||
}
|
||||
}
|
||||
-72
@@ -1,72 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.lib.events.EssentiaHandler;
|
||||
|
||||
public class TileEntityAuramGenerator extends TileEntityEMT {
|
||||
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 ((!this.worldObj.isRemote) && (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);
|
||||
}
|
||||
}
|
||||
-72
@@ -1,72 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.lib.events.EssentiaHandler;
|
||||
|
||||
public class TileEntityIgnisGenerator extends TileEntityEMT {
|
||||
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 ((!this.worldObj.isRemote) && (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);
|
||||
}
|
||||
}
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.lib.events.EssentiaHandler;
|
||||
|
||||
public class TileEntityPotentiaGenerator extends TileEntityEMT {
|
||||
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 ((!this.worldObj.isRemote) && (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);
|
||||
}
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.slot;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.container.ContainerIndustrialWandRecharge;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityAirSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible && this.yCoord >= 160) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityCompressedSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityDarkSolar extends TileEntityEMT 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;
|
||||
}
|
||||
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityDoubleAirSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible && this.yCoord >= 160) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityDoubleCompressedSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityDoubleDarkSolar extends TileEntityEMT 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;
|
||||
}
|
||||
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityDoubleEarthSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible && this.yCoord <= 10) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-119
@@ -1,119 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityDoubleFireSolar extends TileEntityEMT 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;
|
||||
|
||||
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;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
if (worldObj.provider.dimensionId == -1) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput * 2);
|
||||
} else {
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityDoubleOrderSolar extends TileEntityEMT 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;
|
||||
}
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput * 3);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityDoubleWaterSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) {
|
||||
energySource.addEnergy(Config.doubleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityEarthSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible && this.yCoord <= 10) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-119
@@ -1,119 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityFireSolar extends TileEntityEMT 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;
|
||||
|
||||
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;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
if (worldObj.provider.dimensionId == -1) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput * 2);
|
||||
} else {
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityTripleAirSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible && this.yCoord >= 160) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityTripleCompressedSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityTripleDarkSolar extends TileEntityEMT 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;
|
||||
}
|
||||
if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && worldObj.isDaytime() == false && worldObj.isRaining() == false && worldObj.isThundering() == false) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityTripleEarthSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (theSunIsVisible && this.yCoord <= 10) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2.5);
|
||||
} else if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-119
@@ -1,119 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityTripleFireSolar extends TileEntityEMT 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;
|
||||
|
||||
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;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
if (worldObj.provider.dimensionId == -1) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput * 2);
|
||||
} else {
|
||||
if (tick-- == 0) {
|
||||
updateSunState();
|
||||
tick = 64;
|
||||
}
|
||||
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityTripleOrderSolar extends TileEntityEMT 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;
|
||||
}
|
||||
if (theSunIsVisible) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput * 3);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityTripleWaterSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) {
|
||||
energySource.addEnergy(Config.tripleCompressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2014 Tombenpotter.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
|
||||
* which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod.
|
||||
* Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012.
|
||||
* http://www.minecraftforum.net/topic/1585216-
|
||||
******************************************************************************/
|
||||
package electricMagicTools.tombenpotter.electricmagictools.common.tile.solars;
|
||||
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.BlockRegistry;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.Config;
|
||||
import electricMagicTools.tombenpotter.electricmagictools.common.tile.TileEntityEMT;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TileEntityWaterSolar extends TileEntityEMT 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;
|
||||
}
|
||||
|
||||
if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) {
|
||||
energySource.addEnergy(Config.compressedSolarOutput);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -12,41 +12,39 @@ public enum Direction {
|
||||
/**
|
||||
* -X
|
||||
*/
|
||||
XN(0),
|
||||
XN,
|
||||
/**
|
||||
* +X
|
||||
*/
|
||||
XP(1),
|
||||
XP,
|
||||
|
||||
/**
|
||||
* -Y
|
||||
*/
|
||||
YN(2), //MC-Code starts with 0 here
|
||||
YN, //MC-Code starts with 0 here
|
||||
/**
|
||||
* +Y
|
||||
*/
|
||||
YP(3), // 1...
|
||||
YP, // 1...
|
||||
|
||||
/**
|
||||
* -Z
|
||||
*/
|
||||
ZN(4),
|
||||
ZN,
|
||||
/**
|
||||
* +Z
|
||||
*/
|
||||
ZP(5);
|
||||
ZP;
|
||||
|
||||
Direction(int dir1) {
|
||||
this.dir = dir1;
|
||||
public static Direction fromSideValue(int side) {
|
||||
return directions[(side + 2) % 6];
|
||||
}
|
||||
|
||||
/*public CoordinateTuple ApplyToCoordinates(CoordinateTuple coordinates) {
|
||||
CoordinateTuple ret = new CoordinateTuple(coordinates);
|
||||
public static Direction fromForgeDirection(ForgeDirection dir) {
|
||||
if (dir == ForgeDirection.UNKNOWN) return null;
|
||||
|
||||
ret.coords[dir/2] += GetSign();
|
||||
|
||||
return ret;
|
||||
}*/
|
||||
return fromSideValue(dir.ordinal());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tile entity next to a tile entity following this direction.
|
||||
@@ -70,7 +68,7 @@ public enum Direction {
|
||||
public TileEntity applyTo(World world, int x, int y, int z) {
|
||||
int coords[] = { x, y, z };
|
||||
|
||||
coords[dir/2] += getSign();
|
||||
coords[ordinal() / 2] += getSign();
|
||||
|
||||
if (world != null && world.blockExists(coords[0], coords[1], coords[2])) {
|
||||
try {
|
||||
@@ -89,13 +87,7 @@ public enum Direction {
|
||||
* @return Inverse direction
|
||||
*/
|
||||
public Direction getInverse() {
|
||||
int inverseDir = dir - getSign();
|
||||
|
||||
for (Direction direction : directions) {
|
||||
if (direction.dir == inverseDir) return direction;
|
||||
}
|
||||
|
||||
return this;
|
||||
return directions[ordinal() ^ 1];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +96,7 @@ public enum Direction {
|
||||
* @return Minecraft side value
|
||||
*/
|
||||
public int toSideValue() {
|
||||
return (dir + 4) % 6;
|
||||
return (ordinal() + 4) % 6;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,14 +105,13 @@ public enum Direction {
|
||||
* @return -1 if the direction is negative, +1 if the direction is positive
|
||||
*/
|
||||
private int getSign() {
|
||||
return (dir % 2) * 2 - 1;
|
||||
return (ordinal() % 2) * 2 - 1;
|
||||
}
|
||||
|
||||
public ForgeDirection toForgeDirection() {
|
||||
return ForgeDirection.getOrientation(toSideValue());
|
||||
}
|
||||
|
||||
private int dir;
|
||||
public static final Direction[] directions = Direction.values();
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
Binary file not shown.
+41
-39
@@ -15,8 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
*
|
||||
* Any crop extending this can be registered using registerCrop to be added into the game.
|
||||
*/
|
||||
public abstract class CropCard
|
||||
{
|
||||
public abstract class CropCard {
|
||||
/**
|
||||
* Plant name. Will be displayed to the player.
|
||||
*
|
||||
@@ -29,7 +28,7 @@ public abstract class CropCard
|
||||
*
|
||||
* @return Your name
|
||||
*/
|
||||
public String discoveredBy() {return "Alblaka";}
|
||||
public String discoveredBy() {return "IC2 Team";}
|
||||
|
||||
/**
|
||||
* Description of your plant. Keep it short, a few characters per line for up to two lines.
|
||||
@@ -38,15 +37,12 @@ public abstract class CropCard
|
||||
* @param i line to get, starting from 0
|
||||
* @return The line
|
||||
*/
|
||||
public String desc(int i)
|
||||
{
|
||||
public String desc(int i) {
|
||||
String[] att = attributes();
|
||||
if (att == null || att.length==0) return "";
|
||||
if (i == 0)
|
||||
{
|
||||
if (att == null || att.length == 0) return "";
|
||||
if (i == 0) {
|
||||
String s = att[0];
|
||||
if (att.length >= 2)
|
||||
{
|
||||
if (att.length >= 2) {
|
||||
s+=", "+att[1];
|
||||
if (att.length >= 3) s+=",";
|
||||
}
|
||||
@@ -58,6 +54,15 @@ public abstract class CropCard
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* *
|
||||
* @param crop reference to ICropTile
|
||||
* @return roots lengt use in isBlockBelow
|
||||
*/
|
||||
public int getrootslength(ICropTile crop){
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tier of the plant. Ranges from 1 to 16, 0 is Weed.
|
||||
* Valuable and powerful crops have higher tiers, useless and weak ones have lower tiers.
|
||||
@@ -137,8 +142,7 @@ public abstract class CropCard
|
||||
* Amount of growth points needed to increase the plant's size.
|
||||
* Default is 200 * tier.
|
||||
*/
|
||||
public int growthDuration(ICropTile crop)
|
||||
{
|
||||
public int growthDuration(ICropTile crop) {
|
||||
return tier()*200;
|
||||
}
|
||||
|
||||
@@ -171,8 +175,7 @@ public abstract class CropCard
|
||||
* @param air air quality, influences by open gardens and less crops surrounding this one
|
||||
* @return 0-30
|
||||
*/
|
||||
public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air)
|
||||
{
|
||||
public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) {
|
||||
return (int) (humidity+nutrients+air);
|
||||
}
|
||||
|
||||
@@ -182,8 +185,7 @@ public abstract class CropCard
|
||||
*
|
||||
* @param crop crop to crossbreed with
|
||||
*/
|
||||
public boolean canCross(ICropTile crop)
|
||||
{
|
||||
public boolean canCross(ICropTile crop) {
|
||||
return crop.getSize() >= 3;
|
||||
}
|
||||
|
||||
@@ -198,11 +200,19 @@ public abstract class CropCard
|
||||
* @param player player rightclicking the crop
|
||||
* @return Whether the plant has changed
|
||||
*/
|
||||
public boolean rightclick(ICropTile crop, EntityPlayer player)
|
||||
{
|
||||
public boolean rightclick(ICropTile crop, EntityPlayer player) {
|
||||
return crop.harvest(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use in Crop Havester with insert Cropnalyzer to get best Output.
|
||||
*
|
||||
* @param crop reference to ICropTile
|
||||
* @return need crop size for best output.
|
||||
*/
|
||||
|
||||
public abstract int getOptimalHavestSize(ICropTile crop);
|
||||
|
||||
/**
|
||||
* Check whether the crop can be harvested.
|
||||
*
|
||||
@@ -217,8 +227,7 @@ public abstract class CropCard
|
||||
*
|
||||
* @return Chance to drop the gains
|
||||
*/
|
||||
public float dropGainChance()
|
||||
{
|
||||
public float dropGainChance() {
|
||||
float base = 1F;
|
||||
for (int i = 0; i < tier(); i++) {base*=0.95;}
|
||||
return base;
|
||||
@@ -252,8 +261,7 @@ public abstract class CropCard
|
||||
* @param player player leftclicked the crop
|
||||
* @return Whether the plant has changed
|
||||
*/
|
||||
public boolean leftclick(ICropTile crop, EntityPlayer player)
|
||||
{
|
||||
public boolean leftclick(ICropTile crop, EntityPlayer player) {
|
||||
return crop.pick(true);
|
||||
}
|
||||
|
||||
@@ -264,8 +272,7 @@ public abstract class CropCard
|
||||
* @param crop reference to ICropTile
|
||||
* @return Chance to drop the seeds
|
||||
*/
|
||||
public float dropSeedChance(ICropTile crop)
|
||||
{
|
||||
public float dropSeedChance(ICropTile crop) {
|
||||
if (crop.getSize() == 1) return 0;
|
||||
float base = 0.5F;
|
||||
if (crop.getSize() == 2) base/=2F;
|
||||
@@ -281,8 +288,7 @@ public abstract class CropCard
|
||||
* @param crop reference to ICropTile
|
||||
* @return Seeds
|
||||
*/
|
||||
public ItemStack getSeeds(ICropTile crop)
|
||||
{
|
||||
public ItemStack getSeeds(ICropTile crop) {
|
||||
return crop.generateSeeds(crop.getID(), crop.getGrowth(), crop.getGain(), crop.getResistance(), crop.getScanLevel());
|
||||
}
|
||||
|
||||
@@ -291,7 +297,7 @@ public abstract class CropCard
|
||||
*
|
||||
* @param crop reference to ICropTile
|
||||
*/
|
||||
public void onNeighbourChange(ICropTile crop){
|
||||
public void onNeighbourChange(ICropTile crop) {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -300,14 +306,14 @@ public abstract class CropCard
|
||||
*
|
||||
* @return Whether the crop should emit redstone
|
||||
*/
|
||||
public int emitRedstone(ICropTile crop){return 0;}
|
||||
public int emitRedstone(ICropTile crop) {return 0;}
|
||||
|
||||
/**
|
||||
* Called when the crop is destroyed.
|
||||
*
|
||||
* @param crop reference to ICropTile
|
||||
*/
|
||||
public void onBlockDestroyed(ICropTile crop){
|
||||
public void onBlockDestroyed(ICropTile crop) {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -326,11 +332,9 @@ public abstract class CropCard
|
||||
* @param entity entity colliding
|
||||
* @return Whether trampling calculation should happen, return false if the plant is no longer valid.
|
||||
*/
|
||||
public boolean onEntityCollision(ICropTile crop, Entity entity)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
return ((EntityLivingBase)entity).isSprinting();
|
||||
public boolean onEntityCollision(ICropTile crop, Entity entity) {
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
return ((EntityLivingBase) entity).isSprinting();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -353,9 +357,8 @@ public abstract class CropCard
|
||||
* @param crop reference to ICropTile
|
||||
* @return Whether the plant spreads weed
|
||||
*/
|
||||
public boolean isWeed(ICropTile crop)
|
||||
{
|
||||
return crop.getSize()>=2 && (crop.getID()==0 || crop.getGrowth()>=24);
|
||||
public boolean isWeed(ICropTile crop) {
|
||||
return crop.getSize() >= 2 && (crop.getID() == 0 || crop.getGrowth() >= 24);
|
||||
}
|
||||
|
||||
|
||||
@@ -364,8 +367,7 @@ public abstract class CropCard
|
||||
*
|
||||
* @return ID of this CropCard or -1 if it's not registered
|
||||
*/
|
||||
public final int getId()
|
||||
{
|
||||
public final int getId() {
|
||||
return Crops.instance.getIdFor(this);
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -15,27 +15,30 @@ import net.minecraftforge.common.BiomeDictionary.Type;
|
||||
public abstract class Crops {
|
||||
public static Crops instance;
|
||||
|
||||
/**
|
||||
* Adds a crop humidity and nutrient biome bonus.
|
||||
*
|
||||
* 0 indicates no bonus and negative values indicate a penalty.
|
||||
*
|
||||
* @param biome Biome to apply the bonus in
|
||||
* @param humidityBonus Humidity stat bonus
|
||||
* @param nutrientsBonus Nutrient stat bonus
|
||||
*/
|
||||
public abstract void addBiomeBonus(BiomeGenBase biome, int humidityBonus, int nutrientsBonus);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds a crop humidity and nutrient biome bonus.
|
||||
* Adds a crop nutrient biome bonus.
|
||||
*
|
||||
* 0 indicates no bonus and negative values indicate a penalty.
|
||||
* +10/-10 0 indicates no bonus and negative values indicate a penalty.
|
||||
*
|
||||
* @param type Forge biome type to apply the bonus in
|
||||
* @param nutrientsBonus Nutrient stat bonus
|
||||
*/
|
||||
public abstract void addBiomenutrientsBonus(Type type, int nutrientsBonus);
|
||||
|
||||
/**
|
||||
* Adds a crop humidity biome bonus.
|
||||
*
|
||||
* +10/-10 0 indicates no bonus and negative values indicate a penalty.
|
||||
*
|
||||
* @param type Forge biome type to apply the bonus in
|
||||
* @param humidityBonus Humidity stat bonus
|
||||
* @param nutrientsBonus Nutrient stat bonus
|
||||
*/
|
||||
public abstract void addBiomeBonus(Type type, int humidityBonus, int nutrientsBonus);
|
||||
public abstract void addBiomehumidityBonus(Type type, int humidityBonus);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the humidity bonus for a biome.
|
||||
BIN
Binary file not shown.
+43
-32
@@ -16,28 +16,28 @@ public interface ICropTile {
|
||||
* @return Plant ID, or -1 if there is no plant currently on the crop
|
||||
*/
|
||||
public short getID();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's plant ID.
|
||||
*
|
||||
* @param id Plant ID, or -1 for no plant
|
||||
*/
|
||||
public void setID(short id);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's plant size.
|
||||
*
|
||||
* @return Plant size, starting with 1 and maximum varies depending on plant
|
||||
*/
|
||||
public byte getSize();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's plant size.
|
||||
*
|
||||
* @param size Plant size
|
||||
*/
|
||||
public void setSize(byte size);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's plant growth stat.
|
||||
* Higher values indicate faster growth.
|
||||
@@ -45,14 +45,14 @@ public interface ICropTile {
|
||||
* @return Plant growth stat
|
||||
*/
|
||||
public byte getGrowth();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's plant growth stat.
|
||||
*
|
||||
* @param growth Plant growth stat
|
||||
*/
|
||||
public void setGrowth(byte growth);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's plant gain stat.
|
||||
* Higher values indicate more drops.
|
||||
@@ -60,14 +60,14 @@ public interface ICropTile {
|
||||
* @return Plant gain stat
|
||||
*/
|
||||
public byte getGain();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's plant gain stat.
|
||||
*
|
||||
* @param gain Plant gain stat
|
||||
*/
|
||||
public void setGain(byte gain);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's plant resistance stat.
|
||||
* Higher values indicate more resistance against trampling.
|
||||
@@ -75,14 +75,14 @@ public interface ICropTile {
|
||||
* @return Plant resistance stat
|
||||
*/
|
||||
public byte getResistance();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's plant resistance stat.
|
||||
*
|
||||
* @param resistance Plant resistance stat
|
||||
*/
|
||||
public void setResistance(byte resistance);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's plant scan level.
|
||||
* Increases every time the seed is analyzed.
|
||||
@@ -90,14 +90,14 @@ public interface ICropTile {
|
||||
* @return Plant scan level
|
||||
*/
|
||||
public byte getScanLevel();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's plant scan level.
|
||||
*
|
||||
* @param scanLevel Plant scan level
|
||||
*/
|
||||
public void setScanLevel(byte scanLevel);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's plant custom data, stored alongside the crop.
|
||||
* Can be modified in place.
|
||||
@@ -105,7 +105,7 @@ public interface ICropTile {
|
||||
* @return Plant custom data
|
||||
*/
|
||||
public NBTTagCompound getCustomData();
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's nutrient storage.
|
||||
* Ranges from 0 to 100.
|
||||
@@ -113,14 +113,14 @@ public interface ICropTile {
|
||||
* @return Crop nutrient storage
|
||||
*/
|
||||
public int getNutrientStorage();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's nutrient storage.
|
||||
*
|
||||
* @param nutrientStorage Crop nutrient storage
|
||||
*/
|
||||
public void setNutrientStorage(int nutrientStorage);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's hydration storage.
|
||||
* 0 indicates nothing, 1-10 indicate water hydration and 11-100 for hydration cells.
|
||||
@@ -128,28 +128,28 @@ public interface ICropTile {
|
||||
* @return Crop hydration storage
|
||||
*/
|
||||
public int getHydrationStorage();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's hydration storage.
|
||||
*
|
||||
* @param hydrationStorage Crop hydration storage
|
||||
*/
|
||||
public void setHydrationStorage(int hydrationStorage);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's Weed-Ex storage.
|
||||
*
|
||||
* @return Crop Weed-Ex storage
|
||||
*/
|
||||
public int getWeedExStorage();
|
||||
|
||||
|
||||
/**
|
||||
* Set the crop's Weed-Ex storage.
|
||||
*
|
||||
* @param weedExStorage Crop Weed-Ex storage
|
||||
*/
|
||||
public void setWeedExStorage(int weedExStorage);
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's humidity.
|
||||
* Ranges from 0 (dry) to 10 (humid).
|
||||
@@ -160,7 +160,7 @@ public interface ICropTile {
|
||||
* @return Crop humidity level
|
||||
*/
|
||||
public byte getHumidity();
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's nutrient level.
|
||||
* Ranges from 0 (empty) to 10 (full).
|
||||
@@ -171,9 +171,9 @@ public interface ICropTile {
|
||||
* @return Crop nutrient level
|
||||
*/
|
||||
public byte getNutrients();
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's air quality.
|
||||
* Get the crop's air quality.
|
||||
* Ranges from 0 (cluttered) to 10 (fresh).
|
||||
* Updates every couple of seconds or when an update is requested.
|
||||
*
|
||||
@@ -182,44 +182,53 @@ public interface ICropTile {
|
||||
* @return Crop air quality
|
||||
*/
|
||||
public byte getAirQuality();
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's world.
|
||||
*
|
||||
* @return Crop world
|
||||
*/
|
||||
public World getWorld();
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's location.
|
||||
*
|
||||
* @return Crop location
|
||||
*/
|
||||
public ChunkCoordinates getLocation();
|
||||
|
||||
|
||||
/**
|
||||
* Get the crop's light level.
|
||||
*
|
||||
* @return Crop light level
|
||||
*/
|
||||
public int getLightLevel();
|
||||
|
||||
public int getLightLevel();
|
||||
|
||||
/**
|
||||
* Pick the crop, removing and giving seeds for the plant.
|
||||
* Pick the crop, removing and giving seeds for the plant.
|
||||
*
|
||||
* @param manual whether it was done by hand (not automated)
|
||||
* @return true if successfully picked
|
||||
*/
|
||||
public boolean pick(boolean manual);
|
||||
|
||||
|
||||
/**
|
||||
* Harvest the crop, turning it into gain and resetting its size.
|
||||
*
|
||||
* @param manual whether it one by hand (not automated)
|
||||
* drop output on ground
|
||||
* @param manual
|
||||
* @return true if successfully harvested
|
||||
*/
|
||||
public boolean harvest(boolean manual);
|
||||
|
||||
|
||||
/**
|
||||
* Harvest the crop, turning it into gain and resetting its size.
|
||||
* drop output on ground
|
||||
* @param Optimal force check getOptimalHavestSize() for harvest
|
||||
* @return ItemStack[] of harvest output
|
||||
*/
|
||||
|
||||
ItemStack[] harvest_automated(boolean Optimal);
|
||||
|
||||
/**
|
||||
* Fully clears the crop without dropping anything.
|
||||
*/
|
||||
@@ -250,4 +259,6 @@ public interface ICropTile {
|
||||
* @return Plant seed item
|
||||
*/
|
||||
public ItemStack generateSeeds(short plant, byte growth, byte gain, byte resis, byte scan);
|
||||
|
||||
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -7,7 +7,7 @@ package ic2.api.energy;
|
||||
* The old EnergyNet methods missing in IEnergyNet have been migrated to events (load, unload) or
|
||||
* removed (tiles no longer emit energy actively, the energy net implementation requests it).
|
||||
*
|
||||
* See ic2/baubles.api/energy/usage.txt for an overall description of the energy net baubles.api.
|
||||
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
|
||||
*/
|
||||
public final class EnergyNet {
|
||||
/**
|
||||
Binary file not shown.
+26
-4
@@ -8,7 +8,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
/**
|
||||
* Interface representing the methods provided by the global EnergyNet class.
|
||||
*
|
||||
* See ic2/baubles.api/energy/usage.txt for an overall description of the energy net baubles.api.
|
||||
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
|
||||
*/
|
||||
public interface IEnergyNet {
|
||||
/**
|
||||
@@ -42,8 +42,10 @@ public interface IEnergyNet {
|
||||
* @note call this twice with x ticks delay to get the avg. emitted power p = (call2 - call1) / x EU/tick
|
||||
*
|
||||
* @param tileEntity energy emitter
|
||||
* @deprecated Discontinued, use getNodeStats instead.
|
||||
*/
|
||||
long getTotalEnergyEmitted(TileEntity tileEntity);
|
||||
@Deprecated
|
||||
double getTotalEnergyEmitted(TileEntity tileEntity);
|
||||
|
||||
/**
|
||||
* determine how much energy has been sunken by the EnergySink specified
|
||||
@@ -51,8 +53,20 @@ public interface IEnergyNet {
|
||||
* @note call this twice with x ticks delay to get the avg. sunken power p = (call2 - call1) / x EU/tick
|
||||
*
|
||||
* @param tileEntity energy emitter
|
||||
* @deprecated Discontinued, use getNodeStats instead.
|
||||
*/
|
||||
long getTotalEnergySunken(TileEntity tileEntity);
|
||||
@Deprecated
|
||||
double getTotalEnergySunken(TileEntity tileEntity);
|
||||
|
||||
/**
|
||||
* Retrieve statistics for the tile entity specified.
|
||||
*
|
||||
* The statistics apply to the last simulated tick.
|
||||
*
|
||||
* @param te Tile entity to check.
|
||||
* @return Statistics for the tile entity.
|
||||
*/
|
||||
NodeStats getNodeStats(TileEntity te);
|
||||
|
||||
/**
|
||||
* Determine the typical power used by the specific tier, e.g. 128 eu/t for tier 2.
|
||||
@@ -60,5 +74,13 @@ public interface IEnergyNet {
|
||||
* @param tier tier
|
||||
* @return power in eu/t
|
||||
*/
|
||||
int getPowerFromTier(int tier);
|
||||
double getPowerFromTier(int tier);
|
||||
|
||||
/**
|
||||
* Determine minimum tier required to handle the specified power, e.g. tier 2 for 128 eu/t.
|
||||
*
|
||||
* @param power in eu/t
|
||||
* @return tier
|
||||
*/
|
||||
int getTierFromPower(double power);
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
package ic2.api.energy;
|
||||
|
||||
public class NodeStats {
|
||||
public NodeStats(double energyIn, double energyOut, double voltage) {
|
||||
this.energyIn = energyIn;
|
||||
this.energyOut = energyOut;
|
||||
this.voltage = voltage;
|
||||
}
|
||||
|
||||
public double getEnergyIn() {
|
||||
return energyIn;
|
||||
}
|
||||
|
||||
public double getEnergyOut() {
|
||||
return energyOut;
|
||||
}
|
||||
|
||||
public double getVoltage() {
|
||||
return voltage;
|
||||
}
|
||||
|
||||
protected double energyIn;
|
||||
protected double energyOut;
|
||||
protected double voltage;
|
||||
}
|
||||
File renamed without changes.
+1
-1
@@ -9,7 +9,7 @@ import ic2.api.energy.tile.IEnergyTile;
|
||||
/**
|
||||
* Base class for energy net events, don't use it directly.
|
||||
*
|
||||
* See ic2/baubles.api/energy/usage.txt for an overall description of the energy net baubles.api.
|
||||
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
|
||||
*/
|
||||
public class EnergyTileEvent extends WorldEvent {
|
||||
public final IEnergyTile energyTile;
|
||||
File renamed without changes.
+1
-1
@@ -16,7 +16,7 @@ import ic2.api.energy.tile.IEnergyTile;
|
||||
* your own energy grid implementation if you need to. It's not required if you
|
||||
* always lookup energy paths on demand.
|
||||
*
|
||||
* See ic2/baubles.api/energy/usage.txt for an overall description of the energy net baubles.api.
|
||||
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
|
||||
*/
|
||||
public class EnergyTileLoadEvent extends EnergyTileEvent {
|
||||
public EnergyTileLoadEvent(IEnergyTile energyTile1) {
|
||||
File renamed without changes.
+1
-1
@@ -17,7 +17,7 @@ import ic2.api.energy.tile.IEnergyTile;
|
||||
* your own energy grid implementation if you need to. It's not required if you
|
||||
* always lookup energy paths on demand.
|
||||
*
|
||||
* See ic2/baubles.api/energy/usage.txt for an overall description of the energy net baubles.api.
|
||||
* See ic2/api/energy/usage.txt for an overall description of the energy net api.
|
||||
*/
|
||||
public class EnergyTileUnloadEvent extends EnergyTileEvent {
|
||||
public EnergyTileUnloadEvent(IEnergyTile energyTile1) {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
+7
-9
@@ -9,7 +9,6 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import ic2.api.energy.EnergyNet;
|
||||
import ic2.api.energy.event.EnergyTileLoadEvent;
|
||||
import ic2.api.energy.event.EnergyTileUnloadEvent;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
@@ -90,7 +89,6 @@ import ic2.api.item.ElectricItem;
|
||||
* @endcode
|
||||
*/
|
||||
public class BasicSink extends TileEntity implements IEnergySink {
|
||||
|
||||
// **********************************
|
||||
// *** Methods for use by the mod ***
|
||||
// **********************************
|
||||
@@ -100,7 +98,7 @@ public class BasicSink extends TileEntity implements IEnergySink {
|
||||
*
|
||||
* @param parent1 TileEntity represented by this energy sink.
|
||||
* @param capacity1 Maximum amount of eu to store.
|
||||
* @param tier1 IC2 tier, 1=LV, 2=MV, ...
|
||||
* @param tier1 IC2 tier, 1 = LV, 2 = MV, ...
|
||||
*/
|
||||
public BasicSink(TileEntity parent1, int capacity1, int tier1) {
|
||||
this.parent = parent1;
|
||||
@@ -292,12 +290,12 @@ public class BasicSink extends TileEntity implements IEnergySink {
|
||||
public boolean discharge(ItemStack stack, int limit) {
|
||||
if (stack == null || !Info.isIc2Available()) return false;
|
||||
|
||||
int amount = (int) Math.floor(capacity - energyStored);
|
||||
double amount = capacity - energyStored;
|
||||
if (amount <= 0) return false;
|
||||
|
||||
if (limit > 0 && limit < amount) amount = limit;
|
||||
|
||||
amount = ElectricItem.manager.discharge(stack, amount, tier, limit > 0, false);
|
||||
amount = ElectricItem.manager.discharge(stack, amount, tier, limit > 0, true, false);
|
||||
|
||||
energyStored += amount;
|
||||
|
||||
@@ -347,20 +345,20 @@ public class BasicSink extends TileEntity implements IEnergySink {
|
||||
}
|
||||
|
||||
@Override
|
||||
public double demandedEnergyUnits() {
|
||||
public double getDemandedEnergy() {
|
||||
return Math.max(0, capacity - energyStored);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double injectEnergyUnits(ForgeDirection directionFrom, double amount) {
|
||||
public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) {
|
||||
energyStored += amount;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSafeInput() {
|
||||
return EnergyNet.instance.getPowerFromTier(tier);
|
||||
public int getSinkTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
// << energy net interface
|
||||
Binary file not shown.
+17
-17
@@ -88,7 +88,6 @@ import ic2.api.item.ElectricItem;
|
||||
* @endcode
|
||||
*/
|
||||
public class BasicSource extends TileEntity implements IEnergySource {
|
||||
|
||||
// **********************************
|
||||
// *** Methods for use by the mod ***
|
||||
// **********************************
|
||||
@@ -98,14 +97,15 @@ public class BasicSource extends TileEntity implements IEnergySource {
|
||||
*
|
||||
* @param parent1 Base TileEntity represented by this energy source.
|
||||
* @param capacity1 Maximum amount of eu to store.
|
||||
* @param tier1 IC2 tier, 1=LV, 2=MV, ...
|
||||
* @param tier1 IC2 tier, 1 = LV, 2 = MV, ...
|
||||
*/
|
||||
public BasicSource(TileEntity parent1, int capacity1, int tier1) {
|
||||
int power = EnergyNet.instance.getPowerFromTier(tier1);
|
||||
public BasicSource(TileEntity parent1, double capacity1, int tier1) {
|
||||
double power = EnergyNet.instance.getPowerFromTier(tier1);
|
||||
|
||||
this.parent = parent1;
|
||||
this.capacity = capacity1 < power ? power : capacity1;
|
||||
this.tier = tier1;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
// in-world te forwards >>
|
||||
@@ -205,7 +205,7 @@ public class BasicSource extends TileEntity implements IEnergySource {
|
||||
*
|
||||
* @return Capacity in EU.
|
||||
*/
|
||||
public int getCapacity() {
|
||||
public double getCapacity() {
|
||||
return capacity;
|
||||
}
|
||||
|
||||
@@ -214,9 +214,7 @@ public class BasicSource extends TileEntity implements IEnergySource {
|
||||
*
|
||||
* @param capacity1 Capacity in EU.
|
||||
*/
|
||||
public void setCapacity(int capacity1) {
|
||||
int power = EnergyNet.instance.getPowerFromTier(tier);
|
||||
|
||||
public void setCapacity(double capacity1) {
|
||||
if (capacity1 < power) capacity1 = power;
|
||||
|
||||
this.capacity = capacity1;
|
||||
@@ -237,11 +235,12 @@ public class BasicSource extends TileEntity implements IEnergySource {
|
||||
* @param tier1 IC2 Tier.
|
||||
*/
|
||||
public void setTier(int tier1) {
|
||||
int power = EnergyNet.instance.getPowerFromTier(tier1);
|
||||
double power = EnergyNet.instance.getPowerFromTier(tier1);
|
||||
|
||||
if (capacity < power) capacity = power;
|
||||
|
||||
this.tier = tier1;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
|
||||
@@ -299,7 +298,7 @@ public class BasicSource extends TileEntity implements IEnergySource {
|
||||
public boolean charge(ItemStack stack) {
|
||||
if (stack == null || !Info.isIc2Available()) return false;
|
||||
|
||||
int amount = ElectricItem.manager.charge(stack, (int) energyStored, tier, false, false);
|
||||
double amount = ElectricItem.manager.charge(stack, energyStored, tier, false, false);
|
||||
|
||||
energyStored -= amount;
|
||||
|
||||
@@ -350,12 +349,7 @@ public class BasicSource extends TileEntity implements IEnergySource {
|
||||
|
||||
@Override
|
||||
public double getOfferedEnergy() {
|
||||
int power = EnergyNet.instance.getPowerFromTier(tier);
|
||||
|
||||
if (energyStored >= power) {
|
||||
return power;
|
||||
}
|
||||
return 0;
|
||||
return Math.min(energyStored, power);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -363,13 +357,19 @@ public class BasicSource extends TileEntity implements IEnergySource {
|
||||
energyStored -= amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSourceTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
// << energy net interface
|
||||
|
||||
|
||||
public final TileEntity parent;
|
||||
|
||||
protected int capacity;
|
||||
protected double capacity;
|
||||
protected int tier;
|
||||
protected double power;
|
||||
protected double energyStored;
|
||||
protected boolean addedToEnet;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 569 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user