Compare commits

..
52 Commits
Author SHA1 Message Date
fewizz 022137be62 Fix serverside. Closes #28 2016-09-24 14:29:33 +03:00
fewizz 4d98a5691a Release 2016-09-23 21:24:20 +03:00
fewizz 3fcf1a13f4 Changes... 2016-09-23 19:42:25 +03:00
fewizz 5cc45ee0cb Using TC LBolt renderer(very nice). 2016-07-30 21:11:53 +03:00
fewizz a37234c719 Fix incorrect Laser rotation on client, cleanup. 2016-05-29 19:06:08 +03:00
fewizz bc0f99cd33 Solar panels and buildscript cleanup 2016-05-25 17:22:04 +03:00
fewizz 0166b8b26c Closes #25 2016-05-23 17:34:01 +03:00
fewizz 2c7c28bbc3 Now mobs can't see you, if you equipped ONE RING 2016-05-23 16:58:12 +03:00
fewizz 8ee577a958 cleanup 2016-04-10 15:04:55 +03:00
fewizz c2dee6e1c1 texture 2016-04-10 13:45:07 +03:00
fewizz 3aef354b3a cleanup 2016-04-05 13:41:09 +03:00
fewizz 0b8b56a74b now works =) 2016-04-04 19:54:02 +03:00
fewizz 58e387e761 progress... 2016-04-04 14:49:42 +03:00
fewizz 3fdaf92d12 deleted duplicated check, using callList for rendering shield, cleanup. 2016-04-03 20:23:55 +03:00
fewizz f2fb61feb0 Chainsaws now can shear ( Closes #23 ), fixed chainsaws sounds. 2016-03-24 11:47:16 +03:00
fewizz 381896031b EN localisation, new focus(WIP). 2016-03-18 18:56:45 +03:00
fewizz 6a5fc496df renames, new logo, some changes 2016-03-17 18:25:51 +03:00
fewizz 7b6ec78cd7 Cleanup and some changes... 2016-03-16 17:49:28 +03:00
fewizz a39ac3bd74 nothing... 2016-02-04 17:12:00 +03:00
fewizz ba138b6eb2 changes 2016-02-04 17:10:07 +03:00
fewizz 17dc565ece Electrical Cloud 2016-02-03 19:55:40 +03:00
fewizz 93d5267079 small cleanup 2016-02-02 19:20:27 +03:00
fewizz eacb287f6b Merge branch 'master' of https://github.com/fewizz/Electro-Magic-Tools 2016-01-09 11:47:22 +03:00
fewizz a0eb5802bd fixed chestplate, tweaked generators 2016-01-09 11:46:30 +03:00
Anton 296c45f510 Merge pull request #19 from gonglinyuan/master
updated zh_CN.lang
2016-01-05 10:33:37 +03:00
gonglinyuan 427c2ce5d1 updated zh_CN.lang 2016-01-05 15:19:16 +08:00
fewizz 797bde4868 fixes #17 2016-01-01 23:26:52 +03:00
fewizz bb33f0b7d2 1.2.5 2015-12-28 18:31:36 +03:00
fewizz bcc6623337 some changes... 2015-12-26 22:50:59 +03:00
fewizz 3dcd5c43b6 fixes 2015-12-16 14:47:38 +03:00
fewizz 8a0861589b changes 2015-12-15 20:26:18 +03:00
fewizz 170a499cab cleanup 2015-12-15 16:02:36 +03:00
fewizz 68c9653932 Merge pull request #16 from Schevv/master
Some fixes
2015-12-15 15:09:46 +03:00
Jens Bauer 7c36996fe3 Merged 2015-12-14 23:35:58 +01:00
Jens Bauer 38e1e81049 Wand Recharger now needs Wrench to remove 2015-12-14 23:30:39 +01:00
Jens Bauer c80a774da7 Missing File Update for Focus Upgrades 2015-12-14 23:30:00 +01:00
Jens Bauer 2b38ed2f2b Added Toggle to Speed of BoT 2015-12-14 23:28:49 +01:00
Jens Bauer 42340fde1c Added 3 Focus Enchants 2015-12-14 23:28:19 +01:00
Jens Bauer 9bdb607fb4 Fixed Right-Click for Industrial Wand Recharger 2015-12-14 23:27:20 +01:00
fewizz e34b5adec6 renames, fixes, additions. 2015-12-14 21:29:29 +03:00
fewizz 3f8d860b95 who faster? 2015-12-14 19:56:55 +03:00
fewizz 4cbc62afb0 optimisation 2015-12-14 19:32:25 +03:00
fewizz e5d1f1637c Shield focus rewrite. 2015-12-13 21:24:42 +03:00
fewizz a499a47d9f lightning summoner rewrite 2015-12-11 17:45:33 +03:00
fewizz bcc09e1a0e Say no to radiation! 2015-12-08 22:17:42 +03:00
fewizz 051b799fe8 changes 2015-12-07 20:21:36 +03:00
fewizz a5fe149a4c oops xD 2015-12-07 18:13:53 +03:00
fewizz 5dedb54b26 one ring rewrite 2015-12-07 17:58:48 +03:00
fewizz 0f669ce9fd ic2 api update, fix recipes. 2015-12-06 20:46:22 +03:00
fewizz b5349fccbe changes 2015-12-06 19:47:41 +03:00
fewizz 084d48e1a4 Merge pull request #14 from DSLM/patch-1
a bit fix
2015-12-02 07:37:19 +03:00
DSLM e4930a84b7 a bit fix 2015-12-01 16:59:28 -05:00
460 changed files with 10633 additions and 10121 deletions

No files matched your search

-21
View File
@@ -2,16 +2,13 @@ buildscript {
repositories {
mavenCentral()
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'org.ajoberstar:gradle-git:0.10.1'
}
}
apply plugin: 'forge'
apply plugin: 'maven-publish'
ext.configFile = file "build.properties"
configFile.withReader {
@@ -64,22 +61,4 @@ tasks.build.dependsOn sourceJar, deobfJar
tasks.withType(JavaCompile) { task ->
task.options.encoding = 'UTF-8'
}
publishing {
tasks.publish.dependsOn 'build'
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
artifact deobfJar
}
}
repositories {
if (project.hasProperty('maven_repo')) {
maven { url maven_repo }
} else {
mavenLocal()
}
}
}
+3 -5
View File
@@ -1,7 +1,5 @@
#
#Wed Feb 24 14:31:53 PDT 2015
package_group=com.tombenpotter.emt
package_group=emt
mc_version=1.7.10
forge_version=10.13.4.1481
mod_version=1.2.3
forge_version=10.13.4.1614
mod_version=1.2.6.1
mod_name=ElectroMagicTools
+2
View File
@@ -0,0 +1,2 @@
org.gradle.debug=false
org.gradle.daemon=false
+1 -1
View File
@@ -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.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
rootProject.name = 'ElectroMagicTools'
+1 -1
View File
@@ -13,7 +13,7 @@ public interface IBauble {
/**
* This method return the type of bauble this is.
* Type is used to determine the slots it can go into.
* Type is used to determine the slots it can go into.
*/
public BaubleType getBaubleType(ItemStack itemstack);
Binary file not shown.
+17 -13
View File
@@ -37,13 +37,16 @@ public abstract class CropCard {
/**
* Determine the mod id owning this crop.
*
* It's recommended to hard code this to your mod id.
* The owner serves as a name space. With every mod using a different owner, a mod only has to
* make sure it doesn't have conflicts with name() in itself.
* It's recommended to hard code this to your mod id as specified in the @Mod annotation.
* Do not use IC2's mod id here.
*
* @note changing name or owner will cause existing crops in users' worlds to disappear.
*
* @return Mod id.
*/
public String owner() {
public String owner() { // TODO: make abstract
return modId;
}
@@ -100,7 +103,7 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return roots lengt use in isBlockBelow
*/
public int getrootslength(ICropTile crop) {
public int getrootslength(ICropTile crop) { // TODO: camel case
return 1;
}
@@ -126,7 +129,7 @@ public abstract class CropCard {
* @param n index of the requested stat
* @return The requested value of the stats
*/
public abstract int stat(int n);
public abstract int stat(int n); // TODO: change to fixed property object or builder with other attributes like tier
/**
* Additional attributes of the plant, also influencing breeding.
@@ -134,7 +137,7 @@ public abstract class CropCard {
*
* @return Attributes as an array of strings
*/
public abstract String[] attributes();
public abstract String[] attributes(); // TODO: default to none
/**
* Determine the max crop size.
@@ -212,7 +215,7 @@ public abstract class CropCard {
* @return 0-30
*/
public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) {
return (int) (humidity+nutrients+air);
return (int) (humidity + nutrients + air);
}
/**
@@ -247,7 +250,7 @@ public abstract class CropCard {
* @return need crop size for best output.
*/
public abstract int getOptimalHavestSize(ICropTile crop);
public abstract int getOptimalHavestSize(ICropTile crop); // TODO: default to maxSize
/**
* Check whether the crop can be harvested.
@@ -255,7 +258,7 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return Whether the crop can be harvested in its current state.
*/
public abstract boolean canBeHarvested(ICropTile crop);
public abstract boolean canBeHarvested(ICropTile crop); // TODO: default to maxSize check
/**
* Base chance for dropping the plant's gains, specify values greater than 1 for multiple drops.
@@ -282,20 +285,20 @@ public abstract class CropCard {
* @param crop reference to ICropTile
* @return Plant size after harvesting
*/
public byte getSizeAfterHarvest(ICropTile crop) {return 1;}
public byte getSizeAfterHarvest(ICropTile crop) {return 1;} // TODO: change to int
/**
* Called when the plant is leftclicked by a player.
* Called when the plant is left clicked by a player.
* Default action is picking the plant.
*
* Only called Serverside.
* Only called server side.
*
* @param crop reference to ICropTile
* @param player player leftclicked the crop
* @param player player left clicked the crop
* @return Whether the plant has changed
*/
public boolean leftclick(ICropTile crop, EntityPlayer player) {
public boolean leftclick(ICropTile crop, EntityPlayer player) { // TODO: camel case
return crop.pick(true);
}
@@ -428,4 +431,5 @@ public abstract class CropCard {
protected IIcon textures[];
private final String modId; // TODO: make owner abstract, remove modId auto detection
// TODO: add a clean way to obtain world reference and position
}
Binary file not shown.
@@ -260,6 +260,15 @@ public interface ICropTile {
*/
public boolean isBlockBelow(Block block);
/**
* Check if a block is under the farmland containing the crop.
* Searches up to 2 blocks below the farmland or an air space, whichever appears first.
*
* @param oreDictionaryName blocks to search
* @return Whether the blocks were found
*/
public boolean isBlockBelow(String oreDictionaryName);
/**
* Generate plant seeds with the given parameters.
*
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7
View File
@@ -1,5 +1,6 @@
package ic2.api.info;
import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource;
import cpw.mods.fml.common.Loader;
@@ -16,6 +17,12 @@ public class Info {
*/
public static DamageSource DMG_ELECTRIC, DMG_NUKE_EXPLOSION, DMG_RADIATION;
/**
* Potions used by IC2.
* Getting assigned in preload.
*/
public static Potion POTION_RADIATION;
public static boolean isIc2Available() {
if (ic2Available != null) return ic2Available;
+3 -1
View File
@@ -39,7 +39,9 @@ public interface IElectricItem {
/**
* Get the item's tier, lower tiers can't send energy to higher ones.
* Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3.
*
* Batteries are Tier 1, Advanced Batteries are Tier 2, Energy Crystals are Tier 3, Lapotron
* Crystals are Tier 4.
*
* @return Item's tier
*/
@@ -6,12 +6,26 @@ import net.minecraftforge.fluids.Fluid;
public interface ILiquidHeatExchangerManager extends ILiquidAcceptManager {
/**
* Add a new fluid heatup/cooldown recipe.
*
* @param fluidName the fluid to heat up/cool down
* @param fluidOutput the fluid the above fluid turns into
* @param huPerMB the Thermal Energy difference in hU for the conversion of one mB fluid
*/
void addFluid(String fluidName, String fluidOutput, int huPerMB);
HeatExchangeProperty getHeatExchangeProperty(Fluid fluid);
Map<String, HeatExchangeProperty> getHeatExchangeProperties();
/**
* This returns an ILiquidAcceptManager that only accepts fluids, that can be heated up / cooled down, but not both.
* You can basically use this to check if the liquid resulting from this conversion can be reprocessed into the first one.
* @return Returns the SingleDirectionManager.
*/
ILiquidAcceptManager getSingleDirectionLiquidManager();
public static class HeatExchangeProperty {
public HeatExchangeProperty(Fluid outputFluid, int huPerMB) {
this.outputFluid = outputFluid;
+107
View File
@@ -0,0 +1,107 @@
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;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
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.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;
@Mod(
modid = EMT.MOD_ID,
name = EMT.NAME,
version = EMT.VERSION,
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.1";
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());
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);
}
}
+25
View File
@@ -0,0 +1,25 @@
package emt.block;
import emt.EMT;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public abstract class BlockBase extends Block {
public final String name;
public BlockBase(String unlocName, Material material, String textureName, SoundType soundType, float hardness) {
super(material);
name = unlocName;
setBlockName(EMT.MOD_ID + ".block." + unlocName);
if (textureName != null) {
setBlockTextureName(EMT.TEXTURE_PATH + ":" + textureName);
}
setCreativeTab(EMT.TAB);
setStepSound(soundType);
setHardness(hardness);
}
public BlockBase(String unlocName, Material material, SoundType soundType, float hardness) {
this(unlocName, material, null, soundType, hardness);
}
}
@@ -0,0 +1,154 @@
package emt.block;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public abstract class BlockBaseContainer extends BlockContainer {
@SideOnly(Side.CLIENT)
IconSet[] iconSets;
public int instance;
public int countOfMetas;
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, float hardness) {
this(unlocName, material, soundType, 1, hardness);
}
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas, float hardness) {
this(unlocName, material, soundType, countOfMetas, 0, hardness);
}
public BlockBaseContainer(String unlocName, Material material, SoundType soundType, int countOfMetas, int curInstance, float hardness) {
super(material);
this.setBlockName(EMT.MOD_ID + "." + unlocName);
this.setCreativeTab(EMT.TAB);
this.setStepSound(soundType);
this.setHardness(hardness);
this.countOfMetas = countOfMetas;
this.instance = curInstance;
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
iconSets = new IconSet[countOfMetas];
for (int meta = 0; meta < countOfMetas; meta++) {
iconSets[meta] = new IconSet();
}
}
}
public IconSet[] getIconSets() {
return iconSets;
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return null;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z);
int meta = access.getBlockMetadata(x, y, z);
IconSet set = iconSets[meta];
if (side == 0) {
return set.bottom;
}
else if (side == 1) {
return set.top;
}
else if (side != tile.facing) {
return set.side;
}
else if (tile.isOn) {
if (set.frontOn != null) {
return set.frontOn;
}
if (set.frontOff != null) {
return set.frontOff;
}
return set.side;
}
else {
if (set.frontOff != null) {
return set.frontOff;
}
return set.side;
}
}
@Override
public IIcon getIcon(int side, int meta) {
IconSet set = iconSets[meta];
if (side < 1) {
return set.bottom;
}
if (side == 1) {
return set.top;
}
if (side == 3) {
return set.frontOff;
}
return set.side;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z);
switch (facing) {
case 0:
tile.facing = 2;
break;
case 1:
tile.facing = 5;
break;
case 2:
tile.facing = 3;
break;
case 3:
tile.facing = 4;
break;
}
}
@Override
public int damageDropped(int meta) {
return meta;
}
@SideOnly(Side.CLIENT)
public static class IconSet {
public IIcon top;
public IIcon bottom;
public IIcon side;
public IIcon frontOff;
public IIcon frontOn;
}
}
@@ -0,0 +1,103 @@
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;
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;
public BlockElectricCloud(String unlocName) {
super(unlocName, Material.cloth, soundTypeCloth, 0.1f);
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);
ef.setGravity(0.05F);
ParticleEngine.instance.addEffect(world, ef);
}
@Override
public TileEntity createTileEntity(World world, int metadata) {
return new TileElectricCloud();
}
@Override
public String getUnlocalizedName() {
return "tile.EMT." + super.getUnlocalizedName().substring(15);
}
@Override
public void registerBlockIcons(IIconRegister ir) {
icon = ir.registerIcon(EMT.TEXTURE_PATH + ":empty");
}
@Override
public IIcon getIcon(int side, int meta) {
return icon;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return null;
}
@Override
public int getLightValue() {
return 15;
}
@Override
public boolean isAir(IBlockAccess world, int x, int y, int z) {
return false;
}
@Override
public boolean hasTileEntity() {
return true;
}
@Override
public boolean hasTileEntity(int metadata) {
return true;
}
@Override
public int getRenderType() {
return -1;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
}
@@ -0,0 +1,87 @@
package emt.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.generator.*;
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.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;
import org.lwjgl.opengl.GL11;
public class BlockEssentiaGenerators extends BlockBaseContainer {
public BlockEssentiaGenerators(String name) {
super(name, Material.iron, soundTypeMetal, 5, 4.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister ir) {
super.registerBlockIcons(ir);
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
for (int meta = 0; meta < 5; 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");
}
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/potentiafront");
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":essentiagenerator/ignisfront");
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");
}
@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));
list.add(new ItemStack(id, 1, 3));
list.add(new ItemStack(id, 1, 4));
}
@Override
public TileEntity createTileEntity(World world, int meta) {
switch (meta) {
case 0:
return new TileEntityPotentiaGenerator();
case 1:
return new TileEntityIgnisGenerator();
case 2:
return new TileEntityAuramGenerator();
case 3:
return new TileEntityArborGenerator();
case 4:
return new TileEntityAerGenerator();
}
return super.createTileEntity(world, 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 = (float) (color >> 16 & 0xff) / 255F;
float g = (float) (color >> 8 & 0xff) / 255F;
float b = (float) (color & 0xff) / 255F;
EntitySmokeFX fx = new EntitySmokeFX(world, x + 0.5f, y + 1.1, z + 0.5f, 0, 0.1, 0, 3);
fx.setRBGColorF(r, g, b);
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
}
}
}
+127
View File
@@ -0,0 +1,127 @@
package emt.block;
import ic2.api.item.IC2Items;
import java.util.List;
import java.util.Random;
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.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
public class BlockMachines extends BlockBaseContainer {
public BlockMachines(String name) {
super(name, Material.iron, soundTypeMetal, 2, 4.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister ir) {
super.registerBlockIcons(ir);
this.blockIcon = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
iconSets[0].top = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/top");
iconSets[1].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[0].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/side");
iconSets[1].side = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmacerator");
iconSets[0].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
iconSets[1].frontOff = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfront");
iconSets[0].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/wandcharger");
iconSets[1].frontOn = ir.registerIcon(EMT.TEXTURE_PATH + ":machines/etherealmaceratorfrontactive");
}
@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));
}
@Override
public TileEntity createTileEntity(World world, int meta) {
if (meta == 0) {
return new TileEntityIndustrialWandRecharge();
}
if (meta == 1) {
return new TileEntityEtherealMacerator();
}
return super.createTileEntity(world, meta);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge) {
player.openGui(EMT.instance, 0, world, x, y, z);
}
else if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityEtherealMacerator) {
player.openGui(EMT.instance, 1, world, x, y, z);
}
return true;
}
@Override
public Item getItemDropped(int meta, Random random, int fortune) {
return IC2Items.getItem("machine").getItem();
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
dropItems(world, x, y, z);
world.removeTileEntity(x, y, z);
super.breakBlock(world, x, y, z, block, meta);
}
private void dropItems(World world, int x, int y, int z) {
Random rand = world.rand;
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (!(tileEntity instanceof IInventory)) {
return;
}
IInventory inventory = (IInventory) tileEntity;
for (int i = 0; i < inventory.getSizeInventory(); i++) {
ItemStack item = inventory.getStackInSlot(i);
if (item != null && item.stackSize > 0) {
float rx = rand.nextFloat() * 0.8F + 0.1F;
float ry = rand.nextFloat() * 0.8F + 0.1F;
float rz = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage()));
if (item.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
}
float factor = 0.05F;
entityItem.motionX = rand.nextGaussian() * factor;
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
entityItem.motionZ = rand.nextGaussian() * factor;
world.spawnEntityInWorld(entityItem);
item.stackSize = 0;
}
}
}
}
@@ -0,0 +1,88 @@
package emt.block;
import cpw.mods.fml.relauncher.Side;
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 {
public IIcon texture;
public BlockPortableNode(String name) {
this.setCreativeTab(EMT.TAB);
setBlockName(EMT.MOD_ID + "." + name);
setBlockUnbreakable();
}
@Override
public TileEntity createTileEntity(World world, int meta) {
return new TileEntityPortableNode();
}
@Override
public int quantityDropped(Random par1Random) {
return 0;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
protected boolean canSilkHarvest() {
return false;
}
public boolean canEntityDestroy(World world, int x, int y, int z, Entity entity) {
return false;
}
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
}
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister ri) {
texture = ri.registerIcon(EMT.TEXTURE_PATH + ":portablenode");
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return texture;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) {
world.setBlockToAir(x, y, z);
world.removeTileEntity(x, y, z);
}
return true;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return null;
}
}
+77
View File
@@ -0,0 +1,77 @@
package emt.block;
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.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.Random;
public class BlockShield extends Block {
public BlockShield(String name) {
super(Material.rock);
setBlockName(EMT.MOD_ID + "." + name);
this.setCreativeTab(EMT.TAB);
this.setHardness(1F);
this.setResistance(10000000000000000000000000000000000000F);
}
@Override
public int quantityDropped(Random par1Random) {
return 0;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return 0;
}
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister iconRegister) {
this.blockIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":shield");
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
protected boolean canSilkHarvest() {
return false;
}
@Override
public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) {
return false;
}
@Override
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
return false;
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
return false;
}
@Override
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
}
}
+229
View File
@@ -0,0 +1,229 @@
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;
import emt.tile.solar.compressed.TileEntityCompressedSolar;
import emt.tile.solar.compressed.TileEntityDoubleCompressedSolar;
import emt.tile.solar.compressed.TileEntityTripleCompressedSolar;
import emt.tile.solar.dark.TileEntityDarkSolar;
import emt.tile.solar.dark.TileEntityDoubleDarkSolar;
import emt.tile.solar.dark.TileEntityTripleDarkSolar;
import emt.tile.solar.earth.TileEntityDoubleEarthSolar;
import emt.tile.solar.earth.TileEntityEarthSolar;
import emt.tile.solar.earth.TileEntityTripleEarthSolar;
import emt.tile.solar.fire.TileEntityDoubleFireSolar;
import emt.tile.solar.fire.TileEntityFireSolar;
import emt.tile.solar.fire.TileEntityTripleFireSolar;
import emt.tile.solar.order.TileEntityDoubleOrderSolar;
import emt.tile.solar.order.TileEntityOrderSolar;
import emt.tile.solar.order.TileEntityTripleOrderSolar;
import emt.tile.solar.water.TileEntityDoubleWaterSolar;
import emt.tile.solar.water.TileEntityTripleWaterSolar;
import emt.tile.solar.water.TileEntityWaterSolar;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.List;
public class BlockSolars extends BlockBaseContainer {
public BlockSolars(String name, int countOfMetas, int instance) {
super(name, Material.iron, soundTypeMetal, countOfMetas, instance, 4.0F);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister ir) {
IIcon solarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/solartop");
IIcon doubleSolarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/doublesolartop");
IIcon tripleSolarTop = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/triplesolartop");
IIcon bottom = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/bottom");
if(instance == 0) {
iconSets[0].top = solarTop;
iconSets[1].top = doubleSolarTop;
iconSets[2].top = tripleSolarTop;
iconSets[3].top = solarTop;
iconSets[4].top = doubleSolarTop;
iconSets[5].top = tripleSolarTop;
iconSets[6].top = solarTop;
iconSets[7].top = doubleSolarTop;
iconSets[8].top = tripleSolarTop;
iconSets[9].top = solarTop;
iconSets[10].top = doubleSolarTop;
iconSets[11].top = tripleSolarTop;
iconSets[12].top = solarTop;
iconSets[13].top = doubleSolarTop;
iconSets[14].top = tripleSolarTop;
iconSets[15].top = solarTop;
iconSets[0].bottom = bottom;
iconSets[1].bottom = bottom;
iconSets[2].bottom = bottom;
iconSets[3].bottom = bottom;
iconSets[4].bottom = bottom;
iconSets[5].bottom = bottom;
iconSets[6].bottom = bottom;
iconSets[7].bottom = bottom;
iconSets[8].bottom = bottom;
iconSets[9].bottom = bottom;
iconSets[10].bottom = bottom;
iconSets[11].bottom = bottom;
iconSets[12].bottom = bottom;
iconSets[13].bottom = bottom;
iconSets[14].bottom = bottom;
iconSets[15].bottom = bottom;
IIcon side = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/side");
IIcon waterSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/water/waterside");
IIcon darkSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/dark/darkside");
IIcon orderSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/order/orderside");
IIcon fireSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/fire/fireside");
IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
iconSets[0].side = side;
iconSets[1].side = side;
iconSets[2].side = side;
iconSets[3].side = waterSide;
iconSets[4].side = waterSide;
iconSets[5].side = waterSide;
iconSets[6].side = darkSide;
iconSets[7].side = darkSide;
iconSets[8].side = darkSide;
iconSets[9].side = orderSide;
iconSets[10].side = orderSide;
iconSets[11].side = orderSide;
iconSets[12].side = fireSide;
iconSets[13].side = fireSide;
iconSets[14].side = fireSide;
iconSets[15].side = airSide;
}
if(instance == 1) {
iconSets[0].top = doubleSolarTop;
iconSets[1].top = tripleSolarTop;
iconSets[2].top = solarTop;
iconSets[3].top = doubleSolarTop;
iconSets[4].top = tripleSolarTop;
iconSets[0].bottom = bottom;
iconSets[1].bottom = bottom;
iconSets[2].bottom = bottom;
iconSets[3].bottom = bottom;
iconSets[4].bottom = bottom;
IIcon airSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/air/airside");
IIcon earthSide = ir.registerIcon(EMT.TEXTURE_PATH + ":solars/earth/earthside");
iconSets[0].side = airSide;
iconSets[1].side = airSide;
iconSets[2].side = earthSide;
iconSets[3].side = earthSide;
iconSets[4].side = earthSide;
}
}
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
if (instance == 0) {
for (int meta = 0; meta < 16; meta++) {
list.add(new ItemStack(id, 1, meta));
}
}
if (instance == 1) {
for (int meta = 0; meta < 5; meta++) {
list.add(new ItemStack(id, 1, meta));
}
}
}
@Override
public IIcon getIcon(int side, int meta) {
if (side < 1) {
return iconSets[meta].bottom;
}
if (side == 1) {
return iconSets[meta].top;
}
return iconSets[meta].side;
}
@Override
public TileEntity createTileEntity(World world, int meta) {
if (instance == 0) {
switch (meta) {
case 0:
return new TileEntityCompressedSolar();
case 1:
return new TileEntityDoubleCompressedSolar();
case 2:
return new TileEntityTripleCompressedSolar();
case 3:
return new TileEntityWaterSolar();
case 4:
return new TileEntityDoubleWaterSolar();
case 5:
return new TileEntityTripleWaterSolar();
case 6:
return new TileEntityDarkSolar();
case 7:
return new TileEntityDoubleDarkSolar();
case 8:
return new TileEntityTripleDarkSolar();
case 9:
return new TileEntityOrderSolar();
case 10:
return new TileEntityDoubleOrderSolar();
case 11:
return new TileEntityTripleOrderSolar();
case 12:
return new TileEntityFireSolar();
case 13:
return new TileEntityDoubleFireSolar();
case 14:
return new TileEntityTripleFireSolar();
case 15:
return new TileEntityAirSolar();
}
}
if (instance == 1) {
switch (meta) {
case 0:
return new TileEntityDoubleAirSolar();
case 1:
return new TileEntityTripleAirSolar();
case 2:
return new TileEntityEarthSolar();
case 3:
return new TileEntityDoubleEarthSolar();
case 4:
return new TileEntityTripleEarthSolar();
}
}
return super.createTileEntity(world, meta);
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
world.removeTileEntity(x, y, z);
super.breakBlock(world, x, y, z, block, meta);
}
}
@@ -1,4 +1,4 @@
package tombenpotter.emt.client;
package emt.client;
import java.util.HashMap;
import java.util.HashSet;
@@ -8,20 +8,15 @@ import java.util.Set;
import org.lwjgl.input.Keyboard;
import tombenpotter.emt.common.util.TextHelper;
import cpw.mods.fml.client.registry.ClientRegistry;
import emt.util.EMTTextHelper;
import net.minecraft.client.settings.KeyBinding;
public class EMTKeys{
public class EMTKeys {
public static KeyBinding keyUnequip;
public static void registerKeys(){
keyUnequip = new KeyBinding(TextHelper.localize("gui.EMT.key.unequip"), Keyboard.KEY_Z, "EMT");
ClientRegistry.registerKeyBinding(keyUnequip);
}
public static boolean keyUnequipPressed(){
return keyUnequip.getIsKeyPressed();
public static void registerKeys() {
keyUnequip = new KeyBinding(EMTTextHelper.localize("gui.EMT.key.unequip"), Keyboard.KEY_Z, "EMT");
ClientRegistry.registerKeyBinding(keyUnequip);
}
}
@@ -0,0 +1,35 @@
package emt.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import emt.EMT;
import emt.client.gui.container.ContainerEtheralMacerator;
import emt.tile.TileEntityEtherealMacerator;
import emt.util.EMTTextHelper;
public class GuiEtherealMacerator extends GuiContainer {
public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te) {
super(new ContainerEtheralMacerator(inventory, te));
xSize = 176;
ySize = 165;
}
public static final ResourceLocation texture = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/etherealmacerator.png");
@Override
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.etherealMacerator.title"), 6, 6, 4210752);
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
}
@@ -0,0 +1,35 @@
package emt.client.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import emt.EMT;
import emt.client.gui.container.ContainerIndustrialWandRecharge;
import emt.tile.TileEntityIndustrialWandRecharge;
import emt.util.EMTTextHelper;
public class GuiIndustrialWandRecharger extends GuiContainer {
public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te) {
super(new ContainerIndustrialWandRecharge(inventory, te));
xSize = 176;
ySize = 165;
}
public static final ResourceLocation texture = new ResourceLocation(EMT.TEXTURE_PATH, "textures/guis/wandcharger.png");
@Override
public void drawGuiContainerBackgroundLayer(float f, int j, int i) {
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.wandRecharge.title"), 6, 6, 4210752);
this.fontRendererObj.drawString(EMTTextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
}
@@ -0,0 +1,34 @@
package emt.client.gui.config;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;
import emt.EMT;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import static emt.util.EMTConfigHandler.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class EMTGuiConfig extends GuiConfig {
public EMTGuiConfig(GuiScreen parentScreen) {
super(parentScreen, getConfigElements(parentScreen), EMT.MOD_ID, false, false, StatCollector.translateToLocal("gui." + EMT.MOD_ID + ".config.title"));
}
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
List<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(new ConfigElement<ConfigCategory>(config.getCategory(RANDOM.toLowerCase(Locale.US))));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(VALUES.toLowerCase(Locale.US))));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(RESEARCH.toLowerCase(Locale.US))));
list.add(new ConfigElement<ConfigCategory>(config.getCategory(OUTPUTS.toLowerCase(Locale.US))));
return list;
}
}
@@ -0,0 +1,30 @@
package emt.client.gui.config;
import cpw.mods.fml.client.IModGuiFactory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import java.util.Set;
public class EMTGuiFactory implements IModGuiFactory {
@Override
public void initialize(Minecraft minecraftInstance) {
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return EMTGuiConfig.class;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
return null;
}
}
@@ -0,0 +1,88 @@
package emt.client.gui.container;
import emt.tile.TileEntityEtherealMacerator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.tileentity.TileEntity;
import thaumcraft.common.container.SlotOutput;
public class ContainerEtheralMacerator extends Container {
TileEntityEtherealMacerator te;
public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te) {
this.te = ((TileEntityEtherealMacerator) te);
addSlotToContainer(new Slot(this.te, 0, 56, 26));
addSlotToContainer(new SlotOutput(this.te, 2, 116, 26));
addSlotToContainer(new SlotOutput(this.te, 1, 116, 53));
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return this.te.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(par2);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 == 1) {
if (!this.mergeItemStack(itemstack1, 2, 38, true)) {
return null;
}
slot.onSlotChange(itemstack1, itemstack);
}
else if (par2 != 0) {
if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) {
if (!this.mergeItemStack(itemstack1, 0, 1, false)) {
return null;
}
}
else if (par2 >= 2 && par2 < 29) {
if (!this.mergeItemStack(itemstack1, 29, 38, false)) {
return null;
}
}
else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) {
return null;
}
}
else if (!this.mergeItemStack(itemstack1, 3, 38, false)) {
return null;
}
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
}
else {
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
}
return itemstack;
}
}
@@ -0,0 +1,72 @@
package emt.client.gui.container;
import emt.tile.TileEntityIndustrialWandRecharge;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
public class ContainerIndustrialWandRecharge extends Container {
TileEntityIndustrialWandRecharge charger;
public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity) {
this.charger = entity;
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(invPlayer, x, 8 + x * 18, 142));
}
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18));
}
}
this.addSlotToContainer(new Slot(charger, 0, 80, 35));
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return charger.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
ItemStack itemstack = null;
Slot slot = (Slot) this.inventorySlots.get(par2);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 == 36) {
if (!this.mergeItemStack(itemstack1, 0, 35, false)) {
return null;
}
slot.onSlotChange(itemstack1, itemstack);
}
else if (!charger.isItemValidForSlot(0, itemstack1) || !this.mergeItemStack(itemstack1, 36, 37, false)) {
return null;
}
if (itemstack1.stackSize == 0) {
slot.putStack((ItemStack) null);
}
else {
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize) {
return null;
}
slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
}
return itemstack;
}
}
@@ -0,0 +1,126 @@
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 {
public ModelRenderer rightWing;
public ModelRenderer leftWing;
public ModelRenderer center;
public ModelRenderer jetpack;
public boolean isJumping;
public int type = 0;// 0 - Nothing, 1 - Jetpack, 2 - Wings
public ModelSpecialArmor() {
this(1, 0);
}
public ModelSpecialArmor(float scale, int type) {
this(scale, 0.0F, type);
}
public ModelSpecialArmor(float scale, float offset, int type) {
super(scale, offset, type == 1? 128 : 64, type == 0? 32 : type == 1? 96 : 64);
this.type = type;
switch (this.type) {
case 1:
this.textureWidth = 128;
this.textureHeight = 96;
this.jetpack = new ModelRenderer(this, 16, 69);
this.jetpack.setTextureSize(64, 48);
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, scale * 2);
this.jetpack.setRotationPoint(0.0F, 0.0F + offset, 0.0F);
break;
case 2:
this.textureWidth = 64;
this.textureHeight = 64;
rightWing = new ModelRenderer(this, 24, 0 + 32);
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
rightWing.setRotationPoint(-2F, 0F, 3F);
rightWing.setTextureSize(64, 32);
rightWing.mirror = false;
setRotation(rightWing, 0F, 0.1570796F, 0F);
leftWing = new ModelRenderer(this, 0, 0 + 32);
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
leftWing.setRotationPoint(2F, 0F, 3F);
leftWing.setTextureSize(64, 32);
leftWing.mirror = true;
setRotation(leftWing, 0F, -0.1570796F, 0F);
center = new ModelRenderer(this, 0, 14 + 32);
center.addBox(0F, 0F, 1F, 8, 14, 1);
center.setRotationPoint(-4F, 0F, 3F);
center.setTextureSize(64, 32);
center.mirror = true;
setRotation(center, 0F, 0F, 0F);
break;
}
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) {
EntityPlayer player = (EntityPlayer)entity;
this.heldItemRight = player.inventory.getCurrentItem() != null? 1 : 0;
this.isRiding = player.isRiding();
this.isSneak = player.isSneaking();
this.aimedBow = player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem().getItemUseAction(player.inventory.getCurrentItem()) == EnumAction.bow && player.isUsingItem();
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entity);
this.bipedBody.render(scale);
this.bipedRightArm.render(scale);
this.bipedLeftArm.render(scale);
switch (this.type) {
case 1:
this.jetpack.render(scale);
break;
case 2:
this.center.render(scale);
this.leftWing.render(scale);
this.rightWing.render(scale);
}
}
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity) {
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity);
if (this.isJumping) {
this.rightWing.rotateAngleY = 0.5f;
this.leftWing.rotateAngleY = -0.5f;
}
if (this.isSneak) {
switch (this.type) {
case 1:
this.jetpack.rotateAngleX = 0.5F;
break;
case 2:
this.center.offsetY -= 0.1;
this.rightWing.offsetY -= 0.1;
this.leftWing.offsetY -= 0.1;
this.center.rotateAngleX = 0.5F;
this.rightWing.rotateAngleX = 0.5F;
this.leftWing.rotateAngleX = 0.5F;
break;
}
}
}
}
@@ -0,0 +1,77 @@
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 {
ModelRenderer rightWing;
ModelRenderer leftWing;
ModelRenderer center;
public boolean isJumping = false;
public ModelWings() {
textureWidth = 64;
textureHeight = 64;
rightWing = new ModelRenderer(this, 24, 0);
rightWing.addBox(-11F, -1F, -1.5F, 11, 13, 1);
rightWing.setRotationPoint(-2F, 0F, 3F);
rightWing.setTextureSize(64, 32);
rightWing.mirror = false;
setRotation(rightWing, 0F, 0.1570796F, 0F);
leftWing = new ModelRenderer(this, 0, 0);
leftWing.addBox(0F, -1F, -1.5F, 11, 13, 1);
leftWing.setRotationPoint(2F, 0F, 3F);
leftWing.setTextureSize(64, 32);
leftWing.mirror = true;
setRotation(leftWing, 0F, -0.1570796F, 0F);
center = new ModelRenderer(this, 0, 14);
center.addBox(0F, 0F, -0.5F, 8, 14, 1);
center.setRotationPoint(-4F, 0F, 3F);
center.setTextureSize(64, 32);
center.mirror = true;
setRotation(center, 0F, 0F, 0F);
this.bipedBody.addChild(rightWing);
this.bipedBody.addChild(leftWing);
this.bipedBody.addChild(center);
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
rightWing.render(f5);
leftWing.render(f5);
center.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float pt, float f3, float f4, float f5, Entity entity) {
if (isJumping) {
this.rightWing.rotateAngleY = 0.5f;
this.leftWing.rotateAngleY = -0.5f;
}
if (entity.isSneaking()) {
this.center.offsetY -= 0.1;
this.rightWing.offsetY -= 0.1;
this.leftWing.offsetY -= 0.1;
this.center.rotateAngleX = 0.5F;
this.rightWing.rotateAngleX = 0.5F;
this.leftWing.rotateAngleX = 0.5F;
}
}
}
@@ -0,0 +1,69 @@
package emt.client.renderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import emt.EMT;
import emt.entity.EntityLaser;
public class RenderLaser extends Render {
private static final ResourceLocation laserTexture = new ResourceLocation(EMT.TEXTURE_PATH, "textures/models/lasermodel.png");
@Override
public void doRender(Entity entityLaser, double x, double y, double z, float par8, float pTick) {
this.bindEntityTexture(entityLaser);
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(entityLaser.rotationYaw - 90, 0, 1, 0);
GL11.glRotatef(entityLaser.rotationPitch, 0, 0, 1);
Tessellator tess = Tessellator.instance;
byte b0 = 0;
float f2 = 0.4f;
float f3 = 0.7f;
float f4 = (float) (0 + b0 * 10) / 32f;
float f5 = (float) (5 + b0 * 10) / 32f;
float f10 = 0.05625F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glRotatef(45, 1, 0, 0);
GL11.glScalef(f10, f10, f10);
GL11.glTranslatef(-4, 0, 0);
GL11.glPushAttrib(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_LIGHTING);
for (int i = 0; i < 4; ++i) {
GL11.glRotatef(90, 1, 0, 0);
GL11.glNormal3f(0, 0, f10);
tess.startDrawingQuads();
tess.addVertexWithUV(-8, 0, 0, f2, f4);
tess.addVertexWithUV(8, 0, 0, f3, f4);
tess.addVertexWithUV(8, 4, 0, f3, f5);
tess.addVertexWithUV(-8, 4, 0, f2, f5);
tess.draw();
tess.startDrawingQuads();
tess.addVertexWithUV(8, 0, 0, f2, f4);
tess.addVertexWithUV(-8, 0, 0, f3, f4);
tess.addVertexWithUV(-8, 4, 0, f3, f5);
tess.addVertexWithUV(8, 4, 0, f2, f5);
tess.draw();
}
GL11.glPopAttrib();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
protected ResourceLocation getArrowTextures(EntityLaser entityLaser) {
return laserTexture;
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return this.getArrowTextures((EntityLaser) entity);
}
}
@@ -0,0 +1,101 @@
package emt.client.renderer;
import static org.lwjgl.opengl.GL11.*;
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;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
public class RenderShield extends Render {
private static final ResourceLocation shieldTexture = new ResourceLocation(EMT.TEXTURE_PATH, "textures/models/shield.png");
static int glCallList;
static {
glCallList = GLAllocation.generateDisplayLists(3);
GL11.glPushMatrix();
GL11.glNewList(glCallList, GL11.GL_COMPILE);
Tessellator tessellator = Tessellator.instance;
float sin1;
float cos1;
float sin2;
float cos2;
float hsin1 = -1;
float hcos1 = 0;
float hsin2;
float hcos2;
tessellator.startDrawingQuads();
for (float h = -90; h < 90; h += 15) {
sin1 = 0;
cos1 = 1;
hsin2 = MathHelper.sin((float) Math.toRadians(h + 15));
hcos2 = MathHelper.cos((float) Math.toRadians(h + 15));
for (float angle = 0; angle < 360; angle += 15) {
sin2 = MathHelper.sin((float) Math.toRadians(angle + 15));
cos2 = MathHelper.cos((float) Math.toRadians(angle + 15));
tessellator.addVertexWithUV(sin1 * hcos1 * 2, hsin1 * 2, cos1 * hcos1 * 2, 1, 1);
tessellator.addVertexWithUV(sin1 * hcos2 * 2, hsin2 * 2, cos1 * hcos2 * 2, 1, 0);
tessellator.addVertexWithUV(sin2 * hcos2 * 2, hsin2 * 2, cos2 * hcos2 * 2, 0, 0);
tessellator.addVertexWithUV(sin2 * hcos1 * 2, hsin1 * 2, cos2 * hcos1 * 2, 0, 1);
sin1 = sin2;
cos1 = cos2;
}
hsin1 = hsin2;
hcos1 = hcos2;
}
tessellator.draw();
GL11.glEndList();
}
@Override
public void doRender(Entity entityShield, double x, double y, double z, float par8, float par9) {
this.bindEntityTexture(entityShield);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPushAttrib(GL_LIGHTING);
glDisable(GL_LIGHTING);
glDisable(GL_CULL_FACE);
glPushMatrix();
if (((EntityShield) entityShield).owner != null && !Minecraft.getMinecraft().thePlayer.getDisplayName().equals(((EntityShield) entityShield).owner.getDisplayName())) {
glTranslated(x, y, z);
}
glCallList(this.glCallList);
glPopMatrix();
glPopAttrib();
glDisable(GL12.GL_RESCALE_NORMAL);
}
@Override
protected ResourceLocation getEntityTexture(Entity texture) {
return shieldTexture;
}
}
@@ -1,4 +1,4 @@
package tombenpotter.emt.common.commands;
package emt.command;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
@@ -9,12 +9,13 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import thaumcraft.api.aspects.Aspect;
import tombenpotter.emt.common.util.EssentiasOutputs;
import tombenpotter.emt.common.util.TextHelper;
import java.util.Collection;
import java.util.List;
import emt.util.EMTEssentiasOutputs;
import emt.util.EMTTextHelper;
public class CommandOutputs extends CommandBase {
public String text;
@@ -50,13 +51,13 @@ public class CommandOutputs extends CommandBase {
@Override
public void processCommand(ICommandSender command, String[] astring) {
text = TextHelper.localize("gui.EMT.book.aspect.output.essentia.eu") + ": ";
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(EssentiasOutputs.outputs.get(aspect.getTag())) + "\n"));
String text2 = addStrings(text, (aspect.getTag() + ": " + String.valueOf(EMTEssentiasOutputs.outputs.get(aspect.getTag())) + "\n"));
text = text2;
}
addOutputsBook(TextHelper.localize("gui.EMT.book.aspect.output.eu.title"), text, command, astring);
addOutputsBook(EMTTextHelper.localize("gui.EMT.book.aspect.output.eu.title"), text, command, astring);
}
public void addOutputsBook(String title, String text, ICommandSender command, String[] astring) {
+119
View File
@@ -0,0 +1,119 @@
package emt.entity;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntitySnowman;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.IExtendedEntityProperties;
public class EntityArcher extends EntitySnowman implements IExtendedEntityProperties {
public EntityArcher(World world) {
super(world);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector));
this.tasks.addTask(4, new EntityAIWander(this, 0.30D));
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D);
}
@Override
public void onDeath(DamageSource damageSource) {
super.onDeath(damageSource);
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true);
this.setDead();
}
@Override
protected Item getDropItem() {
return Items.arrow;
}
@Override
protected void dropFewItems(boolean hitByPlayer, int levelOfLooting) {
int j;
int k;
j = this.rand.nextInt(3 + levelOfLooting);
for (k = 0; k < j; ++k) {
this.dropItem(Items.arrow, 1);
}
j = this.rand.nextInt(3 + levelOfLooting);
for (k = 0; k < j; ++k) {
this.dropItem(Items.bone, 1);
}
}
@Override
protected void dropRareDrop(int ch) {
this.entityDropItem(new ItemStack(Items.snowball, 1, 1), 0.0F);
}
protected void addRandomArmor() {
super.addRandomArmor();
this.setCurrentItemOrArmor(0, new ItemStack(Items.bow));
}
@Override
public void attackEntityWithRangedAttack(EntityLivingBase entity, float par2) {
EntityArrow entityarrow = new EntityArrow(this.worldObj, this, entity, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4));
int powerLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem());
int punchLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem());
entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F));
if (powerLevel > 0) {
entityarrow.setDamage(entityarrow.getDamage() + (double) powerLevel * 0.5D + 0.5D);
}
if (punchLevel > 0) {
entityarrow.setKnockbackStrength(punchLevel);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) {
entityarrow.setFire(100);
}
this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
this.worldObj.spawnEntityInWorld(entityarrow);
}
@Override
public void saveNBTData(NBTTagCompound compound) {
}
@Override
public void loadNBTData(NBTTagCompound compound) {
}
@Override
public void init(Entity entity, World world) {
}
}
@@ -0,0 +1,239 @@
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;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import thaumcraft.common.Thaumcraft;
public class EntityEnergyBall extends Entity implements IProjectile, IEntityAdditionalSpawnData {
public static final int RADIUS = 8;
public static final int MAX_TICKS_IN_TILE = 60;
public EntityLivingBase shootingEntity;
public boolean inTile = false;
public int ticksAlive = 1; /** Pls, don't ask me why 1 =) **/
public int ticksInAir = 1;
public double accelerationX = 0;
public double accelerationY = 0;
public double accelerationZ = 0;
public EntityEnergyBall(World world, EntityLivingBase shootingEntity, double rotX, double rotY, double rotZ) {
this(world, shootingEntity);
rotX += this.rand.nextGaussian() * 0.4D;
rotY += this.rand.nextGaussian() * 0.4D;
rotZ += this.rand.nextGaussian() * 0.4D;
double len = (double) MathHelper.sqrt_double((rotX * rotX) + (rotY * rotY) + (rotZ * rotZ));
this.accelerationX = rotX / len * 0.1D;
this.accelerationY = rotY / len * 0.1D;
this.accelerationZ = rotZ / len * 0.1D;
}
public EntityEnergyBall(World world, EntityLivingBase shootingEntity) {
this(world);
this.shootingEntity = shootingEntity;
this.setLocationAndAngles(shootingEntity.posX, shootingEntity.posY + shootingEntity.getEyeHeight(), shootingEntity.posZ, shootingEntity.rotationYaw, shootingEntity.rotationPitch);
}
public EntityEnergyBall(World world) {
super(world);
this.setSize(1.0F, 1.0F);
this.ignoreFrustumCheck = true;
this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F;
this.motionX = this.motionY = this.motionZ = 0.0D;
}
@Override
public void writeSpawnData(ByteBuf buffer) {
buffer.writeDouble(accelerationX);
buffer.writeDouble(accelerationY);
buffer.writeDouble(accelerationZ);
}
@Override
public void readSpawnData(ByteBuf buffer) {
accelerationX = buffer.readDouble();
accelerationY = buffer.readDouble();
accelerationZ = buffer.readDouble();
}
@Override
public void onUpdate() {
super.onUpdate();
/** If in Tile **/
if (this.inTile) {
this.ticksAlive++;
if (this.ticksAlive >= MAX_TICKS_IN_TILE) {
this.setDead();
}
/** Generating Coords for every Entity **/
ArrayList<Entity> entities = new ArrayList();
int chunkSize = ((RADIUS - 1) >> 4) + 2;
for (int chX = -chunkSize; chX < chunkSize; chX++) {
for (int chZ = -chunkSize; chZ < chunkSize; chZ++) {
Chunk chunk = worldObj.getChunkFromChunkCoords(chX + (int) (this.posX / 16), chZ + (int) (this.posZ / 16));
if (chunk.isChunkLoaded && chunk.hasEntities) {
for (int i = 0; i < chunk.entityLists.length; i++) {
for (int k = 0; k < chunk.entityLists[i].size(); k++) {
Entity entity = (Entity) chunk.entityLists[i].get(k);
double width = entity.posX - this.posX;
double height = entity.posY - this.posY;
double length = entity.posZ - this.posZ;
double hyp = MathHelper.sqrt_double((width * width) + (length * length) + (height * height));
if (hyp <= RADIUS) {
entities.add(entity);
/** Closer - Harder */
entity.attackEntityFrom(DamageSource.magic, (float) (RADIUS - hyp));
if(worldObj.isRemote) {
Thaumcraft.proxy.bolt(worldObj, this, entity);
}
}
}
}
}
}
}
/************************************************************************/
}
/** If not in Tile **/
else {
/** Collision detection **/
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3next = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition mop = this.worldObj.rayTraceBlocks(vec3, vec3next);
this.ticksInAir++;
if (mop != null) {
inTile = true;
}
/** Updating position */
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F;
for (this.rotationPitch = (float) (Math.atan2((double) f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
double factor = this.getMotionFactor();
this.motionX += this.accelerationX;
this.motionY += this.accelerationY;
this.motionZ += this.accelerationZ;
this.motionX *= factor;
this.motionY *= factor;
this.motionZ *= factor;
this.setPosition(this.posX, this.posY, this.posZ);
/************************************************************************/
}
for(int i = 0; i < 3 && worldObj.isRemote; i ++) {
float rndX = (float) ((((worldObj.rand.nextFloat() - 0.5f) * 2) * (RADIUS - 4)) + posX);
float rndY = (float) ((((worldObj.rand.nextFloat() - 0.5f) * 2) * (RADIUS - 4)) + posY);
float rndZ = (float) ((((worldObj.rand.nextFloat() - 0.5f) * 2) * (RADIUS - 4)) + posZ);
Thaumcraft.proxy.nodeBolt(worldObj, (float)posX, (float)posY, (float)posZ, rndX, rndY, rndZ);
}
}
protected float getMotionFactor() {
return 0.85F;
}
@Override
public boolean canBeCollidedWith() {
return true;
}
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_) {
return 240;
}
@SideOnly(Side.CLIENT)
@Override
public boolean isInRangeToRender3d(double x, double y, double z) {
return true;
}
@Override
protected void entityInit() {
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setByte("inTile", (byte) (this.inTile ? 1 : 0));
nbt.setTag("direction", this.newDoubleNBTList(new double[] { this.motionX, this.motionY, this.motionZ }));
}
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
if (!inTile) {
this.inTile = nbt.getByte("inTile") == 1;
}
if (nbt.hasKey("direction", 9)) {
NBTTagList nbttaglist = nbt.getTagList("direction", 6);
this.motionX = nbttaglist.func_150309_d(0);
this.motionY = nbttaglist.func_150309_d(1);
this.motionZ = nbttaglist.func_150309_d(2);
}
else {
this.setDead();
}
}
@Override
public void setThrowableHeading(double x, double y, double z, float p1, float p2) {
}
}
+291
View File
@@ -0,0 +1,291 @@
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;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import java.util.List;
public class EntityLaser extends Entity implements IThrowableEntity, IProjectile {
private Block inTile;
public Entity shootingEntity;
private int xTile;
private int yTile;
private int zTile;
private int meta;
private boolean inGround = false;
private int ticksInGround;
private int ticksInAir;
private float explosionStrength = 2f;
public EntityLaser(World world) {
super(world);
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
}
public EntityLaser(World world, EntityLivingBase entity, float speed) {
super(world);
this.renderDistanceWeight = 10.0D;
this.shootingEntity = entity;
this.setSize(0.5F, 0.5F);
this.setLocationAndAngles(entity.posX, entity.posY + (double) entity.getEyeHeight(), entity.posZ, entity.rotationYaw, entity.rotationPitch);
this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
this.posY -= 0.10000000149011612D;
this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
this.yOffset = 0.0F;
this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, speed, 1.0F);
}
public void setExplosionStrengthModifier(float f) {
explosionStrength = f;
}
@Override
protected void entityInit() {
}
@Override
public void setThrowableHeading(double x, double y, double z, float speed, float scale) {
this.motionX = x * speed;
this.motionY = y * speed;
this.motionZ = z * speed;
this.ticksInGround = 0;
}
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double x, double y, double z, float rotX, float rotY, int rotZ) {
this.setPosition(x, y, z);
this.setRotation(rotX, rotY);
}
@SideOnly(Side.CLIENT)
@Override
public void setVelocity(double velX, double velY, double velZ) {
this.motionX = velX;
this.motionY = velY;
this.motionZ = velZ;
}
@Override
public void onUpdate() {
super.onUpdate();
Block block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
if (block.getMaterial() != Material.air) {
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
this.inGround = true;
}
}
block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) {
this.inGround = true;
}
if (this.inGround) {
int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(this, (int) this.posX, (int) this.posY, (int) this.posZ, explosionStrength, true);
this.setDead();
}
if (block == this.inTile && k == this.meta) {
++this.ticksInGround;
if (this.ticksInGround == 1200) {
this.setDead();
}
}
else {
this.inGround = false;
this.motionX *= (double) (this.rand.nextFloat() * 0.2F);
this.motionY *= (double) (this.rand.nextFloat() * 0.2F);
this.motionZ *= (double) (this.rand.nextFloat() * 0.2F);
this.ticksInGround = 0;
this.ticksInAir = 0;
}
}
else {
++this.ticksInAir;
Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
Vec3 vec3next = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec3, vec3next, false, true, false);
vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
vec3next = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if (movingobjectposition != null) {
vec3next = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
}
Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
int l;
float down;
for (l = 0; l < list.size(); ++l) {
Entity entity1 = (Entity) list.get(l);
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
down = 0.3F;
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double) down, (double) down, (double) down);
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3next, vec3);
if (movingobjectposition1 != null) {
double d1 = vec3next.distanceTo(movingobjectposition1.hitVec);
if (d1 < d0 || d0 == 0.0D) {
entity = entity1;
d0 = d1;
}
}
}
}
if (entity != null) {
movingobjectposition = new MovingObjectPosition(entity);
}
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) {
EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit;
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) {
movingobjectposition = null;
}
}
float f2;
float f3;
if (movingobjectposition != null) {
if (movingobjectposition.entityHit != null) {
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(this, (int) this.posX, (int) this.posY, (int) this.posZ, explosionStrength, true);
this.setDead();
}
}
else {
this.xTile = movingobjectposition.blockX;
this.yTile = movingobjectposition.blockY;
this.zTile = movingobjectposition.blockZ;
this.inTile = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
this.meta = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);
this.motionX = movingobjectposition.hitVec.xCoord - this.posX;
this.motionY = movingobjectposition.hitVec.yCoord - this.posY;
this.motionZ = movingobjectposition.hitVec.zCoord - this.posZ;
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
this.posX -= this.motionX / (double) f2 * 0.05000000074505806D;
this.posY -= this.motionY / (double) f2 * 0.05000000074505806D;
this.posZ -= this.motionZ / (double) f2 * 0.05000000074505806D;
this.inGround = true;
}
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F);
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F) {
this.prevRotationYaw += 360.0F;
}
if (this.isInWater()) {
for (int j1 = 0; j1 < 4; ++j1) {
f3 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double) f3, this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, this.motionX, this.motionY, this.motionZ);
}
}
this.setPosition(this.posX, this.posY, this.posZ);
}
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setShort("xTile", (short) this.xTile);
nbt.setShort("yTile", (short) this.yTile);
nbt.setShort("zTile", (short) this.zTile);
nbt.setShort("inTile", (short) Block.getIdFromBlock(this.inTile));
nbt.setByte("inData", (byte) this.meta);
nbt.setBoolean("inGround", this.inGround);
nbt.setFloat("explosionStrength", this.explosionStrength);
}
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
this.xTile = nbt.getShort("xTile");
this.yTile = nbt.getShort("yTile");
this.zTile = nbt.getShort("zTile");
this.inTile = Block.getBlockById(nbt.getShort("inTile"));
this.meta = nbt.getByte("inData") & 255;
this.inGround = nbt.getBoolean("inGround");
this.explosionStrength = nbt.getFloat("explosionStrength");
}
public void onCollide(Entity entity) {
if (!this.worldObj.isRemote) {
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, explosionStrength, true);
}
}
@SideOnly(Side.CLIENT)
@Override
public float getShadowSize() {
return 0.0F;
}
@Override
public Entity getThrower() {
return shootingEntity;
}
@Override
public void setThrower(Entity entity) {
shootingEntity = entity;
}
}
+115
View File
@@ -0,0 +1,115 @@
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 {
public EntityPlayer owner;
public boolean needCheck = true;
public EntityShield(World world) {
super(world);
this.ignoreFrustumCheck = true;
}
public EntityShield(World world, EntityPlayer player) {
super(world);
this.setSize(4, 4);
owner = player;
this.dataWatcher.updateObject(11, owner.getDisplayName());
this.setPosition(player.posX, player.posY, player.posZ);
this.ignoreFrustumCheck = true;
}
@Override
protected void entityInit() {
this.dataWatcher.addObject(11, "");
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
}
@Override
public AxisAlignedBB getBoundingBox() {
return this.boundingBox;
}
@Override
public boolean canBePushed() {
return true;
}
@Override
public boolean canBeCollidedWith() {
return true;
}
@Override
public void setPosition(double x, double y, double z) {
this.posX = x;
this.posY = y + 0.5f;
this.posZ = z;
float f = this.width / 2.0F;
float f1 = this.height;
this.boundingBox.setBounds(x - (double) f, y - (double) this.yOffset - 2 + (double) this.ySize, z - (double) f, x + (double) f, y - (double) this.yOffset - 2 + (double) this.ySize + (double) f1, z + (double) f);
}
@Override
public void onUpdate() {
super.onUpdate();
if (needCheck && owner == null) {
owner = this.worldObj.getPlayerEntityByName(dataWatcher.getWatchableObjectString(11));
needCheck = false;
}
if (!needCheck && owner == null) {
this.setDead();
return;
}
if (!this.worldObj.isRemote && owner != null) {
this.setPosition(owner.posX, owner.posY, owner.posZ);
if (!owner.isUsingItem()) {
this.setDead();
}
}
}
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_) {
return 240;
}
public void applyEntityCollision(Entity entity) {
if (entity.riddenByEntity != this && entity.ridingEntity != this) {
double ePosX = entity.posX - this.posX;
double ePosZ = entity.posZ - this.posZ;
entity.addVelocity(ePosX / 5D, 0.0D, ePosZ / 5D);
}
}
@SideOnly(Side.CLIENT)
@Override
public boolean isInRangeToRender3d(double x, double y, double z) {
return true;
}
}
+72
View File
@@ -0,0 +1,72 @@
package emt.init;
import cpw.mods.fml.common.registry.GameRegistry;
import emt.block.BlockElectricCloud;
import emt.block.BlockEssentiaGenerators;
import emt.block.BlockMachines;
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;
public class EMTBlocks {
public static Block portableNode, essentiaGens, shield, emtSolars, emtMachines, emtSolars2, electricCloud;
public static void registerBlocks() {
portableNode = new BlockPortableNode("portablenode");
GameRegistry.registerBlock(portableNode, "PortableNode");
shield = new BlockShield("shield");
GameRegistry.registerBlock(shield, "ShieldBlock");
emtSolars = new BlockSolars("solar", 16, 0);
GameRegistry.registerBlock(emtSolars, ItemBlockSolars.class, "EMTSolars");
emtSolars2 = new BlockSolars("solar2", 5, 1);
GameRegistry.registerBlock(emtSolars2, ItemBlockSolars.class, "EMTSolars2");
emtMachines = new BlockMachines("machine");
GameRegistry.registerBlock(emtMachines, ItemBlockMachines.class, "EMTMachines");
essentiaGens = new BlockEssentiaGenerators("essentia");
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
electricCloud = new BlockElectricCloud("electricCloud");
GameRegistry.registerBlock(electricCloud, ItemBlockElectricCloud.class, "electricCloud");
}
public static void addAspects() {
registerObjectTag(IC2Items.getItem("rubberTrampoline"), new AspectList().add(Aspect.AIR, 5));
registerObjectTag(IC2Items.getItem("ironFence"), new AspectList().add(Aspect.ENERGY, 1).add(Aspect.METAL, 2).add(Aspect.WEATHER, 1));
registerObjectTag(IC2Items.getItem("reinforcedGlass"), new AspectList().add(Aspect.METAL, 2).add(Aspect.COLD, 2));
registerObjectTag(IC2Items.getItem("scaffold"), new AspectList().add(Aspect.TREE, 4));
registerObjectTag(IC2Items.getItem("ironScaffold"), new AspectList().add(Aspect.METAL, 4));
registerObjectTag(IC2Items.getItem("generator"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("waterMill"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.WATER, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("solarPanel"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 1).add(Aspect.LIGHT, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("windMill"), new AspectList().add(Aspect.ENERGY, 1).add(Aspect.WEATHER, 3).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("batBox"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 3).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("cesuUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 4).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("mfeUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("mfsUnit"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 7).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("ironFurnace"), new AspectList().add(Aspect.METAL, 2).add(Aspect.FIRE, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("electroFurnace"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.FIRE, 3).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("macerator"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.MINE, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("extractor"), new AspectList().add(Aspect.METAL, 2).add(Aspect.ENERGY, 1).add(Aspect.CRAFT, 2).add(Aspect.MECHANISM, 1));
registerObjectTag(IC2Items.getItem("compressor"), new AspectList().add(Aspect.METAL, 1).add(Aspect.ENERGY, 2).add(Aspect.VOID, 3).add(Aspect.MECHANISM, 1));
}
}
+41
View File
@@ -0,0 +1,41 @@
package emt.init;
import cpw.mods.fml.common.registry.EntityRegistry;
import emt.EMT;
import emt.entity.EntityArcher;
import emt.entity.EntityEnergyBall;
import emt.entity.EntityLaser;
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 {
private static int startEID = 300;
private static int entityIDs = 0;
private static int getUniqueEntityID() {
do {
startEID++;
}
while (EntityList.getStringFromID(startEID) != null);
return startEID;
}
public static void registerEntityEgg(Class<? extends Entity> entity, int colPrim, int colSec) {
int id = getUniqueEntityID();
EntityList.IDtoClassMapping.put(id, entity);
EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec));
return;
}
public static void registerEMTEntities() {
EntityRegistry.registerModEntity(EntityLaser.class, "laser", entityIDs++, EMT.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityArcher.class, "archer", entityIDs++, EMT.instance, 80, 3, true);
registerEntityEgg(EntityArcher.class, 0x99111F, 0xE5685);
EntityRegistry.registerModEntity(EntityShield.class, "shield", entityIDs++, EMT.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityEnergyBall.class, "energyBall", entityIDs++, EMT.instance, 80, 60, true);
}
}
+194
View File
@@ -0,0 +1,194 @@
package emt.init;
import ic2.core.init.InternalName;
import cpw.mods.fml.common.registry.GameRegistry;
import emt.EMT;
import emt.item.ItemElectricScribingTools;
import emt.item.ItemIC2Baubles;
import emt.item.ItemMaterials;
import emt.item.ItemOneRing;
import emt.item.armor.boots.ItemElectricBootsTraveller;
import emt.item.armor.boots.ItemNanoBootsTraveller;
import emt.item.armor.boots.ItemQuantumBootsTraveller;
import emt.item.armor.chestplate.ItemInfusedQuantumChestplate;
import emt.item.armor.goggles.ItemElectricGoggles;
import emt.item.armor.goggles.ItemNanoGoggles;
import emt.item.armor.goggles.ItemQuantumGoggles;
import emt.item.armor.goggles.ItemSolarHelmetRevealing;
import emt.item.armor.wings.ItemFeatherWing;
import emt.item.armor.wings.ItemNanoWing;
import emt.item.armor.wings.ItemQuantumWing;
import emt.item.armor.wings.ItemThaumiumReinforcedWing;
import emt.item.focus.ItemChargeFocus;
import emt.item.focus.ItemChristmasFocus;
import emt.item.focus.ItemExplosionFocus;
import emt.item.focus.ItemEnergyBallFocus;
import emt.item.focus.ItemShieldFocus;
import emt.item.focus.ItemWandChargingFocus;
import emt.item.tool.ItemElectricHoeGrowth;
import emt.item.tool.ItemElectricThorHammer;
import emt.item.tool.ItemThorHammer;
import emt.item.tool.ItemThorHammerBroken;
import emt.item.tool.chainsaw.ItemDiamondChainsaw;
import emt.item.tool.chainsaw.ItemStreamChainsaw;
import emt.item.tool.chainsaw.ItemThaumiumChainsaw;
import emt.item.tool.drill.ItemRockbreakerDrill;
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;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApi;
public class EMTItems {
public static Item onering;
public static Item materials;
public static Item craftingComponents;
public static Item focusChristmas;
public static Item thaumiumDrill;
public static Item thaumiumChainsaw;
public static Item quantumThaumicHelmet;
public static Item diamondChainsaw;
public static Item ironOmnitool;
public static Item diamondOmnitool;
public static Item thaumiumOmnitool;
public static Item nanoThaumicHelmet;
public static Item explosionFocus;
public static Item christmasFocus;
public static Item shieldFocus;
public static Item energyBallFocus;
public static Item electricGoggles;
public static Item streamChainsaw;
public static Item rockbreakerDrill;
public static Item solarHelmetRevealing;
public static Item thorHammer;
public static Item taintedThorHammer;
public static Item electricThorHammer;
public static Item electricBootsTraveller;
public static Item quantumBootsTraveller;
public static Item nanoBootsTraveller;
public static Item electricScribingTools;
public static Item itemEMTItems;
public static Item electricHoeGrowth;
public static Item chargeFocus;
public static Item emtBauble;
public static Item wandChargeFocus;
public static Item featherWing;
public static Item thaumiumWing;
public static Item nanoWing;
public static Item quantumWing;
public static Item quantumArmor;
public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper.addArmorMaterial("FEATEHRWiNG", 1, new int[] { 2, 2, 2, 2 }, 6);
public static void registerItems() {
itemEMTItems = new ItemMaterials();
GameRegistry.registerItem(itemEMTItems, "EMTItems");
OreDictionary.registerOre("plateThaumium", new ItemStack(itemEMTItems, 1, 5));
OreDictionary.registerOre("slimeball", new ItemStack(itemEMTItems, 1, 8));
emtBauble = new ItemIC2Baubles().setUnlocalizedName(EMT.MOD_ID + ".bauble");
GameRegistry.registerItem(emtBauble, "EMTBaubles");
onering = new ItemOneRing();
GameRegistry.registerItem(onering, "BaseBaubles");
quantumArmor = new ItemInfusedQuantumChestplate(InternalName.itemArmorQuantumChestplate, 1).setUnlocalizedName(EMT.MOD_ID + ".quantum");
electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0).setUnlocalizedName(EMT.MOD_ID + ".goggles.electric");
GameRegistry.registerItem(electricGoggles, "ElectricGogglesRevealing");
nanoThaumicHelmet = new ItemNanoGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(EMT.MOD_ID + ".goggles.nano");
GameRegistry.registerItem(nanoThaumicHelmet, "NanosuitGogglesRevealing");
quantumThaumicHelmet = new ItemQuantumGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(EMT.MOD_ID + ".goggles.quantum");
GameRegistry.registerItem(quantumThaumicHelmet, "QuantumGogglesRevealing");
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");
GameRegistry.registerItem(electricBootsTraveller, "ElectricBootsTraveller");
nanoBootsTraveller = new ItemNanoBootsTraveller(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");
GameRegistry.registerItem(quantumBootsTraveller, "QuantumBootsTraveller");
electricScribingTools = new ItemElectricScribingTools().setUnlocalizedName(EMT.MOD_ID + ".scribingtools.electric");
GameRegistry.registerItem(electricScribingTools, "ElectricScribingTools");
featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.feather");
GameRegistry.registerItem(featherWing, "FeatherWing");
thaumiumWing = new ItemThaumiumReinforcedWing(ThaumcraftApi.armorMatThaumium, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.thaumium");
GameRegistry.registerItem(thaumiumWing, "ThaumiumWing");
nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.nano");
GameRegistry.registerItem(nanoWing, "NanosuitWing");
quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(EMT.MOD_ID + ".wing.quantum");
GameRegistry.registerItem(quantumWing, "QuantumWing");
thorHammer = new ItemThorHammer().setUnlocalizedName(EMT.MOD_ID + ".hammer");
GameRegistry.registerItem(thorHammer, "Mjolnir");
taintedThorHammer = new ItemThorHammerBroken().setUnlocalizedName(EMT.MOD_ID + ".hammer.broken");
GameRegistry.registerItem(taintedThorHammer, "TaintedMjolnir");
electricThorHammer = new ItemElectricThorHammer().setUnlocalizedName(EMT.MOD_ID + ".hammer.electric");
GameRegistry.registerItem(electricThorHammer, "SuperchargedMjolnir");
thaumiumDrill = new ItemThaumiumDrill().setUnlocalizedName(EMT.MOD_ID + ".drill.thaumium");
GameRegistry.registerItem(thaumiumDrill, "ThaumiumDrill");
diamondChainsaw = new ItemDiamondChainsaw().setUnlocalizedName(EMT.MOD_ID + ".chainsaw.diamond");
GameRegistry.registerItem(diamondChainsaw, "DiamondChainsaw");
thaumiumChainsaw = new ItemThaumiumChainsaw().setUnlocalizedName(EMT.MOD_ID + ".chainsaw.thaumium");
GameRegistry.registerItem(thaumiumChainsaw, "ThaumiumChainsaw");
ironOmnitool = new ItemOmnitoolIron().setUnlocalizedName(EMT.MOD_ID + ".omnitool.iron");
GameRegistry.registerItem(ironOmnitool, "Omnitool");
diamondOmnitool = new ItemOmnitoolDiamond().setUnlocalizedName(EMT.MOD_ID + ".omnitool.diamond");
GameRegistry.registerItem(diamondOmnitool, "Diamond Omnitool");
thaumiumOmnitool = new ItemOmnitoolThaumium().setUnlocalizedName(EMT.MOD_ID + ".omnitool.thaumium");
GameRegistry.registerItem(thaumiumOmnitool, "ThaumiumOmnitool");
streamChainsaw = new ItemStreamChainsaw().setUnlocalizedName(EMT.MOD_ID + ".chainsaw.stream");
GameRegistry.registerItem(streamChainsaw, "ChainsawStream");
rockbreakerDrill = new ItemRockbreakerDrill().setUnlocalizedName(EMT.MOD_ID + ".drill.rockbreaker");
GameRegistry.registerItem(rockbreakerDrill, "DrillRockbreaker");
electricHoeGrowth = new ItemElectricHoeGrowth().setUnlocalizedName(EMT.MOD_ID + ".hoeofgrowth.electric");
GameRegistry.registerItem(electricHoeGrowth, "ElectricHoeGrowth");
explosionFocus = new ItemExplosionFocus();
GameRegistry.registerItem(explosionFocus, "ExplosionFocus");
christmasFocus = new ItemChristmasFocus();
GameRegistry.registerItem(christmasFocus, "ChristmasFocus");
shieldFocus = new ItemShieldFocus();
GameRegistry.registerItem(shieldFocus, "ShieldFocus");
chargeFocus = new ItemChargeFocus();
GameRegistry.registerItem(chargeFocus, "ChargingFocus");
wandChargeFocus = new ItemWandChargingFocus();
GameRegistry.registerItem(wandChargeFocus, "WandChargingFocus");
energyBallFocus = new ItemEnergyBallFocus();
GameRegistry.registerItem(energyBallFocus, "EnergyBallFocus");
}
}
+501
View File
@@ -0,0 +1,501 @@
package emt.init;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import emt.EMT;
import emt.util.EMTConfigHandler;
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;
import java.util.Iterator;
public class EMTRecipes {
public static ItemStack uuMCell = new ItemStack(EMTItems.itemEMTItems, 1, 15);
private static void registerShapedRecipes() {
/** Crafting Recipes **/
ironOmnitool = GameRegistry.addShapedRecipe(getChargedItem(EMTItems.ironOmnitool, 10), "X", "Z", "Y", 'X', new ItemStack(IC2Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', new ItemStack(IC2Items.getItem("miningDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', IC2Items.getItem("plateiron"));
diamondChainsaw = GameRegistry.addShapedRecipe(getChargedItem(EMTItems.diamondChainsaw, 10), " X ", "XYX", 'X', new ItemStack(Items.diamond), 'Y', new ItemStack(IC2Items.getItem("chainsaw").getItem(), 1, OreDictionary.WILDCARD_VALUE));
ductTape = GameRegistry.addShapedRecipe(new ItemStack(EMTItems.itemEMTItems, 1, 9), "XXX", "YYY", "XXX", 'X', new ItemStack(EMTItems.itemEMTItems, 1, 8), 'Y', new ItemStack(Items.paper));
featherMesh = GameRegistry.addShapedRecipe(new ItemStack(EMTItems.itemEMTItems, 1, 7), "XYX", "YXY", "XYX", 'X', new ItemStack(Items.feather), 'Y', new ItemStack(EMTItems.itemEMTItems, 1, 9));
featherWing = GameRegistry.addShapedRecipe(new ItemStack(EMTItems.itemEMTItems, 1, 12), "XYZ", "XYZ", "XYZ", 'X', new ItemStack(EMTItems.itemEMTItems, 1, 7), 'Y', new ItemStack(EMTItems.itemEMTItems, 1, 8), 'Z', new ItemStack(EMTItems.itemEMTItems, 1, 11));
featherWings = GameRegistry.addShapedRecipe(new ItemStack(EMTItems.featherWing), "XX", 'X', new ItemStack(EMTItems.itemEMTItems, 1, 12));
taintedFeathers = GameRegistry.addShapedRecipe(new ItemStack(EMTItems.itemEMTItems, 1, 13), " X ", "XYX", " X ", 'X', new ItemStack(ConfigItems.itemResource, 1, 12), 'Y', new ItemStack(Items.feather));
GameRegistry.addRecipe(IC2Items.getItem("nanoHelmet"), "XYX", "XZX", 'X', IC2Items.getItem("carbonPlate"), 'Y', new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(IC2Items.getItem("nightvisionGoggles").getItem(), 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addShapedRecipe(IC2Items.getItem("generator"), "X", "Y", "Z", 'X', new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Y', IC2Items.getItem("machine"), 'Z', new ItemStack(Blocks.furnace));
GameRegistry.addShapedRecipe(IC2Items.getItem("generator"), "X", "Y", "Z", 'X', IC2Items.getItem("reBattery"), 'Y', IC2Items.getItem("machine"), 'Z', new ItemStack(Blocks.furnace));
/** OreDict Crafting Recipes **/
for (int i = 0; i < OreDictionary.getOres("logWood").size(); i++) {
cardboard = GameRegistry.addShapedRecipe(new ItemStack(EMTItems.itemEMTItems, 1, 11), "XXX", "YYY", "XXX", 'X', new ItemStack(Items.paper), 'Y', OreDictionary.getOres("logWood").get(i));
}
for (int i = 0; i < OreDictionary.getOres("itemRubber").size(); i++) {
rubberBall = GameRegistry.addShapedRecipe(new ItemStack(EMTItems.itemEMTItems, 1, 10), "XX", "XX", 'X', OreDictionary.getOres("itemRubber").get(i));
}
/** Smelting Recipes **/
GameRegistry.addSmelting(new ItemStack(EMTItems.itemEMTItems, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
GameRegistry.addSmelting(new ItemStack(EMTItems.itemEMTItems, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 6), 0.0F);
GameRegistry.addSmelting(new ItemStack(EMTItems.itemEMTItems, 1, 3), new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
GameRegistry.addSmelting(new ItemStack(EMTItems.itemEMTItems, 1, 4), new ItemStack(ConfigItems.itemResource, 1, 3), 0.0F);
GameRegistry.addSmelting(new ItemStack(EMTItems.itemEMTItems, 1, 10), new ItemStack(EMTItems.itemEMTItems, 2, 8), 0.0F);
}
private static void registerShaplessRecipes() {
}
private static void registerSmeltingRecipes() {
}
public static void registerEarlyRecipes() {
registerShapedRecipes();
registerShaplessRecipes();
registerSmeltingRecipes();
}
public static void registerUUMInfusionRecipes() {
ItemStack iridium = IC2Items.getItem("iridiumOre").copy();
iridium.stackSize = 2;
uraniumToIridium = addInfusionCraftingRecipe("UU-Matter Infusion", iridium, 4, EMTCraftingAspects.uuMatterInfusions, IC2Items.getItem("Uran238"), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell });
ItemStack uranium = IC2Items.getItem("Uran238").copy();
uranium.stackSize = 2;
diamondToUranium = addInfusionCraftingRecipe("UU-Matter Infusion", uranium, 4, EMTCraftingAspects.lesserUUMInfusions, new ItemStack(Items.diamond), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell, uuMCell });
ItemStack diamond = new ItemStack(Items.diamond).copy();
diamond.stackSize = 1;
goldToDiamond = addInfusionCraftingRecipe("UU-Matter Infusion", diamond, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(Items.gold_ingot), new ItemStack[] { uuMCell, uuMCell, uuMCell, uuMCell });
ItemStack gold = new ItemStack(Items.gold_ingot).copy();
gold.stackSize = 2;
ironToGold = addInfusionCraftingRecipe("UU-Matter Infusion", gold, 4, EMTCraftingAspects.cheapestUUMInfusions, new ItemStack(Items.iron_ingot), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack ironOre = new ItemStack(Blocks.iron_ore).copy();
ironOre.stackSize = 16;
stoneBricksToIronOre = addInfusionCraftingRecipe("UU-Matter Infusion", ironOre, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(Blocks.stonebrick), new ItemStack[] { uuMCell, uuMCell });
/**
* ItemStack copperOre = Items.getItem("copperOre").copy(); BUGGED IN
* 1.6 IF IC2 OREGEN IS DISABLED
**/
ItemStack copperOre = IC2Items.getItem("crushedCopperOre").copy();
copperOre.stackSize = 32;
arcaneStoneToCopperOre = addInfusionCraftingRecipe("UU-Matter Infusion", copperOre, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), new ItemStack[] { uuMCell, uuMCell });
/**
* ItemStack tinOre = Items.getItem("tinOre").copy(); BUGGED IN 1.6 IF
* IC2 OREGEN IS DISABLED
**/
ItemStack tinOre = IC2Items.getItem("crushedTinOre").copy();
tinOre.stackSize = 32;
arcaneStoneBricksToTinOre = addInfusionCraftingRecipe("UU-Matter Infusion", tinOre, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 7), new ItemStack[] { uuMCell, uuMCell });
/**
* ItemStack leadOre = Items.getItem("leadOre").copy(); BUGGED IN 1.6 IF
* IC2 OREGEN IS DISABLED
**/
ItemStack leadOre = IC2Items.getItem("crushedLeadOre").copy();
leadOre.stackSize = 32;
amberBlockToLeadOre = addInfusionCraftingRecipe("UU-Matter Infusion", leadOre, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 0), new ItemStack[] { uuMCell, uuMCell });
ItemStack uraniumOre = IC2Items.getItem("uraniumOre").copy();
uraniumOre.stackSize = 8;
amberBricksToUraniumOre = addInfusionCraftingRecipe("UU-Matter Infusion", uraniumOre, 4, EMTCraftingAspects.lesserUUMInfusions, new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 1), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack coal = new ItemStack(Items.coal, 1, 0).copy();
coal.stackSize = 16;
charcoalToCoal = addInfusionCraftingRecipe("UU-Matter Infusion", coal, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(Items.coal, 1, 1), new ItemStack[] { uuMCell, uuMCell });
ItemStack stickyResin = IC2Items.getItem("resin").copy();
stickyResin.stackSize = 21;
shardToResin = addInfusionCraftingRecipe("UU-Matter Infusion", stickyResin, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack redstone = new ItemStack(Items.redstone).copy();
redstone.stackSize = 24;
shardToRedstone = addInfusionCraftingRecipe("UU-Matter Infusion", redstone, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack lapisLazuli = new ItemStack(Items.dye, 1, 4).copy();
lapisLazuli.stackSize = 8;
shardToLapis = addInfusionCraftingRecipe("UU-Matter Infusion", lapisLazuli, 4, EMTCraftingAspects.cheapUUMInfusions, new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { uuMCell, uuMCell, uuMCell });
ItemStack glowstone = new ItemStack(Blocks.glowstone).copy();
glowstone.stackSize = 1;
glowstoneDustToBlock = addInfusionCraftingRecipe("UU-Matter Infusion", glowstone, 4, EMTCraftingAspects.cheapestUUMInfusions, new ItemStack(Items.glowstone_dust), new ItemStack[] { uuMCell });
}
public static void registerLateRecipes() {
/** Infusion Recipes **/
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") });
thaumiumChainsaw = addInfusionCraftingRecipe("Thaumium Chainsaw", getChargedItem(EMTItems.thaumiumChainsaw, 10), 5, EMTCraftingAspects.thaumiumChainsawCrafting, new ItemStack(EMTItems.diamondChainsaw, 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") });
thaumicQuantumHelmet = addInfusionCraftingRecipe("Quantum Goggles of Revealing", getChargedItem(EMTItems.quantumThaumicHelmet, 10), 6, EMTCraftingAspects.thaumicQuantumHelmetCrafting, new ItemStack(EMTItems.nanoThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.milk_bucket), new ItemStack(IC2Items.getItem("quantumHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(EMTItems.itemEMTItems, 1, 5), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("advancedCircuit") });
thaumicNanoHelmet = addInfusionCraftingRecipe("Nanosuit Goggles of Revealing", getChargedItem(EMTItems.nanoThaumicHelmet, 10), 5, EMTCraftingAspects.thaumicNanoHelmetCrafting, new ItemStack(EMTItems.electricGoggles, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(Items.gold_ingot), new ItemStack(IC2Items.getItem("nanoHelmet").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(EMTItems.itemEMTItems, 1, 5), IC2Items.getItem("carbonPlate"), IC2Items.getItem("electronicCircuit") });
thaumiumOmnitool = addInfusionCraftingRecipe("Thaumium Omnitool", getChargedItem(EMTItems.thaumiumOmnitool, 10), 6, EMTCraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(EMTItems.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(EMTItems.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(EMTItems.itemEMTItems, 1, 5), IC2Items.getItem("carbonPlate"), IC2Items.getItem("plateobsidian") });
diamondOmnitoolToThaumium = addInfusionCraftingRecipe("Thaumium Omnitool", new ItemStack(EMTItems.thaumiumOmnitool), 6, EMTCraftingAspects.thaumiumOmnitoolCrafting, new ItemStack(EMTItems.diamondOmnitool, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(Blocks.diamond_block), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("carbonPlate"), IC2Items.getItem("advancedCircuit") });
explosionFocus = addInfusionCraftingRecipe("Explosion Focus", new ItemStack(EMTItems.explosionFocus), 6, EMTCraftingAspects.laserFocusCrafting, new ItemStack(ConfigItems.itemFocusHellbat, 1),
new ItemStack[] { new ItemStack(IC2Items.getItem("miningLaser").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.arrow), new ItemStack(Items.gunpowder), new ItemStack(Items.firework_charge), new ItemStack(ConfigItems.itemResource, 1, 1) });
shieldFocus = addInfusionCraftingRecipe("Shield Focus", new ItemStack(EMTItems.shieldFocus), 4, EMTCraftingAspects.shieldFocusCrafting, new ItemStack(ConfigItems.itemFocusPortableHole, 1),
new ItemStack[] { IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("reinforcedGlass"), new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.obsidian), new ItemStack(Blocks.obsidian) });
potentiaGenerator = addInfusionCraftingRecipe("Potentia Generator", new ItemStack(EMTBlocks.essentiaGens, 1, 0), 6, EMTCraftingAspects.potentiaGeneratorCrafting, IC2Items.getItem("semifluidGenerator"),
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(ConfigItems.itemFocusTrade), new ItemStack(Blocks.hopper), new ItemStack(ConfigBlocks.blockJar), IC2Items.getItem("mvTransformer"), IC2Items.getItem("advancedMachine"), IC2Items.getItem("orewashingplant"), IC2Items.getItem("scrap") });
streamChainsaw = addInfusionCraftingRecipe("Chainsaw of the Stream", getChargedItem(EMTItems.streamChainsaw, 10), 6, EMTCraftingAspects.streamChaisnawCrafting, new ItemStack(EMTItems.thaumiumChainsaw, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(Items.water_bucket), new ItemStack(ConfigItems.itemAxeElemental), new ItemStack(ConfigBlocks.blockMagicalLog), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade") });
rockbreakerDrill = addInfusionCraftingRecipe("Drill of the Rockbreaker", getChargedItem(EMTItems.rockbreakerDrill, 10), 6, EMTCraftingAspects.rockbreakerDrillCrafting, new ItemStack(EMTItems.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), new ItemStack[] { new ItemStack(Items.flint_and_steel), new ItemStack(Items.fire_charge),
new ItemStack(ConfigItems.itemPickElemental), new ItemStack(ConfigItems.itemShovelElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("reinforcedStone"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("overclockerUpgrade") });
thorHammer = addInfusionCraftingRecipe("Mjolnir", new ItemStack(EMTItems.thorHammer), 7, EMTCraftingAspects.thorHammerCrafting, new ItemStack(EMTItems.taintedThorHammer, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(EMTItems.itemEMTItems, 1, 6), new ItemStack(EMTItems.itemEMTItems, 1, 6), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemFocusShock), IC2Items.getItem("rubber") });
superchargedThorHammer = addInfusionCraftingRecipe("Supercharged Mjolnir", getChargedItem(EMTItems.electricThorHammer, 10), 10, EMTCraftingAspects.superchargedThorHammerCrafting, new ItemStack(EMTItems.thorHammer, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(EMTItems.itemEMTItems, 1, 6), new ItemStack(EMTItems.itemEMTItems, 1, 6), new ItemStack(Blocks.web), new ItemStack(ConfigItems.itemFocusHellbat), new ItemStack(ConfigItems.itemSwordElemental), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"),
IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("nanoSaber").getItem(), 1, OreDictionary.WILDCARD_VALUE) });
wandRecharger = addInfusionCraftingRecipe("Industrial Wand Charging Station", new ItemStack(EMTBlocks.emtMachines, 1, 0), 6, EMTCraftingAspects.wandCharger, new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5),
new ItemStack[] { IC2Items.getItem("replicator"), IC2Items.getItem("iridiumPlate"), new ItemStack(Blocks.diamond_block), new ItemStack(ConfigItems.itemShard, 1, 5), new ItemStack(ConfigBlocks.blockJar) });
solarHelmetRevealing = addInfusionCraftingRecipe("Solar Helmet of Revealing", getChargedItem(EMTItems.solarHelmetRevealing, 10), 5, EMTCraftingAspects.solarHelmetRevealing, new ItemStack(EMTItems.quantumThaumicHelmet, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(EMTBlocks.emtSolars, 1, 1), IC2Items.getItem("glassFiberCableItem"), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, 4) });
electricBootsTravel = addInfusionCraftingRecipe("Electric Boots of the Traveller", getChargedItem(EMTItems.electricBootsTraveller, 10), 2, EMTCraftingAspects.electricBootsTravel, new ItemStack(ConfigItems.itemBootsTraveller),
new ItemStack[] { new ItemStack(Items.diamond), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), IC2Items.getItem("hazmatBoots"), new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE) });
nanoBootsTravel = addInfusionCraftingRecipe("Nano Boots of the Traveller", getChargedItem(EMTItems.nanoBootsTraveller, 10), 2, EMTCraftingAspects.nanoBootsTravel, new ItemStack(EMTItems.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(Items.diamond), new ItemStack(IC2Items.getItem("nanoBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE) });
quantumBootsTravel = addInfusionCraftingRecipe("Quantum Boots of the Traveller", getChargedItem(EMTItems.quantumBootsTraveller, 10), 2, EMTCraftingAspects.quantumBootsTravel, new ItemStack(EMTItems.nanoBootsTraveller, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(Blocks.diamond_block), new ItemStack(IC2Items.getItem("quantumBoots").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate") });
etheralProcessor = addInfusionCraftingRecipe("Etheral Processor", new ItemStack(EMTBlocks.emtMachines, 1, 1), 3, EMTCraftingAspects.etherealProcessor, IC2Items.getItem("macerator"),
new ItemStack[] { IC2Items.getItem("electroFurnace"), new ItemStack(ConfigBlocks.blockMetalDevice, 1, 9), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.iron_block), new ItemStack(Blocks.iron_block), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(EMTItems.itemEMTItems, 1, 5) });
tripleCompressedSolar = addInfusionCraftingRecipe("Compressed Solars", new ItemStack(EMTBlocks.emtSolars, 1, 2), 2, EMTCraftingAspects.compressedSolars, new ItemStack(EMTBlocks.emtSolars, 1, 1), new ItemStack[] { new ItemStack(EMTBlocks.emtSolars, 1, 1), new ItemStack(EMTBlocks.emtSolars, 1, 1), new ItemStack(EMTBlocks.emtSolars, 1, 1),
new ItemStack(EMTBlocks.emtSolars, 1, 1), new ItemStack(EMTBlocks.emtSolars, 1, 1), new ItemStack(EMTBlocks.emtSolars, 1, 1), new ItemStack(EMTBlocks.emtSolars, 1, 1), new ItemStack(EMTBlocks.emtSolars, 1, 1) });
electricHoeGrowth = addInfusionCraftingRecipe("Electric Hoe of Growth", getChargedItem(EMTItems.electricHoeGrowth, 10), 4, EMTCraftingAspects.electricHoeGrowth, new ItemStack(ConfigItems.itemHoeElemental),
new ItemStack[] { new ItemStack(IC2Items.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("electricHoe").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.dye, 1, 15), IC2Items.getItem("elemotor"), IC2Items.getItem("coil"), new ItemStack(Blocks.sapling, 1, OreDictionary.WILDCARD_VALUE) });
chargeFocus = addInfusionCraftingRecipe("Wand Focus: Charging", new ItemStack(EMTItems.chargeFocus), 4, EMTCraftingAspects.chargeFocus, new ItemStack(IC2Items.getItem("advBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { IC2Items.getItem("generator"), IC2Items.getItem("batBox"), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(EMTItems.itemEMTItems, 1, 5), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemShard, 1, OreDictionary.WILDCARD_VALUE) });
wandChargeFocus = addInfusionCraftingRecipe("Wand Focus: Wand Charging", new ItemStack(EMTItems.wandChargeFocus), 5, EMTCraftingAspects.wandChargeFocus, new ItemStack(EMTBlocks.emtMachines, 1, 0),
new ItemStack[] { new ItemStack(EMTItems.chargeFocus), new ItemStack(IC2Items.getItem("energyPack").getItem(), 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate") });
energyBallFocus = addInfusionCraftingRecipe("Wand Focus: Energy Ball", new ItemStack(EMTItems.energyBallFocus), 4, EMTResearchAspects.energyBallFocusResearch, new ItemStack(ConfigItems.itemFocusShock),
new ItemStack[] { new ItemStack(Blocks.tnt), new ItemStack(IC2Items.getItem("advBattery").getItem()), new ItemStack(IC2Items.getItem("advBattery").getItem()), new ItemStack(IC2Items.getItem("advBattery").getItem())});
inventoryChargingRing = addInfusionCraftingRecipe("Inventory Charging Ring", new ItemStack(EMTItems.emtBauble, 1, 1), 6, EMTCraftingAspects.inventoryChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1),
new ItemStack[] { new ItemStack(EMTItems.thaumiumDrill, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("solarPanel"), ic2.core.Ic2Items.WindKineticGenerator, ic2.core.Ic2Items.WaterKineticGenerator, IC2Items.getItem("nuclearReactor") });
armorChargingRing = addInfusionCraftingRecipe("Armor Charging Ring", new ItemStack(EMTItems.emtBauble, 1, 0), 6, EMTCraftingAspects.armorChargingRing, new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1),
new ItemStack[] { new ItemStack(EMTItems.electricBootsTraveller, 1, OreDictionary.WILDCARD_VALUE), IC2Items.getItem("generator"), IC2Items.getItem("geothermalGenerator"), IC2Items.getItem("solarPanel"), ic2.core.Ic2Items.WindKineticGenerator, ic2.core.Ic2Items.WaterKineticGenerator, IC2Items.getItem("nuclearReactor") });
nanoWings = addInfusionCraftingRecipe("Nanosuit Wings", getChargedItem(EMTItems.nanoWing, 10), 4, EMTCraftingAspects.nanoWing, new ItemStack(EMTItems.thaumiumWing),
new ItemStack[] { IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), IC2Items.getItem("carbonPlate"), new ItemStack(IC2Items.getItem("nanoBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1) });
quantumWings = addInfusionCraftingRecipe("Quantum Wings", getChargedItem(EMTItems.quantumWing, 10), 6, EMTCraftingAspects.quantumWing, new ItemStack(EMTItems.nanoWing, 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ConfigItems.itemResource, 1, 1) });
infusedQuantumArmor = addInfusionCraftingRecipe("Infused Quantum Armor", getChargedItem(EMTItems.quantumArmor, 10), 5, EMTCraftingAspects.quantumWing, new ItemStack(IC2Items.getItem("quantumBodyarmor").getItem(), 1, OreDictionary.WILDCARD_VALUE),
new ItemStack[] { new ItemStack(Items.diamond), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), IC2Items.getItem("iridiumPlate"), new ItemStack(EMTBlocks.shield), new ItemStack(EMTBlocks.shield) });
/** Arcane Worktable Recipes **/
diamondOmnitool = addShapelessArcaneCraftingRecipe("Diamond Omnitool", getChargedItem(EMTItems.diamondOmnitool, 10), EMTCraftingAspects.diamondOmnitoolCrafting, new ItemStack(EMTItems.diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(IC2Items.getItem("diamondDrill").getItem(), 1, OreDictionary.WILDCARD_VALUE));
ironOmnitoolToDiamond = addArcaneCraftingRecipe("Diamond Omnitool", new ItemStack(EMTItems.diamondOmnitool), EMTCraftingAspects.diamondOmnitoolCrafting, "XAX", "XBX", "XAX", 'X', new ItemStack(Items.diamond), 'A', IC2Items.getItem("advancedCircuit"), 'B', new ItemStack(EMTItems.ironOmnitool, 1, OreDictionary.WILDCARD_VALUE));
christmasFocus = addArcaneCraftingRecipe("Kris-tmas Focus", new ItemStack(EMTItems.christmasFocus), EMTCraftingAspects.christmasFocusCrafting, "XYX", "YZY", "XYX", 'X', new ItemStack(Blocks.snow), 'Y', new ItemStack(Blocks.pumpkin), 'Z', new ItemStack(ConfigItems.itemFocusFrost));
electricGoggles = addArcaneCraftingRecipe("Electric Goggles", getChargedItem(EMTItems.electricGoggles, 10), EMTCraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', IC2Items.getItem("electronicCircuit"), 'Y', new ItemStack(Items.diamond_helmet), 'A',
new ItemStack(IC2Items.getItem("reBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'B', Items.repeater);
electricGoggles2 = addArcaneCraftingRecipe("Electric Goggles", getChargedItem(EMTItems.electricGoggles, 10), EMTCraftingAspects.electricGogglesCrafting, " Y ", "AZA", "BXB", 'Z', new ItemStack(ConfigItems.itemGoggles), 'X', IC2Items.getItem("electronicCircuit"), 'Y', new ItemStack(Items.diamond_helmet), 'A',
new ItemStack(IC2Items.getItem("chargedReBattery").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'B', Items.repeater);
shieldBlock = addArcaneCraftingRecipe("Shield Block", new ItemStack(EMTBlocks.shield, 6), EMTCraftingAspects.shieldBlockCrafting, "XYX", "X X", "XYX", 'X', new ItemStack(Blocks.glass), 'Y', new ItemStack(Blocks.obsidian));
tinyUranium = addShapelessArcaneCraftingRecipe("Tiny Uranium", new ItemStack(IC2Items.getItem("smallUran235").getItem(), 7), EMTCraftingAspects.tinyUraniumCrafting, IC2Items.getItem("Uran238"));
compressedSolar = addArcaneCraftingRecipe("Compressed Solars", new ItemStack(EMTBlocks.emtSolars, 1, 0), EMTCraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', IC2Items.getItem("solarPanel"));
doubleCompressedSolar = addArcaneCraftingRecipe("Compressed Solars", new ItemStack(EMTBlocks.emtSolars, 1, 1), EMTCraftingAspects.compressedSolars, "XXX", "XXX", "XXX", 'X', new ItemStack(EMTBlocks.emtSolars, 1, 0));
electricScribingTools = addArcaneCraftingRecipe("Electric Scribing Tools", getChargedItem(EMTItems.electricScribingTools, 10), EMTCraftingAspects.electricScribingTools, "YXY", "XZX", "YXY", 'Y', IC2Items.getItem("electronicCircuit"), 'X', new ItemStack(ConfigItems.itemInkwell), 'Z',
new ItemStack(IC2Items.getItem("energyCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE));
thaumiumWing = addArcaneCraftingRecipe("Thaumium Reinforced Wings", new ItemStack(EMTItems.itemEMTItems, 1, 14), EMTCraftingAspects.thaumiumWing, "XYZ", "XYZ", "XYZ", 'X', new ItemStack(EMTItems.itemEMTItems, 1, 13), 'Y', new ItemStack(EMTItems.itemEMTItems, 1, 5), 'Z', IC2Items.getItem("plateiron"));
thaumiumWings = addArcaneCraftingRecipe("Thaumium Reinforced Wings", new ItemStack(EMTItems.thaumiumWing), EMTCraftingAspects.thaumiumWing, "XX", 'X', new ItemStack(EMTItems.itemEMTItems, 1, 14));
/** Crucible Recipes **/
ignisGenerator = addCrucibleRecipe("Ignis Generator", new ItemStack(EMTBlocks.essentiaGens, 1, 1), new ItemStack(EMTBlocks.essentiaGens, 1, 0), EMTCraftingAspects.ignisGeneratorCrafting);
auramGenerator = addCrucibleRecipe("Auram Generator", new ItemStack(EMTBlocks.essentiaGens, 1, 2), new ItemStack(EMTBlocks.essentiaGens, 1, 0), EMTCraftingAspects.auramGeneratorCrafting);
arborGenerator = addCrucibleRecipe("Arbor Generator", new ItemStack(EMTBlocks.essentiaGens, 1, 3), new ItemStack(EMTBlocks.essentiaGens, 1, 0), EMTCraftingAspects.arborGeneratorCrafting);
aerGenerator = addCrucibleRecipe("Aer Generator", new ItemStack(EMTBlocks.essentiaGens, 1, 4), new ItemStack(EMTBlocks.essentiaGens, 1, 0), EMTCraftingAspects.aerGenerator);
waterSolar = addCrucibleRecipe("Water Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 3), new ItemStack(EMTBlocks.emtSolars, 1, 0), EMTCraftingAspects.waterSolars);
doubleWaterSolar = addCrucibleRecipe("Water Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 4), new ItemStack(EMTBlocks.emtSolars, 1, 1), EMTCraftingAspects.waterSolars);
tripleWaterSolar = addCrucibleRecipe("Water Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 5), new ItemStack(EMTBlocks.emtSolars, 1, 2), EMTCraftingAspects.waterSolars);
darkSolar = addCrucibleRecipe("Entropy Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 6), new ItemStack(EMTBlocks.emtSolars, 1, 0), EMTCraftingAspects.darkSolars);
doubleDarkSolar = addCrucibleRecipe("Entropy Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 7), new ItemStack(EMTBlocks.emtSolars, 1, 1), EMTCraftingAspects.darkSolars);
tripleDarkSolar = addCrucibleRecipe("Entropy Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 8), new ItemStack(EMTBlocks.emtSolars, 1, 2), EMTCraftingAspects.darkSolars);
orderSolar = addCrucibleRecipe("Order Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 9), new ItemStack(EMTBlocks.emtSolars, 1, 0), EMTCraftingAspects.orderSolars);
doubleOrderSolar = addCrucibleRecipe("Order Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 10), new ItemStack(EMTBlocks.emtSolars, 1, 1), EMTCraftingAspects.orderSolars);
tripleOrderSolar = addCrucibleRecipe("Order Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 11), new ItemStack(EMTBlocks.emtSolars, 1, 2), EMTCraftingAspects.orderSolars);
fireSolar = addCrucibleRecipe("Fire Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 12), new ItemStack(EMTBlocks.emtSolars, 1, 0), EMTCraftingAspects.fireSolars);
doubleFireSolar = addCrucibleRecipe("Fire Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 13), new ItemStack(EMTBlocks.emtSolars, 1, 1), EMTCraftingAspects.fireSolars);
tripleFireSolar = addCrucibleRecipe("Fire Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 14), new ItemStack(EMTBlocks.emtSolars, 1, 2), EMTCraftingAspects.fireSolars);
airSolar = addCrucibleRecipe("Air Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars, 1, 15), new ItemStack(EMTBlocks.emtSolars, 1, 0), EMTCraftingAspects.airSolars);
doubleAirSolar = addCrucibleRecipe("Air Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars2, 1, 0), new ItemStack(EMTBlocks.emtSolars, 1, 1), EMTCraftingAspects.airSolars);
tripleAirSolar = addCrucibleRecipe("Air Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars2, 1, 1), new ItemStack(EMTBlocks.emtSolars, 1, 2), EMTCraftingAspects.airSolars);
earthSolar = addCrucibleRecipe("Earth Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars2, 1, 2), new ItemStack(EMTBlocks.emtSolars, 1, 0), EMTCraftingAspects.earthSolars);
doubleEarthSolar = addCrucibleRecipe("Earth Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars2, 1, 3), new ItemStack(EMTBlocks.emtSolars, 1, 1), EMTCraftingAspects.earthSolars);
tripleEarthSolar = addCrucibleRecipe("Earth Infused Solar Panels", new ItemStack(EMTBlocks.emtSolars2, 1, 4), new ItemStack(EMTBlocks.emtSolars, 1, 2), EMTCraftingAspects.earthSolars);
ItemStack itemStack = new ItemStack(ConfigItems.itemJarNode);
((ItemJarNode) itemStack.getItem()).setAspects(itemStack, new AspectList());
portableNode = addCrucibleRecipe("Portable Node", new ItemStack(EMTBlocks.portableNode), itemStack, EMTCraftingAspects.portableNode);
uuMCrystal = addCrucibleRecipe("UU-Matter Infusion", new ItemStack(EMTItems.itemEMTItems, 1, 15), Ic2Items.uuMatterCell.copy(), EMTCraftingAspects.uuMatterCrystal);
/** IC2 Stuff related recipes **/
/* Ore Clusters Macerator Recipes */
ItemStack ironClusterRecipe = IC2Items.getItem("smallIronDust").copy();
ironClusterRecipe.stackSize = 22;
((BasicMachineRecipeManager)Recipes.macerator).addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 16)), null, true, ironClusterRecipe);
ItemStack goldClusterRecipe = IC2Items.getItem("smallGoldDust").copy();
goldClusterRecipe.stackSize = 22;
((BasicMachineRecipeManager)Recipes.macerator).addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 31)), null, true, goldClusterRecipe);
ItemStack copperClusterRecipe = IC2Items.getItem("smallCopperDust").copy();
copperClusterRecipe.stackSize = 22;
((BasicMachineRecipeManager)Recipes.macerator).addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 17)), null, true, copperClusterRecipe);
ItemStack tinClusterRecipe = IC2Items.getItem("smallTinDust").copy();
tinClusterRecipe.stackSize = 22;
((BasicMachineRecipeManager)Recipes.macerator).addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 18)), null, true, tinClusterRecipe);
ItemStack silverClusterRecipe = IC2Items.getItem("smallSilverDust").copy();
silverClusterRecipe.stackSize = 22;
((BasicMachineRecipeManager)Recipes.macerator).addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 19)), null, true, silverClusterRecipe);
ItemStack leadClusterRecipe = IC2Items.getItem("smallLeadDust").copy();
leadClusterRecipe.stackSize = 22;
((BasicMachineRecipeManager)Recipes.macerator).addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemNugget, 1, 20)), null, true, leadClusterRecipe);
/* Thaumium Plates Recipes */
thaumiumPlate = GameRegistry.addShapedRecipe(new ItemStack(EMTItems.itemEMTItems, 1, 5), "X", "Y", "Z", 'Y', new ItemStack(ConfigItems.itemResource, 1, 2), 'X', new ItemStack(IC2Items.getItem("ForgeHammer").getItem(), 1, OreDictionary.WILDCARD_VALUE), 'Z', new ItemStack(Blocks.obsidian));
Recipes.metalformerRolling.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigItems.itemResource, 1, 2)), null, new ItemStack(EMTItems.itemEMTItems, 1, 5));
/* Ore Processing for Amber and Cinnabar */
if (EMTConfigHandler.removeAmberAndCinnabarMacerating) {
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext();) {
IRecipeInput input = it.next();
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7))) {
it.remove();
EMT.LOGGER.info("Removing conflicting amber macerating recipe(s)");
}
}
for (Iterator<IRecipeInput> it = Recipes.macerator.getRecipes().keySet().iterator(); it.hasNext();) {
IRecipeInput input = it.next();
if (input.matches(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0))) {
it.remove();
EMT.LOGGER.info("Removing Conflicting cinnabar macerating recipe(s)");
}
}
}
ItemStack crushedAmberRecipe = new ItemStack(EMTItems.itemEMTItems, 1, 1);
crushedAmberRecipe.stackSize = 2;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7)), null, crushedAmberRecipe);
ItemStack crushedCinnabarRecipe = new ItemStack(EMTItems.itemEMTItems, 1, 3);
crushedCinnabarRecipe.stackSize = 2;
Recipes.macerator.addRecipe(new RecipeInputItemStack(new ItemStack(ConfigBlocks.blockCustomOre, 1, 0)), null, crushedCinnabarRecipe);
NBTTagCompound waterAmount = new NBTTagCompound();
waterAmount.setInteger("amount", 1000);
ItemStack smallCopperDust = IC2Items.getItem("smallCopperDust");
smallCopperDust.stackSize = 2;
ItemStack smallTinDust = IC2Items.getItem("smallTinDust");
smallCopperDust.stackSize = 2;
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 1)), waterAmount, new ItemStack[] { new ItemStack(EMTItems.itemEMTItems, 1, 2), smallCopperDust, IC2Items.getItem("stoneDust") });
Recipes.oreWashing.addRecipe(new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 3)), waterAmount, new ItemStack[] { new ItemStack(EMTItems.itemEMTItems, 1, 4), smallTinDust, IC2Items.getItem("stoneDust") });
NBTTagCompound heatAmount = new NBTTagCompound();
heatAmount.setInteger("minHeat", 1000);
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 2)), heatAmount, new ItemStack[] { IC2Items.getItem("smallCopperDust"), new ItemStack(ConfigItems.itemResource, 1, 6) });
Recipes.centrifuge.addRecipe(new RecipeInputItemStack(new ItemStack(EMTItems.itemEMTItems, 1, 4)), heatAmount, new ItemStack[] { IC2Items.getItem("smallTinDust"), new ItemStack(ConfigItems.itemResource, 1, 3) });
}
public static IRecipe ironOmnitool;
public static IRecipe diamondChainsaw;
public static IRecipe ductTape;
public static IRecipe rubberBall;
public static IRecipe featherMesh;
public static IRecipe cardboard;
public static IRecipe featherWing;
public static IRecipe featherWings;
public static IRecipe taintedFeathers;
public static InfusionRecipe uraniumToIridium;
public static InfusionRecipe diamondToUranium;
public static InfusionRecipe goldToDiamond;
public static InfusionRecipe ironToGold;
public static InfusionRecipe stoneBricksToIronOre;
public static InfusionRecipe arcaneStoneToCopperOre;
public static InfusionRecipe arcaneStoneBricksToTinOre;
public static InfusionRecipe amberBlockToLeadOre;
public static InfusionRecipe amberBricksToUraniumOre;
public static InfusionRecipe charcoalToCoal;
public static InfusionRecipe shardToResin;
public static InfusionRecipe shardToRedstone;
public static InfusionRecipe shardToLapis;
public static InfusionRecipe glowstoneDustToBlock;
public static InfusionRecipe infusedQuantumArmor;
public static InfusionRecipe thaumiumDrill;
public static InfusionRecipe thaumiumChainsaw;
public static InfusionRecipe thaumicQuantumHelmet;
public static InfusionRecipe thaumiumOmnitool;
public static InfusionRecipe thaumicNanoHelmet;
public static InfusionRecipe explosionFocus;
public static InfusionRecipe shieldFocus;
public static InfusionRecipe potentiaGenerator;
public static InfusionRecipe streamChainsaw;
public static InfusionRecipe rockbreakerDrill;
public static InfusionRecipe thorHammer;
public static InfusionRecipe superchargedThorHammer;
public static InfusionRecipe wandRecharger;
public static InfusionRecipe solarHelmetRevealing;
public static InfusionRecipe electricBootsTravel;
public static InfusionRecipe nanoBootsTravel;
public static InfusionRecipe quantumBootsTravel;
public static InfusionRecipe diamondOmnitoolToThaumium;
public static InfusionRecipe etheralProcessor;
public static InfusionRecipe tripleCompressedSolar;
public static InfusionRecipe electricHoeGrowth;
public static InfusionRecipe chargeFocus;
public static InfusionRecipe wandChargeFocus;
public static InfusionRecipe energyBallFocus;
public static InfusionRecipe inventoryChargingRing;
public static InfusionRecipe armorChargingRing;
public static InfusionRecipe nanoWings;
public static InfusionRecipe quantumWings;
public static ShapelessArcaneRecipe diamondOmnitool;
public static ShapelessArcaneRecipe tinyUranium;
public static ShapedArcaneRecipe christmasFocus;
public static ShapedArcaneRecipe electricGoggles;
public static ShapedArcaneRecipe electricGoggles2;
public static ShapedArcaneRecipe shieldBlock;
public static ShapedArcaneRecipe compressedSolar;
public static ShapedArcaneRecipe doubleCompressedSolar;
public static ShapedArcaneRecipe ironOmnitoolToDiamond;
public static ShapedArcaneRecipe electricScribingTools;
public static ShapedArcaneRecipe thaumiumWing;
public static ShapedArcaneRecipe thaumiumWings;
public static CrucibleRecipe ignisGenerator;
public static CrucibleRecipe auramGenerator;
public static CrucibleRecipe arborGenerator;
public static CrucibleRecipe aerGenerator;
public static CrucibleRecipe waterSolar;
public static CrucibleRecipe doubleWaterSolar;
public static CrucibleRecipe tripleWaterSolar;
public static CrucibleRecipe darkSolar;
public static CrucibleRecipe doubleDarkSolar;
public static CrucibleRecipe tripleDarkSolar;
public static CrucibleRecipe orderSolar;
public static CrucibleRecipe doubleOrderSolar;
public static CrucibleRecipe tripleOrderSolar;
public static CrucibleRecipe fireSolar;
public static CrucibleRecipe doubleFireSolar;
public static CrucibleRecipe tripleFireSolar;
public static CrucibleRecipe airSolar;
public static CrucibleRecipe doubleAirSolar;
public static CrucibleRecipe tripleAirSolar;
public static CrucibleRecipe earthSolar;
public static CrucibleRecipe doubleEarthSolar;
public static CrucibleRecipe tripleEarthSolar;
public static CrucibleRecipe portableNode;
public static CrucibleRecipe uuMCrystal;
public static IRecipe thaumiumPlate;
}
+283
View File
@@ -0,0 +1,283 @@
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 {
public static void register() {
addResearchTab();
addResearch();
}
public static void addResearchTab() {
ResourceLocation background = new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/background.png");
ResearchCategories.registerCategory("EMT", new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png"), background);
}
public static void addResearch() {
/** Research that can't be disabled **/
new EMTResearchItem("Electric Magic Tools", 0, 0, 0, new ResourceLocation(EMT.TEXTURE_PATH, "textures/misc/emt.png")).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("Diamond Chainsaw", 5, -6, 0, new ItemStack(EMTItems.diamondChainsaw)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.diamondChainsaw));
new EMTResearchItem("Thaumium Plate", 6, -6, 0, new ItemStack(EMTItems.itemEMTItems, 1, 5)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumPlate));
new EMTResearchItem("Macerating Native Ore Clusters", 5, -7, 0, IC2Items.getItem("smallGoldDust")).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("The Legend", 5, -5, 0, new ItemStack(EMTItems.taintedThorHammer)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("Lightning Summoner", 6, -5, 0, new ItemStack(EMTItems.itemEMTItems, 1, 6)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("The One Ring", 6, -7, 0, new ItemStack(EMTItems.onering)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""));
new EMTResearchItem("Electric Cloud", 4, -7, 0, new ItemStack(EMTBlocks.electricCloud)).setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage("1"), new ResearchPage("2"));
new EMTResearchItem("Feather Wings", 0, 2, 0, new ItemStack(EMTItems.featherWing)).setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(EMTRecipes.cardboard), new ResearchPage(EMTRecipes.featherWing), new ResearchPage(EMTRecipes.featherWings));
/*************************************/
/** Research that can be disabled **/
if (!EMTConfigHandler.thaumiumDrillResearch) {
new EMTResearchItem("Thaumium Drill", EMTResearchAspects.thaumiumDrillResearch, -1, -2, 1, new ItemStack(EMTItems.thaumiumDrill)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumDrill));
}
if (!EMTConfigHandler.thaumiumChainsawResearch) {
new EMTResearchItem("Thaumium Chainsaw", EMTResearchAspects.thaumiumChainsawResearch, -2, -2, 1, new ItemStack(EMTItems.thaumiumChainsaw)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumChainsaw));
}
if (!EMTConfigHandler.electricGooglesResearch) {
new EMTResearchItem("Electric Goggles", EMTResearchAspects.electricGogglesResearch, 1, -2, 1, new ItemStack(EMTItems.electricGoggles)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricGoggles));
}
if (!EMTConfigHandler.electricGooglesResearch) {
if (!EMTConfigHandler.nanoGooglesResearch) {
;
new EMTResearchItem("Nanosuit Goggles of Revealing", EMTResearchAspects.thaumicNanoHelmet, 2, -2, 2, new ItemStack(EMTItems.nanoThaumicHelmet)).setParents("Electric Goggles").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumicNanoHelmet));
}
}
if (!EMTConfigHandler.electricGooglesResearch) {
if (!EMTConfigHandler.nanoGooglesResearch) {
if (!EMTConfigHandler.quantumGooglesResearch) {
new EMTResearchItem("Quantum Goggles of Revealing", EMTResearchAspects.thaumicQuantumHelmet, 3, -2, 3, new ItemStack(EMTItems.quantumThaumicHelmet)).setParents("Nanosuit Goggles of Revealing").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumicQuantumHelmet));
}
}
}
if (!EMTConfigHandler.ironOmnitoolResearch) {
new EMTResearchItem("Iron Omnitool", -2, 0, 0, new ItemStack(EMTItems.ironOmnitool)).setParents("Electric Magic Tools").setRound().setAutoUnlock().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ironOmnitool));
}
if (!EMTConfigHandler.ironOmnitoolResearch) {
if (!EMTConfigHandler.diamondOmnitoolResearch) {
new EMTResearchItem("Diamond Omnitool", EMTResearchAspects.diamondOmnitoolResearch, -4, 0, 1, new ItemStack(EMTItems.diamondOmnitool)).setSecondary().setParents("Iron Omnitool").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.diamondOmnitool), new ResearchPage(EMTRecipes.ironOmnitoolToDiamond));
}
}
if (!EMTConfigHandler.thaumiumDrillResearch && !EMTConfigHandler.thaumiumChainsawResearch) {
if (!EMTConfigHandler.thaumiumOmnitoolResearch) {
new EMTResearchItem("Thaumium Omnitool", EMTResearchAspects.thaumiumOmnitoolResearch, -6, 0, 2, new ItemStack(EMTItems.thaumiumOmnitool)).setParentsHidden("Thaumium Drill", "Thaumium Chainsaw").setParents("Diamond Omnitool").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumOmnitool), new ResearchPage(EMTRecipes.diamondOmnitoolToThaumium));
}
}
if (!EMTConfigHandler.explosionFocusResearch) {
new EMTResearchItem("Explosion Focus", EMTResearchAspects.laserFocusResearch, 2, 3, 2, new ItemStack(EMTItems.explosionFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.explosionFocus));
}
if (!EMTConfigHandler.christmasFocusResearch) {
new EMTResearchItem("Kris-tmas Focus", EMTResearchAspects.christmasFocusResearch, 3, 3, 1, new ItemStack(EMTItems.christmasFocus)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.christmasFocus));
}
if (!EMTConfigHandler.shieldFocusResearch) {
new EMTResearchItem("Shield Focus", EMTResearchAspects.shieldFocusResearch, 4, 3, 2, new ItemStack(EMTItems.shieldFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.shieldFocus));
}
if (!EMTConfigHandler.energyBallFocusResearch) {
new EMTResearchItem("Energy Ball Focus", EMTResearchAspects.energyBallFocusResearch, 1, 3, 2, new ItemStack(EMTItems.energyBallFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.energyBallFocus));
}
if (!EMTConfigHandler.shieldFocusResearch) {
if (!EMTConfigHandler.shieldBlockResearch) {
new EMTResearchItem("Shield Block", EMTResearchAspects.shieldBlockResearch, 4, 5, 1, new ItemStack(EMTBlocks.shield)).setSecondary().setParents("Shield Focus").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.shieldBlock));
}
}
if (!EMTConfigHandler.potentiaGeneratorResearch) {
new EMTResearchItem("Potentia Generator", EMTResearchAspects.potentiaGeneratorResearch, -2, 3, 3, new ItemStack(EMTBlocks.essentiaGens, 1, 0)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.potentiaGenerator));
}
if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.ignisGeneratorResearch) {
new EMTResearchItem("Ignis Generator", EMTResearchAspects.ignisGeneratorResearch, -3, 4, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 1)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.ignisGenerator));
}
}
if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.auramGeneratorResearch) {
new EMTResearchItem("Auram Generator", EMTResearchAspects.auramGeneratorResearch, -1, 4, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 2)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.auramGenerator));
}
}
if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.arborGeneratorResearch) {
new EMTResearchItem("Arbor Generator", EMTResearchAspects.arborGeneratorResearch, -2, 5, 1, new ItemStack(EMTBlocks.essentiaGens, 1, 3)).setSecondary().setParents("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.arborGenerator));
}
}
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));
}
}
if (!EMTConfigHandler.potentiaGeneratorResearch) {
if (!EMTConfigHandler.wandChargingSationResearch) {
new EMTResearchItem("Industrial Wand Charging Station", EMTResearchAspects.wandCharger, -4, 2, 3, new ItemStack(EMTBlocks.emtMachines, 1, 0)).setParents("Potentia Generator").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.wandRecharger));
}
}
if (!EMTConfigHandler.thaumiumChainsawResearch) {
if (!EMTConfigHandler.streamChainsawResearch) {
new EMTResearchItem("Chainsaw of the Stream", EMTResearchAspects.streamChainsawResearch, -3, -4, 3, new ItemStack(EMTItems.streamChainsaw)).setParents("Thaumium Chainsaw").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.streamChainsaw));
}
}
if (!EMTConfigHandler.thaumiumDrillResearch) {
if (!EMTConfigHandler.rockbreakerDrillResearch) {
new EMTResearchItem("Drill of the Rockbreaker", EMTResearchAspects.rockbreakerDrillResearch, 0, -4, 3, new ItemStack(EMTItems.rockbreakerDrill)).setParents("Thaumium Drill").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.rockbreakerDrill));
}
}
if (!EMTConfigHandler.tinyUraniumResearch) {
new EMTResearchItem("Tiny Uranium", EMTResearchAspects.tinyUraniumResearch, -5, -5, 1, IC2Items.getItem("Uran238")).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.tinyUranium));
}
if (!EMTConfigHandler.thorHammerResearch) {
new EMTResearchItem("Mjolnir", EMTResearchAspects.thorHammerResearch, -5, 5, 3, new ItemStack(EMTItems.thorHammer)).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thorHammer));
}
if (!EMTConfigHandler.thorHammerResearch) {
if (!EMTConfigHandler.superchargedThorHammerResearch) {
new EMTResearchItem("Supercharged Mjolnir", EMTResearchAspects.superchargedThorHammerResearch, -6, 6, 3, new ItemStack(EMTItems.electricThorHammer)).setParents("Mjolnir").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.superchargedThorHammer));
}
}
if (!EMTConfigHandler.compressedSolarsResearch) {
new EMTResearchItem("Compressed Solars", EMTResearchAspects.compressedSolars, -4, -5, 2, new ItemStack(EMTBlocks.emtSolars)).setParentsHidden("Potentia Generator").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.compressedSolar), new ResearchPage(EMTRecipes.doubleCompressedSolar), new ResearchPage(EMTRecipes.tripleCompressedSolar));
}
if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.solarHelmetResearch) {
new EMTResearchItem("Solar Helmet of Revealing", EMTResearchAspects.solarHelmetRevealing, -2, -5, 1, new ItemStack(EMTItems.solarHelmetRevealing)).setSecondary().setParents("Compressed Solars").setParentsHidden("Quantum Goggles of Revealing").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.solarHelmetRevealing));
}
}
if (!EMTConfigHandler.electricBootsResearch) {
new EMTResearchItem("Electric Boots of the Traveller", EMTResearchAspects.electricBootsTravel, 2, 0, 1, new ItemStack(EMTItems.electricBootsTraveller)).setSecondary().setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricBootsTravel));
}
if (!EMTConfigHandler.electricBootsResearch) {
if (!EMTConfigHandler.nanoBootsResearch) {
new EMTResearchItem("Nano Boots of the Traveller", EMTResearchAspects.nanoBootsTravel, 4, 0, 2, new ItemStack(EMTItems.nanoBootsTraveller)).setParents("Electric Boots of the Traveller").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.nanoBootsTravel));
}
}
if (!EMTConfigHandler.electricBootsResearch) {
if (!EMTConfigHandler.nanoBootsResearch) {
if (!EMTConfigHandler.quantumBootsResearch) {
new EMTResearchItem("Quantum Boots of the Traveller", EMTResearchAspects.quantumBootsTravel, 6, 0, 3, new ItemStack(EMTItems.quantumBootsTraveller)).setParents("Nano Boots of the Traveller").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.quantumBootsTravel));
}
}
}
if (!EMTConfigHandler.electricScribingToolsResearch) {
new EMTResearchItem("Electric Scribing Tools", EMTResearchAspects.electricScribingTools, -6, -5, 1, new ItemStack(EMTItems.electricScribingTools)).setSecondary().setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricScribingTools));
}
if (!EMTConfigHandler.etherealProcessorResearch) {
new EMTResearchItem("Etheral Processor", EMTResearchAspects.etherealProcessor, -1, 2, 2, new ItemStack(EMTBlocks.emtMachines, 1, 1)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.etheralProcessor));
}
if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.waterSolarsResearch) {
new EMTResearchItem("Water Infused Solar Panels", EMTResearchAspects.waterSolars, -7, -7, 1, new ItemStack(EMTBlocks.emtSolars, 1, 3)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.waterSolar), new ResearchPage(EMTRecipes.doubleWaterSolar), new ResearchPage(EMTRecipes.tripleWaterSolar));
}
}
if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.darkSolarsResearch) {
new EMTResearchItem("Entropy Infused Solar Panels", EMTResearchAspects.darkSolars, -8, -6, 1, new ItemStack(EMTBlocks.emtSolars, 1, 6)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.darkSolar), new ResearchPage(EMTRecipes.doubleDarkSolar), new ResearchPage(EMTRecipes.tripleDarkSolar));
}
}
if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.orderSolarsResearch) {
new EMTResearchItem("Order Infused Solar Panels", EMTResearchAspects.orderSolars, -6, -8, 1, new ItemStack(EMTBlocks.emtSolars, 1, 9)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.orderSolar), new ResearchPage(EMTRecipes.doubleOrderSolar), new ResearchPage(EMTRecipes.tripleOrderSolar));
}
}
if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.fireSolarsResearch) {
new EMTResearchItem("Fire Infused Solar Panels", EMTResearchAspects.fireSolars, -5, -7, 1, new ItemStack(EMTBlocks.emtSolars, 1, 12)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.fireSolar), new ResearchPage(EMTRecipes.doubleFireSolar), new ResearchPage(EMTRecipes.tripleFireSolar));
}
}
if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.airSolarsResearch) {
new EMTResearchItem("Air Infused Solar Panels", EMTResearchAspects.airSolars, -4, -6, 1, new ItemStack(EMTBlocks.emtSolars, 1, 15)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.airSolar), new ResearchPage(EMTRecipes.doubleAirSolar), new ResearchPage(EMTRecipes.tripleAirSolar));
}
}
if (!EMTConfigHandler.compressedSolarsResearch) {
if (!EMTConfigHandler.earthSolarsResearch) {
new EMTResearchItem("Earth Infused Solar Panels", EMTResearchAspects.earthSolars, -6, -7, 1, new ItemStack(EMTBlocks.emtSolars2, 1, 2)).setSecondary().setParents("Compressed Solars").registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.earthSolar), new ResearchPage(EMTRecipes.doubleEarthSolar), new ResearchPage(EMTRecipes.tripleEarthSolar));
}
}
if (!EMTConfigHandler.uuMInfusionResearch) {
new EMTResearchItem("UU-Matter Infusion", EMTResearchAspects.uuMInfusion, 5, 5, 3, new ItemStack(EMTItems.itemEMTItems, 1, 15)).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.uuMCrystal), new ResearchPage(EMTRecipes.charcoalToCoal), new ResearchPage(EMTRecipes.glowstoneDustToBlock), new ResearchPage(EMTRecipes.stoneBricksToIronOre), new ResearchPage(EMTRecipes.arcaneStoneToCopperOre), new ResearchPage(EMTRecipes.arcaneStoneBricksToTinOre), new ResearchPage(EMTRecipes.amberBlockToLeadOre), new ResearchPage(EMTRecipes.amberBricksToUraniumOre), new ResearchPage(EMTRecipes.shardToResin), new ResearchPage(EMTRecipes.shardToRedstone), new ResearchPage(EMTRecipes.shardToLapis), new ResearchPage(EMTRecipes.ironToGold), new ResearchPage(EMTRecipes.goldToDiamond), new ResearchPage(EMTRecipes.diamondToUranium), new ResearchPage(EMTRecipes.uraniumToIridium));
}
if (!EMTConfigHandler.portableNodeResarch) {
new EMTResearchItem("Portable Node", EMTResearchAspects.portableNode, 2, 5, 3, new ItemStack(EMTBlocks.portableNode)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.portableNode));
}
if (!EMTConfigHandler.electricHoeGrowthResearch) {
new EMTResearchItem("Electric Hoe of Growth", EMTResearchAspects.electricHoeGrowth, -1, -4, 2, new ItemStack(EMTItems.electricHoeGrowth)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.electricHoeGrowth));
}
if (!EMTConfigHandler.chargeFocusResearch) {
new EMTResearchItem("Wand Focus: Charging", EMTResearchAspects.chargeFocus, 5, 3, 2, new ItemStack(EMTItems.chargeFocus)).setParents("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.chargeFocus));
}
if (!EMTConfigHandler.wandChargeFocusResearch) {
new EMTResearchItem("Wand Focus: Wand Charging", EMTResearchAspects.wandChargeFocus, 7, 3, 3, new ItemStack(EMTItems.wandChargeFocus)).setParents("Wand Focus: Charging").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.wandChargeFocus));
}
if (!EMTConfigHandler.inventoryChargingRing) {
new EMTResearchItem("Inventory Charging Ring", EMTResearchAspects.inventoryChargingRing, 0, -5, 3, new ItemStack(EMTItems.emtBauble, 1, 1)).setParentsHidden("Electric Magic Tools").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.inventoryChargingRing));
}
if (!EMTConfigHandler.armorChargingRing) {
new EMTResearchItem("Armor Charging Ring", EMTResearchAspects.armorChargingRing, 0, -7, 3, new ItemStack(EMTItems.emtBauble, 1, 0)).setSecondary().setParents("Inventory Charging Ring").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.armorChargingRing));
}
if (!EMTConfigHandler.thaumiumWingResearch) {
new EMTResearchItem("Thaumium Reinforced Wings", EMTResearchAspects.thaumiumWing, 0, 4, 0, new ItemStack(EMTItems.thaumiumWing)).setSecondary().setParents("Feather Wings").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.thaumiumWing), new ResearchPage(EMTRecipes.thaumiumWings));
}
if (!EMTConfigHandler.nanoWingResearch && !EMTConfigHandler.thaumiumWingResearch) {
new EMTResearchItem("Nanosuit Wings", EMTResearchAspects.nanoWing, 0, 6, 2, new ItemStack(EMTItems.nanoWing)).setParents("Thaumium Reinforced Wings").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.nanoWings));
}
if (!EMTConfigHandler.quantumWingsResearch && !EMTConfigHandler.thaumiumWingResearch && !EMTConfigHandler.nanoWingResearch) {
new EMTResearchItem("Quantum Wings", EMTResearchAspects.quantumWing, 0, 8, 3, new ItemStack(EMTItems.quantumWing)).setParents("Nanosuit Wings").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.quantumWings));
}
if (!EMTConfigHandler.infusedQuantumChestplate && !EMTConfigHandler.thaumiumWingResearch && !EMTConfigHandler.nanoWingResearch && !EMTConfigHandler.quantumWingsResearch) {
new EMTResearchItem("Infused Quantum Armor", EMTResearchAspects.quantumWing, 0, 10, 4, new ItemStack(EMTItems.quantumArmor)).setParents("Quantum Wings").setConcealed().registerResearchItem().setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.infusedQuantumArmor));
}
/***********************************/
}
}
+69
View File
@@ -0,0 +1,69 @@
package emt.init;
import cpw.mods.fml.common.registry.GameRegistry;
import emt.tile.TileElectricCloud;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
import emt.tile.TileEntityPortableNode;
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.tile.solar.air.TileEntityAirSolar;
import emt.tile.solar.air.TileEntityDoubleAirSolar;
import emt.tile.solar.air.TileEntityTripleAirSolar;
import emt.tile.solar.compressed.TileEntityCompressedSolar;
import emt.tile.solar.compressed.TileEntityDoubleCompressedSolar;
import emt.tile.solar.compressed.TileEntityTripleCompressedSolar;
import emt.tile.solar.dark.TileEntityDarkSolar;
import emt.tile.solar.dark.TileEntityDoubleDarkSolar;
import emt.tile.solar.dark.TileEntityTripleDarkSolar;
import emt.tile.solar.earth.TileEntityDoubleEarthSolar;
import emt.tile.solar.earth.TileEntityEarthSolar;
import emt.tile.solar.earth.TileEntityTripleEarthSolar;
import emt.tile.solar.fire.TileEntityDoubleFireSolar;
import emt.tile.solar.fire.TileEntityFireSolar;
import emt.tile.solar.fire.TileEntityTripleFireSolar;
import emt.tile.solar.order.TileEntityDoubleOrderSolar;
import emt.tile.solar.order.TileEntityOrderSolar;
import emt.tile.solar.order.TileEntityTripleOrderSolar;
import emt.tile.solar.water.TileEntityDoubleWaterSolar;
import emt.tile.solar.water.TileEntityTripleWaterSolar;
import emt.tile.solar.water.TileEntityWaterSolar;
public class EMTTiles {
public static void registerTiles() {
GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode");
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(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
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");
GameRegistry.registerTileEntity(TileEntityDarkSolar.class, "tileentitydarksolar");
GameRegistry.registerTileEntity(TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar");
GameRegistry.registerTileEntity(TileEntityTripleDarkSolar.class, "tileentitytripledarksolar");
GameRegistry.registerTileEntity(TileEntityOrderSolar.class, "tileentityordersolar");
GameRegistry.registerTileEntity(TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar");
GameRegistry.registerTileEntity(TileEntityTripleOrderSolar.class, "tileentitytripleordersolar");
GameRegistry.registerTileEntity(TileEntityFireSolar.class, "tileentityfiresolar");
GameRegistry.registerTileEntity(TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar");
GameRegistry.registerTileEntity(TileEntityTripleFireSolar.class, "tileentitytriplefiresolar");
GameRegistry.registerTileEntity(TileEntityAirSolar.class, "tileentityairsolar");
GameRegistry.registerTileEntity(TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar");
GameRegistry.registerTileEntity(TileEntityTripleAirSolar.class, "tileentitytripleairsolar");
GameRegistry.registerTileEntity(TileEntityEarthSolar.class, "tileentityearthsolar");
GameRegistry.registerTileEntity(TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar");
GameRegistry.registerTileEntity(TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar");
GameRegistry.registerTileEntity(TileElectricCloud.class, "tileEntityElectricCloud");
}
}
+16
View File
@@ -0,0 +1,16 @@
package emt.init;
public class Registry {
public static void register() {
EMTBlocks.registerBlocks();
EMTItems.registerItems();
EMTTiles.registerTiles();
EMTRecipes.registerEarlyRecipes();
}
public static void registerLate() {
EMTBlocks.addAspects();
EMTRecipes.registerLateRecipes();
EMTRecipes.registerUUMInfusionRecipes();
}
}
+28
View File
@@ -0,0 +1,28 @@
package emt.item;
import emt.EMT;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
public class ItemBase extends Item {
public ItemBase(String unlocName, String textureName) {
super();
setUnlocalizedName(EMT.MOD_ID + unlocName);
setTextureName(EMT.TEXTURE_PATH + ":" + textureName);
setCreativeTab(EMT.TAB);
}
public ItemBase(String unlocName) {
super();
setUnlocalizedName(EMT.MOD_ID + ".item." + unlocName);
setCreativeTab(EMT.TAB);
}
public String getItemStackDisplayName(ItemStack stack) {
return (EMTTextHelper.GREEN + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
}
}
@@ -0,0 +1,68 @@
package emt.item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import thaumcraft.api.IScribeTools;
import thaumcraft.common.items.ItemInkwell;
import java.util.List;
public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools {
public static int maxCharge = 400;
public ItemElectricScribingTools() {
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(400);
this.setMaxStackSize(1);
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return 1;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return 5;
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -1,9 +1,11 @@
package tombenpotter.emt.common.items;
package emt.item;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -13,8 +15,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.util.ConfigHandler;
import java.util.List;
import java.util.Random;
@@ -38,25 +38,25 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage()) {
case 0: {
name = "euMaker.armor";
break;
}
case 1: {
name = "euMaker.inventory";
break;
}
default:
name = "nothing";
break;
case 0: {
name = "euMaker.armor";
break;
}
case 1: {
name = "euMaker.inventory";
break;
}
default:
name = "nothing";
break;
}
return getUnlocalizedName() + "." + name;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ri) {
this.icon[0] = ri.registerIcon(ModInformation.texturePath + ":armoreumaker");
this.icon[1] = ri.registerIcon(ModInformation.texturePath + ":inventoryeumaker");
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":armoreumaker");
this.icon[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":inventoryeumaker");
}
@SideOnly(Side.CLIENT)
@@ -64,7 +64,6 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
return this.icon[meta];
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
list.add(new ItemStack(this, 1, 0));
@@ -75,7 +74,8 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
public BaubleType getBaubleType(ItemStack stack) {
if (stack.getItemDamage() <= 1) {
return BaubleType.RING;
} else {
}
else {
return null;
}
}
@@ -86,7 +86,7 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
if (stack != null) {
if (stack.getItemDamage() == 0) {
if (player instanceof EntityPlayer) {
int energyLeft = ConfigHandler.armorBaubleProduction;
int energyLeft = EMTConfigHandler.armorBaubleProduction;
for (int i = 0; i < ((EntityPlayer) player).inventory.armorInventory.length; i++) {
if (energyLeft > 0) {
if ((((EntityPlayer) player).inventory.armorInventory[i] != null) && (((EntityPlayer) player).inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
@@ -101,7 +101,7 @@ public class ItemIC2Baubles extends ItemBase implements IBauble {
if (stack != null) {
if (stack.getItemDamage() == 1) {
if (player instanceof EntityPlayer) {
int energyLeft = ConfigHandler.inventoryBaubleProdution;
int energyLeft = EMTConfigHandler.inventoryBaubleProdution;
for (int i = 0; i < ((EntityPlayer) player).inventory.mainInventory.length; i++) {
if (energyLeft > 0) {
if ((((EntityPlayer) player).inventory.mainInventory[i] != null) && (((EntityPlayer) player).inventory.mainInventory[i].getItem() instanceof IElectricItem)) {
+210
View File
@@ -0,0 +1,210 @@
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;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import 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;
import java.util.List;
public class ItemMaterials extends Item {
public IIcon[] icon = new IIcon[16];
public ItemMaterials() {
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(0);
this.setMaxStackSize(64);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = null;
switch (itemstack.getItemDamage()) {
case 0:
name = "oreClusterUranium";
break;
case 1:
name = "crushedOreAmber";
break;
case 2:
name = "purifiedOreAmber";
break;
case 3:
name = "crushedOreCinnabar";
break;
case 4:
name = "purifiedOreCinnabar";
break;
case 5:
name = "thaumiumPlate";
break;
case 6:
name = "lightningSummoner";
break;
case 7:
name = "featherMesh";
break;
case 8:
name = "glue";
break;
case 9:
name = "ductTape";
break;
case 10:
name = "rubberBall";
break;
case 11:
name = "cardboard";
break;
case 12:
name = "featherGluedCardboardWing";
break;
case 13:
name = "taintedFeather";
break;
case 14:
name = "thaumiumWing";
break;
case 15:
name = "uumatterDrop";
break;
default:
name = "nothing";
break;
}
return "item." + EMT.MOD_ID + "." + name;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ri) {
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/clusteruranium");
this.icon[1] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/crushedamber");
this.icon[2] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/purifiedamber");
this.icon[3] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/crushedcinnabar");
this.icon[4] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/purifiedcinnabar");
this.icon[5] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/thaumiumplate");
this.icon[6] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/lightningsummoner");
this.icon[7] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/feathermesh");
this.icon[8] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/glue");
this.icon[9] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/ducttape");
this.icon[10] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/rubberball");
this.icon[11] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/cardboard");
this.icon[12] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/cardboardsheet");
this.icon[13] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/taintedfeather");
this.icon[14] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/thaumiumWing");
this.icon[15] = ri.registerIcon(EMT.TEXTURE_PATH + ":materials/uumatterdrop");
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta) {
return this.icon[meta];
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
for (int i = 1; i <= 15; i++) {
list.add(new ItemStack(this, 1, i));
}
}
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
if (stack != null && stack.getItemDamage() == 6 && this.getMaxItemUseDuration(stack) - count >= 40) {
World world = player.worldObj;
player.swingItem();
float f = 1.0F;
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
double playerX = player.prevPosX + ((player.posX - player.prevPosX) * f);
double playerY = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
double playerZ = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
Vec3 playerLoc = Vec3.createVectorHelper(playerX, playerY, playerZ);
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
float f6 = MathHelper.sin(-f1 * 0.01745329F);
float f7 = f4 * f5;
float f8 = f6;
float f9 = f3 * f5;
float d3 = 5000;
Vec3 vec3d1 = playerLoc.addVector(f7 * d3, f8 * d3, f9 * d3);
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(playerLoc, vec3d1, true);
if (movingobjectposition != null) {
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
int x2 = movingobjectposition.blockX;
int y2 = movingobjectposition.blockY;
int z2 = movingobjectposition.blockZ;
world.spawnEntityInWorld(new EntityLightningBolt(world, x2, y2, z2));
}
else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
Entity entityhit = movingobjectposition.entityHit;
double x = entityhit.posX;
double y = entityhit.posY;
double z = entityhit.posZ;
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
}
if (!player.capabilities.isCreativeMode) {
player.inventory.consumeInventoryItem(this);
}
}
player.stopUsingItem();
}
}
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (stack.getItemDamage() == 6) {
ArrowNockEvent event = new ArrowNockEvent(player, stack);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled()) {
return event.result;
}
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
}
return stack;
}
public int getMaxItemUseDuration(ItemStack stack) {
if (stack.getItemDamage() == 6)
return 72000;
return super.getMaxItemUseDuration(stack);
}
public EnumAction getItemUseAction(ItemStack stack) {
if (stack.getItemDamage() == 6)
return EnumAction.bow;
return EnumAction.none;
}
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
super.onUpdate(stack, world, entity, par4, par5);
if ((!entity.worldObj.isRemote) && ((stack.getItemDamage() == 13)) && ((entity instanceof EntityLivingBase)) && (!((EntityLivingBase) entity).isEntityUndead()) && (!((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID)) && (world.rand.nextInt(4321) <= stack.stackSize)) {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Config.potionTaintPoisonID, 120, 0, false));
if ((entity instanceof EntityPlayer)) {
InventoryUtils.consumeInventoryItem((EntityPlayer) entity, stack.getItem(), stack.getItemDamage());
}
}
}
}
+161
View File
@@ -0,0 +1,161 @@
package emt.item;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.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 java.util.List;
import java.util.Random;
public class ItemOneRing extends ItemBase implements IBauble {
public IIcon[] icon = new IIcon[16];
public Random random = new Random();
public ItemOneRing() {
super("bauble");
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setMaxStackSize(1);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage()) {
case 0: {
name = "oneRing";
break;
}
default:
name = "nothing";
break;
}
return "item." + EMT.MOD_ID + ".bauble." + name;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ri) {
this.icon[0] = ri.registerIcon(EMT.TEXTURE_PATH + ":onering");
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta) {
return this.icon[meta];
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) {
list.add(new ItemStack(this, 1, 0));
}
@Override
public BaubleType getBaubleType(ItemStack stack) {
if (stack.getItemDamage() <= 0) {
return BaubleType.RING;
}
else {
return null;
}
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
if (!player.isInvisible()) {
player.setInvisible(true);
}
NBTTagCompound tag = new NBTTagCompound();
((EntityPlayer) player).writeToNBT(tag);
NBTTagCompound forgeTag = tag.getCompoundTag("ForgeData");
int corruption = 0;
if (forgeTag.hasKey("MindCorruption"))
corruption = forgeTag.getInteger("MindCorruption");
else
forgeTag.setInteger("MindCorruption", 0);
((EntityPlayer) player).capabilities.disableDamage = true;
if (!player.worldObj.isRemote) {
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));
}
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) {
((EntityPlayer) player).capabilities.disableDamage = false;
player.attackEntityFrom(DamageSource.magic, 5);
}
else if (corruption >= 72000 && corruption < 120000 && random.nextInt(4000) == 0) {
((EntityPlayer) player).capabilities.disableDamage = false;
player.motionY += 2d;
}
else if (corruption >= 120000 && random.nextInt(10000) == 0) {
((EntityPlayer) player).capabilities.disableDamage = false;
player.addPotionEffect(new PotionEffect(Potion.wither.id, 5000, 4, false));
}
else if (corruption + 100 >= Integer.MAX_VALUE) { // =3333333
player.isDead = true;
}
}
forgeTag.setInteger("MindCorruption", ++corruption);
tag.setTag("ForgeData", forgeTag);
((EntityPlayer) player).readFromNBT(tag);
}
@Override
public void onEquipped(ItemStack stack, EntityLivingBase player) {
NBTTagCompound tag = new NBTTagCompound();
((EntityPlayer) player).writeToNBT(tag);
tag.getCompoundTag("ForgeData").setInteger("MindCorruption", 0);
((EntityPlayer) player).readFromNBT(tag);
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
player.setInvisible(false);
if (!((EntityPlayer) player).capabilities.isCreativeMode)
((EntityPlayer) player).capabilities.disableDamage = false;
NBTTagCompound tag = new NBTTagCompound();
((EntityPlayer) player).writeToNBT(tag);
tag.removeTag("ForgeData");
((EntityPlayer) player).readFromNBT(tag);
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false));
}
@Override
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
return stack.getItemDamage() == 0 && player instanceof EntityPlayer;
}
@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;
}
}
@@ -0,0 +1,231 @@
package emt.item.armor.boots;
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;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
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 int maxCharge = 100000;
public int energyPerDamage = 100;
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);
this.setMaxDamage(27);
this.setMaxStackSize(1);
this.setCreativeTab(EMT.TAB);
MinecraftForge.EVENT_BUS.register(this);
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_electric");
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
}
else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
}
}
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
}
else {
return 0;
}
}
@Override
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
}
public double getDamageAbsorptionRatio() {
return 1.1000000000000001D;
}
private double getBaseAbsorptionRatio() {
return 0.14999999999999999D;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
list.add(EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
}
@Override
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
return visDiscount;
}
@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()))) {
Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(player.getEntityId()), Float.valueOf(player.stepHeight));
}
player.stepHeight = 1.0F;
}
if (speedBoostActive && ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)) {
player.moveFlying(0F, 1F, speedBonus);
player.jumpMovementFactor = jumpBonus;
}
}
}
@SubscribeEvent
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
if (hasArmor)
player.motionY += jumpBonus;
}
}
@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);
}
}
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/electricboots.png";
}
@Override
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
return true;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public int getItemEnchantability() {
if (EMTConfigHandler.enchanting == false) {
return 0;
}
else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (EMTConfigHandler.enchanting == false) {
return false;
}
else {
return true;
}
}
public int getEnergyPerDamage() {
return energyPerDamage;
}
/* IC2 API METHODS */
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return 2;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return transferLimit;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -0,0 +1,33 @@
package emt.item.armor.boots;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
public class ItemNanoBootsTraveller extends ItemElectricBootsTraveller {
public ItemNanoBootsTraveller(int par3, int par4) {
super(par3, par4);
maxCharge = 1000000;
speedBonus = (float) EMTConfigHandler.nanoBootsSpeed;
jumpBonus = (float) EMTConfigHandler.nanoBootsJump;
visDiscount = 4;
transferLimit = 1000;
energyPerDamage = 500;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_nano");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/nanobootstravel.png";
}
}
@@ -0,0 +1,33 @@
package emt.item.armor.boots;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
public class ItemQuantumBootsTraveller extends ItemElectricBootsTraveller {
public ItemQuantumBootsTraveller(int par3, int par4) {
super(par3, par4);
maxCharge = 10000000;
speedBonus = (float) EMTConfigHandler.quantumBootsSpeed;
jumpBonus = (float) EMTConfigHandler.quantumBootsJump;
visDiscount = 5;
transferLimit = 10000;
energyPerDamage = 1000;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/boots_quantum");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/quantumbootstravel.png";
}
}
@@ -0,0 +1,567 @@
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;
public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
public final byte NONE = 0;
public final byte JETPACK = 1;
public final byte THAUMIUM = 2;
public final byte NANO = 3;
public final byte QUANTUM = 4;
private IIcon iconNONE;
private IIcon iconJETPACK;
private IIcon iconTHAUMIUM;
private IIcon iconNANO;
private IIcon iconQUANTUM;
protected static ArrayList<Integer> potionRemovalCost = new ArrayList<Integer>();
public static AudioSource audioSource;
private static boolean lastJetpackUsed = false;
public ItemInfusedQuantumChestplate(InternalName internalName, int armorType) {
super(internalName, InternalName.quantum, armorType, 2000000, 12000.0D, 4);
MinecraftForge.EVENT_BUS.register(this);
this.setCreativeTab(EMT.TAB);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
iconNONE = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest");
iconJETPACK = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_jetpack");
iconTHAUMIUM = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_t");
iconNANO = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_n");
iconQUANTUM = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/armor_quantum_chest_wing_q");
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
return "item." + EMT.MOD_ID + ".chestplates.infusedQuantum";
}
public String getItemStackDisplayName(ItemStack stack) {
return (StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
}
@SubscribeEvent
public void onEntityLivingFallEvent(LivingFallEvent event) {
if (IC2.platform.isSimulating() && (event.entity instanceof EntityLivingBase)) {
EntityLivingBase entity = (EntityLivingBase) event.entity;
ItemStack armor = entity.getEquipmentInSlot(1);
if ((armor != null) && (armor.getItem() == this)) {
int fallDamage = Math.max((int) event.distance - 10, 0);
double energyCost = getEnergyPerDamage() * fallDamage;
if (energyCost <= ElectricItem.manager.getCharge(armor)) {
ElectricItem.manager.discharge(armor, energyCost, Integer.MAX_VALUE, true, false, false);
event.setCanceled(true);
}
}
}
}
@Override
public double getDamageAbsorptionRatio() {
return 1.1D;
}
@Override
public int getEnergyPerDamage() {
return 20000;
}
@SideOnly(Side.CLIENT)
@Override
public EnumRarity getRarity(ItemStack stack) {
return EnumRarity.rare;
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(itemStack);
byte toggleTimer = nbt.getByte("toggleTimer");
boolean ret = false;
boolean hoverMode = nbt.getBoolean("hoverMode");
boolean jetpackUsed = false;
byte wing = nbt.getByte("wing");
if (!world.isRemote) {
for (PotionEffect effect : (Collection<PotionEffect>) player.getActivePotionEffects()) {
if (potionRemovalCost.contains(effect.getPotionID())) {
IC2.platform.removePotion(player, effect.getPotionID());
}
}
ItemStack currentStack = player.inventory.getCurrentItem();
Item currentItem = currentStack == null ? null : currentStack.getItem();
if (nbt.hasKey("useother")) {
String useother = nbt.getString("useother");
if (useother.equals("Jetpack")) {
nbt.setByte("wing", JETPACK);
}
if (useother.equals("TW")) {
nbt.setByte("wing", THAUMIUM);
}
if (useother.equals("NW")) {
nbt.setByte("wing", NANO);
}
if (useother.equals("QW")) {
nbt.setByte("wing", QUANTUM);
}
wing = nbt.getByte("wing");
nbt.removeTag("useother");
}
if (wing == NONE) {
nbt.setByte("wing", NONE);
}
if (IC2.keyboard.isJumpKeyDown(player) && IC2.keyboard.isModeSwitchKeyDown(player) && toggleTimer == 0) {
toggleTimer = 30;
hoverMode = !hoverMode;
if (IC2.platform.isSimulating()) {
nbt.setBoolean("hoverMode", hoverMode);
if (hoverMode) {
IC2.platform.messagePlayer(player, "Hover Mode enabled.", new Object[0]);
}
else {
IC2.platform.messagePlayer(player, "Hover Mode disabled.", new Object[0]);
}
}
}
if (currentStack != null && player.isSneaking() && toggleTimer == 0 && wing == NONE) {
if (currentItem == IC2Items.getItem("electricJetpack").getItem()) {
IC2.platform.messagePlayer(player, "Jetpack enabled.", new Object[0]);
nbt.setByte("wing", JETPACK);
//int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(player.inventory.getCurrentItem()) < 30000) {
// ElectricItem.manager.use(itemStack, 30000 - ElectricItem.manager.getCharge(currentStack), player);
//}
nbt.setInteger("jetpackCharge", (int) (ElectricItem.manager.getCharge(currentStack)/* + charge - (int) ElectricItem.manager.getCharge(itemStack))*/));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
else if (currentItem == EMTItems.thaumiumWing) {
IC2.platform.messagePlayer(player, "Thaumium wings enabled.", new Object[0]);
nbt.setByte("wing", THAUMIUM);
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
else if (currentItem == EMTItems.nanoWing) {
IC2.platform.messagePlayer(player, "Nano wings enabled.", new Object[0]);
nbt.setByte("wing", NANO);
//int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(currentStack) < ItemNanoWing.maxCharge) {
// ElectricItem.manager.use(itemStack, ItemNanoWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player);
//}
nbt.setInteger("NWCharge", (int) (ElectricItem.manager.getCharge(player.inventory.getCurrentItem())/* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
else if (currentItem == EMTItems.quantumWing) {
IC2.platform.messagePlayer(player, "Quantum wings enabled.", new Object[0]);
nbt.setByte("wing", QUANTUM);
//int charge = (int) ElectricItem.manager.getCharge(itemStack);
//if (ElectricItem.manager.getCharge(currentStack) < ItemQuantumWing.maxCharge) {
// ElectricItem.manager.use(itemStack, ItemQuantumWing.maxCharge - ElectricItem.manager.getCharge(currentStack), player);
//}
nbt.setInteger("QWCharge", (int) (ElectricItem.manager.getCharge(currentStack)/* + charge - (int) ElectricItem.manager.getCharge(itemStack)*/));
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
}
if (currentStack == null && nbt.getBoolean("unequip") && player.isSneaking()) {
toggleTimer = 30;
if (wing == JETPACK) {
IC2.platform.messagePlayer(player, "Jetpack disabled.", new Object[0]);
nbt.setByte("wing", NONE);
ItemStack charged = new ItemStack(IC2Items.getItem("electricJetpack").getItem());
if (nbt.getInteger("jetpackCharge") > 0)
ElectricItem.manager.charge(charged, nbt.getInteger("jetpackCharge"), 1, true, false);
else
ElectricItem.manager.charge(charged, 0, 1, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
}
if (wing == THAUMIUM) {
IC2.platform.messagePlayer(player, "Thaumium wings disabled.", new Object[0]);
nbt.setByte("wing", NONE);
player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(EMTItems.thaumiumWing));
}
if (wing == NANO) {
IC2.platform.messagePlayer(player, "Nano wings disabled.", new Object[0]);
nbt.setByte("wing", NONE);
ItemStack charged = new ItemStack(EMTItems.nanoWing);
if (nbt.getInteger("NWCharge") > 0)
ElectricItem.manager.charge(charged, nbt.getInteger("NWCharge"), 3, true, false);
else
ElectricItem.manager.charge(charged, 0, 3, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
}
if (wing == QUANTUM) {
IC2.platform.messagePlayer(player, "Quantum wings disabled.", new Object[0]);
nbt.setByte("wing", NONE);
ItemStack charged = new ItemStack(EMTItems.quantumWing);
if (nbt.getInteger("QWCharge") > 0)
ElectricItem.manager.charge(charged, nbt.getInteger("QWCharge"), 3, true, false);
else
ElectricItem.manager.charge(charged, 0, 3, true, false);
player.inventory.setInventorySlotContents(player.inventory.currentItem, charged);
}
}
nbt.setBoolean("unequip", false);
}
if ((IC2.keyboard.isJumpKeyDown(player) && wing == JETPACK) || (hoverMode && player.motionY < -0.029999999329447746D)) {
jetpackUsed = useJetpack(player, hoverMode, itemStack);
}
if (wing == THAUMIUM)
useWings(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false);
if (wing == NANO)
useWings(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
if (wing == QUANTUM)
useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
if (IC2.platform.isSimulating() && toggleTimer > 0) {
toggleTimer = (byte) (toggleTimer - 1);
nbt.setByte("toggleTimer", toggleTimer);
}
if (IC2.platform.isRendering() && player == IC2.platform.getPlayerInstance()) {
if (lastJetpackUsed != jetpackUsed) {
if (jetpackUsed) {
if (audioSource == null) {
audioSource = IC2.audioManager.createSource(player, PositionSpec.Backpack, "Tools/Jetpack/JetpackLoop.ogg", true, false, IC2.audioManager.getDefaultVolume());
}
if (audioSource != null) {
audioSource.play();
}
}
else if (audioSource != null) {
audioSource.remove();
audioSource = null;
}
lastJetpackUsed = jetpackUsed;
}
if (audioSource != null) {
audioSource.updatePosition();
}
}
ret = jetpackUsed;
player.extinguish();
if (ret) {
player.inventoryContainer.detectAndSendChanges();
}
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIconIndex(ItemStack stack) {
try {
byte wing = stack.stackTagCompound.getByte("wing");
switch (wing) {
case JETPACK:
return iconJETPACK;
case THAUMIUM:
return iconTHAUMIUM;
case NANO:
return iconNANO;
case QUANTUM:
return iconQUANTUM;
default:
return iconNONE;
}
} catch (Exception e) {
return iconNONE;
}
}
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) {
try {
byte wing = stack.stackTagCompound.getByte("wing");
switch (wing) {
case JETPACK:
return iconJETPACK;
case THAUMIUM:
return iconTHAUMIUM;
case NANO:
return iconNANO;
case QUANTUM:
return iconQUANTUM;
default:
return iconNONE;
}
} catch (Exception e) {
return iconNONE;
}
}
@Override
public int getItemEnchantability() {
if (EMTConfigHandler.enchanting == false)
return 0;
else
return 4;
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
byte wing = stack.stackTagCompound.getByte("wing");
switch (wing) {
case JETPACK:
return EMT.TEXTURE_PATH + ":textures/models/quantum_jetpack.png";
case THAUMIUM:
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_t.png";
case NANO:
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_n.png";
case QUANTUM:
return EMT.TEXTURE_PATH + ":textures/models/quantum_wings_q.png";
default:
return EMT.TEXTURE_PATH + ":textures/models/quantum.png";
}
}
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
try {
if (entity instanceof EntityPlayer) {
byte wing = stack.stackTagCompound.getByte("wing");
if (wing == JETPACK) {
ModelSpecialArmor mbm = new ModelSpecialArmor(1, 1);
return mbm;
}
else if (wing != 0) {
ModelSpecialArmor mbm = new ModelSpecialArmor(1, 2);
mbm.isJumping = stack.stackTagCompound.getBoolean("isJumping");
return mbm;
}
}
} catch (NullPointerException e) {
new ModelSpecialArmor(1, 0);
}
return new ModelSpecialArmor(1, 0);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
try {
list.add(StatCollector.translateToLocal("ic2.item.tooltip.PowerTier") + " " + tier);
} catch (NullPointerException e) {}
}
public boolean useJetpack(EntityPlayer player, boolean hoverMode, ItemStack stack) {
int jetpackMaxCharge = 30000;
float power = 1.0F;
float dropPercentage = 0.05F;
if (ElectricItem.manager.getCharge(stack) <= 0) {
return false;
}
if (((float) ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) <= dropPercentage) {
power = (float) (power * (ElectricItem.manager.getCharge(stack) / (float) jetpackMaxCharge) * dropPercentage);
}
if (IC2.keyboard.isForwardKeyDown(player)) {
float retruster = 3.5F;
if (hoverMode) {
retruster = 0.5F;
}
float forwardpower = power * retruster * 2.0F;
if (forwardpower > 0.0F) {
player.moveFlying(0.0F, 0.4F * forwardpower, 0.02F);
}
}
int worldHeight = IC2.getWorldHeight(player.worldObj);
double y = player.posY;
if (y > worldHeight - 25) {
if (y > worldHeight) {
y = worldHeight;
}
power = (float) (power * ((worldHeight - y) / 25.0D));
}
double prevmotion = player.motionY;
player.motionY = Math.min(player.motionY + power * 0.2F, 0.6000000238418579D);
if (hoverMode) {
float maxHoverY = -0.025F;
if (IC2.keyboard.isSneakKeyDown(player)) {
maxHoverY = -0.1F;
}
if (IC2.keyboard.isJumpKeyDown(player)) {
maxHoverY = 0.1F;
}
if (player.motionY > maxHoverY) {
player.motionY = maxHoverY;
if (prevmotion > player.motionY) {
player.motionY = prevmotion;
}
}
}
double consume = 8.0D;
if (hoverMode) {
consume = 10.0D;
}
ElectricItem.manager.use(stack, consume, player);
player.fallDistance = 0.0F;
player.distanceWalkedModified = 0.0F;
IC2.platform.resetPlayerInAirTime(player);
return true;
}
void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount, boolean isElectric) {
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
boolean isJumping = IC2.keyboard.isJumpKeyDown(player);
nbt.setBoolean("isJumping", isJumping);
if (isJumping) {
byte f = nbt.getByte("f");
nbt.setBoolean("isHolding", true);
nbt.setByte("f", (byte) (f + 1));
if (f > 7) {
nbt.setByte("f", (byte) 7);
}
}
else if (nbt.getBoolean("isHolding")) {
byte f = nbt.getByte("f");
nbt.setBoolean("isHolding", false);
player.motionY = motionY * f;
if (isElectric) {
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
}
if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) {
player.motionX /= motionXZ;
player.motionZ /= motionXZ;
}
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 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0);
}
nbt.setByte("f", (byte) 0);
}
if (isJumping && !player.onGround && player.motionY < 0) {
player.motionY *= f1;
}
if (player.isInWater() && !player.capabilities.isCreativeMode) {
player.motionY += -0.05;
}
if (EMTConfigHandler.impactOfRain) {
int playerX = MathHelper.floor_double(player.posX);
int playerY = MathHelper.floor_double(player.posY);
int playerZ = MathHelper.floor_double(player.posZ);
if ((world.getBiomeGenForCoords(playerX, playerZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky(playerX, playerY, playerZ) && world.isRaining() && !player.capabilities.isCreativeMode) {
player.motionY += -0.05;
}
}
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
player.motionY *= 0.6;
}
if (player.fallDistance > 0.0F) {
player.fallDistance = 0;
}
}
}
@@ -0,0 +1,193 @@
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;
import ic2.api.item.IElectricItem;
import ic2.api.item.IMetalArmor;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import thaumcraft.api.IGoggles;
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 double maxCharge = 10000;
public double transferLimit = 10;
public int tier = 2;
public int energyPerDamage = 100;
public int visDiscount = 5;
public ItemElectricGoggles(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
this.setCreativeTab(EMT.TAB);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_electric");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/electricgoggles.png";
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public int getItemEnchantability() {
if (EMTConfigHandler.enchanting == false) {
return 0;
}
else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (EMTConfigHandler.enchanting == false) {
return false;
}
else {
return true;
}
}
@Override
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
return visDiscount;
}
@Override
public boolean showNodes(ItemStack itemstack, EntityLivingBase player) {
return true;
}
@Override
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) {
return true;
}
@Override
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
return true;
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0);
}
else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit);
}
}
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
}
else {
return 0;
}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
list.add(EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
}
@Override
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
}
public double getDamageAbsorptionRatio() {
return 1.1000000000000001D;
}
public int getEnergyPerDamage() {
return energyPerDamage;
}
private double getBaseAbsorptionRatio() {
return 0.14999999999999999D;
}
/* IC2 API METHODS */
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return 2;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return transferLimit;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -0,0 +1,62 @@
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 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 {
public ItemNanoGoggles(ArmorMaterial material, int renderIndex, int armorType) {
super(material, renderIndex, armorType);
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(27);
this.setMaxStackSize(1);
visDiscount = 6;
tier = 3;
maxCharge = 100000;
energyPerDamage = 1000;
transferLimit = 100;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_nano");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/thaumicnanohelmet.png";
}
@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));
}
}
}
}
@@ -0,0 +1,99 @@
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 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 ItemQuantumGoggles extends ItemNanoGoggles {
private static final Map<Integer, Integer> potionCost = new HashMap();
public ItemQuantumGoggles(ArmorMaterial material, int renderIndex, int armorType) {
super(material, renderIndex, armorType);
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(27);
this.setMaxStackSize(1);
maxCharge = 10000000;
tier = 3;
visDiscount = 8;
transferLimit = 10000;
energyPerDamage = 1000;
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_quantum");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/thaumicquantumhelmet.png";
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
int refill = player.getAir();
if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) {
player.setAir(refill + 200);
ElectricItem.manager.use(itemStack, 1000, null);
}
Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator();
do {
if (!i$.hasNext()) {
break;
}
{
PotionEffect effect = (PotionEffect) i$.next();
int id = effect.getPotionID();
Integer cost = (Integer) potionCost.get(Integer.valueOf(id));
if (cost != null) {
cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1));
if (ElectricItem.manager.canUse(itemStack, cost.intValue())) {
ElectricItem.manager.use(itemStack, cost.intValue(), null);
ItemStack milk = (new ItemStack(Items.milk_bucket));
player.curePotionEffects(milk);
}
}
}
}
while (true);
if (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));
}
}
}
}
@@ -0,0 +1,185 @@
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 generating;
private int genDay;
private int genNight;
private boolean sunIsUp;
private boolean skyIsVisible;
private boolean noSunWorld;
private boolean dampPlace;
private static final Map potionCost = new HashMap();
@SuppressWarnings("unchecked")
public ItemSolarHelmetRevealing(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
this.setMaxDamage(27);
this.setMaxStackSize(1);
this.setCreativeTab(EMT.TAB);
this.maxCharge = 1000000;
this.genDay = 256;
this.genNight = 128;
maxCharge = 10000000;
visDiscount = 7;
tier = 3;
transferLimit = 10000;
energyPerDamage = 10000;
potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000));
potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000));
potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000));
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/goggles_solar");
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layerType) {
return EMT.TEXTURE_PATH + ":textures/models/solarrevealinghelmet.png";
}
@SuppressWarnings("unchecked")
@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);
if (worldObj.isRemote) {
return;
}
checkForSun(player);
if (this.generating > 0) {
int energyLeft = this.generating;
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
if (energyLeft > 0) {
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
}
else {
return;
}
}
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
if (energyLeft > 0) {
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
}
else {
return;
}
}
}
}
public int checkForSun(EntityPlayer player) {
if (this.ticker++ % tickRate() == 0) {
updateVisibility(player);
}
if ((this.sunIsUp) && (this.skyIsVisible)) {
this.generating = (0 + this.genDay);
return this.generating;
}
if (this.skyIsVisible) {
this.generating = (0 + this.genNight);
return this.generating;
}
this.generating = 0;
return this.generating;
}
public void updateVisibility(EntityPlayer player) {
this.dampPlace = (player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ).getIntRainfall() > 0);
this.noSunWorld = player.worldObj.provider.hasNoSky;
Boolean rainWeather = Boolean.valueOf((this.dampPlace) && ((player.worldObj.isRaining()) || (player.worldObj.isThundering())));
if ((!player.worldObj.isDaytime()) || (rainWeather.booleanValue())) {
this.sunIsUp = false;
}
else {
this.sunIsUp = true;
}
if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld)) {
this.skyIsVisible = false;
}
else {
this.skyIsVisible = true;
}
}
public static int tickRate() {
return 128;
}
}
@@ -0,0 +1,123 @@
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;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class ItemFeatherWing extends ItemArmor {
public int visDiscount = 0;
Random rnd;
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
this.setMaxStackSize(1);
this.setMaxDamage(120);
this.setCreativeTab(EMT.TAB);
this.isDamageable();
rnd = new Random();
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_feather");
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/featherwing.png";
}
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, int armorSlot) {
try {
if (entity instanceof EntityPlayer) {
ModelWings mw = new ModelWings();
mw.isJumping = stack.stackTagCompound.getBoolean("isJumping");
return mw;
}
} catch (NullPointerException e) {
return new ModelWings();
}
return new ModelWings();
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
useWings(player, stack, world, 0.09f, 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");
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
if (isJmuping) {
byte f = nbtData.getByte("f");
nbtData.setBoolean("isHolding", true);
nbtData.setByte("f", (byte) (f + 1));
if (f > 7)
nbtData.setByte("f", (byte) 7);
}
else if (isHolding) {
byte f = nbtData.getByte("f");
nbtData.setBoolean("isHolding", false);
player.motionY = motionY * f;
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) {
player.motionX /= motionXZ;
player.motionZ /= motionXZ;
}
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);
}
nbtData.setByte("f", (byte) 0);
}
if (isJmuping && !player.onGround && player.motionY < 0) {
player.motionY *= f1;
}
if (player.isInWater() && !player.capabilities.isCreativeMode) {
player.motionY += -0.03;
}
if (EMTConfigHandler.impactOfRain) {
if ((world.getBiomeGenForCoords((int) player.posX, (int) player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int) player.posX, (int) player.posY, (int) player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode) {
player.motionY += -0.03;
}
}
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
player.motionY *= 0.6;
}
if (player.fallDistance > 0.0F) {
player.fallDistance = 0;
}
}
}
@@ -0,0 +1,172 @@
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;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import java.util.List;
public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectricItem, ISpecialArmor, IMetalArmor {
public static int maxCharge = 100000;
public int tier = 3;
public double transferLimit = 1000;
public int energyPerDamage = 100;
public ItemNanoWing(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
this.setMaxStackSize(1);
this.setMaxDamage(27);
this.setCreativeTab(EMT.TAB);
visDiscount = 5;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_nano");
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/nanowing.png";
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
this.useWings(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
}
@Override
public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) {
return true;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public int getItemEnchantability() {
if (EMTConfigHandler.enchanting == false) {
return 0;
}
else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
if (EMTConfigHandler.enchanting == false) {
return false;
}
else {
return true;
}
}
public int getEnergyPerDamage() {
return energyPerDamage;
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
if (source.isUnblockable()) {
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 3);
}
else {
double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio();
int energyPerDamage = getEnergyPerDamage();
double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage;
return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(3, absorptionRatio, (int) damageLimit);
}
}
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) {
return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio());
}
else {
return 0;
}
}
@Override
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false);
}
public double getDamageAbsorptionRatio() {
return 1.1000000000000001D;
}
private double getBaseAbsorptionRatio() {
return 0.14999999999999999D;
}
/* IC2 API METHODS */
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return 2;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return transferLimit;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -1,16 +1,15 @@
package tombenpotter.emt.common.items.armor.wings;
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;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.util.ConfigHandler;
public class ItemQuantumWing extends ItemNanoWing {
public static int maxCharge = 1000000;
@@ -19,7 +18,7 @@ public class ItemQuantumWing extends ItemNanoWing {
super(material, par3, par4);
this.setMaxStackSize(1);
this.setMaxDamage(27);
this.setCreativeTab(ElectroMagicTools.tabEMT);
this.setCreativeTab(EMT.TAB);
visDiscount = 6;
transferLimit = 10000;
energyPerDamage = 1000;
@@ -28,18 +27,18 @@ public class ItemQuantumWing extends ItemNanoWing {
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":armor/wing_quantum");
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_quantum");
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return ModInformation.texturePath + ":textures/models/quantumwing.png";
return EMT.TEXTURE_PATH + ":textures/models/quantumwing.png";
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
this.useWing(player, stack, world, 0.33f, 0.5f, 0.2f, 7);
this.useWings(player, stack, world, 0.33f, 0.5f, 0.2f, 7);
}
@Override
@@ -0,0 +1,61 @@
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;
public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisDiscountGear, IRepairable {
public ItemThaumiumReinforcedWing(ArmorMaterial material, int par3, int par4) {
super(material, par3, par4);
this.setMaxStackSize(1);
this.setMaxDamage(250);
this.setCreativeTab(EMT.TAB);
this.isDamageable();
visDiscount = 4;
}
@Override
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
return visDiscount;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":armor/wing_thaumium");
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return EMT.TEXTURE_PATH + ":textures/models/thaumiumwing.png";
}
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
list.add(EMTTextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%");
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
this.useWings(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
}
}
@@ -0,0 +1,35 @@
package emt.item.block;
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;
import net.minecraft.util.StatCollector;
public class ItemBlockElectricCloud extends ItemBlock{
public IIcon icon;
public ItemBlockElectricCloud(Block block) {
super(block);
}
@Override
public IIcon getIconFromDamage(int meta) {
return icon;
}
@Override
public void registerIcons(IIconRegister ir) {
icon = ir.registerIcon(EMT.TEXTURE_PATH + ":" + "electric_cloud");
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
return EMTTextHelper.PURPLE + EMTTextHelper.BOLD + StatCollector.translateToLocal(getUnlocalizedName() + ".name");
}
}
@@ -1,4 +1,4 @@
package tombenpotter.emt.common.items.blocks;
package emt.item.block;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,9 +12,4 @@ public class ItemBlockEssentiaGenerator extends ItemBlock {
public ItemBlockEssentiaGenerator(Block id) {
super(id);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
// list.add("");
}
}
@@ -0,0 +1,53 @@
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;
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;
public class ItemBlockEssentiaGenerators extends ItemBlock {
public ItemBlockEssentiaGenerators(Block id) {
super(id);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage()) {
case 0:
name = "potentia";
break;
case 1:
name = "ignis";
break;
case 2:
name = "auram";
break;
case 3:
name = "arbor";
break;
case 4:
name = "aer";
break;
default:
name = "nothing";
}
return getUnlocalizedName() + "." + name;
}
@Override
public int getMetadata(int meta) {
return meta;
}
}
@@ -0,0 +1,40 @@
package emt.item.block;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockMachines extends ItemBlock {
public ItemBlockMachines(Block id) {
super(id);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
switch (itemstack.getItemDamage()) {
case 0: {
name = "wandrecharge";
break;
}
case 1: {
name = "etheralprocessor";
break;
}
case 2: {
name = "raindispeller";
break;
}
default:
name = "nothing";
}
return getUnlocalizedName() + "." + name;
}
@Override
public int getMetadata(int par1) {
return par1;
}
}
@@ -0,0 +1,257 @@
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 emt.block.BlockBaseContainer;
import emt.block.BlockSolars;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
public class ItemBlockSolars extends ItemBlock {
int instance;
public ItemBlockSolars(Block block) {
super(block);
setHasSubtypes(true);
instance = ((BlockBaseContainer) block).instance;
}
@Override
public String getUnlocalizedName(ItemStack itemstack) {
String name = "";
if (instance == 0) {
switch (itemstack.getItemDamage()) {
case 0: {
name = "compressed";
break;
}
case 1: {
name = "doublecompressed";
break;
}
case 2: {
name = "triplecompressed";
break;
}
case 3: {
name = "water";
break;
}
case 4: {
name = "doublewater";
break;
}
case 5: {
name = "triplewater";
break;
}
case 6: {
name = "dark";
break;
}
case 7: {
name = "doubledark";
break;
}
case 8: {
name = "tripledark";
break;
}
case 9: {
name = "order";
break;
}
case 10: {
name = "doubleorder";
break;
}
case 11: {
name = "tripleorder";
break;
}
case 12: {
name = "fire";
break;
}
case 13: {
name = "doublefire";
break;
}
case 14: {
name = "triplefire";
break;
}
case 15: {
name = "air";
break;
}
default:
name = "nothing";
break;
}
}
if (instance == 1) {
switch (itemstack.getItemDamage()) {
case 0: {
name = "doubleair";
break;
}
case 1: {
name = "tripleair";
break;
}
case 2: {
name = "earth";
break;
}
case 3: {
name = "doubleearth";
break;
}
case 4: {
name = "tripleearth";
break;
}
default:
name = "nothing";
break;
}
}
return getUnlocalizedName() + "." + name;
}
@Override
public int getMetadata(int meta) {
return meta;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean advancedItemTooltips) {
if (instance == 0) {
switch (itemstack.getItemDamage()) {
case 0: {
list.add(EMTConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick"));
break;
}
case 1: {
list.add(EMTConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick"));
break;
}
case 2: {
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"));
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"));
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"));
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"));
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"));
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"));
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"));
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"));
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"));
break;
}
case 12: {
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") + " " + 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.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.double") + " " + localize("tooltip.EMT.output.double.nether"));
break;
}
case 15: {
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"));
break;
}
default: {
list.add(localize("tooltip.EMT.forget"));
break;
}
}
}
if (instance == 1) {
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"));
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"));
break;
}
case 2: {
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"));
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"));
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"));
break;
}
default: {
list.add(localize("tooltip.EMT.forget"));
break;
}
}
}
}
}
@@ -1,4 +1,4 @@
package tombenpotter.emt.common.items.foci;
package emt.item.focus;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -13,37 +13,31 @@ import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.IWandFocus;
import thaumcraft.api.wands.ItemFocusBasic;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
public abstract class ItemBaseFocus extends ItemFocusBasic {
private IIcon ornament, depth;
String textureName = null;
public IIcon ornament;
String textureName = "";
public ItemBaseFocus(String unlocName, String textureName) {
public ItemBaseFocus(String unlocName) {
super();
setUnlocalizedName(ModInformation.modid + unlocName);
setCreativeTab(ElectroMagicTools.tabEMT);
setUnlocalizedName(EMT.MOD_ID + ".focus." + unlocName);
setCreativeTab(EMT.TAB);
setMaxDamage(1);
setNoRepair();
setMaxStackSize(1);
this.textureName = textureName;
this.textureName = unlocName;
}
boolean hasOrnament() {
return false;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ir) {
this.icon = ir.registerIcon(ModInformation.texturePath + ":" + textureName);
public void registerIcons(IIconRegister ir) {
this.icon = ir.registerIcon(EMT.TEXTURE_PATH + ":" + "focus_" + textureName);
}
boolean hasDepth() {
@@ -65,25 +59,19 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
return EnumRarity.rare;
}
public IIcon getFocusDepthLayerIcon() {
return depth;
}
@Override
public IIcon getOrnament(ItemStack focusstack) {
return ornament;
}
public WandFocusAnimation getAnimation() {
return WandFocusAnimation.WAVE;
}
public AspectList getVisCost() {
return null;
@Override
public AspectList getVisCost(ItemStack focusstack) {
return new AspectList();
}
public boolean isUseItem(ItemStack stack) {
return isVisCostPerTick(stack);
}
return isVisCostPerTick(stack);
}
public boolean isVisCostPerTick() {
return false;
@@ -115,19 +103,14 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
return false;
}
public boolean acceptsEnchant(int id) {
return false;
}
@Override
public int getItemEnchantability() {
return 5;
}
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
AspectList cost = getVisCost();
AspectList cost = getVisCost(stack);
if (cost != null && cost.size() > 0) {
list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
for (Aspect aspect : cost.getAspectsSorted()) {
@@ -0,0 +1,85 @@
package emt.item.focus;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import java.util.Map.Entry;
import emt.util.EMTConfigHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemChargeFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10);
public ItemChargeFocus() {
super("charge");
}
@Override
public int getFocusColor(ItemStack stack) {
return 0xFFFF00;
}
@Override
public AspectList getVisCost(ItemStack stack) {
AspectList actualCost = new AspectList();
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet())
actualCost.add(e.getKey(), (int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
return visCost;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "WANDCHARGING";
}
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
}
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
return true;
}
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) {
int energyLeft = (int) (EMTConfigHandler.chargeFocusProduction * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
for (int i = 0; i < player.inventory.armorInventory.length; i++) {
if (energyLeft > 0) {
if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
}
else {
return itemstack;
}
}
for (int j = 0; j < player.inventory.mainInventory.length; j++) {
if (energyLeft > 0) {
if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) {
double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false);
energyLeft -= sentPacket;
}
}
else {
return itemstack;
}
}
}
}
return itemstack;
}
}
@@ -0,0 +1,60 @@
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 {
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500);
public ItemChristmasFocus() {
super("christmas");
}
@Override
public int getFocusColor(ItemStack stack) {
return 0x00FFFF;
}
@Override
public AspectList getVisCost(ItemStack stack) {
return visCost;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "CHRISTMAS";
}
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) {
int x = mop.blockX;
int y = mop.blockY + 1;
int z = mop.blockZ;
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) {
EntitySnowman snowman;
snowman = new EntitySnowman(world);
snowman.setPosition(x, y, z);
world.spawnEntityInWorld(snowman);
}
}
player.swingItem();
}
return itemstack;
}
}
@@ -0,0 +1,59 @@
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 {
public ItemEnergyBallFocus() {
super("energyBall");
}
@Override
public int getFocusColor(ItemStack stack) {
return 0x0000FF;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "ENERGYBALL";
}
@Override
public ItemStack onFocusRightClick(ItemStack stack, World world, EntityPlayer player, MovingObjectPosition mop) {
if (world.isRemote) {
return stack;
}
ItemStack armor = player.inventory.armorInventory[2];
if (armor == null) {
return stack;
}
double val = ElectricItem.manager.discharge(armor, 5120, 4, true, false, false);
if (val < 5120) {
return stack;
}
float rotX = (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotY = (-MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
float rotZ = (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI)) * 100;
world.spawnEntityInWorld(new EntityEnergyBall(world, player, rotX, rotY, rotZ));
return stack;
}
}
@@ -0,0 +1,66 @@
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;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemExplosionFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200);
public ItemExplosionFocus() {
super("explosion");
}
@Override
public int getFocusColor(ItemStack stack) {
return 0x8B0000;
}
@Override
public AspectList getVisCost(ItemStack focusstack) {
return visCost;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "EXPLOSION";
}
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
if (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
if (!world.isRemote) {
EntityLaser laser;
laser = new EntityLaser(world, player, 1);
laser.setExplosionStrengthModifier(getUpgradeLevel(itemstack, FocusUpgradeType.potency) * 0.5f + 1);
world.spawnEntityInWorld(laser);
}
}
return itemstack;
}
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank)
{
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
}
/**
* Use this method to define custom logic about which upgrades can be applied. This can be used to set up upgrade "trees"
* that make certain upgrades available only when others are unlocked first, when certain research is completed, or similar logic.
*
*/
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
return true;
}
}
@@ -0,0 +1,74 @@
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;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.items.wands.ItemWandCasting;
public class ItemShieldFocus extends ItemBaseFocus {
private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 5).add(Aspect.WATER, 5).add(Aspect.AIR, 5);
public ItemShieldFocus() {
super("shield");
}
@Override
public int getFocusColor(ItemStack stack) {
return 0x1E90FF;
}
@Override
public AspectList getVisCost(ItemStack stack) {
return visCost;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "SHIELD";
}
@Override
public boolean isUseItem(ItemStack stack) {
return true;
}
@Override
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
for (PotionEffect effect : new LinkedList<PotionEffect>(player.getActivePotionEffects())) {
IC2.platform.removePotion(player, effect.getPotionID());
}
if (!player.capabilities.isCreativeMode && !wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) {
player.stopUsingItem();
}
}
@Override
public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition paramMovingObjectPosition) {
ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
player.setItemInUse(itemstack, Integer.MAX_VALUE);
if (!world.isRemote && (player.capabilities.isCreativeMode || wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true))) {
EntityShield shield = new EntityShield(world, player);
world.spawnEntityInWorld(shield);
}
return itemstack;
}
}
@@ -0,0 +1,74 @@
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;
import net.minecraft.item.ItemStack;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
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);
public ItemWandChargingFocus() {
super("chargeWand");
}
@Override
public int getFocusColor(ItemStack stack) {
return 0xFFFF450;
}
@Override
public String getSortingHelper(ItemStack itemstack) {
return "ELECTRICCHARGING";
}
@Override
public boolean isVisCostPerTick(ItemStack focusstack) {
return true;
}
@Override
public AspectList getVisCost(ItemStack stack) {
AspectList actualCost = new AspectList();
for (Entry<Aspect, Integer> e : visCost.aspects.entrySet())
actualCost.add(e.getKey(), (int) (e.getValue() * Math.pow(1.1, getUpgradeLevel(stack, FocusUpgradeType.potency))));
return visCost;
}
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
return new FocusUpgradeType[] { FocusUpgradeType.potency, FocusUpgradeType.frugal };
}
public boolean canApplyUpgrade(ItemStack focusstack, EntityPlayer player, FocusUpgradeType type, int rank) {
return true;
}
@Override
public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int integer) {
if (!player.worldObj.isRemote) {
ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem();
ItemStack armor = player.inventory.armorInventory[1];
if (armor != null) {
if ((ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player) && (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, EMTConfigHandler.wandChargeFocusCost / 4, player)))) {
int amount = (int) (100 * Math.pow(1.1, getUpgradeLevel(itemstack, FocusUpgradeType.potency)));
wandItem.addRealVis(itemstack, Aspect.ORDER, amount, true);
wandItem.addRealVis(itemstack, Aspect.FIRE, amount, true);
wandItem.addRealVis(itemstack, Aspect.ENTROPY, amount, true);
wandItem.addRealVis(itemstack, Aspect.WATER, amount, true);
wandItem.addRealVis(itemstack, Aspect.EARTH, amount, true);
wandItem.addRealVis(itemstack, Aspect.AIR, amount, true);
}
}
}
}
}
@@ -0,0 +1,146 @@
package emt.item.tool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
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.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
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;
public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
public IIcon icon;
public int maxCharge = 20000;
public int growthCost = 500;
public int tillCost = 100;
public ItemElectricHoeGrowth() {
super(ToolMaterial.EMERALD);
this.setCreativeTab(EMT.TAB);
this.setMaxStackSize(1);
this.growthCost = 10000;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.icon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/hoe_growth");
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1) {
return this.icon;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) {
if (stack.hasTagCompound()) {
stack.stackTagCompound.setBoolean("Unbreakable", true);
}
boolean did = false;
for (int x1 = -1; x1 <= 1; x1++) {
for (int z1 = -1; z1 <= 1; z1++) {
if (ElectricItem.manager.canUse(stack, 25) && super.onItemUse(stack, player, world, x + x1, y, z + z1, par7, par8, par9, par10)) {
ElectricItem.manager.use(stack, 25, player);
Thaumcraft.proxy.blockSparkle(world, x + x1, y, z + z1, 8401408, 2);
if (!did) {
did = true;
}
}
}
}
if (!did && ElectricItem.manager.canUse(stack, 250)) {
did = Utils.useBonemealAtLoc(world, player, x, y, z);
if (!did) {
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if ((block == ConfigBlocks.blockCustomPlant) && (meta == 0)) {
((BlockCustomPlant) block).growGreatTree(world, x, y, z, world.rand);
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
did = true;
}
else if ((block == ConfigBlocks.blockCustomPlant) && (meta == 1)) {
((BlockCustomPlant) block).growSilverTree(world, x, y, z, world.rand);
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 2);
did = true;
}
}
else {
ElectricItem.manager.use(stack, 250, player);
Thaumcraft.proxy.blockSparkle(world, x, y, z, 0, 3);
}
if (did) {
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wand", 0.75F, 0.9F + world.rand.nextFloat() * 0.2F);
}
}
if (stack.hasTagCompound()) {
stack.stackTagCompound.setBoolean("Unbreakable", false);
}
return did;
}
/* IC2 API METHODS */
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return true;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return 1;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return 1000;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -1,7 +1,11 @@
package tombenpotter.emt.common.items.tools;
package emt.item.tool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.entity.EntityArcher;
import emt.util.EMTConfigHandler;
import emt.util.EMTTextHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -16,11 +20,6 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import tombenpotter.emt.ElectroMagicTools;
import tombenpotter.emt.ModInformation;
import tombenpotter.emt.common.entities.EntityArcher;
import tombenpotter.emt.common.util.ConfigHandler;
import tombenpotter.emt.common.util.TextHelper;
import java.util.List;
@@ -32,16 +31,15 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
public ItemElectricThorHammer() {
super(ToolMaterial.EMERALD);
this.setCreativeTab(ElectroMagicTools.tabEMT);
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(27);
this.setMaxStackSize(1);
// OreDictionary.registerOre("craftingToolForgeHammer", this);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/electricthorhammer");
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/electricthorhammer");
}
@SuppressWarnings({"rawtypes", "unchecked"})
@@ -69,7 +67,7 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
list.add(TextHelper.localize("tooltip.EMT.hammer.electric").replace("%player%", player.getCommandSenderName()));
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.electric").replace("%player%", player.getCommandSenderName()));
}
@Override
@@ -146,7 +144,7 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
@Override
public int getItemEnchantability() {
if (ConfigHandler.enchanting == false) {
if (EMTConfigHandler.enchanting == false) {
return 0;
} else {
return 4;
@@ -155,7 +153,7 @@ public class ItemElectricThorHammer extends ItemSword implements IElectricItem {
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
return ConfigHandler.enchanting;
return EMTConfigHandler.enchanting;
}
/* IC2 API METHODS */
@@ -0,0 +1,94 @@
package emt.item.tool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import thaumcraft.api.IRepairable;
import java.util.List;
public class ItemThorHammer extends ItemSword implements IRepairable {
public ItemThorHammer() {
super(ToolMaterial.EMERALD);
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(2000);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/thorhammer");
}
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
player.swingItem();
float f = 1.0F;
float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f);
float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f);
double d = player.prevPosX + ((player.posX - player.prevPosX) * f);
double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset;
double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f);
Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F);
float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F);
float f5 = -MathHelper.cos(-f1 * 0.01745329F);
float f6 = MathHelper.sin(-f1 * 0.01745329F);
float f7 = f4 * f5;
float f8 = f6;
float f9 = f3 * f5;
double d3 = 5000D;
Vec3 vec3d1 = vec3d.addVector(f7 * d3, f8 * d3, f9 * d3);
MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(vec3d, vec3d1, true);
if (movingobjectposition == null) {
return itemstack;
}
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
}
else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) {
Entity entityhit = movingobjectposition.entityHit;
double x = entityhit.posX;
double y = entityhit.posY;
double z = entityhit.posZ;
world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z));
}
if (player.capabilities.isCreativeMode) {
return itemstack;
}
else {
itemstack.damageItem(20, player);
return itemstack;
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
itemstack.damageItem(1, attacker);
return true;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.The Hammer of Thor"));
}
}
@@ -0,0 +1,71 @@
package emt.item.tool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTTextHelper;
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;
import java.util.List;
public class ItemThorHammerBroken extends ItemSword implements IRepairable {
public ItemThorHammerBroken() {
super(ToolMaterial.EMERALD);
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(1000);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":hammer/taintedthorhammer");
}
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
player.swingItem();
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ - 8));
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ + 8));
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ - 8));
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ + 8));
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 4, player.posZ));
world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 8, player.posZ));
if (!player.capabilities.isCreativeMode) {
itemstack.damageItem(20, player);
}
return itemstack;
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 2F);
itemstack.damageItem(1, attacker);
return true;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4) {
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.thor"));
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.danger"));
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.plsNoRightClick"));
}
else {
list.add(EMTTextHelper.localize("tooltip.EMT.hammer.broken.plsRightClick"));
}
}
}
@@ -0,0 +1,289 @@
package emt.item.tool.chainsaw;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
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;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.stats.StatList;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.IShearable;
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 cost = 200;
public int hitCost = 300;
public int tier = 2;
public ItemDiamondChainsaw() {
super(ToolMaterial.EMERALD);
this.efficiencyOnProperMaterial = 16F;
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(27);
this.setMaxStackSize(1);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_diamond");
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
}
else {
return super.getDigSpeed(stack, block, meta);
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
}
return false;
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null) {
continue;
}
Item item = torchStack.getItem();
if (!(item instanceof ItemBlock)) {
continue;
}
if (!(Block.getBlockFromItem(item) instanceof BlockTorch)) {
continue;
}
int oldMeta = torchStack.getItemDamage();
int oldSize = torchStack.stackSize;
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
if (player.capabilities.isCreativeMode) {
torchStack.setItemDamage(oldMeta);
torchStack.stackSize = oldSize;
}
else if (torchStack.stackSize <= 0) {
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
player.inventory.mainInventory[i] = null;
}
if (result) {
return true;
}
}
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (!IC2.platform.isSimulating()) {
return super.onItemRightClick(stack, world, player);
}
if (IC2.keyboard.isModeSwitchKeyDown(player)) {
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
if (!nbt.hasKey("shearsMode")) {
nbt.setBoolean("shearsMode", true);
}
if (!nbt.getBoolean("shearsMode")) {
nbt.setBoolean("shearsMode", true);
IC2.platform.messagePlayer(player, "ic2.tooltip.mode", "ic2.tooltip.mode.normal");
}
else {
nbt.setBoolean("shearsMode", false);
IC2.platform.messagePlayer(player, "ic2.tooltip.mode", "ic2.tooltip.mode.noShear");
}
}
return super.onItemRightClick(stack, world, player);
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(itemstack);
if (!nbt.hasKey("shearsMode")) {
nbt.setBoolean("shearsMode", true);
}
if (!nbt.getBoolean("shearsMode") || player.worldObj.isRemote) {
return false;
}
Block block = player.worldObj.getBlock(x, y, z);
if (block instanceof IShearable) {
IShearable target = (IShearable) block;
if (target.isShearable(itemstack, player.worldObj, x, y, z)) {
ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
Random rand = new Random();
for (ItemStack stack : drops) {
float f = 0.7F;
double xOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double yOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
double zOffset = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(player.worldObj, (double) x + xOffset, (double) y + yOffset, (double) z + zOffset, stack);
entityitem.delayBeforeCanPickup = 10;
player.worldObj.spawnEntityInWorld(entityitem);
}
player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1);
}
}
return false;
}
@Override
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) {
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(itemstack);
if (!nbt.hasKey("shearsMode")) {
nbt.setBoolean("shearsMode", true);
}
if (!nbt.getBoolean("shearsMode") || entity.worldObj.isRemote) {
return false;
}
if (entity instanceof IShearable) {
IShearable target = (IShearable) entity;
if (target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
Random rand = new Random();
for (ItemStack stack : drops) {
EntityItem ent = entity.entityDropItem(stack, 1.0F);
ent.motionY += rand.nextFloat() * 0.05F;
ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
}
}
return true;
}
return false;
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean flag) {
if (entity instanceof EntityLivingBase) {
NBTTagCompound nbt = StackUtil.getOrCreateNbtData(stack);
if (!nbt.hasKey("shearsMode")) {
nbt.setBoolean("shearsMode", true);
}
}
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public int getItemEnchantability() {
if (EMTConfigHandler.enchanting == false) {
return 0;
}
else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
return EMTConfigHandler.enchanting;
}
/* IC2 API METHODS */
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return 300;
}
}
@@ -0,0 +1,99 @@
package emt.item.tool.chainsaw;
import cpw.mods.fml.common.network.NetworkRegistry;
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;
import net.minecraft.world.World;
import thaumcraft.common.lib.network.PacketHandler;
import thaumcraft.common.lib.network.fx.PacketFXBlockBubble;
import thaumcraft.common.lib.utils.BlockUtils;
import thaumcraft.common.lib.utils.Utils;
import java.awt.*;
import java.util.ArrayList;
public class ItemStreamChainsaw extends ItemThaumiumChainsaw {
boolean alternateServer;
boolean alternateClient;
public static ArrayList oreDictLogs = new ArrayList();
public ItemStreamChainsaw() {
this.efficiencyOnProperMaterial = 25F;
alternateServer = false;
alternateClient = false;
setCreativeTab(EMT.TAB);
this.maxStackSize = 1;
this.setMaxDamage(27);
maxCharge = 900000;
cost = 400;
hitCost = 500;
tier = 3;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_stream");
}
@Override
public EnumAction getItemUseAction(ItemStack itemstack) {
return EnumAction.bow;
}
@Override
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) {
Block bi = world.getBlock(x, y, z);
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z)) && ElectricItem.manager.getCharge(itemstack) > cost) {
if (!world.isRemote) {
if (BlockUtils.breakFurthestBlock(world, x, y, z, bi, player)) {
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
ElectricItem.manager.use(itemstack, cost, player);
this.alternateServer = (!this.alternateServer);
}
}
else {
player.swingItem();
ElectricItem.manager.use(itemstack, cost, player);
this.alternateClient = (!this.alternateClient);
}
}
return super.onItemUse(itemstack, player, world, x, y, z, par7, par8, par9, par10);
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) {
World world = player.worldObj;
Block bi = world.getBlock(x, y, z);
if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) {
if (!world.isRemote) {
BlockUtils.breakFurthestBlock(world, x, y, z, bi, player);
PacketHandler.INSTANCE.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D));
world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F);
}
ElectricItem.manager.use(itemstack, cost, player);
return true;
}
return super.onBlockStartBreak(itemstack, x, y, z, player);
}
/* IC2 API METHODS */
@Override
public double getTransferLimit(ItemStack itemStack) {
return 900;
}
}
@@ -0,0 +1,55 @@
package emt.item.tool.chainsaw;
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;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class ItemThaumiumChainsaw extends ItemDiamondChainsaw {
public ItemThaumiumChainsaw() {
this.efficiencyOnProperMaterial = 21F;
this.setCreativeTab(EMT.TAB);
this.setMaxDamage(27);
this.setMaxStackSize(1);
maxCharge = 60000;
cost = 250;
hitCost = 350;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/chainsaw_thaumium");
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
}
return false;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return 600;
}
}
@@ -0,0 +1,202 @@
package emt.item.tool.drill;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.event.ForgeEventFactory;
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;
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;
public ItemRockbreakerDrill() {
side = 0;
setCreativeTab(EMT.TAB);
this.efficiencyOnProperMaterial = 25F;
this.setMaxStackSize(1);
if (EMTConfigHandler.toolsInBore == false) {
this.setMaxDamage(27);
}
else {
this.setMaxDamage(2571);
}
maxCharge = 900000;
transferLimit = 900;
tier = 3;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/drill_rockbreaker");
}
private boolean isEffectiveAgainst(Block block) {
for (int var3 = 0; var3 < isEffective.length; var3++) {
if (isEffective[var3] == block) {
return true;
}
}
return false;
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
MovingObjectPosition movingobjectposition = BlockUtils.getTargetBlock(((Entity) (player)).worldObj, player, true);
if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) {
side = movingobjectposition.sideHit;
}
return super.onBlockStartBreak(itemstack, X, Y, Z, player);
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) {
if (EMTConfigHandler.toolsInBore == false) {
cost = 350;
}
else {
cost = 1;
}
if (entityLiving.isSneaking()) {
if (ElectricItem.manager.canUse(stack, cost)) {
ElectricItem.manager.use(stack, cost, entityLiving);
}
return true;
}
int md = world.getBlockMetadata(x, y, z);
if (ForgeHooks.isToolEffective(stack, block, md) || isEffectiveAgainst(block)) {
for (int aa = -1; aa <= 1; aa++) {
for (int bb = -1; bb <= 1; bb++) {
int xx = 0;
int yy = 0;
int zz = 0;
if (side <= 1) {
xx = aa;
zz = bb;
}
else if (side <= 3) {
xx = aa;
yy = bb;
}
else {
zz = aa;
yy = bb;
}
Block bl = world.getBlock(x + xx, y + yy, z + zz);
md = world.getBlockMetadata(x + xx, y + yy, z + zz);
if (!ForgeHooks.isToolEffective(stack, bl, md) && !isEffectiveAgainst(bl)) {
continue;
}
if (ElectricItem.manager.canUse(stack, cost)) {
ElectricItem.manager.use(stack, cost, entityLiving);
}
int fortune = EnchantmentHelper.getFortuneModifier(entityLiving);
world.setBlockToAir(x + xx, y + yy, z + zz);
ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune);
boolean creative = false;
if ((entityLiving instanceof EntityPlayer) && ((EntityPlayer) entityLiving).capabilities.isCreativeMode) {
creative = true;
}
if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) {
continue;
}
ItemStack is;
for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, entityLiving, 3))) {
is = (ItemStack) i$.next();
}
}
}
}
return true;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
if (!player.isSneaking()) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
continue;
}
Item item = torchStack.getItem();
if (!(item instanceof ItemBlock)) {
continue;
}
int oldMeta = torchStack.getItemDamage();
int oldSize = torchStack.stackSize;
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
if (player.capabilities.isCreativeMode) {
torchStack.setItemDamage(oldMeta);
torchStack.stackSize = oldSize;
}
else if (torchStack.stackSize <= 0) {
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
player.inventory.mainInventory[i] = null;
}
if (result) {
return true;
}
}
}
else {
ElectricItem.manager.use(stack, searchCost, player);
if (!world.isRemote) {
world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset);
}
Minecraft mc = Minecraft.getMinecraft();
Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L, 1);
player.swingItem();
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) {
entity.setFire(2);
}
return super.onLeftClickEntity(stack, player, entity);
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F);
}
return false;
}
}
@@ -0,0 +1,147 @@
package emt.item.tool.drill;
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;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.List;
public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
public int maxCharge = 60000;
public int cost;
public int tier = 2;
public double transferLimit = 100;
public ItemThaumiumDrill() {
super(ToolMaterial.EMERALD);
this.efficiencyOnProperMaterial = 20F;
this.setCreativeTab(EMT.TAB);
this.setMaxStackSize(1);
if (EMTConfigHandler.toolsInBore == false) {
this.setMaxDamage(27);
}
else {
this.setMaxDamage(240);
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/drill_thaumium");
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
if (EMTConfigHandler.toolsInBore == false) {
cost = 250;
}
else {
cost = 1;
}
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
}
else {
return super.getDigSpeed(stack, block, meta);
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
return true;
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public int getItemEnchantability() {
if (EMTConfigHandler.enchanting == false) {
return 0;
}
else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
return EMTConfigHandler.enchanting;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return transferLimit;
}
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
}
@@ -0,0 +1,64 @@
package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block;
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.util.DamageSource;
import net.minecraft.world.World;
public class ItemOmnitoolDiamond extends ItemOmnitoolIron {
public ItemOmnitoolDiamond() {
super();
this.efficiencyOnProperMaterial = 16F;
this.setCreativeTab(EMT.TAB);
this.setMaxStackSize(1);
if (!EMTConfigHandler.toolsInBore) {
this.setMaxDamage(27);
}
else {
this.setMaxDamage(350);
}
maxCharge = 70000;
hitCost = 250;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_diamond");
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
if (!EMTConfigHandler.toolsInBore) {
cost = 200;
}
else {
cost = 1;
}
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
}
return false;
}
/* IC2 API METHODS */
@Override
public double getTransferLimit(ItemStack itemStack) {
return 400;
}
}
@@ -0,0 +1,186 @@
package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
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.ItemBlock;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
import java.util.List;
import java.util.Locale;
public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
public int maxCharge = 20000;
public int cost;
public int hitCost = 125;
public ItemOmnitoolIron() {
super(ToolMaterial.EMERALD);
this.efficiencyOnProperMaterial = 13F;
this.setCreativeTab(EMT.TAB);
this.setMaxStackSize(1);
if (!EMTConfigHandler.toolsInBore) {
this.setMaxDamage(27);
}
else {
this.setMaxDamage(200);
}
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_iron");
}
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this) {
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this) {
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving)
{
if (!EMTConfigHandler.toolsInBore) {
cost = 100;
}
else {
cost = 1;
}
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean canHarvestBlock(Block block, ItemStack stack) {
return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack);
}
@Override
public float getDigSpeed(ItemStack stack, Block block, int meta) {
if (!ElectricItem.manager.canUse(stack, cost)) {
return 1.0F;
}
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial;
}
else {
return super.getDigSpeed(stack, block, meta);
}
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F);
}
return false;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) {
for (int i = 0; i < player.inventory.mainInventory.length; i++) {
ItemStack torchStack = player.inventory.mainInventory[i];
if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase(Locale.US).contains("torch")) {
continue;
}
Item item = torchStack.getItem();
if (!(item instanceof ItemBlock)) {
continue;
}
int oldMeta = torchStack.getItemDamage();
int oldSize = torchStack.stackSize;
boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset);
if (player.capabilities.isCreativeMode) {
torchStack.setItemDamage(oldMeta);
torchStack.stackSize = oldSize;
}
else if (torchStack.stackSize <= 0) {
ForgeEventFactory.onPlayerDestroyItem(player, torchStack);
player.inventory.mainInventory[i] = null;
}
if (result) {
return true;
}
}
return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
}
@Override
public boolean isRepairable() {
return false;
}
@Override
public int getItemEnchantability() {
if (!EMTConfigHandler.enchanting) {
return 0;
}
else {
return 4;
}
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
return EMTConfigHandler.enchanting;
}
/* IC2 API METHODS */
@Override
public Item getChargedItem(ItemStack itemStack) {
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack) {
return this;
}
@Override
public boolean canProvideEnergy(ItemStack itemStack) {
return false;
}
@Override
public double getMaxCharge(ItemStack itemStack) {
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack) {
return 2;
}
@Override
public double getTransferLimit(ItemStack itemStack) {
return 200;
}
}
@@ -0,0 +1,64 @@
package emt.item.tool.omnitool;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import emt.EMT;
import emt.util.EMTConfigHandler;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block;
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.util.DamageSource;
import net.minecraft.world.World;
public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond {
public ItemOmnitoolThaumium() {
super();
this.efficiencyOnProperMaterial = 21F;
this.setCreativeTab(EMT.TAB);
this.setMaxStackSize(1);
if (!EMTConfigHandler.toolsInBore) {
this.setMaxDamage(27);
}
else {
this.setMaxDamage(467);
}
maxCharge = 140000;
hitCost = 650;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(EMT.TEXTURE_PATH + ":tools/omnitool_thaumium");
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) {
if (!EMTConfigHandler.toolsInBore) {
cost = 300;
}
else {
cost = 1;
}
ElectricItem.manager.use(stack, cost, entityLiving);
return true;
}
@Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) {
if (ElectricItem.manager.use(itemstack, hitCost, attacker)) {
entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F);
}
return false;
}
/* IC2 API METHODS */
@Override
public double getTransferLimit(ItemStack itemStack) {
return 800;
}
}
@@ -1,18 +1,18 @@
package tombenpotter.emt.common.network;
package emt.network;
import tombenpotter.emt.common.init.ItemRegistry;
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>{
public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, IMessage> {
@Override
public IMessage onMessage(PacketEMTKeys message, MessageContext ctx) {
if(ctx.getServerHandler().playerEntity.inventory.armorInventory[2] != null && ctx.getServerHandler().playerEntity.inventory.armorInventory[2].getItem() == ItemRegistry.quantumArmor){
if (ctx.getServerHandler().playerEntity.inventory.armorInventory[2] != null && ctx.getServerHandler().playerEntity.inventory.armorInventory[2].getItem() == EMTItems.quantumArmor) {
ctx.getServerHandler().playerEntity.inventory.armorInventory[2].stackTagCompound.setBoolean("unequip", true);
}
return null;
@@ -20,7 +20,7 @@ public class PacketEMTKeys implements IMessage, IMessageHandler<PacketEMTKeys, I
@Override
public void fromBytes(ByteBuf buf) {
}
@Override
+50
View File
@@ -0,0 +1,50 @@
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;
import emt.client.renderer.RenderShield;
import emt.entity.EntityArcher;
import emt.entity.EntityEnergyBall;
import emt.entity.EntityLaser;
import emt.entity.EntityShield;
public class ClientProxy extends CommonProxy {
@Override
public void load() {
registerRenders();
EMTKeys.registerKeys();
}
@Override
public void registerRenders() {
Render empty = new Render() {
@Override
public void doRender(Entity e, double x, double y, double z, float f1, float f2) {
}
@Override
protected ResourceLocation getEntityTexture(Entity e) {
return null;
}
};
RenderingRegistry.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser());
RenderingRegistry.registerEntityRenderingHandler(EntityArcher.class, new RenderSnowMan());
RenderingRegistry.registerEntityRenderingHandler(EntityShield.class, new RenderShield());
RenderingRegistry.registerEntityRenderingHandler(EntityEnergyBall.class, empty);
}
}
+59
View File
@@ -0,0 +1,59 @@
package emt.proxy;
import cpw.mods.fml.common.network.IGuiHandler;
import emt.client.gui.GuiEtherealMacerator;
import emt.client.gui.GuiIndustrialWandRecharger;
import emt.client.gui.container.ContainerEtheralMacerator;
import emt.client.gui.container.ContainerIndustrialWandRecharge;
import emt.tile.TileEntityEtherealMacerator;
import emt.tile.TileEntityIndustrialWandRecharge;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class CommonProxy implements IGuiHandler {
public void load() {
registerRenders();
}
public void registerRenders() {
/* Empty in base proxy */
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getTileEntity(x, y, z);
switch (ID) {
case 0:
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) {
return new ContainerIndustrialWandRecharge(player.inventory, (TileEntityIndustrialWandRecharge) entity);
}
case 1:
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
return new ContainerEtheralMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
}
default:
return null;
}
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getTileEntity(x, y, z);
switch (ID) {
case 0:
if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) {
return new GuiIndustrialWandRecharger(player.inventory, (TileEntityIndustrialWandRecharge) entity);
}
case 1:
if (entity != null && entity instanceof TileEntityEtherealMacerator) {
return new GuiEtherealMacerator(player.inventory, (TileEntityEtherealMacerator) entity);
}
default:
return null;
}
}
}
@@ -0,0 +1,48 @@
package emt.tile;
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;
import thaumcraft.common.Thaumcraft;
public class TileElectricCloud extends TileEntity {
@Override
public boolean canUpdate() {
return true;
}
@Override
public void updateEntity() {
if(FMLCommonHandler.instance().getSide().isClient())
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) {
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(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);
}
}
}
+52
View File
@@ -0,0 +1,52 @@
package emt.tile;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
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);
}
}
Loaded 100 of 460 files, more files were not shown because too many files have changed in this diff. Show more