mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-26 06:43:01 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
980df8516a | ||
|
|
cddada359b | ||
|
|
9b30535265 | ||
|
|
7456c20fb5 | ||
|
|
73bbe09c6b | ||
|
|
bb0db68866 | ||
|
|
c781dd4231 | ||
|
|
91e7a95fbc | ||
|
|
6ce578c7cb | ||
|
|
7cac8bdd7d | ||
|
|
e77a74544d | ||
|
|
6ec2fe0d3d | ||
|
|
80cb4c94d6 | ||
|
|
2f971ac8e3 | ||
|
|
7d63503645 | ||
|
|
42d1bd07e1 | ||
|
|
6d05bc4dfe | ||
|
|
028f5ef031 | ||
|
|
805553e04e | ||
|
|
facff8752d | ||
|
|
63f04556e2 | ||
|
|
d229201b90 | ||
|
|
5869418115 | ||
|
|
2e2b2ef941 | ||
|
|
be6fc768f8 | ||
|
|
9a1a1bbf3f | ||
|
|
a97a032210 | ||
|
|
956fb3dca8 | ||
|
|
cf16727366 | ||
|
|
93a0751493 | ||
|
|
14115778d0 | ||
|
|
cb5ba100bf | ||
|
|
6c0f4cffa0 | ||
|
|
91fb7afded | ||
|
|
96d86b67f9 | ||
|
|
0e82f8617b | ||
|
|
cb086bbb11 | ||
|
|
3fa79927a4 | ||
|
|
9ad8b01686 | ||
|
|
3467c41bef | ||
|
|
ac7b3e0b7d | ||
|
|
31cd1cb543 | ||
|
|
860162cb6f | ||
|
|
16c7a830a6 | ||
|
|
dccd62b33a | ||
|
|
03e9deebdc | ||
|
|
62438e890a | ||
|
|
37bb2991a3 | ||
|
|
d4ec5b5ec3 | ||
|
|
56e8993f03 | ||
|
|
e2f20373e6 | ||
|
|
b7d30223a0 | ||
|
|
7b5782af5d | ||
|
|
6378580b31 | ||
|
|
108966a079 | ||
|
|
8724b77039 | ||
|
|
5c7d87498c | ||
|
|
2f9c2746b4 | ||
|
|
e91f77ca96 | ||
|
|
d18f9730a8 | ||
|
|
cbbd68031b | ||
|
|
47942e17e3 | ||
|
|
6ab4c94ed8 | ||
|
|
3f724c34ad | ||
|
|
38d769e384 | ||
|
|
9048436bf1 | ||
|
|
3ac6826e6c | ||
|
|
be9af968b9 | ||
|
|
30d0534377 | ||
|
|
9c4f0034fb | ||
|
|
b97d3e1d27 | ||
|
|
28535c1d72 | ||
|
|
44114660b1 | ||
|
|
f2e17fab72 | ||
|
|
21ce8e85c6 | ||
|
|
501360c92b | ||
|
|
022137be62 |
No files matched your search
+4
-1
@@ -1,3 +1,4 @@
|
||||
/bin/
|
||||
#General use .gitignore for Minecraft modding.
|
||||
|
||||
#Folders
|
||||
@@ -25,6 +26,7 @@
|
||||
*.classpath
|
||||
*.project
|
||||
*.lock
|
||||
*.log
|
||||
|
||||
#Specific files
|
||||
MCFPost.txt
|
||||
@@ -41,4 +43,5 @@ ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
#Vim backups
|
||||
*~
|
||||
*~
|
||||
*.bat
|
||||
@@ -19,4 +19,10 @@ Before posting to the issue tracker, make sure you meet the following criteria:
|
||||
- You've gone through the effort to isolate EMT from other mods that aren't related to the issue.
|
||||
- You've gone through the effort to find what conditions are necessary to reproduce the issue.
|
||||
- The issue is subtle enough and has been around long enough that you think we might have missed it.
|
||||
- You speak English or Russian well enough to explain yourself without wondering whether you will be understood.
|
||||
- You speak English or Russian well enough to explain yourself without wondering whether you will be understood.
|
||||
|
||||
|
||||
# Fork
|
||||
This mod was forked by the GT:NH Team to continue the development of the 1.7.10 Branch.
|
||||
The up-to-date Master branch can be found on our Jenkins:
|
||||
http://jenkins.usrv.de
|
||||
+24
-1
@@ -9,6 +9,12 @@ buildscript {
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'signing'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
ext.configFile = file "build.properties"
|
||||
configFile.withReader {
|
||||
@@ -24,7 +30,9 @@ archivesBaseName = config.mod_name
|
||||
minecraft {
|
||||
version = config.mc_version + "-" + config.forge_version + "-" + config.mc_version
|
||||
runDir = "run"
|
||||
|
||||
replaceIn "EMT.java"
|
||||
replace "@version@", config.mod_version
|
||||
|
||||
if (project.hasProperty('mappings_version'))
|
||||
mappings = project.mappings_version
|
||||
}
|
||||
@@ -61,4 +69,19 @@ tasks.build.dependsOn sourceJar, deobfJar
|
||||
|
||||
tasks.withType(JavaCompile) { task ->
|
||||
task.options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
task signJar(dependsOn: 'reobf'){
|
||||
doLast {
|
||||
ant.signjar(
|
||||
destDir: jar.destinationDir,
|
||||
jar: jar.getArchivePath(),
|
||||
alias: findProperty('keyStoreAlias') ?: '',
|
||||
keystore: findProperty('keyStore') ?: '',
|
||||
storepass: findProperty('keyStorePass') ?: '',
|
||||
digestalg: findProperty('signDigestAlg') ?: '',
|
||||
tsaurl: findProperty('signTSAurl') ?: '',
|
||||
verbose: true
|
||||
)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package_group=emt
|
||||
mc_version=1.7.10
|
||||
forge_version=10.13.4.1614
|
||||
mod_version=1.2.6
|
||||
mod_version=1.2.7.5
|
||||
mod_name=ElectroMagicTools
|
||||
+1
-1
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -1,3 +1,3 @@
|
||||
@API(apiVersion = "1.7.10-1.0.1.5", owner = "Baubles", provides = "Baubles|API") package baubles.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
import cpw.mods.fml.common.API;
|
||||
+89
-74
@@ -2,8 +2,6 @@ package emt;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
@@ -14,15 +12,13 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import emt.command.CommandOutputs;
|
||||
import emt.init.EMTEntities;
|
||||
import emt.init.Registry;
|
||||
import emt.init.EMTResearches;
|
||||
import emt.init.Registry;
|
||||
import emt.network.PacketEMTKeys;
|
||||
import emt.proxy.CommonProxy;
|
||||
import emt.util.*;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -33,73 +29,92 @@ import org.apache.logging.log4j.Logger;
|
||||
guiFactory = EMT.GUI_FACTORY,
|
||||
dependencies = EMT.DEPENDS
|
||||
)
|
||||
public class EMT {
|
||||
public static final String NAME = "Electro-Magic Tools";
|
||||
public static final String MOD_ID = "EMT";
|
||||
public static final String VERSION = "1.2.6";
|
||||
public static final String TEXTURE_PATH = "emt";
|
||||
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
|
||||
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
|
||||
public static final String COMMON_PROXY = "emt.proxy.CommonProxy";
|
||||
public static final String CHANNEL = "EMT";
|
||||
public static final String DEPENDS = "required-after:Thaumcraft ; required-after:IC2";
|
||||
|
||||
@SidedProxy(
|
||||
clientSide = CLIENT_PROXY,
|
||||
serverSide = COMMON_PROXY
|
||||
)
|
||||
public static CommonProxy proxy;
|
||||
public static final CreativeTabs TAB = new EMTCreativeTab(MOD_ID + ".creativeTab");
|
||||
public static final Logger LOGGER = LogManager.getLogger(NAME);
|
||||
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(CHANNEL);
|
||||
|
||||
@Instance(MOD_ID)
|
||||
public static EMT instance;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
LOGGER.info("Starting planning the world domination");
|
||||
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
|
||||
FMLCommonHandler.instance().bus().register(new EMTClientEventHandler());
|
||||
Registry.register();
|
||||
EMTEssentiasOutputs.addPrimalOutputs();
|
||||
EMTEssentiasOutputs.addOutputs();
|
||||
registerPackets();
|
||||
LOGGER.info("Planning complete");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent event) {
|
||||
LOGGER.info("Gathering allies");
|
||||
LOGGER.info("Loading the proxies");
|
||||
proxy.load();
|
||||
LOGGER.info("Making mobs drop additional items");
|
||||
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new EMTClientEventHandler());
|
||||
LOGGER.info("Adding dungeon loot");
|
||||
EMTDungeonChestGenerator.generateLoot();
|
||||
LOGGER.info("Registering entities");
|
||||
EMTEntities.registerEMTEntities();
|
||||
LOGGER.info("Registering the GUI Handler");
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||
LOGGER.info("Allies gathered.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
LOGGER.info("Starting the world takeover");
|
||||
Registry.registerLate();
|
||||
EMTResearches.register();
|
||||
LOGGER.info("World takeover complete. Enjoy!");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFMLServerStart(FMLServerStartingEvent event) {
|
||||
event.registerServerCommand(new CommandOutputs());
|
||||
}
|
||||
|
||||
public void registerPackets() {
|
||||
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
|
||||
}
|
||||
public class EMT
|
||||
{
|
||||
public static final String NAME = "Electro-Magic Tools";
|
||||
public static final String MOD_ID = "EMT";
|
||||
public static final String VERSION = "@version@";
|
||||
public static final String TEXTURE_PATH = "emt";
|
||||
public static final String GUI_FACTORY = "emt.client.gui.config.EMTGuiFactory";
|
||||
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
|
||||
public static final String COMMON_PROXY = "emt.proxy.CommonProxy";
|
||||
public static final String CHANNEL = "EMT";
|
||||
public static final String DEPENDS =
|
||||
"required-after:Thaumcraft;" +
|
||||
"required-after:IC2;" +
|
||||
"required-after:gregtech;"+
|
||||
"after:Avaritia;"+
|
||||
"after:MagicBees;"+
|
||||
"after:ForbiddenMagic;";
|
||||
@SidedProxy(clientSide="emt.proxy.ClientProxy", serverSide="emt.proxy.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
public static final CreativeTabs TAB = new EMTCreativeTab("EMT.creativeTab");
|
||||
public static final Logger LOGGER = LogManager.getLogger("Electro-Magic Tools");
|
||||
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("EMT");
|
||||
@Mod.Instance("EMT")
|
||||
public static EMT instance;
|
||||
|
||||
public boolean isSimulating()
|
||||
{
|
||||
return !FMLCommonHandler.instance().getEffectiveSide().isClient();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
LOGGER.info("Starting planning the world domination|start preinit");
|
||||
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
|
||||
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
|
||||
if (FMLCommonHandler.instance().getSide().isClient()) {
|
||||
FMLCommonHandler.instance().bus().register(new EMTClientEventHandler());
|
||||
}
|
||||
Registry.registerPreInit();
|
||||
EMTEssentiasOutputs.addPrimalOutputs();
|
||||
//EMTEssentiasOutputs.addOutputs();
|
||||
registerPackets();
|
||||
LOGGER.info("Planning complete|end preinit");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void load(FMLInitializationEvent event)
|
||||
{
|
||||
LOGGER.info("Execute the plan|start init");
|
||||
Registry.registerInit();
|
||||
//LOGGER.info("Gathering allies");
|
||||
//LOGGER.info("Loading the proxies");
|
||||
proxy.load();
|
||||
//LOGGER.info("Making mobs drop additional items");
|
||||
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
|
||||
if (FMLCommonHandler.instance().getSide().isClient()) {
|
||||
MinecraftForge.EVENT_BUS.register(new EMTClientEventHandler());
|
||||
}
|
||||
//LOGGER.info("Adding dungeon loot");
|
||||
EMTDungeonChestGenerator.generateLoot();
|
||||
//LOGGER.info("Registering entities");
|
||||
EMTEntities.registerEMTEntities();
|
||||
//LOGGER.info("Registering the GUI Handler");
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||
LOGGER.info("Allies gathered.|end init");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
LOGGER.info("Starting the world takeover|start postinit");
|
||||
EMTEssentiasOutputs.addOutputs();
|
||||
Registry.registerLate();
|
||||
EMTResearches.register();
|
||||
LOGGER.info("World takeover complete. Enjoy!|end postinit");
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onFMLServerStart(FMLServerStartingEvent event)
|
||||
{
|
||||
event.registerServerCommand(new CommandOutputs());
|
||||
}
|
||||
|
||||
public void registerPackets()
|
||||
{
|
||||
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import emt.EMT;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package emt.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.tile.TileElectricCloud;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -19,10 +15,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.lib.world.ThaumcraftWorldGenerator;
|
||||
import thaumcraft.common.tiles.TileNitor;
|
||||
|
||||
public class BlockElectricCloud extends BlockBase {
|
||||
public IIcon icon;
|
||||
@@ -32,6 +24,7 @@ public class BlockElectricCloud extends BlockBase {
|
||||
setBlockBounds(0.3f, 0.3f, 0.3f, 0.7f, 0.7f, 0.7f);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rnd) {
|
||||
FXSparkle ef = new FXSparkle(world, x + 0.5F, y + 0.5F, z + 0.5F, x + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, y + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, z + 0.5F + (rnd.nextFloat() - rnd.nextFloat()) / 3.0F, 1.0F, 6, 3);
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntitySmokeFX;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -17,12 +18,12 @@ import net.minecraft.world.World;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
|
||||
private static int subtypes=6;
|
||||
|
||||
public BlockEssentiaGenerators(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 5, 4.0F);
|
||||
super(name, Material.iron, soundTypeMetal, subtypes, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,7 +32,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
super.registerBlockIcons(ir);
|
||||
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
|
||||
for (int meta = 0; meta < 5; meta++) {
|
||||
for (int meta = 0; meta < subtypes; meta++) {
|
||||
iconSets[meta].top = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||
iconSets[meta].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/top");
|
||||
iconSets[meta].side = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/side");
|
||||
@@ -42,6 +43,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
iconSets[2].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/auramfront");
|
||||
iconSets[3].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/arborfront");
|
||||
iconSets[4].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||
iconSets[5].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/aerfront");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -51,6 +53,7 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
list.add(new ItemStack(id, 1, 2));
|
||||
list.add(new ItemStack(id, 1, 3));
|
||||
list.add(new ItemStack(id, 1, 4));
|
||||
list.add(new ItemStack(id, 1, 5));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,6 +69,8 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
return new TileEntityArborGenerator();
|
||||
case 4:
|
||||
return new TileEntityAerGenerator();
|
||||
case 5:
|
||||
return new TileEntityLucrumGenerator();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
@@ -84,4 +89,19 @@ public class BlockEssentiaGenerators extends BlockBaseContainer {
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3)
|
||||
{
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
}
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
if (tileentity != null) {
|
||||
player.openGui(emt.EMT.instance, 1, world, i, j, k);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package emt.block;
|
||||
|
||||
import emt.gthandler.common.implementations.automation.EssentiaFiller;
|
||||
import ic2.api.item.IC2Items;
|
||||
|
||||
import java.util.List;
|
||||
@@ -26,7 +27,7 @@ import emt.tile.TileEntityIndustrialWandRecharge;
|
||||
public class BlockMachines extends BlockBaseContainer {
|
||||
|
||||
public BlockMachines(String name) {
|
||||
super(name, Material.iron, soundTypeMetal, 2, 4.0F);
|
||||
super(name, Material.iron, soundTypeMetal, 3, 4.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,24 +39,30 @@ public class BlockMachines extends BlockBaseContainer {
|
||||
|
||||
iconSets[0].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
|
||||
iconSets[1].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
iconSets[2].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
iconSets[0].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||
iconSets[1].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||
iconSets[2].bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
iconSets[0].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
|
||||
iconSets[1].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
|
||||
iconSets[2].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfront");
|
||||
iconSets[2].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
|
||||
iconSets[0].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
|
||||
iconSets[1].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfrontactive");
|
||||
iconSets[2].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratortop");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(id, 1, 0));
|
||||
list.add(new ItemStack(id, 1, 1));
|
||||
list.add(new ItemStack(id, 1, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,9 +70,12 @@ public class BlockMachines extends BlockBaseContainer {
|
||||
if (meta == 0) {
|
||||
return new TileEntityIndustrialWandRecharge();
|
||||
}
|
||||
if (meta == 1) {
|
||||
else if (meta == 1) {
|
||||
return new TileEntityEtherealMacerator();
|
||||
}
|
||||
else if (meta == 2){
|
||||
return new EssentiaFiller();
|
||||
}
|
||||
return super.createTileEntity(world, meta);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,18 +5,14 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.tile.TileEntityPortableNode;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.blocks.BlockAiry;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockPortableNode extends BlockAiry {
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package emt.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.tile.generator.TileEntityBaseGenerator;
|
||||
import emt.tile.generator.TileEntityReflexionGen;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntitySmokeFX;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockReflectedGen
|
||||
extends BlockBaseContainer
|
||||
{
|
||||
private int subtypes;
|
||||
private static int overalltypes = TileEntityReflexionGen.L.size();
|
||||
public static short Set;
|
||||
private int[] posInList;
|
||||
|
||||
public BlockReflectedGen(String name, short Set)
|
||||
{
|
||||
super(name, Material.iron, soundTypeMetal, 16, 4.0F);
|
||||
this.Set = Set;
|
||||
this.subtypes = 16;
|
||||
|
||||
if ((Set*16) > overalltypes)
|
||||
subtypes= ((Set-1)*16)+overalltypes-((Set-1)*16);
|
||||
|
||||
posInList= new int[subtypes];
|
||||
if ((Set*16) < overalltypes)
|
||||
for (int i=0; i<subtypes;++i) {
|
||||
posInList[i]=(Set*16)+i;
|
||||
}
|
||||
else if ((Set*16) > overalltypes)
|
||||
for (int i=0; i<subtypes;++i) {
|
||||
posInList[i]=((Set-1)*16)+overalltypes-((Set-1)*16)+i;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister ir)
|
||||
{
|
||||
super.registerBlockIcons(ir);
|
||||
this.blockIcon = ir.registerIcon("emt:machines/top");
|
||||
for (int meta = 0; meta < this.subtypes; meta++)
|
||||
{
|
||||
this.iconSets[meta].top = ir.registerIcon("emt:essentiagenerator/top");
|
||||
this.iconSets[meta].bottom = ir.registerIcon("emt:essentiagenerator/top");
|
||||
this.iconSets[meta].side = ir.registerIcon("emt:essentiagenerator/side");
|
||||
}
|
||||
for (int i = 0; i < this.subtypes; i++) {
|
||||
this.iconSets[i].frontOff = ir.registerIcon("emt:essentiagenerator/side");
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item id, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < this.subtypes; i++) {
|
||||
list.add(new ItemStack(id, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public TileEntity createTileEntity(World world, int meta)
|
||||
{
|
||||
return TileEntityReflexionGen.Gens[posInList[meta]];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
TileEntityBaseGenerator te = (TileEntityBaseGenerator)world.getTileEntity(x, y, z);
|
||||
if (te.isActive)
|
||||
{
|
||||
int color = te.aspect.getColor();
|
||||
float r = (color >> 16 & 0xFF) / 255.0F;
|
||||
float g = (color >> 8 & 0xFF) / 255.0F;
|
||||
float b = (color & 0xFF) / 255.0F;
|
||||
|
||||
EntitySmokeFX fx = new EntitySmokeFX(world, x + 0.5F, y + 1.1D, z + 0.5F, 0.0D, 0.1D, 0.0D, 3.0F);
|
||||
fx.setRBGColorF(r, g, b);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3)
|
||||
{
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
}
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
if (tileentity != null) {
|
||||
player.openGui(EMT.instance, 1, world, i, j, k);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,6 @@ package emt.block;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.block.BlockBaseContainer.IconSet;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import emt.tile.solar.air.TileEntityAirSolar;
|
||||
import emt.tile.solar.air.TileEntityDoubleAirSolar;
|
||||
import emt.tile.solar.air.TileEntityTripleAirSolar;
|
||||
@@ -30,11 +28,11 @@ 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.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
@@ -226,4 +224,20 @@ public class BlockSolars extends BlockBaseContainer {
|
||||
world.removeTileEntity(x, y, z);
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer player, int s, float f1, float f2, float f3)
|
||||
{
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
}
|
||||
TileEntity tileentity = world.getTileEntity(i, j, k);
|
||||
if (tileentity != null) {
|
||||
player.openGui(emt.EMT.instance, 1, world, i, j, k);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,5 @@
|
||||
package emt.client;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package emt.client.gui;
|
||||
|
||||
import emt.EMT;
|
||||
import emt.client.gui.container.ConainerGenerator;
|
||||
import emt.tile.generator.TileEntityBaseGenerator;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GuiGenerator extends GuiContainer {
|
||||
|
||||
private static ResourceLocation tex = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/generator.png");
|
||||
|
||||
TileEntityBaseGenerator tileentity;
|
||||
private boolean allowUserInput;
|
||||
private int xSize;
|
||||
private int ySize;
|
||||
|
||||
public GuiGenerator(InventoryPlayer invPlayer, TileEntityBaseGenerator entity) {
|
||||
super(new ConainerGenerator(invPlayer, entity));
|
||||
this.tileentity = entity;
|
||||
this.allowUserInput = false;
|
||||
this.xSize = 194;
|
||||
this.ySize = 168;
|
||||
}
|
||||
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
String formatPanelName = I18n.format(this.tileentity.getInventoryName(), new Object[0]);
|
||||
int nmPos = (this.xSize - this.fontRendererObj.getStringWidth(formatPanelName)) / 2;
|
||||
this.fontRendererObj.drawStringWithShadow(formatPanelName, nmPos, 7, 6618118);
|
||||
|
||||
String storageString = I18n.format("emt.Storage", new Object[0]);
|
||||
String fuel=I18n.format("emt.Fuel", new Object[0]);
|
||||
if (this.tileentity.maxstorage<1000)
|
||||
this.fontRendererObj.drawString(storageString + this.tileentity.storage + "/" + this.tileentity.maxstorage +"EU", 36, 22, 0);
|
||||
else if (10000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 10000000)
|
||||
this.fontRendererObj.drawString(storageString + (this.tileentity.mpshownstroage) + "/" + (this.tileentity.maxstorage/1000) +"kEU", 36, 22, 0);
|
||||
else if (10000000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 1000000000)
|
||||
this.fontRendererObj.drawString(storageString + (this.tileentity.mpshownstroage/1000) + "/" + (this.tileentity.maxstorage/1000000) +"MEU", 36, 22, 0);
|
||||
else if (1000000000 <= this.tileentity.maxstorage)
|
||||
this.fontRendererObj.drawString(storageString + (this.tileentity.mpshownstroage/1000000) + "/" + (this.tileentity.maxstorage/1000000000) +"GEU", 36, 22, 0);
|
||||
if(this.tileentity.isActive)
|
||||
this.fontRendererObj.drawString(I18n.format("emt.Generating",new Object[0])+Double.toString(this.tileentity.generating/20/20)+" EU/t", 36, 35, 0);
|
||||
else
|
||||
this.fontRendererObj.drawString(I18n.format("emt.Generating",new Object[0])+"0 EU/t",36, 35, 0);
|
||||
this.fontRendererObj.drawString(fuel+": "+Integer.toString(this.tileentity.fuel),36,48,0);
|
||||
this.fontRendererObj.drawString(fuel+"/t: "+Integer.toString((this.tileentity.fuel*20*20)-this.tileentity.tick),36,63,0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
||||
{
|
||||
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
this.mc.renderEngine.bindTexture(tex);
|
||||
|
||||
int h = (this.width - this.xSize) / 2;
|
||||
int k = (this.height - this.ySize) / 2;
|
||||
drawTexturedModalRect(h, k, 0, 0, this.xSize, this.ySize);
|
||||
if (this.tileentity.storage > 0)
|
||||
{
|
||||
int l = this.tileentity.gaugeEnergyScaled(33);
|
||||
drawTexturedModalRect(h + 18, k + 23, 195, 0, l, 14);
|
||||
}
|
||||
|
||||
if (this.tileentity.fuel > 0)
|
||||
{
|
||||
int l = this.tileentity.gaugeFuelScaled(33);
|
||||
drawTexturedModalRect(h + 18, k + 42, 195, 0, l, 14);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package emt.client.gui;
|
||||
|
||||
import emt.EMT;
|
||||
import emt.client.gui.container.ContainerSolars;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiSolar extends GuiContainer {
|
||||
|
||||
private static ResourceLocation tex = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/solar.png");
|
||||
|
||||
TileEntitySolarBase tileentity;
|
||||
private boolean allowUserInput;
|
||||
private int xSize;
|
||||
private int ySize;
|
||||
private String color;
|
||||
private int cColor;
|
||||
|
||||
public GuiSolar(InventoryPlayer invPlayer, TileEntitySolarBase entity) {
|
||||
super(new ContainerSolars(invPlayer, entity));
|
||||
this.tileentity = entity;
|
||||
this.allowUserInput = false;
|
||||
this.xSize = 194;
|
||||
this.ySize = 168;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
|
||||
{
|
||||
color = this.tileentity.getInventoryName().replaceAll("Solar", "").replaceAll("Compressed", "").replaceAll("Triple", "").replaceAll("Double", "").trim();
|
||||
if (color != null)
|
||||
switch (color)
|
||||
{
|
||||
case "Aer": {
|
||||
GL11.glColor4f(1.0f, 0.86f, 0.0f, 1.0f);
|
||||
break;
|
||||
}
|
||||
case "Terra": {
|
||||
GL11.glColor4f(0.0f, 0.66f, 0.08f, 1.0f);
|
||||
cColor=8224255;
|
||||
break;
|
||||
}
|
||||
case "Ordo": {
|
||||
GL11.glColor4f(0.8f, 0.8f, 0.8f, 1.0f);
|
||||
break;
|
||||
}
|
||||
case "Perditio": {
|
||||
GL11.glColor4f(0.33F, 0.33F, 0.33F, 1.0F);
|
||||
break;
|
||||
}
|
||||
case "Ignis": {
|
||||
GL11.glColor4f(0.82f, 0.11f, 0.11f, 1.0f);
|
||||
break;
|
||||
}
|
||||
case "Aqua": {
|
||||
GL11.glColor4f(0.27f, 0.65f, 1.0f, 1.0f);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
|
||||
this.mc.renderEngine.bindTexture(tex);
|
||||
|
||||
int h = (this.width - this.xSize) / 2;
|
||||
int k = (this.height - this.ySize) / 2;
|
||||
drawTexturedModalRect(h, k, 0, 0, this.xSize, this.ySize);
|
||||
if (this.tileentity.mp_storage > 0)
|
||||
{
|
||||
int l = this.tileentity.gaugeEnergyScaled(33);
|
||||
drawTexturedModalRect(h + 18, k + 23, 195, 0, l, 14);
|
||||
}
|
||||
if (this.tileentity.generating>9)
|
||||
drawTexturedModalRect(h + 18, k + 42, 195, 20, 11, 14);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
String formatPanelName = I18n.format(this.tileentity.getInventoryName(), new Object[0]);
|
||||
int nmPos = (this.xSize - this.fontRendererObj.getStringWidth(formatPanelName)) / 2;
|
||||
|
||||
if(!color.equals("Terra"))
|
||||
this.fontRendererObj.drawStringWithShadow(formatPanelName, 0, 7, 6618118);
|
||||
else
|
||||
this.fontRendererObj.drawStringWithShadow(formatPanelName, 0, 7, cColor);
|
||||
|
||||
String storageString = I18n.format("emt.Storage", new Object[0]);
|
||||
|
||||
if (this.tileentity.maxstorage<1000)
|
||||
this.fontRendererObj.drawString(storageString + this.tileentity.storage + "/" + this.tileentity.maxstorage +"EU", 36, 22, 0);
|
||||
else if (10000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 10000000)
|
||||
this.fontRendererObj.drawString(storageString + (this.tileentity.mp_storage) + "/" + (this.tileentity.maxstorage/1000) +"kEU", 36, 22, 0);
|
||||
else if (10000000 <= this.tileentity.maxstorage && this.tileentity.maxstorage < 1000000000)
|
||||
this.fontRendererObj.drawString(storageString + (this.tileentity.mp_storage/1000) + "/" + (this.tileentity.maxstorage/1000000) +"MEU", 36, 22, 0);
|
||||
else if (1000000000 <= this.tileentity.maxstorage)
|
||||
this.fontRendererObj.drawString(storageString + (this.tileentity.mp_storage/1000000) + "/" + (this.tileentity.maxstorage/1000000000) +"GEU", 36, 22, 0);
|
||||
if(this.tileentity.isActive)
|
||||
if (Double.toString(this.tileentity.generating).length()>5)
|
||||
this.fontRendererObj.drawString(I18n.format("emt.Generating",new Object[0])+Double.toString(this.tileentity.generating).substring(0, 4)+" EU/t", 36, 35, 0);
|
||||
else
|
||||
this.fontRendererObj.drawString(I18n.format("emt.Generating",new Object[0])+Double.toString(this.tileentity.generating)+" EU/t", 36, 35, 0);
|
||||
else
|
||||
this.fontRendererObj.drawString(I18n.format("emt.Generating",new Object[0])+"0 EU/t",36, 35, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package emt.client.gui.container;
|
||||
|
||||
import emt.tile.generator.TileEntityBaseGenerator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ConainerGenerator
|
||||
extends Container
|
||||
{
|
||||
private TileEntityBaseGenerator tileentity;
|
||||
|
||||
public ConainerGenerator(InventoryPlayer inventoryplayer, TileEntityBaseGenerator tileentity)
|
||||
{
|
||||
this.tileentity = tileentity;
|
||||
}
|
||||
|
||||
public void addCraftingToCrafters(ICrafting icrafting)
|
||||
{
|
||||
|
||||
super.addCraftingToCrafters(icrafting);
|
||||
icrafting.sendProgressBarUpdate(this, 0, (short) (this.tileentity.generating/400));
|
||||
icrafting.sendProgressBarUpdate(this, 1, (byte) this.tileentity.fuel);
|
||||
icrafting.sendProgressBarUpdate(this, 2, (short) this.tileentity.mpshownstroage);
|
||||
}
|
||||
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting icrafting = (ICrafting)this.crafters.get(i);
|
||||
|
||||
icrafting.sendProgressBarUpdate(this, 0, (short) (this.tileentity.generating/400));
|
||||
icrafting.sendProgressBarUpdate(this, 1, (byte) this.tileentity.fuel);
|
||||
icrafting.sendProgressBarUpdate(this, 2, (short) (this.tileentity.storage/1000));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateProgressBar(int i, int j)
|
||||
{
|
||||
if (i == 0) {
|
||||
this.tileentity.generating = (((int)j)*400);
|
||||
}
|
||||
if (i == 1) {
|
||||
this.tileentity.fuel=((byte) j);
|
||||
}
|
||||
if (i == 2) {
|
||||
this.tileentity.mpshownstroage=(short) j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
this.detectAndSendChanges();
|
||||
return this.tileentity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
|
||||
public class ContainerIndustrialWandRecharge extends Container {
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
package emt.client.gui.container;
|
||||
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerSolars
|
||||
extends Container
|
||||
{
|
||||
private TileEntitySolarBase tileentity;
|
||||
|
||||
public ContainerSolars(InventoryPlayer inventoryplayer, TileEntitySolarBase tileentity)
|
||||
{
|
||||
this.tileentity = tileentity;
|
||||
}
|
||||
|
||||
public void addCraftingToCrafters(ICrafting icrafting)
|
||||
{
|
||||
super.addCraftingToCrafters(icrafting);
|
||||
icrafting.sendProgressBarUpdate(this, 0, (short) this.tileentity.generating);
|
||||
icrafting.sendProgressBarUpdate(this, 1, (short) this.tileentity.mp_storage);
|
||||
}
|
||||
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
super.detectAndSendChanges();
|
||||
short help = 0;
|
||||
if (this.tileentity.generating < 326D && this.tileentity.generating > 9D)
|
||||
help = (short) (this.tileentity.generating*100*-1);
|
||||
else
|
||||
help = (short) (this.tileentity.generating);
|
||||
|
||||
for (int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting icrafting = (ICrafting)this.crafters.get(i);
|
||||
|
||||
icrafting.sendProgressBarUpdate(this, 0, help);
|
||||
icrafting.sendProgressBarUpdate(this, 1, (short) (this.tileentity.getSourceStored()/1000));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateProgressBar(int i, int j)
|
||||
{
|
||||
|
||||
if (i == 0) {
|
||||
if (j < 0) {
|
||||
double help= j;
|
||||
help=help/100*-1;
|
||||
this.tileentity.generating = help;
|
||||
}
|
||||
else
|
||||
this.tileentity.generating=j;
|
||||
}
|
||||
if (i == 1) {
|
||||
this.tileentity.mp_storage = (short) (j);
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer entityplayer)
|
||||
{
|
||||
this.detectAndSendChanges();
|
||||
return this.tileentity.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,11 @@ package emt.client.model;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBow;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelSpecialArmor extends ModelBiped {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package emt.client.model;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ModelWings extends ModelBiped {
|
||||
|
||||
|
||||
@@ -6,11 +6,9 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import emt.EMT;
|
||||
import emt.entity.EntityLaser;
|
||||
import emt.entity.EntityShield;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package emt.command;
|
||||
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTTextHelper;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -10,16 +12,11 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTTextHelper;
|
||||
|
||||
public class CommandOutputs extends CommandBase {
|
||||
|
||||
public String text;
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "emt_outputs";
|
||||
@@ -51,37 +48,70 @@ public class CommandOutputs extends CommandBase {
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender command, String[] astring) {
|
||||
text = EMTTextHelper.localize("gui.EMT.book.aspect.output.essentia.eu") + ": ";
|
||||
Collection<Aspect> aspectCollection = Aspect.aspects.values();
|
||||
for (Aspect aspect : aspectCollection) {
|
||||
String text2 = addStrings(text, (aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())) + "\n"));
|
||||
text = text2;
|
||||
}
|
||||
addOutputsBook(EMTTextHelper.localize("gui.EMT.book.aspect.output.eu.title"), text, command, astring);
|
||||
}
|
||||
|
||||
public void addOutputsBook(String title, String text, ICommandSender command, String[] astring) {
|
||||
ItemStack book = new ItemStack(Items.written_book);
|
||||
book.setTagInfo("author", new NBTTagString("Tombenpotter"));
|
||||
book.setTagInfo("title", new NBTTagString(title));
|
||||
NBTTagCompound nbttagcompound = book.getTagCompound();
|
||||
NBTTagList bookPages = new NBTTagList();
|
||||
|
||||
bookPages.appendTag(new NBTTagString(text.substring(0, 237)));
|
||||
bookPages.appendTag(new NBTTagString(text.substring(237, 476)));
|
||||
bookPages.appendTag(new NBTTagString(text.substring(476, 709)));
|
||||
bookPages.appendTag(new NBTTagString(text.substring(709)));
|
||||
|
||||
nbttagcompound.setTag("pages", bookPages);
|
||||
|
||||
System.out.println(text.length());
|
||||
ItemStack book = mkbook();
|
||||
|
||||
if (!command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).inventory.addItemStackToInventory(book))
|
||||
command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).entityDropItem(book, 0);
|
||||
|
||||
}
|
||||
|
||||
public String addStrings(String string1, String string2) {
|
||||
String result = string1 + string2;
|
||||
return result;
|
||||
public static ItemStack mkbook(){
|
||||
String text = EMTTextHelper.localize("gui.EMT.book.aspect.output.essentia.eu") + ": \n";
|
||||
String text2 = EMTTextHelper.localize("gui.EMT.book.aspect.output.essentia.eu") + " /t: \n";
|
||||
String text3 = EMTTextHelper.localize("gui.EMT.book.aspect.output.essentia.eu") + " /t singleblock: \n";
|
||||
|
||||
final String title = EMTTextHelper.localize("gui.EMT.book.aspect.output.eu.title");
|
||||
|
||||
final ArrayList<String> singleblock = new ArrayList<String>();
|
||||
final ArrayList<String> bookL = new ArrayList<String>();
|
||||
final ArrayList<String> bookL2 = new ArrayList<String>();
|
||||
|
||||
byte counter = 0;
|
||||
|
||||
for (final Aspect aspect : Aspect.aspects.values()) {
|
||||
++counter;
|
||||
|
||||
if (aspect.equals(Aspect.ENERGY)||aspect.equals(Aspect.TREE)||aspect.equals(Aspect.FIRE)||aspect.equals(Aspect.AURA)||aspect.equals(Aspect.GREED)||aspect.equals(Aspect.AIR))
|
||||
text3 = text3 + aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())/20D/20D) + "EU\n";
|
||||
|
||||
if (counter < 12){
|
||||
text2 = text2 + aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())/20D) + "EU/t\n";
|
||||
text = text + aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())) + "EU\n";
|
||||
}
|
||||
else {
|
||||
text2 = text2+ aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())/20D) + "EU\n";
|
||||
text = text + aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())) + "EU\n";
|
||||
bookL.add(text);
|
||||
bookL2.add(text2);
|
||||
text2 = new String("");
|
||||
text = new String("");
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
singleblock.add(text3);
|
||||
|
||||
if (counter != 0){
|
||||
bookL.add(text);
|
||||
bookL2.add(text2);
|
||||
}
|
||||
|
||||
final ItemStack book = new ItemStack(Items.written_book);
|
||||
book.setTagInfo("author", new NBTTagString("Tombenpotter, bartimaeusnek"));
|
||||
book.setTagInfo("title", new NBTTagString(title));
|
||||
final NBTTagCompound nbttagcompound = book.getTagCompound();
|
||||
final NBTTagList bookPages = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < singleblock.size(); i++) {
|
||||
bookPages.appendTag(new NBTTagString(singleblock.get(i)));
|
||||
}
|
||||
for (int i = 0; i < bookL.size(); i++) {
|
||||
bookPages.appendTag(new NBTTagString(bookL.get(i)));
|
||||
}
|
||||
for (int i = 0; i < bookL2.size(); i++) {
|
||||
bookPages.appendTag(new NBTTagString(bookL2.get(i)));
|
||||
}
|
||||
nbttagcompound.setTag("pages", bookPages);
|
||||
return book;
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.entity.monster.EntitySnowman;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -1,23 +1,14 @@
|
||||
package emt.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.util.EMTRandomHelper.Bolt;
|
||||
import emt.util.EMTRandomHelper.Point;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.projectile.EntityFireball;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -26,6 +17,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class EntityEnergyBall extends Entity implements IProjectile, IEntityAdditionalSpawnData {
|
||||
public static final int RADIUS = 8;
|
||||
public static final int MAX_TICKS_IN_TILE = 60;
|
||||
@@ -116,10 +109,10 @@ public class EntityEnergyBall extends Entity implements IProjectile, IEntityAddi
|
||||
entities.add(entity);
|
||||
/** Closer - Harder */
|
||||
entity.attackEntityFrom(DamageSource.magic, (float) (RADIUS - hyp));
|
||||
entity.performHurtAnimation();
|
||||
|
||||
if(worldObj.isRemote)
|
||||
if(worldObj.isRemote) {
|
||||
Thaumcraft.proxy.bolt(worldObj, this, entity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
package emt.entity;
|
||||
|
||||
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import cpw.mods.fml.common.registry.IThrowableEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
package emt.entity;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ic2.core.IC2;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityShield extends Entity {
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package emt.gthandler.common.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
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.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EMT_GT_Block extends Block {
|
||||
|
||||
public EMT_GT_Block(String name, String[] texture) {
|
||||
super(Material.anvil);
|
||||
this.setHardness(15.0F);
|
||||
this.setResistance(30.0F);
|
||||
this.name = name;
|
||||
this.textureNames=texture;
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] texture;
|
||||
private String[] textureNames;
|
||||
private String name;
|
||||
|
||||
@Override
|
||||
public int damageDropped(final int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
|
||||
for (int i = 0; i < textureNames.length; i ++) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return meta < texture.length ? texture[meta] : texture[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister){
|
||||
texture = new IIcon[textureNames.length];
|
||||
for (int i = 0; i < textureNames.length; i++) {
|
||||
texture[i] = par1IconRegister.registerIcon(textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(){
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package emt.gthandler.common.implementations;
|
||||
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.ITexture;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import gregtech.api.metatileentity.MetaTileEntity;
|
||||
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class EssentiaHatch extends GT_MetaTileEntity_Hatch_Input {
|
||||
|
||||
private AspectList current = new AspectList();
|
||||
private static int ApTe = (int) Math.ceil(Aspect.aspects.size()/GT_Values.V.length);
|
||||
|
||||
public boolean addAspectList(final AspectList A){
|
||||
|
||||
if ((this.mTier+1)*ApTe > A.size()+current.size()){
|
||||
if (current.visSize() + A.visSize() < (this.mTier+1)*ApTe*64)
|
||||
current.add(A);
|
||||
return true;
|
||||
}else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public EssentiaHatch(int aID, String aName, String aNameRegional, int aTier) {
|
||||
super(aID, aName, aNameRegional, aTier);
|
||||
}
|
||||
|
||||
public EssentiaHatch(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
|
||||
super(aName, aTier, aDescription, aTextures);
|
||||
}
|
||||
|
||||
public EssentiaHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
|
||||
super(aName, aTier, aDescription, aTextures);
|
||||
}
|
||||
|
||||
public void setCurrent(AspectList List){
|
||||
this.current = List;
|
||||
}
|
||||
|
||||
public AspectList getAspects() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
|
||||
return new EssentiaHatch("Essentia Hatch "+ GT_Values.VN[this.mTier],this.mTier,this.getDescription(),this.mTextures);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
|
||||
//TODO: new GUI.
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
|
||||
//TODO: new contanier GUI.
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getInfoData() {
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
list.add("This Essentia-Hatch contains:");
|
||||
for (final Aspect A : this.current.aspects.keySet())
|
||||
list.add(A.getName()+": "+Integer.toString(current.getAmount(A)));
|
||||
|
||||
String[] ret = new String[list.size()];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ret[i]=list.get(i);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
/*String[] old = super.getInfoData();
|
||||
if (old.length!=0) {
|
||||
String[] newDescription = new String[old.length + 1];
|
||||
for (int i = 0; i < old.length; i++) {
|
||||
newDescription[i] = old[i];
|
||||
}
|
||||
newDescription[old.length] = "This Contains: " + current.size() + " different Aspects";
|
||||
return newDescription;
|
||||
}else
|
||||
return new String[]{"This Contains: " + current.size() + " different Aspects"};*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDescription(){ //this is the fucking tooltip -_-'
|
||||
return new String[] {
|
||||
"Essentia Hatch for usage in Multiblocks",
|
||||
"Can only be filled with the Essentia Filler",
|
||||
"Can hold "+Integer.toString((ApTe*(mTier+1)))+" Different Essentia Types",
|
||||
"Can hold "+Integer.toString((64*ApTe*(mTier+1)))+" Essentia in total"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGivingInformation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveNBTData(NBTTagCompound var1){
|
||||
|
||||
NBTTagList tlist = new NBTTagList();
|
||||
var1.setTag("Aspects", tlist);
|
||||
Aspect[] aspectA = current.getAspects();
|
||||
|
||||
for(int i = 0; i < aspectA.length; ++i) {
|
||||
Aspect aspect = aspectA[i];
|
||||
if (aspect != null) {
|
||||
NBTTagCompound f = new NBTTagCompound();
|
||||
f.setString("key", aspect.getTag());
|
||||
f.setInteger("amount", current.getAmount(aspect));
|
||||
tlist.appendTag(f);
|
||||
}
|
||||
}
|
||||
|
||||
super.saveNBTData(var1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadNBTData(NBTTagCompound var1){
|
||||
current = new AspectList();
|
||||
NBTTagList tlist = var1.getTagList("Aspects", 10);
|
||||
|
||||
for(int j = 0; j < tlist.tagCount(); ++j) {
|
||||
NBTTagCompound rs = tlist.getCompoundTagAt(j);
|
||||
if (rs.hasKey("key")) {
|
||||
current.add(Aspect.getAspect(rs.getString("key")), rs.getInteger("amount"));
|
||||
}
|
||||
}
|
||||
|
||||
super.loadNBTData(var1);
|
||||
}
|
||||
|
||||
public int fuelleft() {
|
||||
int ret = 0;
|
||||
for (final Aspect A : current.aspects.keySet()){
|
||||
ret += current.getAmount(A);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
public boolean isFluidInputAllowed(FluidStack aFluid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getCapacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
package emt.gthandler.common.implementations.automation;
|
||||
|
||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class EssentiaFiller extends TileEntityEMT implements IAspectContainer, IEssentiaTransport {
|
||||
|
||||
private AspectList current = new AspectList();
|
||||
private byte tick = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity(){
|
||||
++tick;
|
||||
fillfrompipe();
|
||||
if (tick %20 == 0){
|
||||
TileEntity T = this.worldObj.getTileEntity(xCoord,yCoord+1,zCoord);
|
||||
if (checkTE(T)){
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null)
|
||||
T = this.worldObj.getTileEntity(xCoord+1,yCoord,zCoord);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null)
|
||||
T = this.worldObj.getTileEntity(xCoord,yCoord,zCoord+1);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null)
|
||||
T = this.worldObj.getTileEntity(xCoord,yCoord-1,zCoord);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null)
|
||||
T = this.worldObj.getTileEntity(xCoord-1,yCoord,zCoord);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
if (T == null)
|
||||
T = this.worldObj.getTileEntity(xCoord,yCoord,zCoord-1);
|
||||
if (checkTE(T)) {
|
||||
tick = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkTE(final TileEntity T){
|
||||
if (T == null)
|
||||
return false;
|
||||
if (this.current.visSize() > 0)
|
||||
if (T instanceof IGregTechTileEntity) {
|
||||
IMetaTileEntity M = ((IGregTechTileEntity) T).getMetaTileEntity();
|
||||
if (M instanceof EssentiaHatch){
|
||||
if (((EssentiaHatch)M).addAspectList(current))
|
||||
this.current=new AspectList();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void fillfrompipe()
|
||||
{
|
||||
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
|
||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++)
|
||||
{
|
||||
te[i] = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.VALID_DIRECTIONS[i]);
|
||||
if (te[i] != null)
|
||||
{
|
||||
IEssentiaTransport pipe = (IEssentiaTransport)te[i];
|
||||
if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) {
|
||||
return;
|
||||
}
|
||||
if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null) && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) {
|
||||
addToContainer(pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), pipe.takeEssentia(pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]), 1, ForgeDirection.VALID_DIRECTIONS[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAspects(AspectList aspectList) {
|
||||
this.current.add(aspectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerAccept(Aspect aspect) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addToContainer(Aspect aspect, int i) {
|
||||
current.add(aspect,i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(Aspect aspect, int i) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeFromContainer(AspectList aspectList) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContainAmount(Aspect aspect, int i) {
|
||||
return current.aspects.containsKey(aspect) && i <= current.getAmount(aspect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerContain(AspectList aspectList) {
|
||||
ArrayList<Boolean> ret = new ArrayList<Boolean>();
|
||||
for (Aspect a : aspectList.aspects.keySet())
|
||||
if (current.aspects.containsKey(a)) {
|
||||
ret.add(true);
|
||||
}else
|
||||
ret.add(false);
|
||||
return !ret.contains(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int containerContains(Aspect aspect) {
|
||||
return current.aspects.containsKey(aspect) ? current.getAmount(aspect) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnectable(ForgeDirection forgeDirection) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInputFrom(ForgeDirection forgeDirection) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canOutputTo(ForgeDirection forgeDirection) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuction(Aspect aspect, int i) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Aspect getSuctionType(ForgeDirection forgeDirection) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSuctionAmount(ForgeDirection forgeDirection) {
|
||||
return 256;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int takeEssentia(Aspect aspect, int i, ForgeDirection forgeDirection) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addEssentia(Aspect aspect, int i, ForgeDirection forgeDirection) {
|
||||
current.add(aspect,i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Aspect getEssentiaType(ForgeDirection forgeDirection) {
|
||||
return current.getAspects()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEssentiaAmount(ForgeDirection forgeDirection) {
|
||||
int ret = 0;
|
||||
for (final Aspect A : current.aspects.keySet()){
|
||||
ret += current.getAmount(A);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimumSuction() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderExtendedTube() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package emt.gthandler.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.gthandler.common.blocks.EMT_GT_Block;
|
||||
import gregtech.api.util.GT_LanguageManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EMT_CasingBlock extends ItemBlock {
|
||||
|
||||
public static final Block[] EMT_GT_BLOCKS = {new EMT_GT_Block("EMT_GTBLOCK_CASEING", new String[]
|
||||
{
|
||||
EMT.TEXTURE_PATH+":machines/side",
|
||||
EMT.TEXTURE_PATH+":machines/GT/inner",
|
||||
EMT.TEXTURE_PATH+":machines/GT/siderawI",
|
||||
EMT.TEXTURE_PATH+":machines/GT/rawcoreI",
|
||||
EMT.TEXTURE_PATH+":machines/GT/siderawII",
|
||||
EMT.TEXTURE_PATH+":machines/GT/rawcoreII",
|
||||
}
|
||||
)};
|
||||
|
||||
public EMT_CasingBlock(final Block par1){
|
||||
super(par1);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
}
|
||||
|
||||
protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block");
|
||||
protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!");
|
||||
|
||||
@Override
|
||||
public int getMetadata(final int aMeta) {
|
||||
return aMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(final ItemStack aStack) {
|
||||
return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) {
|
||||
aList.add(this.mNoMobsToolTip);
|
||||
aList.add(this.mNoTileEntityToolTip);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
return this.field_150939_a.getIcon(0,stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
|
||||
return getIcon(stack, renderPass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) {
|
||||
return this.field_150939_a.getIcon(0,p_77618_2_);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package emt.gthandler.common.loader;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
||||
import emt.gthandler.common.items.EMT_CasingBlock;
|
||||
import emt.gthandler.common.tileentities.machines.multi.generator.EMT_Large_Essentia_Gen;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.enums.ItemList;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.OrePrefixes;
|
||||
import gregtech.api.util.GT_ModHandler;
|
||||
import gregtech.api.util.GT_OreDictUnificator;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
import static emt.command.CommandOutputs.mkbook;
|
||||
|
||||
public class EMT_GT_Loader implements Runnable {
|
||||
|
||||
|
||||
public static final int TIERS = GT_Values.VN.length;
|
||||
public static int aIDoffset = 13000-TIERS-1;
|
||||
public static ItemStack[] EHatch = new ItemStack[TIERS];
|
||||
public static ItemStack LEG;
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
for (int i = 0; i < TIERS; i++) {
|
||||
EHatch[i] = new EssentiaHatch(aIDoffset+i,"Essentia Hatch "+ GT_Values.VN[i],"Essentia Hatch "+ GT_Values.VN[i],i).getStackForm(1L);
|
||||
}
|
||||
GameRegistry.registerBlock(EMT_CasingBlock.EMT_GT_BLOCKS[0],EMT_CasingBlock.class,"EMT_GTBLOCK_CASEING");
|
||||
LEG = new EMT_Large_Essentia_Gen(aIDoffset+TIERS+1,"Large Essentia Generator","Large Essentia Generator").getStackForm(1L);
|
||||
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.Indium,1L),GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Tungsten,4L)},Materials.SolderingAlloy.getMolten(576L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0],1,3),100, (int)(GT_Values.V[5]-(GT_Values.V[5]/10)));
|
||||
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0],1,3),GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Iridium,8L)},Materials.Osmiridium.getMolten(576L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0],1,5),100, (int)(GT_Values.V[5]-(GT_Values.V[5]/10)));
|
||||
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.Iridium,1L),GT_OreDictUnificator.get(OrePrefixes.stickLong,Materials.Osmiridium,4L)},Materials.SolderingAlloy.getMolten(576L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0],1,2),100, (int)(GT_Values.V[5]-(GT_Values.V[5]/10)));
|
||||
if (Loader.isModLoaded("ThaumicTinkerer"))
|
||||
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0],1,2), GT_ModHandler.getModItem("ThaumicTinkerer","kamiResource",2L,2)},Materials.Concrete.getMolten(2304L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0],1,4),100, (int)(GT_Values.V[5]-(GT_Values.V[5]/10)));
|
||||
else
|
||||
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0],1,2), Materials.ElectrumFlux.getPlates(8)},Materials.Concrete.getMolten(2304L), new ItemStack(EMT_CasingBlock.EMT_GT_BLOCKS[0],1,4),100, (int)(GT_Values.V[5]-(GT_Values.V[5]/10)));
|
||||
|
||||
for (int i = 0; i < ItemList.HATCHES_INPUT.length; i++)
|
||||
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ItemList.HATCHES_INPUT[i].get(1L), new ItemStack(ConfigBlocks.blockTube,1,4)},Materials.Thaumium.getMolten(288L),EHatch[i],100,(int)(GT_Values.V[i]-(GT_Values.V[i]/10)));
|
||||
}
|
||||
|
||||
public void runlate(){
|
||||
GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(Items.book), GT_OreDictUnificator.get(OrePrefixes.circuit,Materials.Basic,1L), new ItemStack(ConfigItems.itemShard,1, OreDictionary.WILDCARD_VALUE)},GT_Values.NF,mkbook(),128,64);
|
||||
}
|
||||
}
|
||||
+416
@@ -0,0 +1,416 @@
|
||||
package emt.gthandler.common.tileentities.machines.multi.generator;
|
||||
|
||||
import emt.gthandler.common.implementations.EssentiaHatch;
|
||||
import emt.gthandler.common.items.EMT_CasingBlock;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTTextHelper;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.Textures;
|
||||
import gregtech.api.interfaces.ITexture;
|
||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
|
||||
import gregtech.api.objects.GT_RenderedTexture;
|
||||
import gregtech.api.objects.XSTR;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.visnet.VisNetHandler;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class EMT_Large_Essentia_Gen extends GT_MetaTileEntity_MultiBlockBase {
|
||||
|
||||
public ArrayList<EssentiaHatch> mEssentiaHatches = new ArrayList();
|
||||
private static final byte CASING_INDEX = 2;
|
||||
private byte tick = 0;
|
||||
private boolean has_lube = false;
|
||||
|
||||
public EMT_Large_Essentia_Gen(int aID, String aName, String aNameRegional) {
|
||||
super(aID, aName, aNameRegional);
|
||||
}
|
||||
|
||||
public EMT_Large_Essentia_Gen(String aName) {
|
||||
super(aName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDescription() {
|
||||
return new String[]{
|
||||
"Controller Block for the Large Essentia Generator.",
|
||||
"Produces energy from magical essentia decay.",
|
||||
"Size(WxHxD): 7x4x7, Controller (Bottom, Center)",
|
||||
"Top-Middle 5x1x5 layer are Muffler Hatches",
|
||||
"Middle 5x2x5 layer are Essentia Diffusion Cells",
|
||||
"Everything from here on goes either in the bottom or on the sides",
|
||||
"1x Fluid Input Hatch",
|
||||
"1x Essentia Input Hatch",
|
||||
"1x Dynamo Hatches",
|
||||
"1x Maintenance Hatch",
|
||||
"The outer hull is made out of Magic Containing Casings",
|
||||
"Produces 20x more than the singleblock generator per essentia",
|
||||
"Causes magical and serious conventional pollution",
|
||||
"Needs 1L Lubricant per second or will cause way more conventional pollution",
|
||||
"Needs 10 " + EMTTextHelper.LIGHT_BLUE +"Aqua"+ EMTTextHelper.LIGHT_GRAY +" cVis per second or will cause way more magical pollution",
|
||||
"Added by EMT",
|
||||
"Made by bartimaeusnek"
|
||||
};
|
||||
}
|
||||
|
||||
public int getCurrentEfficiency(ItemStack itemStack) {
|
||||
return this.mEfficiency - (this.getIdealStatus() - this.getRepairStatus()) * this.getMaxEfficiency(itemStack) / 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone){
|
||||
if (aSide == aFacing) {
|
||||
return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_TOWER)};
|
||||
}
|
||||
return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_INDEX]};
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) {
|
||||
return new EMT_Large_Essentia_Gen(this.mName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int p_70301_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
// TODO Auto-generated method stub
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) {
|
||||
|
||||
final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3;
|
||||
final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3;
|
||||
|
||||
for (int x = -3; x <= 3; x++) {
|
||||
for (int z = -3; z <= 3; z++) {
|
||||
for (int h = 0; h <= 3; h++) {
|
||||
final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, h, zDir + z);
|
||||
|
||||
if (!((x == -3) || (x == 3) || (z == -3) || (z == 3))) {
|
||||
// Muffler on top.
|
||||
if ((h == 3)) {
|
||||
if (!this.addMufflerToMachineList(tTileEntity, CASING_INDEX)) {
|
||||
return false;
|
||||
}
|
||||
} else if (h != 0) {
|
||||
//inside Special Blocks
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z) != EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
||||
return false;
|
||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 1))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if (!(this.addEssetiaHatchToList(tTileEntity,CASING_INDEX)||this.addDynamoToMachineList(tTileEntity,CASING_INDEX)||this.addMaintenanceToMachineList(tTileEntity,CASING_INDEX)||this.addInputToMachineList(tTileEntity,CASING_INDEX)))
|
||||
//ground still casings
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z) != EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
||||
return false;
|
||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0))
|
||||
return false;
|
||||
|
||||
}
|
||||
else if (h != 0) {
|
||||
//walls
|
||||
if (!(this.addEssetiaHatchToList(tTileEntity,CASING_INDEX)||this.addDynamoToMachineList(tTileEntity,CASING_INDEX)||this.addMaintenanceToMachineList(tTileEntity,CASING_INDEX)||this.addInputToMachineList(tTileEntity,CASING_INDEX)))
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z) != EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
||||
return false;
|
||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0))
|
||||
return false;
|
||||
}
|
||||
else if (h == 0 ){
|
||||
//top and bottom corners
|
||||
if (!(this.addEssetiaHatchToList(tTileEntity,CASING_INDEX)||this.addDynamoToMachineList(tTileEntity,CASING_INDEX)||this.addMaintenanceToMachineList(tTileEntity,CASING_INDEX)||this.addInputToMachineList(tTileEntity,CASING_INDEX)))
|
||||
if (((xDir + x) != 0) || ((zDir + z) != 0)) //controller
|
||||
if (aBaseMetaTileEntity.getBlockOffset(xDir + x, h, zDir + z) != EMT_CasingBlock.EMT_GT_BLOCKS[0])
|
||||
return false;
|
||||
else if ((aBaseMetaTileEntity.getMetaIDOffset(xDir + x, h, zDir + z) != 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.mDynamoHatches.size() != 1)
|
||||
return false;
|
||||
|
||||
if (this.mInputHatches.size() != 1)
|
||||
return false;
|
||||
|
||||
if (this.mMaintenanceHatches.size() != 1)
|
||||
return false;
|
||||
|
||||
/*
|
||||
//repair shit debug shit
|
||||
this.mWrench = true;
|
||||
this.mScrewdriver = true;
|
||||
this.mSoftHammer = true;
|
||||
this.mHardHammer = true;
|
||||
this.mSolderingTool = true;
|
||||
this.mCrowbar = true;
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean addEssetiaHatchToList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex){
|
||||
if (aTileEntity == null) {
|
||||
return false;
|
||||
} else {
|
||||
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
|
||||
if (aMetaTileEntity == null) {
|
||||
return false;
|
||||
} else if (aMetaTileEntity instanceof EssentiaHatch) {
|
||||
((EssentiaHatch)aMetaTileEntity).updateTexture(aBaseCasingIndex);
|
||||
return this.mEssentiaHatches.add((EssentiaHatch)aMetaTileEntity);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void make_energy(){
|
||||
AspectList fuel = this.mEssentiaHatches.get(0).getAspects();
|
||||
double cached = 0;
|
||||
|
||||
++tick;
|
||||
|
||||
//make energy
|
||||
for (final Aspect A : fuel.aspects.keySet()) {
|
||||
if (fuel.getAmount(A) > 0 ) {
|
||||
double burnvalue = EMTEssentiasOutputs.outputs.get(A.getTag()).doubleValue();
|
||||
cached += (burnvalue / 20D);
|
||||
cached = Math.ceil(cached);
|
||||
|
||||
if (tick % 20 == 0) { //every second consume 1 essentia
|
||||
//consume essentia and remove it from the Aspect List if its 0
|
||||
this.mEssentiaHatches.get(0).getAspects().reduce(A, 1);
|
||||
if (this.mEssentiaHatches.get(0).getAspects().getAmount(A)==0)
|
||||
this.mEssentiaHatches.get(0).getAspects().remove(A);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tick % 20 == 0){
|
||||
//consume lubricant
|
||||
if (has_lube)
|
||||
this.mInputHatches.get(0).getFluid().amount -= 1;
|
||||
|
||||
tick = 0; //reset ticktimer
|
||||
}
|
||||
|
||||
//transfer energy into mEU
|
||||
this.mEUt = (int) Math.ceil(cached);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkRecipe(ItemStack arg0) {
|
||||
/*
|
||||
if (!this.getBaseMetaTileEntity().isActive())
|
||||
if (this.mEfficiency > 100)
|
||||
this.mEfficiency -= 8;
|
||||
else
|
||||
this.mEfficiency = 100;
|
||||
*/
|
||||
if (this.mEssentiaHatches.get(0).fuelleft() > 0){
|
||||
this.mMaxProgresstime=1;
|
||||
this.mProgresstime=0;
|
||||
}
|
||||
|
||||
return this.mEssentiaHatches.get(0).fuelleft() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRunningTick(ItemStack aStack) {
|
||||
|
||||
if (tick % 20 == 0) {//every second
|
||||
//highers eff to max by 0.16% every running tick = 3,2% every second
|
||||
if (this.mEfficiency < this.getMaxEfficiency(null) - 320)
|
||||
this.mEfficiency += 320;
|
||||
else
|
||||
this.mEfficiency = getMaxEfficiency(null);
|
||||
|
||||
//check for Lubricant
|
||||
this.has_lube = this.mInputHatches.get(0).getFluid() != null && this.mInputHatches.get(0).getFluid().isFluidEqual(Materials.Lubricant.getFluid(1L)) && this.mInputHatches.get(0).getFluidAmount() > 0;
|
||||
}
|
||||
|
||||
|
||||
if (tick % 2 == 0) {//every 2nd tick
|
||||
|
||||
final XSTR R = new XSTR();
|
||||
final World WORLD=this.getBaseMetaTileEntity().getWorld();
|
||||
int x = this.getBaseMetaTileEntity().getXCoord();
|
||||
int y = this.getBaseMetaTileEntity().getYCoord();
|
||||
int z = this.getBaseMetaTileEntity().getZCoord();
|
||||
|
||||
//if out of aqua, make much flux but to not stop.
|
||||
boolean outOfcVis = VisNetHandler.drainVis(WORLD, x, y, z, Aspect.WATER, 10) <= 9;
|
||||
|
||||
//Random Change of a bit of Flux Gas.
|
||||
final int RANDOMHATCH = R.nextInt(this.mMufflerHatches.size());
|
||||
|
||||
//gets a chanche to release flux gas based on missing efficiency, min 1%
|
||||
if ((R.nextInt(getMaxEfficiency(null)) > (this.mEfficiency > 100 ? this.mEfficiency : 100)) || outOfcVis) {
|
||||
x = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getXCoord();
|
||||
y = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getYCoord() + 1;
|
||||
z = this.mMufflerHatches.get(RANDOMHATCH).getBaseMetaTileEntity().getZCoord();
|
||||
WORLD.setBlock(x, y, z, ConfigBlocks.blockFluxGas, R.nextInt(8), 3);
|
||||
}
|
||||
}
|
||||
|
||||
make_energy();
|
||||
++this.mProgresstime;
|
||||
return super.onRunningTick(aStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean explodesOnComponentBreak(ItemStack arg0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageToComponent(ItemStack arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEfficiency(ItemStack arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
return 10000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPollutionPerTick(ItemStack arg0) {
|
||||
return has_lube ? 50 : 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCorrectMachinePart(ItemStack arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGivingInformation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getInfoData() {
|
||||
String[] old = super.getInfoData();
|
||||
old[2]="Produces "+EMTTextHelper.RED+mEUt+EMTTextHelper.WHITE+"EU/t";
|
||||
return old;
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public void explodeMultiblock() {
|
||||
|
||||
final World WORLD=this.getBaseMetaTileEntity().getWorld();
|
||||
final int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 3;
|
||||
final int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 3;
|
||||
|
||||
for (int x = -3; x <= 3; x++)
|
||||
for (int z = -3; z <= 3; z++)
|
||||
for (int h = 0; h <= 3; h++)
|
||||
WORLD.setBlock(xDir+x, this.getBaseMetaTileEntity().getYCoord()+h, zDir+z, ConfigBlocks.blockFluxGas, 8, 3);
|
||||
super.explodeMultiblock();
|
||||
}*/
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package emt.init;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.block.BlockReflectedGen;
|
||||
import emt.tile.generator.TileEntityBaseGenerator;
|
||||
import emt.tile.generator.TileEntityReflexionGen;
|
||||
|
||||
public class EMTAutogeneratedGens
|
||||
implements Runnable
|
||||
{
|
||||
public static BlockReflectedGen[] BRG;
|
||||
public static TileEntityReflexionGen TFG = new TileEntityReflexionGen();
|
||||
private static short sets;
|
||||
|
||||
public void run()
|
||||
{
|
||||
sets = (short)(TileEntityReflexionGen.L.size() / 16);
|
||||
if (TileEntityReflexionGen.L.size() % 16 != 0) {
|
||||
sets = (short)(sets + 1);
|
||||
}
|
||||
BRG = new BlockReflectedGen[sets];
|
||||
for (short i = 0; i < sets; ++i) {
|
||||
BRG[i] = new BlockReflectedGen("EGenerator.Set." + Short.toString(i), i);
|
||||
}
|
||||
// for (int i = 0; i < TileEntityReflexionGen.L.size(); i++) {
|
||||
GameRegistry.registerTileEntity(TileEntityBaseGenerator.class, "TileEntityBaseGenerator");// + TileEntityReflexionGen.L.get(i));
|
||||
//}
|
||||
for (short i = 0; i < sets; i = (short)(i + 1)) {
|
||||
GameRegistry.registerBlock(BRG[i], "EGenerator.Set." + Short.toString(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,16 +8,12 @@ import emt.block.BlockPortableNode;
|
||||
import emt.block.BlockShield;
|
||||
import emt.block.BlockSolars;
|
||||
import emt.item.block.ItemBlockElectricCloud;
|
||||
import emt.item.block.ItemBlockEssentiaGenerator;
|
||||
import emt.item.block.ItemBlockEssentiaGenerators;
|
||||
import emt.item.block.ItemBlockMachines;
|
||||
import emt.item.block.ItemBlockSolars;
|
||||
import ic2.api.item.IC2Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import static thaumcraft.api.ThaumcraftApi.*;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
@@ -9,7 +9,6 @@ import emt.entity.EntityShield;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityList.EntityEggInfo;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
|
||||
public class EMTEntities {
|
||||
|
||||
|
||||
@@ -37,8 +37,6 @@ import emt.item.tool.drill.ItemThaumiumDrill;
|
||||
import emt.item.tool.omnitool.ItemOmnitoolDiamond;
|
||||
import emt.item.tool.omnitool.ItemOmnitoolIron;
|
||||
import emt.item.tool.omnitool.ItemOmnitoolThaumium;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -113,13 +111,13 @@ public class EMTItems {
|
||||
solarHelmetRevealing = new ItemSolarHelmetRevealing(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(EMT.MOD_ID + ".goggles.solar");
|
||||
GameRegistry.registerItem(solarHelmetRevealing, "SolarHelmetRevealing");
|
||||
|
||||
electricBootsTraveller = new ItemElectricBootsTraveller(3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.electric");
|
||||
electricBootsTraveller = new ItemElectricBootsTraveller(ItemArmor.ArmorMaterial.IRON, 3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.electric");
|
||||
GameRegistry.registerItem(electricBootsTraveller, "ElectricBootsTraveller");
|
||||
|
||||
nanoBootsTraveller = new ItemNanoBootsTraveller(3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.nano");
|
||||
nanoBootsTraveller = new ItemNanoBootsTraveller(ItemArmor.ArmorMaterial.DIAMOND, 3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.nano");
|
||||
GameRegistry.registerItem(nanoBootsTraveller, "NanoBootsTraveller");
|
||||
|
||||
quantumBootsTraveller = new ItemQuantumBootsTraveller(3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.quantum");
|
||||
quantumBootsTraveller = new ItemQuantumBootsTraveller(ItemArmor.ArmorMaterial.DIAMOND, 3, 3).setUnlocalizedName(EMT.MOD_ID + ".boots.traveller.quantum");
|
||||
GameRegistry.registerItem(quantumBootsTraveller, "QuantumBootsTraveller");
|
||||
|
||||
electricScribingTools = new ItemElectricScribingTools().setUnlocalizedName(EMT.MOD_ID + ".scribingtools.electric");
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package emt.init;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
@@ -8,32 +7,28 @@ import emt.util.EMTCraftingAspects;
|
||||
import emt.util.EMTResearchAspects;
|
||||
|
||||
import static emt.util.EMTRandomHelper.*;
|
||||
import ic2.api.item.ElectricItem;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.recipe.IRecipeInput;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import ic2.api.recipe.Recipes;
|
||||
import ic2.core.BasicMachineRecipeManager;
|
||||
import ic2.core.Ic2Items;
|
||||
import ic2.core.item.ItemFluidCell;
|
||||
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.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import static thaumcraft.api.ThaumcraftApi.*;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.CrucibleRecipe;
|
||||
import thaumcraft.api.crafting.InfusionRecipe;
|
||||
import thaumcraft.api.crafting.ShapedArcaneRecipe;
|
||||
import thaumcraft.api.crafting.ShapelessArcaneRecipe;
|
||||
import thaumcraft.common.blocks.ItemJarFilled;
|
||||
import thaumcraft.common.blocks.ItemJarNode;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
@@ -160,6 +155,9 @@ public class EMTRecipes {
|
||||
|
||||
public static void registerLateRecipes() {
|
||||
/** Infusion Recipes **/
|
||||
lucrumGenerator = addInfusionCraftingRecipe("Lucrum Generator", new ItemStack(EMTBlocks.essentiaGens, 1, 5), 10, new AspectList().add(Aspect.GREED, 64).add(Aspect.EXCHANGE, 128), new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
new ItemStack[] {new ItemStack(Blocks.gold_block),new ItemStack(Blocks.gold_block),new ItemStack(Blocks.gold_block),new ItemStack(Blocks.gold_block),new ItemStack(Blocks.gold_block),new ItemStack(Blocks.gold_block)});
|
||||
|
||||
thaumiumDrill = addInfusionCraftingRecipe("Thaumium Drill", getChargedItem(EMTItems.thaumiumDrill, 10), 5, EMTCraftingAspects.thaumiumDrillCrafting, new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.diamond), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(EMTItems.itemEMTItems, 1, 5), IC2Items.getItem("denseplateiron") });
|
||||
|
||||
@@ -458,6 +456,7 @@ public class EMTRecipes {
|
||||
public static InfusionRecipe armorChargingRing;
|
||||
public static InfusionRecipe nanoWings;
|
||||
public static InfusionRecipe quantumWings;
|
||||
public static InfusionRecipe lucrumGenerator;
|
||||
|
||||
public static ShapelessArcaneRecipe diamondOmnitool;
|
||||
public static ShapelessArcaneRecipe tinyUranium;
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package emt.init;
|
||||
|
||||
import emt.EMT;
|
||||
import emt.client.EMTKeys;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTResearchAspects;
|
||||
import emt.util.EMTResearchItem;
|
||||
import ic2.api.item.IC2Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchCategories;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
|
||||
public class EMTResearches {
|
||||
@@ -125,6 +122,12 @@ public class EMTResearches {
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
if (!EMTConfigHandler.lucrumGeneratorResearch) {
|
||||
new EMTResearchItem("Lucrum Generator", EMTResearchAspects.lucrumGeneratorResearch, -2, 2, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 5)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.lucrumGenerator));
|
||||
}
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.potentiaGeneratorResearch) {
|
||||
if (!EMTConfigHandler.aerGeneratorResearch) {
|
||||
new EMTResearchItem("Aer Generator", EMTResearchAspects.aerGenerator, -2, 6, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 4)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.aerGenerator));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package emt.init;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import emt.gthandler.common.implementations.automation.EssentiaFiller;
|
||||
import emt.tile.TileElectricCloud;
|
||||
import emt.tile.TileEntityEtherealMacerator;
|
||||
import emt.tile.TileEntityIndustrialWandRecharge;
|
||||
@@ -9,6 +10,7 @@ import emt.tile.generator.TileEntityAerGenerator;
|
||||
import emt.tile.generator.TileEntityArborGenerator;
|
||||
import emt.tile.generator.TileEntityAuramGenerator;
|
||||
import emt.tile.generator.TileEntityIgnisGenerator;
|
||||
import emt.tile.generator.TileEntityLucrumGenerator;
|
||||
import emt.tile.generator.TileEntityPotentiaGenerator;
|
||||
import emt.tile.solar.air.TileEntityAirSolar;
|
||||
import emt.tile.solar.air.TileEntityDoubleAirSolar;
|
||||
@@ -34,18 +36,25 @@ import emt.tile.solar.water.TileEntityWaterSolar;
|
||||
|
||||
public class EMTTiles {
|
||||
|
||||
public static void registerTiles() {
|
||||
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
|
||||
public static void registerTileEntities() {
|
||||
|
||||
//Essentia Gens
|
||||
GameRegistry.registerTileEntity(TileEntityPotentiaGenerator.class, "tileentitypotentiagenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityIgnisGenerator.class, "tileentityignisgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityAuramGenerator.class, "tileentityauramgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityArborGenerator.class, "tileentityarborgenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityAerGenerator.class, "tileentityaergenerator");
|
||||
GameRegistry.registerTileEntity(TileEntityLucrumGenerator.class, "tileentitylucrumgenerator");
|
||||
|
||||
//Machinery
|
||||
GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
|
||||
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
||||
GameRegistry.registerTileEntity(EssentiaFiller.class,"EssentiaFillerTE");
|
||||
|
||||
//Solars
|
||||
GameRegistry.registerTileEntity(TileEntityCompressedSolar.class, "tileentitycompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleCompressedSolar.class, "tileentitytriplecompressedsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
|
||||
GameRegistry.registerTileEntity(TileEntityWaterSolar.class, "tileentitywatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar");
|
||||
@@ -64,6 +73,9 @@ public class EMTTiles {
|
||||
GameRegistry.registerTileEntity(TileEntityEarthSolar.class, "tileentityearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar");
|
||||
GameRegistry.registerTileEntity(TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar");
|
||||
|
||||
//Random Stuff
|
||||
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
|
||||
GameRegistry.registerTileEntity(TileElectricCloud.class, "tileEntityElectricCloud");
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,29 @@
|
||||
package emt.init;
|
||||
|
||||
public class Registry {
|
||||
public static void register() {
|
||||
EMTBlocks.registerBlocks();
|
||||
EMTItems.registerItems();
|
||||
EMTTiles.registerTiles();
|
||||
EMTRecipes.registerEarlyRecipes();
|
||||
}
|
||||
import emt.gthandler.common.loader.EMT_GT_Loader;
|
||||
|
||||
public static void registerLate() {
|
||||
EMTBlocks.addAspects();
|
||||
EMTRecipes.registerLateRecipes();
|
||||
EMTRecipes.registerUUMInfusionRecipes();
|
||||
}
|
||||
public class Registry
|
||||
{
|
||||
private static final EMT_GT_Loader gtloader = new EMT_GT_Loader();
|
||||
public static void registerPreInit() {
|
||||
}
|
||||
|
||||
public static void registerInit()
|
||||
{
|
||||
EMTBlocks.registerBlocks();
|
||||
EMTItems.registerItems();
|
||||
EMTTiles.registerTileEntities();
|
||||
gtloader.run();
|
||||
EMTRecipes.registerEarlyRecipes();
|
||||
}
|
||||
|
||||
public static void registerLate()
|
||||
{
|
||||
EMTBlocks.addAspects();
|
||||
gtloader.runlate();
|
||||
EMTRecipes.registerLateRecipes();
|
||||
EMTRecipes.registerUUMInfusionRecipes();
|
||||
// new EMTAutogeneratedGens().run();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package emt.item;
|
||||
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTTextHelper;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 1;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,11 +15,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class ItemIC2Baubles extends ItemBase implements IBauble {
|
||||
public class ItemIC2Baubles extends ItemBase implements IBauble, IRunicArmor {
|
||||
|
||||
public IIcon[] icon = new IIcon[16];
|
||||
public static int wornTick;
|
||||
@@ -133,4 +134,9 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
|
||||
public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,12 @@ package emt.item;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
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.effect.EntityLightningBolt;
|
||||
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.ItemStack;
|
||||
@@ -23,7 +21,6 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.lib.utils.InventoryUtils;
|
||||
|
||||
|
||||
@@ -16,17 +16,26 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class ItemOneRing extends ItemBase implements IBauble {
|
||||
|
||||
public IIcon[] icon = new IIcon[16];
|
||||
public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRunicArmor
|
||||
{
|
||||
private static final String NBT_TAG_FORGE_DATA = "EMT";
|
||||
private static final String NBT_TAG_MIND_CORRUPTION = "MindCorruption";
|
||||
private static final String NBT_TAG_WARP = "warp";
|
||||
public IIcon[] icon = new IIcon[16];
|
||||
public Random random = new Random();
|
||||
|
||||
public int getWarp(ItemStack itemstack, EntityPlayer player)
|
||||
{
|
||||
return getItemWarpLevel(itemstack, false);
|
||||
}
|
||||
|
||||
public ItemOneRing() {
|
||||
super("bauble");
|
||||
this.setHasSubtypes(true);
|
||||
@@ -74,65 +83,122 @@ public class ItemOneRing extends ItemBase implements IBauble {
|
||||
}
|
||||
}
|
||||
|
||||
private NBTTagCompound getOrSetForgeTag(EntityPlayer pPlayer)
|
||||
{
|
||||
NBTTagCompound tPlayerNBT = pPlayer.getEntityData();
|
||||
NBTTagCompound forgeTag = new NBTTagCompound();
|
||||
|
||||
// getCompoundTag already returns the contents of "ForgeData" TagCompound. Changed this to
|
||||
// save our value in EMT Sub-Tag
|
||||
if (tPlayerNBT.hasKey( NBT_TAG_FORGE_DATA ))
|
||||
forgeTag = tPlayerNBT.getCompoundTag( NBT_TAG_FORGE_DATA );
|
||||
else
|
||||
tPlayerNBT.setTag( NBT_TAG_FORGE_DATA, forgeTag );
|
||||
|
||||
return forgeTag;
|
||||
}
|
||||
|
||||
private int getItemWarpLevel(ItemStack stack, boolean increment)
|
||||
{
|
||||
NBTTagCompound tWarpTag = new NBTTagCompound();
|
||||
int tWarpLevel = 0;
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
if (stack.getTagCompound().hasKey( NBT_TAG_WARP ))
|
||||
{
|
||||
tWarpLevel = stack.getTagCompound().getInteger( NBT_TAG_WARP );
|
||||
if (increment)
|
||||
stack.getTagCompound().setInteger( NBT_TAG_WARP , ++tWarpLevel);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tWarpTag.setInteger( NBT_TAG_WARP, 0 );
|
||||
stack.setTagCompound( tWarpTag );
|
||||
}
|
||||
|
||||
return tWarpLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWornTick(ItemStack stack, EntityLivingBase player) {
|
||||
if (!player.isInvisible()) {
|
||||
player.setInvisible(true);
|
||||
((EntityPlayer) player).capabilities.disableDamage = true;
|
||||
}
|
||||
|
||||
// Stop doing this 20 times per second...
|
||||
if ( random.nextInt(20) > 0)
|
||||
return;
|
||||
|
||||
/* Why dump to a new tag when you can just grab the tag and work with it?
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
((EntityPlayer) player).writeToNBT(tag);
|
||||
NBTTagCompound forgeTag = tag.getCompoundTag("ForgeData");
|
||||
*/
|
||||
|
||||
// Retrieve Players NBT Data
|
||||
|
||||
NBTTagCompound forgeTag = getOrSetForgeTag((EntityPlayer)player);
|
||||
|
||||
int corruption = 0;
|
||||
|
||||
if (forgeTag.hasKey("MindCorruption"))
|
||||
corruption = forgeTag.getInteger("MindCorruption");
|
||||
// get corruption levels, init to 0 if not existing yet
|
||||
if (forgeTag.hasKey( NBT_TAG_MIND_CORRUPTION ))
|
||||
corruption = forgeTag.getInteger( NBT_TAG_MIND_CORRUPTION );
|
||||
else
|
||||
forgeTag.setInteger("MindCorruption", 0);
|
||||
|
||||
((EntityPlayer) player).capabilities.disableDamage = true;
|
||||
forgeTag.setInteger( NBT_TAG_MIND_CORRUPTION, 0);
|
||||
|
||||
if (!player.worldObj.isRemote) {
|
||||
if (corruption <= 0) {
|
||||
//EMT.LOGGER.info( String.format( "Total Corruption: %d ItemWarpLevel: %d", corruption, getItemWarpLevel( stack, false ) ));
|
||||
|
||||
if (corruption == 0) {
|
||||
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "You have worn the Ring. Your soul has now been forever " + EMTTextHelper.PURPLE + "tainted. " + EMTTextHelper.RED + EMTTextHelper.ITALIC + "Beware of wearing the ring. The tainting will only " + EMTTextHelper.RED + EMTTextHelper.ITALIC + "increase, and strange things will start happening."));
|
||||
}
|
||||
else if (corruption > 6000 && corruption < 24000 && random.nextInt(2000) == 0) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 500, 2, false));
|
||||
// First effect should become active after ~5 Minutes
|
||||
else if (corruption > 300 && corruption < 1400 && random.nextInt(100) == 0) {
|
||||
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "The Ring somehow feels heavy"));
|
||||
if (random.nextBoolean())
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 500, 2, false));
|
||||
else
|
||||
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false));
|
||||
}
|
||||
else if (corruption >= 6000 && corruption < 24000 && random.nextInt(2000) == 0) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false));
|
||||
}
|
||||
else if (corruption >= 24000 && corruption < 72000 && random.nextInt(2000) == 0) {
|
||||
else if (corruption >= 1400 && corruption < 3800 && random.nextInt(100) == 0) {
|
||||
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||
|
||||
player.attackEntityFrom(DamageSource.magic, 5);
|
||||
player.addPotionEffect(new PotionEffect(Potion.poison.id, 500, 2, false));
|
||||
}
|
||||
else if (corruption >= 72000 && corruption < 120000 && random.nextInt(4000) == 0) {
|
||||
else if (corruption >= 3800 && corruption < 6500 && random.nextInt(100) == 0) {
|
||||
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||
|
||||
player.motionY += 2d;
|
||||
}
|
||||
else if (corruption >= 120000 && random.nextInt(10000) == 0) {
|
||||
else if (corruption >= 6500 && random.nextInt(10000) == 0) {
|
||||
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||
player.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 4, false));
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.wither.id, 5000, 4, false));
|
||||
}
|
||||
else if (corruption + 100 >= Integer.MAX_VALUE) { // =3333333
|
||||
player.isDead = true;
|
||||
}
|
||||
if (corruption >= 300)
|
||||
{
|
||||
if ( random.nextInt( 100 ) == 0)
|
||||
{
|
||||
getItemWarpLevel( stack, true );
|
||||
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple"));
|
||||
}
|
||||
}
|
||||
}
|
||||
forgeTag.setInteger("MindCorruption", ++corruption);
|
||||
tag.setTag("ForgeData", forgeTag);
|
||||
((EntityPlayer) player).readFromNBT(tag);
|
||||
forgeTag.setInteger( NBT_TAG_MIND_CORRUPTION, ++corruption);
|
||||
//tag.setTag( NBT_TAG_FORGE_DATA, forgeTag);
|
||||
//((EntityPlayer) player).readFromNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEquipped(ItemStack stack, EntityLivingBase player) {
|
||||
// This purges all corruption once the ring is put on / a second ring is equipped?
|
||||
/*
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
((EntityPlayer) player).writeToNBT(tag);
|
||||
tag.getCompoundTag("ForgeData").setInteger("MindCorruption", 0);
|
||||
tag.getCompoundTag( NBT_TAG_FORGE_DATA ).setInteger( NBT_TAG_MIND_CORRUPTION, 0);
|
||||
((EntityPlayer) player).readFromNBT(tag);
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,11 +206,13 @@ public class ItemOneRing extends ItemBase implements IBauble {
|
||||
player.setInvisible(false);
|
||||
if (!((EntityPlayer) player).capabilities.isCreativeMode)
|
||||
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
/* Wtf? Remove ForgeData tag? There are more mods using this tag than just emt!
|
||||
((EntityPlayer) player).writeToNBT(tag);
|
||||
tag.removeTag("ForgeData");
|
||||
tag.removeTag( NBT_TAG_FORGE_DATA );
|
||||
((EntityPlayer) player).readFromNBT(tag);
|
||||
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false));
|
||||
*/
|
||||
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 1, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,8 +222,26 @@ public class ItemOneRing extends ItemBase implements IBauble {
|
||||
|
||||
@Override
|
||||
public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
((EntityPlayer) player).writeToNBT(tag);
|
||||
return tag.getCompoundTag("ForgeData").getInteger("MindCorruption") > 600 ? true : false;
|
||||
// So, how this was written, you basically could not unequip the ring for 600 ticks after you equipped it, but afterwards you could?
|
||||
// Let's make it a random chance to remove it instead...
|
||||
|
||||
// NBTTagCompound tag = getOrSetForgeTag((EntityPlayer) player);
|
||||
// return (tag.getCompoundTag( NBT_TAG_FORGE_DATA ).getInteger( NBT_TAG_MIND_CORRUPTION ) > 600);
|
||||
boolean tRet = false;
|
||||
if (random.nextInt( 5 ) == 0)
|
||||
{
|
||||
tRet = true;
|
||||
((EntityPlayer) player).addChatMessage(new ChatComponentText(EMTTextHelper.GREEN + "You removed the Ring. Maybe you should think twice before using it next time?"));
|
||||
}
|
||||
else
|
||||
( (EntityPlayer) player ).addChatMessage( new ChatComponentText( EMTTextHelper.PURPLE + "Nooo, don't remove me! I give you great power!" ) );
|
||||
|
||||
return tRet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,13 +4,11 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.api.item.IMetalArmor;
|
||||
import ic2.api.util.Keys;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -25,24 +23,24 @@ import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemElectricBootsTraveller extends ItemArmor implements IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
|
||||
public class ItemElectricBootsTraveller extends ItemArmor implements IRunicArmor, IElectricItem, IVisDiscountGear, IMetalArmor, ISpecialArmor {
|
||||
|
||||
public int maxCharge = 100000;
|
||||
public int energyPerDamage = 100;
|
||||
public int energyPerDamage = 1000;
|
||||
public int visDiscount = 2;
|
||||
public float speedBonus = 0.055F;
|
||||
public float jumpBonus = 0.3F;
|
||||
public double transferLimit = 100;
|
||||
public boolean speedBoostActive = false;
|
||||
|
||||
public ItemElectricBootsTraveller(int par3, int par4) {
|
||||
super(ArmorMaterial.DIAMOND, par3, par4);
|
||||
public ItemElectricBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
@@ -71,13 +69,13 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
|
||||
if (source.isUnblockable()) {
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
|
||||
}
|
||||
else {
|
||||
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
|
||||
int energyPerDamage = getEnergyPerDamage();
|
||||
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
|
||||
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,11 +95,11 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
return 0.5D;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
return 0.15D;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,11 +114,6 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if (Keys.instance.isBoostKeyDown(player) && Keys.instance.isModeSwitchKeyDown(player))
|
||||
{
|
||||
speedBoostActive = !speedBoostActive;
|
||||
}
|
||||
|
||||
if ((!player.capabilities.isFlying) && (player.moveForward > 0.0F)) {
|
||||
if ((player.worldObj.isRemote) && (!player.isSneaking())) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) {
|
||||
@@ -128,7 +121,8 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
}
|
||||
player.stepHeight = 1.0F;
|
||||
}
|
||||
if (speedBoostActive && ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)) {
|
||||
|
||||
if (((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)) {
|
||||
player.moveFlying(0F, 1F, speedBonus);
|
||||
player.jumpMovementFactor = jumpBonus;
|
||||
}
|
||||
@@ -146,17 +140,49 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
}
|
||||
}
|
||||
|
||||
// make the boots worth upgrading
|
||||
public float getMaxHealthyDropDist()
|
||||
{
|
||||
return 20.0F;
|
||||
}
|
||||
|
||||
public float getMinimumDropDist()
|
||||
{
|
||||
return 4.0f;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingFall(LivingFallEvent event) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
EntityPlayer entity = (EntityPlayer) event.entity;
|
||||
if ((entity.inventory.armorInventory[0] != null) && (entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller)) {
|
||||
ItemStack stack = entity.inventory.armorInventory[0];
|
||||
if (ElectricItem.manager.use(stack, energyPerDamage, entity))
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void onLivingFall(LivingFallEvent event)
|
||||
{
|
||||
if( ( EMT.instance.isSimulating() ) && ( ( event.entity instanceof EntityLivingBase ) ) )
|
||||
{
|
||||
if( event.entity instanceof EntityPlayer )
|
||||
{
|
||||
EntityPlayer entity = (EntityPlayer) event.entity;
|
||||
if( ( entity.inventory.armorInventory[0] != null ) && ( entity.inventory.armorInventory[0].getItem() instanceof ItemElectricBootsTraveller ) )
|
||||
{
|
||||
ItemElectricBootsTraveller tUsedBoots = (ItemElectricBootsTraveller)entity.inventory.armorInventory[0].getItem();
|
||||
ItemStack stack = entity.inventory.armorInventory[0];
|
||||
|
||||
// Check if we dropped the minimum amount; To cover the jump-boost bonus without penalty
|
||||
if ( tUsedBoots.getMinimumDropDist() > event.distance )
|
||||
{
|
||||
event.setCanceled( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
float tEnergyDemand = tUsedBoots.energyPerDamage * (( ( event.distance > tUsedBoots.getMaxHealthyDropDist() ) ? event.distance * 3 : event.distance ) - 4.0F);
|
||||
if( tEnergyDemand <= ElectricItem.manager.getCharge( stack ) )
|
||||
{
|
||||
//EMT.LOGGER.info( String.format("FD: %f DMG: %f EPD: %d HDD: %f", event.distance, tEnergyDemand, tUsedBoots.energyPerDamage, tUsedBoots.getMaxHealthyDropDist() ));
|
||||
ElectricItem.manager.discharge( stack, tEnergyDemand, Integer.MAX_VALUE, true, false, false );
|
||||
event.setCanceled( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
|
||||
@@ -228,4 +254,9 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,36 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public ItemNanoBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
public ItemNanoBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
maxCharge = 1000000;
|
||||
speedBonus = (float) EMTConfigHandler.nanoBootsSpeed;
|
||||
jumpBonus = (float) EMTConfigHandler.nanoBootsJump;
|
||||
visDiscount = 4;
|
||||
transferLimit = 1000;
|
||||
energyPerDamage = 500;
|
||||
transferLimit = 1600;
|
||||
energyPerDamage = 5000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxHealthyDropDist()
|
||||
{
|
||||
return (float) EMTConfigHandler.nanoBootsMaxDrop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMinimumDropDist()
|
||||
{
|
||||
return (float) EMTConfigHandler.nanoBootsMinDrop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 0.9D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -10,14 +10,36 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
|
||||
|
||||
public ItemQuantumBootsTraveller(int par3, int par4) {
|
||||
super(par3, par4);
|
||||
public ItemQuantumBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
maxCharge = 10000000;
|
||||
speedBonus = (float) EMTConfigHandler.quantumBootsSpeed;
|
||||
jumpBonus = (float) EMTConfigHandler.quantumBootsJump;
|
||||
visDiscount = 5;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
transferLimit = 12000;
|
||||
energyPerDamage = 20000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMaxHealthyDropDist()
|
||||
{
|
||||
return (float) EMTConfigHandler.quantumBootsMaxDrop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMinimumDropDist()
|
||||
{
|
||||
return (float) EMTConfigHandler.quantumBootsMinDrop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -1,72 +1,44 @@
|
||||
package emt.item.armor.chestplate;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventBus;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.client.model.ModelSpecialArmor;
|
||||
import emt.client.model.ModelWings;
|
||||
import emt.init.EMTItems;
|
||||
import emt.item.armor.wings.ItemNanoWing;
|
||||
import emt.item.armor.wings.ItemQuantumWing;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTRandomHelper;
|
||||
import emt.util.EMTTextHelper;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.item.IElectricItemManager;
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.IC2Achievements;
|
||||
import ic2.core.IC2Potion;
|
||||
import ic2.core.Ic2Items;
|
||||
import ic2.core.Platform;
|
||||
import ic2.core.audio.AudioManager;
|
||||
import ic2.core.audio.AudioSource;
|
||||
import ic2.core.audio.PositionSpec;
|
||||
import ic2.core.init.InternalName;
|
||||
import ic2.core.init.MainConfig;
|
||||
import ic2.core.item.ItemTinCan;
|
||||
import ic2.core.item.armor.ItemArmorElectric;
|
||||
import ic2.core.util.ConfigUtil;
|
||||
import ic2.core.util.Keyboard;
|
||||
import ic2.core.util.StackUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.FoodStats;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
|
||||
public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements IRunicArmor {
|
||||
|
||||
public final byte NONE = 0;
|
||||
public final byte JETPACK = 1;
|
||||
@@ -85,7 +57,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
private static boolean lastJetpackUsed = false;
|
||||
|
||||
public ItemInfusedQuantumChestplate(InternalName internalName, int armorType) {
|
||||
super(internalName, InternalName.quantum, armorType, 2000000, 12000.0D, 4);
|
||||
super(internalName, InternalName.quantum, armorType, 20000000D, 18000.0D, 4);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
}
|
||||
@@ -404,6 +376,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
|
||||
@@ -564,4 +541,9 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package emt.item.armor.goggles;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
import ic2.api.item.ElectricItem;
|
||||
@@ -21,18 +20,19 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
|
||||
public class ItemElectricGoggles extends ItemArmor implements IRunicArmor, IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor {
|
||||
|
||||
public double maxCharge = 10000;
|
||||
public double transferLimit = 10;
|
||||
public double maxCharge = 100000;
|
||||
public double transferLimit = 100;
|
||||
public int tier = 2;
|
||||
public int energyPerDamage = 100;
|
||||
public int energyPerDamage = 1000;
|
||||
public int visDiscount = 5;
|
||||
|
||||
public ItemElectricGoggles(ArmorMaterial material, int par3, int par4) {
|
||||
@@ -148,7 +148,7 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
return 0.5D;
|
||||
}
|
||||
|
||||
public int getEnergyPerDamage() {
|
||||
@@ -156,7 +156,7 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
return 0.15D;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@@ -190,4 +190,9 @@ public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVi
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3,16 +3,11 @@ package emt.item.armor.goggles;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IC2Items;
|
||||
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.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemNanoGoggles extends ItemElectricGoggles {
|
||||
@@ -24,9 +19,9 @@ public class ItemNanoGoggles extends ItemElectricGoggles {
|
||||
this.setMaxStackSize(1);
|
||||
visDiscount = 6;
|
||||
tier = 3;
|
||||
maxCharge = 100000;
|
||||
energyPerDamage = 1000;
|
||||
transferLimit = 100;
|
||||
maxCharge = 1000000;
|
||||
energyPerDamage = 5000;
|
||||
transferLimit = 1600;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -40,23 +35,18 @@ public class ItemNanoGoggles extends ItemElectricGoggles {
|
||||
return EMT.TEXTURE_PATH + ":textures/models/thaumicnanohelmet.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 0.9D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if (EMTConfigHandler.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));
|
||||
}
|
||||
}
|
||||
IC2Items.getItem("nightvisionGoggles").getItem().onArmorTick(world, player, itemStack);
|
||||
}
|
||||
}
|
||||
@@ -3,23 +3,21 @@ package emt.item.armor.goggles;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.util.Keyboard;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ItemQuantumGoggles extends ItemNanoGoggles {
|
||||
|
||||
@@ -31,10 +29,10 @@ public class ItemQuantumGoggles extends ItemNanoGoggles {
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
maxCharge = 10000000;
|
||||
tier = 3;
|
||||
tier = 4;
|
||||
visDiscount = 8;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
transferLimit = 12000;
|
||||
energyPerDamage = 20000;
|
||||
|
||||
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||
@@ -53,47 +51,49 @@ public class ItemQuantumGoggles extends ItemNanoGoggles {
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1D;
|
||||
}
|
||||
|
||||
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);
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
// MUAHAHAHA
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
try {
|
||||
Field f;
|
||||
f = Keyboard.class.getDeclaredField("playerKeys");
|
||||
f.setAccessible(true);
|
||||
Map<EntityPlayer, Set<Enum>> playerKeys = (Map<EntityPlayer, Set<Enum>>) f.get(IC2.keyboard);
|
||||
|
||||
Enum hub = null;
|
||||
Set<Enum> set = playerKeys.get(player);
|
||||
|
||||
if (set != null) {
|
||||
for (Enum e : set) {
|
||||
if (e.ordinal() == 6) {
|
||||
hub = e;
|
||||
}
|
||||
}
|
||||
set.remove(hub);
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
|
||||
if (EMTConfigHandler.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));
|
||||
IC2Items.getItem("quantumHelmet").getItem().onArmorTick(world, player, itemStack);
|
||||
|
||||
if (hub != null) {
|
||||
set.add(hub);
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
} catch (SecurityException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,35 +3,28 @@ package emt.item.armor.goggles;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||
|
||||
private int ticker;
|
||||
/*private int ticker;
|
||||
private int generating;
|
||||
private int genDay;
|
||||
private int genNight;
|
||||
private boolean sunIsUp;
|
||||
private boolean skyIsVisible;
|
||||
private boolean noSunWorld;
|
||||
private boolean dampPlace;
|
||||
private boolean dampPlace;*/
|
||||
private int genDay;
|
||||
private int genNight;
|
||||
|
||||
private static final Map potionCost = new HashMap();
|
||||
|
||||
@@ -41,14 +34,14 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
this.maxCharge = 1000000;
|
||||
this.genDay = 256;
|
||||
this.genNight = 128;
|
||||
maxCharge = 10000000;
|
||||
// this.maxCharge = 20000000; //REALLY?
|
||||
this.genDay = 65536;
|
||||
this.genNight = 4096;
|
||||
maxCharge = 20000000;
|
||||
visDiscount = 7;
|
||||
tier = 3;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 10000;
|
||||
tier = 4;
|
||||
transferLimit = 18000;
|
||||
energyPerDamage = 20000;
|
||||
|
||||
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
|
||||
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
|
||||
@@ -66,120 +59,47 @@ public class ItemSolarHelmetRevealing extends ItemQuantumGoggles {
|
||||
return EMT.TEXTURE_PATH + ":textures/models/solarrevealinghelmet.png";
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World worldObj, EntityPlayer player, ItemStack itemStack) {
|
||||
if (EMTConfigHandler.nightVisionOff == false) {
|
||||
if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) {
|
||||
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
|
||||
int lightlevel = player.worldObj.getBlockLightValue(x, y, z);
|
||||
if (lightlevel >= 0)
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3));
|
||||
ElectricItem.manager.use(itemStack, 1 / 1000, player);
|
||||
}
|
||||
else {
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true));
|
||||
}
|
||||
}
|
||||
|
||||
int refill = player.getAir();
|
||||
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
|
||||
player.setAir(refill + 200);
|
||||
ElectricItem.manager.use(itemStack, 1000, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
|
||||
do {
|
||||
if (!i$.hasNext()) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
PotionEffect effect = (PotionEffect) i$.next();
|
||||
int id = effect.getPotionID();
|
||||
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
|
||||
if (cost != null) {
|
||||
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
|
||||
if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
|
||||
ElectricItem.manager.use(itemStack, cost.intValue(), null);
|
||||
ItemStack milk = (new ItemStack(Items.milk_bucket));
|
||||
player.curePotionEffects(milk);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
super.onArmorTick(worldObj, player, itemStack);
|
||||
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
checkForSun(player);
|
||||
if (this.generating > 0) {
|
||||
int energyLeft = this.generating;
|
||||
|
||||
if(worldObj.canBlockSeeTheSky((int)player.posX, (int)player.posY + 1, (int)player.posZ) && !worldObj.isRaining()) {
|
||||
double enerj = (worldObj.isDaytime() ? (double)genDay : (double) genNight) / 12000D;
|
||||
|
||||
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
|
||||
if (energyLeft > 0) {
|
||||
if (enerj > 0) {
|
||||
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], enerj ,4, false, false);
|
||||
enerj -= sentPacket;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
|
||||
if (energyLeft > 0) {
|
||||
if (enerj > 0) {
|
||||
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
|
||||
energyLeft -= sentPacket;
|
||||
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], enerj, 4, false, false);
|
||||
enerj -= sentPacket;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int checkForSun(EntityPlayer player) {
|
||||
if (this.ticker++ % tickRate() == 0) {
|
||||
updateVisibility(player);
|
||||
}
|
||||
if ((this.sunIsUp) && (this.skyIsVisible)) {
|
||||
this.generating = (0 + this.genDay);
|
||||
return this.generating;
|
||||
}
|
||||
if (this.skyIsVisible) {
|
||||
this.generating = (0 + this.genNight);
|
||||
return this.generating;
|
||||
}
|
||||
this.generating = 0;
|
||||
return this.generating;
|
||||
}
|
||||
|
||||
public void updateVisibility(EntityPlayer player) {
|
||||
this.dampPlace = (player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ).getIntRainfall() > 0);
|
||||
this.noSunWorld = player.worldObj.provider.hasNoSky;
|
||||
Boolean rainWeather = Boolean.valueOf((this.dampPlace) && ((player.worldObj.isRaining()) || (player.worldObj.isThundering())));
|
||||
if ((!player.worldObj.isDaytime()) || (rainWeather.booleanValue())) {
|
||||
this.sunIsUp = false;
|
||||
}
|
||||
else {
|
||||
this.sunIsUp = true;
|
||||
}
|
||||
if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld)) {
|
||||
this.skyIsVisible = false;
|
||||
}
|
||||
else {
|
||||
this.skyIsVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static int tickRate() {
|
||||
return 128;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,13 @@
|
||||
package emt.item.armor.wings;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.util.StackUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.client.model.ModelWings;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -21,11 +17,10 @@ import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
|
||||
public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
public class ItemFeatherWing extends ItemArmor implements IRunicArmor {
|
||||
public int visDiscount = 0;
|
||||
Random rnd;
|
||||
|
||||
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
@@ -33,9 +28,12 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
this.setMaxDamage(120);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
this.isDamageable();
|
||||
rnd = new Random();
|
||||
}
|
||||
|
||||
public float getFallDamageMult() {
|
||||
return 0.75F;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
@@ -65,11 +63,12 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
useWings(player, stack, world, 0.09f, 0.9f, 0.9f, 0);
|
||||
useWings(player, stack, world, 0.11f, 0.9f, 0.9f, 0);
|
||||
}
|
||||
|
||||
public void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount) {
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
|
||||
boolean isJmuping = nbtData.getBoolean("isJumping");
|
||||
boolean isHolding = nbtData.getBoolean("isHolding");
|
||||
|
||||
@@ -93,7 +92,7 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
}
|
||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
@@ -115,9 +114,10 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack itemStack) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,10 @@ package emt.item.armor.wings;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.item.armor.wings.ItemThaumiumReinforcedWing;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.api.item.IMetalArmor;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -25,10 +22,10 @@ import java.util.List;
|
||||
|
||||
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
|
||||
|
||||
public static int maxCharge = 100000;
|
||||
public static int maxCharge = 1000000;
|
||||
public int tier = 3;
|
||||
public double transferLimit = 1000;
|
||||
public int energyPerDamage = 100;
|
||||
public double transferLimit = 1600;
|
||||
public int energyPerDamage = 5000;
|
||||
|
||||
public ItemNanoWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
@@ -37,6 +34,11 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
visDiscount = 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFallDamageMult() {
|
||||
return 0.2F;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@@ -131,11 +133,11 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1.1000000000000001D;
|
||||
return 0.9D;
|
||||
}
|
||||
|
||||
private double getBaseAbsorptionRatio() {
|
||||
return 0.14999999999999999D;
|
||||
return 0.25D;
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
@@ -152,7 +154,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,8 +3,6 @@ package emt.item.armor.wings;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -12,7 +10,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemQuantumWing extends ItemNanoWing {
|
||||
public static int maxCharge = 1000000;
|
||||
public static int maxCharge = 10000000;
|
||||
public int tier = 4;
|
||||
|
||||
public ItemQuantumWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
@@ -20,8 +19,13 @@ public class ItemQuantumWing extends ItemNanoWing {
|
||||
this.setMaxDamage(27);
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
visDiscount = 6;
|
||||
transferLimit = 10000;
|
||||
energyPerDamage = 1000;
|
||||
transferLimit = 12000;
|
||||
energyPerDamage = 20000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFallDamageMult() {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -45,4 +49,13 @@ public class ItemQuantumWing extends ItemNanoWing {
|
||||
public double getMaxCharge(ItemStack itemStack) {
|
||||
return maxCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public double getDamageAbsorptionRatio() {
|
||||
return 1D;
|
||||
}
|
||||
}
|
||||
@@ -3,21 +3,15 @@ package emt.item.armor.wings;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
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.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.util.StackUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,6 +25,11 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
|
||||
this.isDamageable();
|
||||
visDiscount = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFallDamageMult() {
|
||||
return 0.5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import emt.EMT;
|
||||
import emt.util.EMTTextHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package emt.item.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBlockEssentiaGenerator extends ItemBlock {
|
||||
|
||||
public ItemBlockEssentiaGenerator(Block id) {
|
||||
super(id);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,24 @@
|
||||
package emt.item.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import emt.util.EMTTextHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import emt.tile.generator.TileEntityAerGenerator;
|
||||
import emt.tile.generator.TileEntityArborGenerator;
|
||||
import emt.tile.generator.TileEntityAuramGenerator;
|
||||
import emt.tile.generator.TileEntityIgnisGenerator;
|
||||
import emt.tile.generator.TileEntityPotentiaGenerator;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class ItemBlockEssentiaGenerators extends ItemBlock {
|
||||
|
||||
public ItemBlockEssentiaGenerators(Block id) {
|
||||
super(id);
|
||||
public ItemBlockEssentiaGenerators(Block block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@@ -40,6 +41,9 @@ public class ItemBlockEssentiaGenerators extends ItemBlock {
|
||||
case 4:
|
||||
name = "aer";
|
||||
break;
|
||||
case 5:
|
||||
name = "lucrum";
|
||||
break;
|
||||
default:
|
||||
name = "nothing";
|
||||
}
|
||||
@@ -50,4 +54,56 @@ public class ItemBlockEssentiaGenerators extends ItemBlock {
|
||||
public int getMetadata(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
private long getOutputAmperage(double EU) {
|
||||
return (long) (1L + (EU / 20.0D / 20.0D / GT_Values.V[2]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, EntityPlayer player, List list, boolean flag) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||
switch (is.getItemDamage()) {
|
||||
case 0:
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Generating")+EMTTextHelper.LIGHT_GRAY+Integer.toString((int)(EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag())/20/20)) +" EU/t");
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Output")+EMTTextHelper.LIGHT_GRAY+"128 EU/t @ "+getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()))+" A");
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN+StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")+": "+EMTTextHelper.LIGHT_GRAY+Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.ENERGY.getTag()))) +" EU");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Generating")+EMTTextHelper.LIGHT_GRAY+Integer.toString((int)(EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag())/20/20)) +" EU/t");
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Output")+EMTTextHelper.LIGHT_GRAY+"128 EU/t @ "+getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))+" A");
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN+StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")+": "+EMTTextHelper.LIGHT_GRAY+Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))) +" EU");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Generating")+EMTTextHelper.LIGHT_GRAY+Integer.toString((int)(EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag())/20/20)) +" EU/t");
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Output")+EMTTextHelper.LIGHT_GRAY+"128 EU/t @ "+getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()))+" A");
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN+StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")+": "+EMTTextHelper.LIGHT_GRAY+Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AURA.getTag()))) +" EU");
|
||||
break;
|
||||
|
||||
case 3:
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Generating")+EMTTextHelper.LIGHT_GRAY+Integer.toString((int)(EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag())/20/20)) +" EU/t");
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Output")+EMTTextHelper.LIGHT_GRAY+"128 EU/t @ "+getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.TREE.getTag()))+" A");
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN+StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")+": "+EMTTextHelper.LIGHT_GRAY+Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.FIRE.getTag()))) +" EU");
|
||||
break;
|
||||
|
||||
case 4:
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Generating")+EMTTextHelper.LIGHT_GRAY+Integer.toString((int)(EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag())/20/20)) +" EU/t");
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Output")+EMTTextHelper.LIGHT_GRAY+"128 EU/t @ "+getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()))+" A");
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN+StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")+": "+EMTTextHelper.LIGHT_GRAY+Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.AIR.getTag()))) +" EU");
|
||||
break;
|
||||
|
||||
case 5:
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Generating")+EMTTextHelper.LIGHT_GRAY+Integer.toString((int)(EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag())/20/20)) +" EU/t");
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE+StatCollector.translateToLocal("emt.Output")+EMTTextHelper.LIGHT_GRAY+"128 EU/t @ "+getOutputAmperage(EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()))+" A");
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN+StatCollector.translateToLocal("gui.EMT.book.aspect.output.essentia.eu")+": "+EMTTextHelper.LIGHT_GRAY+Double.toString((EMTEssentiasOutputs.outputs.get(Aspect.GREED.getTag()))) +" EU");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
list.add(EMTTextHelper.YELLOW+StatCollector.translateToLocal("emt.Storage")+EMTTextHelper.LIGHT_GRAY+Double.toString(EMTConfigHandler.EssentiaGeneratorStorage)+" EU");
|
||||
} else
|
||||
list.add(StatCollector.translateToLocal("emt.PressShift"));
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package emt.item.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBlockMachines extends ItemBlock {
|
||||
|
||||
public ItemBlockMachines(Block id) {
|
||||
@@ -23,7 +26,11 @@ public class ItemBlockMachines extends ItemBlock {
|
||||
name = "etheralprocessor";
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
case 2:{
|
||||
name = "essentiafiller";
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
name = "raindispeller";
|
||||
break;
|
||||
}
|
||||
@@ -37,4 +44,16 @@ public class ItemBlockMachines extends ItemBlock {
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
|
||||
switch (p_77624_1_.getItemDamage()) {
|
||||
case 2: {
|
||||
p_77624_3_.add("Connects between Essentia Hatches and the Pipe Network");
|
||||
p_77624_3_.add("Looses its Essentia on Restart");
|
||||
p_77624_3_.add("Added by bartimaeusnek");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
package emt.item.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import static emt.util.EMTTextHelper.localize;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import emt.block.BlockBaseContainer;
|
||||
import emt.block.BlockSolars;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTTextHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemBlockSolars extends ItemBlock {
|
||||
|
||||
@@ -138,6 +139,7 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean advancedItemTooltips) {
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
|
||||
if (instance == 0) {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
@@ -152,65 +154,81 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
list.add(EMTConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
case 3: {//aqua
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder"));
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.underwater"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (3F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (6F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.thunder"));
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
|
||||
case 6: {//dark
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
case 9: {//ordo
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.compressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.doubleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
|
||||
case 11: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple"));
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + (2F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.day"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + (0.75F * EMTConfigHandler.tripleCompressedSolarOutput) + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night"));
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
case 12: {//fire
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " " + localize("tooltip.EMT.output.double.lava"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 13: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " " + localize("tooltip.EMT.output.double.lava"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 14: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple") + " " + localize("tooltip.EMT.output.double.lava"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether"));
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
case 15: {//aer
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -224,27 +242,27 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
switch (itemstack.getItemDamage()) {
|
||||
case 0: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.height"));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
case 2: {//terra
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
list.add(EMTTextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + EMTTextHelper.LIGHT_GRAY + EMTConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low"));
|
||||
list.add(EMTTextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + EMTTextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half.low"));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -253,5 +271,7 @@ public class ItemBlockSolars extends ItemBlock {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
list.add(StatCollector.translateToLocal("emt.PressShift"));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package emt.item.focus;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -11,7 +10,6 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.IWandFocus;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.monster.EntitySnowman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class ItemChristmasFocus extends ItemBaseFocus {
|
||||
|
||||
@@ -2,18 +2,11 @@ package emt.item.focus;
|
||||
|
||||
import emt.entity.EntityEnergyBall;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.core.item.armor.ItemArmorElectric;
|
||||
import ic2.core.item.armor.ItemArmorIC2;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityLargeFireball;
|
||||
import net.minecraft.entity.projectile.EntitySmallFireball;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
|
||||
public class ItemEnergyBallFocus extends ItemBaseFocus {
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ package emt.item.focus;
|
||||
import emt.entity.EntityLaser;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import emt.EMT;
|
||||
import emt.entity.EntityShield;
|
||||
import emt.init.EMTBlocks;
|
||||
import ic2.core.IC2;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import emt.item.focus.ItemBaseFocus;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -12,6 +9,8 @@ import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class ItemWandChargingFocus extends ItemBaseFocus {
|
||||
|
||||
AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
|
||||
|
||||
@@ -8,7 +8,6 @@ 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.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
@@ -18,7 +17,6 @@ import net.minecraft.world.World;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.blocks.BlockCustomPlant;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.items.equipment.ItemElementalHoe;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
|
||||
import java.util.List;
|
||||
@@ -26,7 +24,7 @@ import java.util.List;
|
||||
public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
|
||||
|
||||
public IIcon icon;
|
||||
public int maxCharge = 20000;
|
||||
public int maxCharge = 200000;
|
||||
public int growthCost = 500;
|
||||
public int tillCost = 100;
|
||||
|
||||
@@ -126,7 +124,7 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.List;
|
||||
|
||||
public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
||||
|
||||
public int maxCharge = 1000000;
|
||||
public int maxCharge = 2000000;
|
||||
private final int hitCost = 5000;
|
||||
private final int lightningCost = 75000;
|
||||
|
||||
@@ -180,7 +180,7 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
|
||||
|
||||
@Override
|
||||
public int getTier(ItemStack itemStack) {
|
||||
return 2;
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,13 +8,10 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.common.entities.projectile.EntityAlumentum;
|
||||
|
||||
|
||||
@@ -7,12 +7,9 @@ import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.audio.AudioSource;
|
||||
import ic2.core.audio.PositionSpec;
|
||||
import ic2.core.util.StackUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockTorch;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
@@ -35,12 +32,11 @@ import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
|
||||
|
||||
public int maxCharge = 40000;
|
||||
public int maxCharge = 50000;
|
||||
public int cost = 200;
|
||||
public int hitCost = 300;
|
||||
public int tier = 2;
|
||||
|
||||
@@ -5,13 +5,8 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.audio.AudioSource;
|
||||
import ic2.core.audio.PositionSpec;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -37,7 +32,7 @@ public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
|
||||
setCreativeTab(EMT.TAB);
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(27);
|
||||
maxCharge = 900000;
|
||||
maxCharge = 1000000;
|
||||
cost = 400;
|
||||
hitCost = 500;
|
||||
tier = 3;
|
||||
|
||||
@@ -4,12 +4,8 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.core.IC2;
|
||||
import ic2.core.audio.AudioSource;
|
||||
import ic2.core.audio.PositionSpec;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -23,7 +19,7 @@ public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
|
||||
this.setCreativeTab(EMT.TAB);
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
maxCharge = 60000;
|
||||
maxCharge = 100000;
|
||||
cost = 250;
|
||||
hitCost = 350;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.entities.EntityFollowingItem;
|
||||
import thaumcraft.common.lib.utils.BlockUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
@@ -36,7 +35,6 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
|
||||
private static final Block[] isEffective = { Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone, Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block, Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass, Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone,
|
||||
Blocks.diamond_ore, Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay, Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay, Blocks.stained_hardened_clay, Blocks.mossy_cobblestone };
|
||||
public Icon icon;
|
||||
int side;
|
||||
public int searchCost = 1000;
|
||||
public int hitCost = 400;
|
||||
@@ -52,8 +50,8 @@ public class ItemRockbreakerDrill extends ItemThaumiumDrill {
|
||||
else {
|
||||
this.setMaxDamage(2571);
|
||||
}
|
||||
maxCharge = 900000;
|
||||
transferLimit = 900;
|
||||
maxCharge = 1000000;
|
||||
transferLimit = 1000;
|
||||
tier = 3;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,14 +4,12 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTRandomHelper;
|
||||
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.Item;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
@@ -22,7 +20,7 @@ import java.util.List;
|
||||
|
||||
public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
||||
|
||||
public int maxCharge = 60000;
|
||||
public int maxCharge = 100000;
|
||||
public int cost;
|
||||
public int tier = 2;
|
||||
public double transferLimit = 100;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
|
||||
else {
|
||||
this.setMaxDamage(350);
|
||||
}
|
||||
maxCharge = 70000;
|
||||
maxCharge = 100000;
|
||||
hitCost = 250;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Locale;
|
||||
|
||||
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
||||
|
||||
public int maxCharge = 20000;
|
||||
public int maxCharge = 50000;
|
||||
public int cost;
|
||||
public int hitCost = 125;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
|
||||
else {
|
||||
this.setMaxDamage(467);
|
||||
}
|
||||
maxCharge = 140000;
|
||||
maxCharge = 200000;
|
||||
hitCost = 650;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package emt.network;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import emt.init.EMTItems;
|
||||
|
||||
public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, IMessage> {
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
package emt.proxy;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderFireball;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowMan;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import emt.client.EMTKeys;
|
||||
import emt.client.renderer.RenderLaser;
|
||||
|
||||
@@ -2,11 +2,17 @@ package emt.proxy;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import emt.client.gui.GuiEtherealMacerator;
|
||||
import emt.client.gui.GuiGenerator;
|
||||
import emt.client.gui.GuiIndustrialWandRecharger;
|
||||
import emt.client.gui.GuiSolar;
|
||||
import emt.client.gui.container.ConainerGenerator;
|
||||
import emt.client.gui.container.ContainerEtheralMacerator;
|
||||
import emt.client.gui.container.ContainerIndustrialWandRecharge;
|
||||
import emt.client.gui.container.ContainerSolars;
|
||||
import emt.tile.TileEntityEtherealMacerator;
|
||||
import emt.tile.TileEntityIndustrialWandRecharge;
|
||||
import emt.tile.generator.TileEntityBaseGenerator;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
@@ -34,6 +40,12 @@ public class CommonProxy implements IGuiHandler {
|
||||
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
|
||||
return new ContainerEtheralMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
|
||||
}
|
||||
else if (entity != null && entity instanceof TileEntityBaseGenerator) {
|
||||
return new ConainerGenerator(player.inventory, (TileEntityBaseGenerator) entity);
|
||||
}
|
||||
else if (entity != null && entity instanceof TileEntitySolarBase) {
|
||||
return new ContainerSolars(player.inventory, (TileEntitySolarBase) entity);
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -52,6 +64,12 @@ public class CommonProxy implements IGuiHandler {
|
||||
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
|
||||
return new GuiEtherealMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
|
||||
}
|
||||
else if (entity != null && entity instanceof TileEntityBaseGenerator) {
|
||||
return new GuiGenerator(player.inventory, (TileEntityBaseGenerator) entity);
|
||||
}
|
||||
else if (entity != null && entity instanceof TileEntitySolarBase) {
|
||||
return new GuiSolar(player.inventory, (TileEntitySolarBase) entity);
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package emt.tile;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class DefinitelyNotAIC2Source extends TileEntity {
|
||||
public final TileEntity parent;
|
||||
protected double capacity;
|
||||
protected byte tier;
|
||||
protected double power;
|
||||
protected double energyStored;
|
||||
protected boolean addedToEnet;
|
||||
|
||||
public DefinitelyNotAIC2Source(TileEntity parent1, double capacity1, int tier1) {
|
||||
double power = (double) GT_Values.V[tier1];
|
||||
this.parent = parent1;
|
||||
this.capacity = capacity1 < power ? power : capacity1;
|
||||
this.tier = (byte) tier1;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
if (!this.addedToEnet && !FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
this.worldObj = this.parent.getWorldObj();
|
||||
this.xCoord = this.parent.xCoord;
|
||||
this.yCoord = this.parent.yCoord;
|
||||
this.zCoord = this.parent.zCoord;
|
||||
this.addedToEnet = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
this.onChunkUnload();
|
||||
}
|
||||
|
||||
public void onChunkUnload() {
|
||||
if (this.addedToEnet) {
|
||||
this.addedToEnet = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
NBTTagCompound data = tag.getCompoundTag("EMTGTSource");
|
||||
this.energyStored = data.getDouble("energy");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
try {
|
||||
super.writeToNBT(tag);
|
||||
} catch (RuntimeException var3) {
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setDouble("energy", this.energyStored);
|
||||
tag.setTag("EMTGTSource", data);
|
||||
}
|
||||
|
||||
public double getCapacity() {
|
||||
return this.capacity;
|
||||
}
|
||||
|
||||
public void setCapacity(double capacity1) {
|
||||
if (capacity1 < this.power) {
|
||||
capacity1 = this.power;
|
||||
}
|
||||
|
||||
this.capacity = capacity1;
|
||||
}
|
||||
|
||||
public double getEnergyStored() {
|
||||
return this.energyStored;
|
||||
}
|
||||
|
||||
public void setEnergyStored(double amount) {
|
||||
this.energyStored = amount;
|
||||
}
|
||||
|
||||
public double addEnergy(double amount) {
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
return 0.0D;
|
||||
} else {
|
||||
if (amount > this.capacity - this.energyStored) {
|
||||
amount = this.capacity - this.energyStored;
|
||||
}
|
||||
|
||||
this.energyStored += amount;
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
|
||||
public void drawEnergy(double amount) {
|
||||
this.energyStored -= amount;
|
||||
}
|
||||
|
||||
public byte getSourceTier() {
|
||||
return this.tier;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
package emt.tile;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
@@ -14,28 +18,32 @@ public class TileElectricCloud extends TileEntity {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (worldObj.isRemote) {
|
||||
if (worldObj.rand.nextInt(4) == 0) {
|
||||
Thaumcraft.proxy.wispFX3(worldObj, xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, xCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, yCoord + 0.5F, zCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, 0.25F, 1, true, -0.02F);
|
||||
}
|
||||
if(worldObj.isRemote && FMLCommonHandler.instance().getSide().isClient() && FMLClientHandler.instance().getClient().renderViewEntity != null)
|
||||
fx();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void fx() {
|
||||
if (worldObj.rand.nextInt(4) == 0) {
|
||||
Thaumcraft.proxy.wispFX3(worldObj, xCoord + 0.5F, yCoord + 0.5F, zCoord + 0.5F, xCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, yCoord + 0.5F, zCoord + 0.4F + worldObj.rand.nextFloat() * 0.2F, 0.25F, 1, true, -0.02F);
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextInt(12) == 0) {
|
||||
if (worldObj.rand.nextInt(12) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
if (worldObj.rand.nextInt(2) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
if (worldObj.rand.nextInt(2) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
}
|
||||
if (worldObj.rand.nextInt(4) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
}
|
||||
}
|
||||
if (worldObj.rand.nextInt(4) == 0) {
|
||||
Thaumcraft.proxy.nodeBolt(worldObj, xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, xCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, yCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f, zCoord + (worldObj.rand.nextInt(40) / 20f) - 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextInt(3) == 0) {
|
||||
FXWisp wisp = new FXWisp(worldObj, xCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), yCoord + 0.5, zCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), 0.4f + worldObj.rand.nextInt(40) / 100f, 1);
|
||||
wisp.setGravity(-0.02F);
|
||||
wisp.setRBGColorF(worldObj.rand.nextInt(40) / 100f, 0, 1);
|
||||
wisp.setAlphaF(1);
|
||||
ParticleEngine.instance.addEffect(worldObj, wisp);
|
||||
}
|
||||
if (worldObj.rand.nextInt(3) == 0) {
|
||||
FXWisp wisp = new FXWisp(worldObj, xCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), yCoord + 0.5, zCoord + 0.5 + ((worldObj.rand.nextInt(40) / 160f) - 0.125f), 0.4f + worldObj.rand.nextInt(40) / 100f, 1);
|
||||
wisp.setGravity(-0.02F);
|
||||
wisp.setRBGColorF(worldObj.rand.nextInt(20) / 100f, worldObj.rand.nextInt(20) / 100f, 1);
|
||||
wisp.setAlphaF(1);
|
||||
ParticleEngine.instance.addEffect(worldObj, wisp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,47 +6,47 @@ import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public abstract class TileEntityEMT extends TileEntity {
|
||||
|
||||
public int facing;
|
||||
public boolean isOn;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
|
||||
facing = tagCompound.getInteger("facing");
|
||||
isOn = tagCompound.getBoolean("isOn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
|
||||
tagCompound.setInteger("facing", facing);
|
||||
tagCompound.setBoolean("isOn", isOn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
writeToNBT(nbt);
|
||||
S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbt);
|
||||
return packet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
readFromNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
super.markDirty();
|
||||
if (worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
public class TileEntityEMT
|
||||
extends TileEntity
|
||||
{
|
||||
public int facing;
|
||||
public boolean isOn;
|
||||
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.readFromNBT(tagCompound);
|
||||
|
||||
this.facing = tagCompound.getInteger("facing");
|
||||
this.isOn = tagCompound.getBoolean("isOn");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
tagCompound.setInteger("facing", this.facing);
|
||||
tagCompound.setBoolean("isOn", this.isOn);
|
||||
super.writeToNBT(tagCompound);
|
||||
}
|
||||
|
||||
public final Packet getDescriptionPacket()
|
||||
{
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
writeToNBT(nbt);
|
||||
S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
|
||||
{
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
readFromNBT(nbt);
|
||||
}
|
||||
|
||||
public void markDirty()
|
||||
{
|
||||
super.markDirty();
|
||||
if (this.worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package emt.tile;
|
||||
|
||||
import emt.init.EMTBlocks;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityAerGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityAerGenerator() {
|
||||
aspect = Aspect.AIR;
|
||||
output = EMTEssentiasOutputs.outputs.get(aspect.getTag());
|
||||
}
|
||||
}
|
||||
public class TileEntityAerGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityAerGenerator()
|
||||
{
|
||||
super(Aspect.AIR);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityArborGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityArborGenerator() {
|
||||
aspect = Aspect.TREE;
|
||||
output = EMTEssentiasOutputs.outputs.get(aspect.getTag());
|
||||
}
|
||||
public class TileEntityArborGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityArborGenerator()
|
||||
{
|
||||
super(Aspect.TREE);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityAuramGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityAuramGenerator() {
|
||||
aspect = Aspect.AURA;
|
||||
output = EMTEssentiasOutputs.outputs.get(aspect.getTag());
|
||||
}
|
||||
public class TileEntityAuramGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityAuramGenerator()
|
||||
{
|
||||
super(Aspect.AURA);
|
||||
}
|
||||
}
|
||||
@@ -1,87 +1,728 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.tile.TileEntityEMT;
|
||||
import emt.tile.solar.TileEntitySolarBase;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.tileentity.IBasicEnergyContainer;
|
||||
import gregtech.api.interfaces.tileentity.IEnergyConnected;
|
||||
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
|
||||
import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
|
||||
import gregtech.api.net.GT_Packet_Block_Event;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import net.minecraft.client.particle.EntitySmokeFX;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IAspectContainer;
|
||||
import thaumcraft.api.aspects.IAspectSource;
|
||||
import thaumcraft.common.lib.events.EssentiaHandler;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.fx.PacketFXEssentiaSource;
|
||||
|
||||
public abstract class TileEntityBaseGenerator extends TileEntityEMT {
|
||||
public class TileEntityBaseGenerator
|
||||
extends TileEntityEMT
|
||||
implements IInventory, IAspectContainer, IEssentiaTransport, IHasWorldObjectAndCoords, IEnergyConnected, IBasicEnergyContainer {
|
||||
public DefinitelyNotAIC2Source energySource = new DefinitelyNotAIC2Source(this, 100000.0D, 2);
|
||||
public Aspect aspect;
|
||||
public double generating;
|
||||
public int tick = 0;
|
||||
public boolean isActive = false;
|
||||
public int tier;
|
||||
public int storage;
|
||||
public short mpshownstroage;
|
||||
public int maxstorage;
|
||||
public byte maxfuel;
|
||||
public byte fuel;
|
||||
public byte refuel;
|
||||
public long timer = 0L;
|
||||
public boolean dead = true;
|
||||
public byte color;
|
||||
private boolean side;
|
||||
|
||||
public BasicSource energySource = new BasicSource(this, 1000000000, 3);
|
||||
public Aspect aspect;
|
||||
public double output;
|
||||
public int tick = 0;
|
||||
public boolean isActive = false;
|
||||
Random rnd = new Random();
|
||||
public TileEntityBaseGenerator(Aspect aspect) {
|
||||
super();
|
||||
this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage);
|
||||
this.maxstorage = ((int) this.energySource.getCapacity());
|
||||
this.maxfuel = 64;
|
||||
this.fuel = 0;
|
||||
this.storage = 0;
|
||||
this.refuel = 1;
|
||||
this.aspect = aspect;
|
||||
this.generating = ((Double) EMTEssentiasOutputs.outputs.get(aspect.getTag())).doubleValue();
|
||||
this.color = -1;
|
||||
}
|
||||
|
||||
public TileEntityBaseGenerator() {
|
||||
output = 2000;
|
||||
}
|
||||
public void updateEntity() {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (tick > 0)
|
||||
tick--;
|
||||
this.side = !this.worldObj.isRemote ? FMLCommonHandler.instance().getEffectiveSide().isServer() : FMLCommonHandler.instance().getSide().isServer();
|
||||
this.dead = false;
|
||||
this.timer += 1L;
|
||||
if (this.timer <= Long.MAX_VALUE - 1)
|
||||
this.timer = 0L;
|
||||
storeFuel();
|
||||
fillfrompipe();
|
||||
createEnergy();
|
||||
inputintoGTnet();
|
||||
this.energySource.updateEntity();
|
||||
}
|
||||
|
||||
if (tick == 0) {
|
||||
energySource.updateEntity();
|
||||
isActive = false;
|
||||
createEnergy();
|
||||
tick = 20;
|
||||
}
|
||||
}
|
||||
|
||||
public void createEnergy() {
|
||||
int count = 0;
|
||||
for (int x = this.xCoord - 4; x < this.xCoord + 4; x++) {
|
||||
for (int y = this.yCoord - 4; y < this.yCoord + 4; y++) {
|
||||
for (int z = this.zCoord - 4; z < this.zCoord + 4; z++) {
|
||||
TileEntity tile = this.worldObj.getTileEntity(x, y, z);
|
||||
if (tile != null && tile instanceof IAspectSource) {
|
||||
IAspectSource as = (IAspectSource) tile;
|
||||
if (as.doesContainerContainAmount(aspect, 1)) {
|
||||
if (as.takeFromContainer(aspect, 1)) {
|
||||
isActive = true;
|
||||
PacketHandler.INSTANCE.sendToAllAround(new PacketFXEssentiaSource(xCoord, yCoord, zCoord, (byte) (xCoord - x), (byte) (yCoord - y), (byte) (zCoord - z), aspect.getColor()), new cpw.mods.fml.common.network.NetworkRegistry.TargetPoint(this.getWorldObj().provider.dimensionId, xCoord, yCoord, zCoord, 32.0D));
|
||||
energySource.addEnergy(output / 30D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void storeFuel() {
|
||||
if (this.fuel < this.maxfuel) {
|
||||
for (int x = this.xCoord - 4; x < this.xCoord + 4; x++) {
|
||||
for (int y = this.yCoord - 4; y < this.yCoord + 4; y++) {
|
||||
for (int z = this.zCoord - 4; z < this.zCoord + 4; z++) {
|
||||
TileEntity tile = this.worldObj.getTileEntity(x, y, z);
|
||||
if ((tile != null) && ((tile instanceof IAspectSource))) {
|
||||
IAspectSource as = (IAspectSource) tile;
|
||||
if ((as.doesContainerContainAmount(this.aspect, this.refuel)) &&
|
||||
(as.takeFromContainer(this.aspect, this.refuel))) {
|
||||
PacketHandler.INSTANCE.sendToAllAround(new PacketFXEssentiaSource(this.xCoord, this.yCoord, this.zCoord, (byte) (this.xCoord - x), (byte) (this.yCoord - y), (byte) (this.zCoord - z), this.aspect.getColor()), new NetworkRegistry.TargetPoint(getWorldObj().provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32.0D));
|
||||
addToContainer(this.aspect, this.refuel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
energySource.onChunkUnload();
|
||||
}
|
||||
public void fillfrompipe() {
|
||||
TileEntity[] te = new TileEntity[ForgeDirection.VALID_DIRECTIONS.length];
|
||||
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
|
||||
te[i] = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.VALID_DIRECTIONS[i]);
|
||||
if (te[i] != null) {
|
||||
IEssentiaTransport pipe = (IEssentiaTransport) te[i];
|
||||
if (!pipe.canOutputTo(ForgeDirection.VALID_DIRECTIONS[i])) {
|
||||
return;
|
||||
}
|
||||
if ((pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]) != null) && (pipe.getEssentiaType(ForgeDirection.VALID_DIRECTIONS[i]).equals(this.aspect)) && (pipe.getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]) < getSuctionAmount(ForgeDirection.VALID_DIRECTIONS[i]))) {
|
||||
addToContainer(this.aspect, pipe.takeEssentia(this.aspect, 1, ForgeDirection.VALID_DIRECTIONS[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
public String getInventoryName() {
|
||||
return StatCollector.translateToLocal("tile.EMT.essentia." + this.aspect.getTag() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
energySource.readFromNBT(tag);
|
||||
}
|
||||
public void createEnergy() {
|
||||
if (this.fuel > 0) {
|
||||
if (this.storage + this.generating / 20.0D / 20.0D < this.maxstorage) {
|
||||
this.isActive = true;
|
||||
if (side) {
|
||||
this.energySource.addEnergy(this.generating / 20.0D / 20.0D);
|
||||
this.storage = ((int) this.energySource.getEnergyStored());
|
||||
}
|
||||
this.tick += 1;
|
||||
if (this.tick == 400) {
|
||||
this.fuel -= 1;
|
||||
this.tick = 0;
|
||||
}
|
||||
} else if (this.storage == this.maxstorage) {
|
||||
this.isActive = false;
|
||||
} else if ((this.storage + this.generating / 20.0D / 20.0D > this.maxstorage) && (this.storage != this.maxstorage)) {
|
||||
this.isActive = true;
|
||||
if (side) {
|
||||
this.energySource.setEnergyStored(this.maxstorage);
|
||||
this.storage = this.maxstorage;
|
||||
}
|
||||
this.tick += 1;
|
||||
if (this.tick == 400) {
|
||||
this.fuel -= 1;
|
||||
this.tick = 0;
|
||||
}
|
||||
this.isActive = false;
|
||||
}
|
||||
} else {
|
||||
this.isActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
energySource.writeToNBT(tag);
|
||||
}
|
||||
public void onChunkUnload() {
|
||||
this.energySource.onChunkUnload();
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
this.energySource.invalidate();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
this.energySource.readFromNBT(tag);
|
||||
if (tag.getInteger("storage") > this.storage) {
|
||||
this.storage = tag.getInteger("storage");
|
||||
}
|
||||
if (tag.getByte("fuel") > this.fuel) {
|
||||
this.fuel = tag.getByte("fuel");
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
tag.setInteger("storage", this.storage);
|
||||
tag.setInteger("fuel", this.fuel);
|
||||
super.writeToNBT(tag);
|
||||
this.energySource.writeToNBT(tag);
|
||||
}
|
||||
|
||||
public int getSizeInventory() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
|
||||
}
|
||||
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getInventoryStackLimit() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
public int gaugeEnergyScaled(int i) {
|
||||
return this.mpshownstroage * 1000 * i / this.maxstorage;
|
||||
}
|
||||
|
||||
public int gaugeFuelScaled(int i) {
|
||||
return this.fuel * i / this.maxfuel;
|
||||
}
|
||||
|
||||
public boolean isItemValidForSlot(int i, ItemStack Stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public AspectList getAspects() {
|
||||
return new AspectList().add(this.aspect, this.fuel);
|
||||
}
|
||||
|
||||
public void setAspects(AspectList aspects) {
|
||||
}
|
||||
|
||||
public boolean doesContainerAccept(Aspect tag) {
|
||||
return tag.equals(this.aspect);
|
||||
}
|
||||
|
||||
public int addToContainer(Aspect tag, int amount) {
|
||||
if ((!tag.equals(this.aspect)) || (amount < 0)) {
|
||||
return amount;
|
||||
}
|
||||
if (amount + this.fuel < this.maxfuel) {
|
||||
this.fuel += amount;
|
||||
return 0;
|
||||
}
|
||||
this.fuel += amount - (amount - (this.maxfuel - this.fuel));
|
||||
return amount - (this.maxfuel - this.fuel);
|
||||
}
|
||||
|
||||
public boolean takeFromContainer(Aspect tag, int amount) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean takeFromContainer(AspectList ot) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean doesContainerContainAmount(Aspect tag, int amount) {
|
||||
return (tag.equals(this.aspect)) && (amount <= this.fuel);
|
||||
}
|
||||
|
||||
public boolean doesContainerContain(AspectList ot) {
|
||||
return ot.aspects.containsKey(this.aspect);
|
||||
}
|
||||
|
||||
public int containerContains(Aspect tag) {
|
||||
return tag == this.aspect ? this.fuel : 0;
|
||||
}
|
||||
|
||||
public boolean isConnectable(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canInputFrom(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canOutputTo(ForgeDirection face) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setSuction(Aspect aspect, int amount) {
|
||||
}
|
||||
|
||||
public Aspect getSuctionType(ForgeDirection face) {
|
||||
return this.aspect;
|
||||
}
|
||||
|
||||
public int getSuctionAmount(ForgeDirection face) {
|
||||
return 128;
|
||||
}
|
||||
|
||||
public int takeEssentia(Aspect aspect, int amount, ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int addEssentia(Aspect aspect, int amount, ForgeDirection face) {
|
||||
if (amount < this.maxfuel - this.fuel) {
|
||||
return amount;
|
||||
}
|
||||
return this.maxfuel - addToContainer(aspect, amount);
|
||||
}
|
||||
|
||||
public Aspect getEssentiaType(ForgeDirection face) {
|
||||
return this.aspect;
|
||||
}
|
||||
|
||||
public int getEssentiaAmount(ForgeDirection face) {
|
||||
return this.fuel;
|
||||
}
|
||||
|
||||
public int getMinimumSuction() {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
public boolean renderExtendedTube() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void inputintoGTnet() {
|
||||
for (byte i = 0; i < 6; i = (byte) (i + 1)) {
|
||||
if (getIGregTechTileEntityAtSide(i) != null) {
|
||||
if (isUniversalEnergyStored(getOutputVoltage() * getOutputAmperage())) {
|
||||
long tEU = IEnergyConnected.Util.emitEnergyToNetwork(getOutputVoltage(), getOutputAmperage(), this);
|
||||
drainEnergyUnits(i, getOutputVoltage(), tEU);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public byte getColorization() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public byte setColorization(byte aColor) {
|
||||
this.color = aColor;
|
||||
return this.color;
|
||||
}
|
||||
|
||||
public boolean isUniversalEnergyStored(long aEnergyAmount) {
|
||||
return aEnergyAmount < this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
public long getUniversalEnergyStored() {
|
||||
return (long) this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
public long getUniversalEnergyCapacity() {
|
||||
return (long) this.energySource.getCapacity();
|
||||
}
|
||||
|
||||
public long getOutputAmperage() {
|
||||
if (this.generating / 20.0D / 20.0D <= GT_Values.V[this.energySource.getSourceTier()]) {
|
||||
return 1L;
|
||||
}
|
||||
if (this.generating / 20.0D / 20.0D % GT_Values.V[this.energySource.getSourceTier()] == 0.0D) {
|
||||
return (long) (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()]);
|
||||
}
|
||||
return (long) (1L + (this.generating / 20.0D / 20.0D / GT_Values.V[this.energySource.getSourceTier()]));
|
||||
}
|
||||
|
||||
public long getOutputVoltage() {
|
||||
return GT_Values.V[this.energySource.getSourceTier()];
|
||||
}
|
||||
|
||||
public long getInputAmperage() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public long getInputVoltage() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
|
||||
if (this.energySource.getEnergyStored() > aEnergy) {
|
||||
this.energySource.drawEnergy(aEnergy);
|
||||
this.storage = ((int) this.energySource.getEnergyStored());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return decreaseStoredEnergyUnits(aVoltage * aAmperage, this.energySource.getEnergyStored() > aVoltage * aAmperage);
|
||||
}
|
||||
|
||||
public long getAverageElectricInput() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public long getAverageElectricOutput() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public long getStoredEU() {
|
||||
return (long) this.energySource.getEnergyStored();
|
||||
}
|
||||
|
||||
public long getEUCapacity() {
|
||||
return (long) this.energySource.getCapacity();
|
||||
}
|
||||
|
||||
public long getStoredSteam() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public long getSteamCapacity() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public boolean increaseStoredSteam(long aEnergy, boolean aIgnoreTooMuchEnergy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public boolean inputEnergyFrom(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean outputsEnergyTo(byte aSide) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean energyStateReady() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return this.worldObj;
|
||||
}
|
||||
|
||||
public int getXCoord() {
|
||||
return this.xCoord;
|
||||
}
|
||||
|
||||
public short getYCoord() {
|
||||
return (short) this.yCoord;
|
||||
}
|
||||
|
||||
public int getZCoord() {
|
||||
return this.zCoord;
|
||||
}
|
||||
|
||||
public boolean isServerSide() {
|
||||
return !worldObj.isRemote;
|
||||
}
|
||||
|
||||
public boolean isClientSide() {
|
||||
return worldObj.isRemote;
|
||||
}
|
||||
|
||||
public int getRandomNumber(int aRange) {
|
||||
return this.worldObj.rand.nextInt(aRange);
|
||||
}
|
||||
|
||||
public TileEntity getTileEntity(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getTileEntity(aX, aY, aZ);
|
||||
}
|
||||
|
||||
public TileEntity getTileEntityOffset(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
public TileEntity getTileEntityAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
}
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return this.worldObj.getTileEntity(tX, tY, tZ);
|
||||
}
|
||||
|
||||
public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getTileEntityAtSide(aSide);
|
||||
}
|
||||
return getTileEntity(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
public IInventory getIInventory(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IInventory getIInventoryOffset(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IInventory getIInventoryAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IFluidHandler getITankContainer(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IFluidHandler getITankContainerAtSide(byte aSide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ) {
|
||||
TileEntity tTileEntity = getTileEntity(aX, aY, aZ);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
return (IGregTechTileEntity) tTileEntity;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ) {
|
||||
return getIGregTechTileEntity(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide) {
|
||||
TileEntity tTileEntity = getTileEntityAtSide(aSide);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
return (IGregTechTileEntity) tTileEntity;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
TileEntity tTileEntity = getTileEntityAtSideAndDistance(aSide, aDistance);
|
||||
if ((tTileEntity instanceof IGregTechTileEntity)) {
|
||||
return (IGregTechTileEntity) tTileEntity;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Block getBlock(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getBlock(aX, aY, aZ);
|
||||
}
|
||||
|
||||
public Block getBlockOffset(int aX, int aY, int aZ) {
|
||||
return getBlock(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
public Block getBlockAtSide(byte aSide) {
|
||||
if ((aSide < 0) || (aSide >= 6)) {
|
||||
return null;
|
||||
}
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return this.worldObj.getBlock(tX, tY, tZ);
|
||||
}
|
||||
|
||||
public Block getBlockAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getBlockAtSide(aSide);
|
||||
}
|
||||
return getBlock(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
public byte getMetaID(int aX, int aY, int aZ) {
|
||||
return (byte) this.worldObj.getBlockMetadata(aX, aY, aZ);
|
||||
}
|
||||
|
||||
public byte getMetaIDOffset(int aX, int aY, int aZ) {
|
||||
return getMetaID(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
public byte getMetaIDAtSide(byte aSide) {
|
||||
int tX = getOffsetX(aSide, 1);
|
||||
int tY = getOffsetY(aSide, 1);
|
||||
int tZ = getOffsetZ(aSide, 1);
|
||||
return (byte) this.worldObj.getBlockMetadata(tX, tY, tZ);
|
||||
}
|
||||
|
||||
public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance) {
|
||||
if (aDistance == 1) {
|
||||
return getMetaIDAtSide(aSide);
|
||||
}
|
||||
return getMetaID(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
public byte getLightLevel(int aX, int aY, int aZ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public byte getLightLevelOffset(int aX, int aY, int aZ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public byte getLightLevelAtSide(byte aSide) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean getOpacity(int aX, int aY, int aZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getOpacityOffset(int aX, int aY, int aZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getOpacityAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getSky(int aX, int aY, int aZ) {
|
||||
boolean sky = true;
|
||||
do {
|
||||
if (!this.worldObj.getBlock(aX, ++aY, aZ).equals(Blocks.air)) {
|
||||
sky = false;
|
||||
}
|
||||
} while ((sky) && (aY < 256));
|
||||
return sky;
|
||||
}
|
||||
|
||||
public boolean getSkyOffset(int aX, int aY, int aZ) {
|
||||
return getSky(aX + this.xCoord, aY + this.yCoord, aZ + this.zCoord);
|
||||
}
|
||||
|
||||
public boolean getSkyAtSide(byte aSide) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getSkyAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean getAir(int aX, int aY, int aZ) {
|
||||
return this.worldObj.getBlock(aX, aY, aZ).equals(Blocks.air);
|
||||
}
|
||||
|
||||
public boolean getAirOffset(int aX, int aY, int aZ) {
|
||||
return getAir(this.xCoord + aX, this.yCoord + aY, this.zCoord + aZ);
|
||||
}
|
||||
|
||||
public boolean getAirAtSide(byte aSide) {
|
||||
return getAirAtSideAndDistance(aSide, 1);
|
||||
}
|
||||
|
||||
public boolean getAirAtSideAndDistance(byte aSide, int aDistance) {
|
||||
return getAir(getOffsetX(aSide, aDistance), getOffsetY(aSide, aDistance), getOffsetZ(aSide, aDistance));
|
||||
}
|
||||
|
||||
public BiomeGenBase getBiome() {
|
||||
return this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord);
|
||||
}
|
||||
|
||||
public BiomeGenBase getBiome(int aX, int aZ) {
|
||||
return this.worldObj.getBiomeGenForCoords(aX, aZ);
|
||||
}
|
||||
|
||||
public int getOffsetX(byte aSide, int aMultiplier) {
|
||||
return this.xCoord + ForgeDirection.getOrientation(aSide).offsetX * aMultiplier;
|
||||
}
|
||||
|
||||
public short getOffsetY(byte aSide, int aMultiplier) {
|
||||
return (short) (this.yCoord + ForgeDirection.getOrientation(aSide).offsetY * aMultiplier);
|
||||
}
|
||||
|
||||
public int getOffsetZ(byte aSide, int aMultiplier) {
|
||||
return this.zCoord + ForgeDirection.getOrientation(aSide).offsetZ * aMultiplier;
|
||||
}
|
||||
|
||||
public boolean isDead() {
|
||||
return this.dead;
|
||||
}
|
||||
|
||||
public void sendBlockEvent(byte aID, byte aValue) {
|
||||
GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Block_Event(this.xCoord, (short) this.yCoord, this.zCoord, aID, aValue), this.xCoord, this.zCoord);
|
||||
}
|
||||
|
||||
public long getTimer() {
|
||||
return this.timer;
|
||||
}
|
||||
|
||||
public void setLightValue(byte aLightValue) {
|
||||
}
|
||||
|
||||
public boolean isInvalidTileEntity() {
|
||||
return this.tileEntityInvalid;
|
||||
}
|
||||
|
||||
public boolean openGUI(EntityPlayer aPlayer, int aID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean openGUI(EntityPlayer aPlayer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean outputsEnergyTo(byte b, boolean b1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean inputEnergyFrom(byte b, boolean b1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import emt.tile.DefinitelyNotAIC2Source;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import ic2.api.energy.prefab.BasicSource;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public abstract class TileEntityCompressedGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityCompressedGenerator(Aspect aspect)
|
||||
{
|
||||
super(aspect);
|
||||
this.energySource = new DefinitelyNotAIC2Source(this, 1000000.0D, 3);
|
||||
this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage * 10.0D);
|
||||
this.maxfuel *= 10;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTEssentiasOutputs;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityIgnisGenerator extends TileEntityBaseGenerator {
|
||||
|
||||
public TileEntityIgnisGenerator() {
|
||||
aspect = Aspect.FIRE;
|
||||
output = EMTEssentiasOutputs.outputs.get(aspect.getTag());
|
||||
}
|
||||
public class TileEntityIgnisGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityIgnisGenerator()
|
||||
{
|
||||
super(Aspect.FIRE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package emt.tile.generator;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class TileEntityLucrumGenerator
|
||||
extends TileEntityBaseGenerator
|
||||
{
|
||||
public TileEntityLucrumGenerator()
|
||||
{
|
||||
super(Aspect.GREED);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 156 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user