diff --git a/build.gradle b/build.gradle index 46b5696..a87d18f 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,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 } diff --git a/build.properties b/build.properties index bbd8d18..b867c87 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ package_group=emt mc_version=1.7.10 forge_version=10.13.4.1614 -mod_version=1.2.6.8 +mod_version=1.2.7.0 mod_name=ElectroMagicTools diff --git a/libs/gregtech-5.09.32pre3.jar b/libs/gregtech-5.09.32pre3.jar new file mode 100644 index 0000000..a8186c1 Binary files /dev/null and b/libs/gregtech-5.09.32pre3.jar differ diff --git a/src/main/java/emt/EMT.java b/src/main/java/emt/EMT.java index 2c14217..e836f14 100644 --- a/src/main/java/emt/EMT.java +++ b/src/main/java/emt/EMT.java @@ -9,19 +9,24 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.eventhandler.EventBus; import cpw.mods.fml.common.network.NetworkRegistry; 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 emt.util.EMTClientEventHandler; +import emt.util.EMTConfigHandler; +import emt.util.EMTCreativeTab; +import emt.util.EMTDungeonChestGenerator; +import emt.util.EMTEssentiasOutputs; +import emt.util.EMTEventHandler; import net.minecraft.creativetab.CreativeTabs; import net.minecraftforge.common.MinecraftForge; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -32,80 +37,85 @@ 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.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); - - public boolean isSimulating() - { - return !FMLCommonHandler.instance().getEffectiveSide().isClient(); - } - - @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()); - if(FMLCommonHandler.instance().getSide().isClient()) - 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()); - 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."); - } - - @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"; + @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"); + 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); + } } diff --git a/src/main/java/emt/block/BlockReflectedGen.java b/src/main/java/emt/block/BlockReflectedGen.java new file mode 100644 index 0000000..582ff0e --- /dev/null +++ b/src/main/java/emt/block/BlockReflectedGen.java @@ -0,0 +1,102 @@ +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.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; + +public class BlockReflectedGen + extends BlockBaseContainer +{ + private int subtypes; + public static short Set; + + public BlockReflectedGen(String name, short Set) + { + super(name, Material.iron, soundTypeMetal, 16, 4.0F); + this.Set = Set; + if (Set * 16 < TileEntityReflexionGen.L.size()) { + this.subtypes = 16; + } else { + this.subtypes = (-(TileEntityReflexionGen.L.size() - Set * 16)); + } + } + + @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) + { + if (meta + Set * 16 < TileEntityReflexionGen.L.size()) { + return TileEntityReflexionGen.Gens[(meta + 16 * Set)]; + } + return TileEntityReflexionGen.Gens[(meta + 16 * (Set - 1))]; + } + + @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; + } +} diff --git a/src/main/java/emt/init/EMTAutogeneratedGens.java b/src/main/java/emt/init/EMTAutogeneratedGens.java new file mode 100644 index 0000000..c8a9d94 --- /dev/null +++ b/src/main/java/emt/init/EMTAutogeneratedGens.java @@ -0,0 +1,32 @@ +package emt.init; + +import cpw.mods.fml.common.registry.GameRegistry; +import emt.block.BlockReflectedGen; +import emt.tile.generator.TileEntityReflexionGen; +import java.util.List; + +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 = (short)(i + 1)) { + BRG[i] = new BlockReflectedGen("EGenerator", i); + } + for (int i = 0; i < TileEntityReflexionGen.L.size(); i++) { + GameRegistry.registerTileEntity(TileEntityReflexionGen.GensS[i], "tileentity" + TileEntityReflexionGen.L.get(i)); + } + for (short i = 0; i < sets; i = (short)(i + 1)) { + GameRegistry.registerBlock(BRG[i], "EGenerator.Set." + Short.toString(i)); + } + } +} diff --git a/src/main/java/emt/init/EMTTiles.java b/src/main/java/emt/init/EMTTiles.java index 91bedf7..89669c3 100644 --- a/src/main/java/emt/init/EMTTiles.java +++ b/src/main/java/emt/init/EMTTiles.java @@ -43,7 +43,7 @@ public class EMTTiles { GameRegistry.registerTileEntity(TileEntityAuramGenerator.class, "tileentityauramgenerator"); GameRegistry.registerTileEntity(TileEntityArborGenerator.class, "tileentityarborgenerator"); GameRegistry.registerTileEntity(TileEntityAerGenerator.class, "tileentityaergenerator"); - GameRegistry.registerTileEntity(TileEntityLucrumGenerator.class, "tileentityperditiogenerator"); + GameRegistry.registerTileEntity(TileEntityLucrumGenerator.class, "tileentitylucrumgenerator"); //Machinery GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge"); diff --git a/src/main/java/emt/init/Registry.java b/src/main/java/emt/init/Registry.java index ac11078..932fc58 100644 --- a/src/main/java/emt/init/Registry.java +++ b/src/main/java/emt/init/Registry.java @@ -1,16 +1,22 @@ package emt.init; -public class Registry { - public static void register() { - EMTBlocks.registerBlocks(); - EMTItems.registerItems(); - EMTTiles.registerTileEntities(); - EMTRecipes.registerEarlyRecipes(); - } - - public static void registerLate() { - EMTBlocks.addAspects(); - EMTRecipes.registerLateRecipes(); - EMTRecipes.registerUUMInfusionRecipes(); - } +public class Registry +{ + public static void registerPreInit() {} + + public static void registerInit() + { + EMTBlocks.registerBlocks(); + EMTItems.registerItems(); + EMTTiles.registerTileEntities(); + EMTRecipes.registerEarlyRecipes(); + } + + public static void registerLate() + { + EMTBlocks.addAspects(); + EMTRecipes.registerLateRecipes(); + EMTRecipes.registerUUMInfusionRecipes(); + // new EMTAutogeneratedGens().run(); + } } diff --git a/src/main/java/emt/tile/TileEntityEMT.java b/src/main/java/emt/tile/TileEntityEMT.java index 19442cc..56e1054 100644 --- a/src/main/java/emt/tile/TileEntityEMT.java +++ b/src/main/java/emt/tile/TileEntityEMT.java @@ -5,47 +5,49 @@ import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; -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) { - tagCompound.setInteger("facing", facing); - tagCompound.setBoolean("isOn", isOn); - super.writeToNBT(tagCompound); - } - - @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); + } } diff --git a/src/main/java/emt/tile/generator/TileEntityAerGenerator.java b/src/main/java/emt/tile/generator/TileEntityAerGenerator.java index 4cff75e..ce69a5e 100644 --- a/src/main/java/emt/tile/generator/TileEntityAerGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityAerGenerator.java @@ -1,18 +1,12 @@ package emt.tile.generator; -import emt.util.EMTEssentiasOutputs; -import net.minecraft.util.StatCollector; import thaumcraft.api.aspects.Aspect; -public class TileEntityAerGenerator extends TileEntityBaseGenerator { - - public TileEntityAerGenerator() { - aspect = Aspect.AIR; - generating = EMTEssentiasOutputs.outputs.get(aspect.getTag()); - } - - @Override - public String getInventoryName() { - return StatCollector.translateToLocal("tile.EMT.essentia.aer.name"); - } -} \ No newline at end of file +public class TileEntityAerGenerator + extends TileEntityBaseGenerator +{ + public TileEntityAerGenerator() + { + super(Aspect.AIR); + } +} diff --git a/src/main/java/emt/tile/generator/TileEntityArborGenerator.java b/src/main/java/emt/tile/generator/TileEntityArborGenerator.java index 6961d40..ccb8114 100644 --- a/src/main/java/emt/tile/generator/TileEntityArborGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityArborGenerator.java @@ -1,18 +1,12 @@ package emt.tile.generator; -import emt.util.EMTEssentiasOutputs; -import net.minecraft.util.StatCollector; import thaumcraft.api.aspects.Aspect; -public class TileEntityArborGenerator extends TileEntityBaseGenerator { - - public TileEntityArborGenerator() { - aspect = Aspect.TREE; - generating = EMTEssentiasOutputs.outputs.get(aspect.getTag()); - } - - @Override - public String getInventoryName() { - return StatCollector.translateToLocal("tile.EMT.essentia.arbor.name"); - } +public class TileEntityArborGenerator + extends TileEntityBaseGenerator +{ + public TileEntityArborGenerator() + { + super(Aspect.TREE); + } } diff --git a/src/main/java/emt/tile/generator/TileEntityAuramGenerator.java b/src/main/java/emt/tile/generator/TileEntityAuramGenerator.java index c9f47fb..1582a18 100644 --- a/src/main/java/emt/tile/generator/TileEntityAuramGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityAuramGenerator.java @@ -1,18 +1,12 @@ package emt.tile.generator; -import emt.util.EMTEssentiasOutputs; -import net.minecraft.util.StatCollector; import thaumcraft.api.aspects.Aspect; -public class TileEntityAuramGenerator extends TileEntityBaseGenerator { - - public TileEntityAuramGenerator() { - aspect = Aspect.AURA; - generating = EMTEssentiasOutputs.outputs.get(aspect.getTag()); - } - - @Override - public String getInventoryName() { - return StatCollector.translateToLocal("tile.EMT.essentia.auram.name"); - } +public class TileEntityAuramGenerator + extends TileEntityBaseGenerator +{ + public TileEntityAuramGenerator() + { + super(Aspect.AURA); + } } diff --git a/src/main/java/emt/tile/generator/TileEntityBaseGenerator.java b/src/main/java/emt/tile/generator/TileEntityBaseGenerator.java index aec8a3c..73731e9 100644 --- a/src/main/java/emt/tile/generator/TileEntityBaseGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityBaseGenerator.java @@ -1,15 +1,29 @@ package emt.tile.generator; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.network.NetworkRegistry; import emt.tile.TileEntityEMT; 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.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; @@ -19,336 +33,812 @@ import thaumcraft.api.aspects.IEssentiaTransport; import thaumcraft.common.lib.network.PacketHandler; import thaumcraft.common.lib.network.fx.PacketFXEssentiaSource; -public class TileEntityBaseGenerator extends TileEntityEMT implements IInventory, IAspectContainer, IEssentiaTransport { - - public BasicSource energySource = new BasicSource(this, 100000, 2); - public Aspect aspect; - public double generating; - public int tick = 0; - public boolean isActive = false; - public int tier; - public int storage; - public int maxstorage; - public int maxfuel; - public int fuel; - public int refuel; - - public TileEntityBaseGenerator() { - energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage); - maxstorage = (int) energySource.getCapacity(); - maxfuel = 64; - fuel = 0; - storage = 0; - refuel = 1; - } - - @Override - public void updateEntity() { - storeFuel(); - fillfrompipe(); - createEnergy(); - energySource.updateEntity(); - } - - public void storeFuel() { - if (fuel0) { - if (storage+(generating/20/20) < maxstorage) { - isActive = true; - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - energySource.addEnergy(generating/20/20); - storage = (int) energySource.getEnergyStored(); - } - tick = tick+1; - if (tick == 20*20) { - fuel=fuel-1; - tick = 0; - } - } - else if (storage == maxstorage) - isActive = false; - else if ((storage+(generating/20/20) > maxstorage) && storage != maxstorage) { - isActive = true; - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - energySource.setEnergyStored((double)maxstorage); - storage = maxstorage; - } - tick = tick+1; - if (tick == 20*20) { - fuel=fuel-1; - tick = 0; - } - isActive = false; - } - - } - else { - isActive = false; - } - - } - - @Override - public void onChunkUnload() { - energySource.onChunkUnload(); - } - - @Override - public void invalidate() { - energySource.invalidate(); - super.invalidate(); - } - - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - energySource.readFromNBT(tag); - if (tag.getInteger("storage")>storage) - storage = tag.getInteger("storage"); - if (tag.getInteger("fuel")>fuel) - fuel = tag.getInteger("fuel"); - - } - - @Override - public void writeToNBT(NBTTagCompound tag) { - tag.setInteger("storage", this.storage); - tag.setInteger("fuel", this.fuel); - super.writeToNBT(tag); - energySource.writeToNBT(tag); - } - - @Override - public int getSizeInventory() { - return 5; - } - - @Override - public ItemStack getStackInSlot(int i) { - return null; - } - - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int p_70304_1_) { - return null; - } - - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - - } - - @Override - public String getInventoryName() { - return "EMT"; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public int getInventoryStackLimit() { - return 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return true; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - public int gaugeEnergyScaled(int i) - { - return this.storage * i / this.maxstorage; - } - - public int gaugeFuelScaled(int i) - { - return fuel*i/maxfuel; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack Stack) { - /*boolean ret= false; - if (i<=4) - ret = true; - else if(IEssentiaContainerItem.class.isInstance(Stack)) - ret = true; - return ret;*/ - return false; - } - - @Override - public AspectList getAspects() { - return new AspectList().add(aspect, fuel); - } - - @Override - public void setAspects(AspectList aspects) { - - } - - @Override - public boolean doesContainerAccept(Aspect tag) { - if(!tag.equals(aspect)) - return false; - else return true; - } - - @Override - public int addToContainer(Aspect tag, int amount) { - if(!tag.equals(aspect)||amount<0) - return amount; - else if (amount+this.fuel 0) + { + if (this.storage + this.generating / 20.0D / 20.0D < this.maxstorage) + { + this.isActive = true; + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) + { + 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 (FMLCommonHandler.instance().getEffectiveSide().isServer()) + { + 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; + } + } + + 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.getInteger("fuel") > this.fuel) { + this.fuel = tag.getInteger("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.storage * 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) + { + if (!tag.equals(this.aspect)) { + return false; + } + return true; + } + + 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 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 FMLCommonHandler.instance().getEffectiveSide().isServer(); + } + + public boolean isClientSide() + { + return FMLCommonHandler.instance().getEffectiveSide().isClient(); + } + + 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; + } } diff --git a/src/main/java/emt/tile/generator/TileEntityCompressedGenerator.java b/src/main/java/emt/tile/generator/TileEntityCompressedGenerator.java new file mode 100644 index 0000000..c3e0165 --- /dev/null +++ b/src/main/java/emt/tile/generator/TileEntityCompressedGenerator.java @@ -0,0 +1,17 @@ +package emt.tile.generator; + +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 BasicSource(this, 1000000.0D, 3); + this.energySource.setCapacity(EMTConfigHandler.EssentiaGeneratorStorage * 10.0D); + this.maxfuel *= 10; + } +} diff --git a/src/main/java/emt/tile/generator/TileEntityIgnisGenerator.java b/src/main/java/emt/tile/generator/TileEntityIgnisGenerator.java index b894eab..97e9676 100644 --- a/src/main/java/emt/tile/generator/TileEntityIgnisGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityIgnisGenerator.java @@ -1,18 +1,12 @@ package emt.tile.generator; -import emt.util.EMTEssentiasOutputs; -import net.minecraft.util.StatCollector; import thaumcraft.api.aspects.Aspect; -public class TileEntityIgnisGenerator extends TileEntityBaseGenerator { - - public TileEntityIgnisGenerator() { - aspect = Aspect.FIRE; - generating = EMTEssentiasOutputs.outputs.get(aspect.getTag()); - } - - @Override - public String getInventoryName() { - return StatCollector.translateToLocal("tile.EMT.essentia.ignis.name"); - } +public class TileEntityIgnisGenerator + extends TileEntityBaseGenerator +{ + public TileEntityIgnisGenerator() + { + super(Aspect.FIRE); + } } diff --git a/src/main/java/emt/tile/generator/TileEntityLucrumGenerator.java b/src/main/java/emt/tile/generator/TileEntityLucrumGenerator.java index a871ced..0a1a2c6 100644 --- a/src/main/java/emt/tile/generator/TileEntityLucrumGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityLucrumGenerator.java @@ -1,18 +1,12 @@ package emt.tile.generator; -import emt.util.EMTEssentiasOutputs; -import net.minecraft.util.StatCollector; import thaumcraft.api.aspects.Aspect; -public class TileEntityLucrumGenerator extends TileEntityBaseGenerator { - - public TileEntityLucrumGenerator() { - aspect = Aspect.GREED; - generating = EMTEssentiasOutputs.outputs.get(aspect.getTag()); - } - - @Override - public String getInventoryName() { - return StatCollector.translateToLocal("tile.EMT.essentia.lucrum.name"); - } +public class TileEntityLucrumGenerator + extends TileEntityBaseGenerator +{ + public TileEntityLucrumGenerator() + { + super(Aspect.GREED); + } } diff --git a/src/main/java/emt/tile/generator/TileEntityPotentiaGenerator.java b/src/main/java/emt/tile/generator/TileEntityPotentiaGenerator.java index 992d33b..19f7e4d 100644 --- a/src/main/java/emt/tile/generator/TileEntityPotentiaGenerator.java +++ b/src/main/java/emt/tile/generator/TileEntityPotentiaGenerator.java @@ -1,18 +1,12 @@ package emt.tile.generator; -import emt.util.EMTEssentiasOutputs; -import net.minecraft.util.StatCollector; import thaumcraft.api.aspects.Aspect; -public class TileEntityPotentiaGenerator extends TileEntityBaseGenerator { - - public TileEntityPotentiaGenerator() { - aspect = Aspect.ENERGY; - generating = EMTEssentiasOutputs.outputs.get(aspect.getTag()); - } - - @Override - public String getInventoryName() { - return StatCollector.translateToLocal("tile.EMT.essentia.potentia.name"); - } +public class TileEntityPotentiaGenerator + extends TileEntityBaseGenerator +{ + public TileEntityPotentiaGenerator() + { + super(Aspect.ENERGY); + } } diff --git a/src/main/java/emt/tile/generator/TileEntityReflexionGen.java b/src/main/java/emt/tile/generator/TileEntityReflexionGen.java new file mode 100644 index 0000000..314e147 --- /dev/null +++ b/src/main/java/emt/tile/generator/TileEntityReflexionGen.java @@ -0,0 +1,25 @@ +package emt.tile.generator; + +import emt.util.EMTEssentiasOutputs; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import net.minecraft.tileentity.TileEntity; +import thaumcraft.api.aspects.Aspect; + +public class TileEntityReflexionGen +{ + public static List L = new ArrayList(EMTEssentiasOutputs.outputs.keySet()); + public static Class[] GensS = new Class[L.size()]; + public static TileEntityBaseGenerator[] Gens = new TileEntityBaseGenerator[L.size()]; + + public TileEntityReflexionGen() + { + for (int i = 0; i < L.size(); i++) + { + GensS[i] = TileEntityBaseGenerator.class; + Gens[i] = new TileEntityBaseGenerator((Aspect)Aspect.aspects.get(L.get(i))); + } + } +}