diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-04-10 18:03:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-10 18:03:14 +0200 |
commit | bd10bd57d3db003f63a7abd59422a27894358355 (patch) | |
tree | f642d9209c7112f6d77543591e8d805325123656 /src/main/java/gregtech/common | |
parent | 7fbe84d6d9904514137b066d8bd2a34e90e101fe (diff) | |
download | GT5-Unofficial-bd10bd57d3db003f63a7abd59422a27894358355.tar.gz GT5-Unofficial-bd10bd57d3db003f63a7abd59422a27894358355.tar.bz2 GT5-Unofficial-bd10bd57d3db003f63a7abd59422a27894358355.zip |
Void miner adjustments (#262)
* Added all Ores to Voidminer in DeepDark
+ removed Infinity Ore
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
* renormalize line endings
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/common')
43 files changed, 8297 insertions, 8297 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 99e035772d..978afd9e06 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -1,687 +1,687 @@ -// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
-// Jad home page: http://www.kpdus.com/jad.html
-// Decompiler options: packimports(3)
-// Source File Name: GT_Client.java
-
-package gregtech.common;
-
-import codechicken.lib.vec.Rotation;
-import cpw.mods.fml.client.registry.RenderingRegistry;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.gameevent.TickEvent;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Materials;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.ITurnable;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.BaseTileEntity;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_PlayedSound;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.entities.GT_Entity_Arrow;
-import gregtech.common.entities.GT_Entity_Arrow_Potion;
-import gregtech.common.render.*;
-import ic2.api.tile.IWrenchable;
-import net.minecraft.block.Block;
-import net.minecraft.client.Minecraft;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.stats.StatFileWriter;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.client.event.DrawBlockHighlightEvent;
-import net.minecraftforge.oredict.OreDictionary;
-import org.lwjgl.opengl.GL11;
-
-import java.net.URL;
-import java.util.*;
-
-// Referenced classes of package gregtech.common:
-// GT_Proxy
-
-public class GT_Client extends GT_Proxy
- implements Runnable {
-
- private static List ROTATABLE_VANILLA_BLOCKS;
-
- static {
- ROTATABLE_VANILLA_BLOCKS = Arrays.asList(new Block[]{
- Blocks.piston, Blocks.sticky_piston, Blocks.furnace, Blocks.lit_furnace, Blocks.dropper, Blocks.dispenser, Blocks.chest, Blocks.trapped_chest, Blocks.ender_chest, Blocks.hopper,
- Blocks.pumpkin, Blocks.lit_pumpkin
- });
- }
-
- private final HashSet mCapeList = new HashSet();
- private final GT_CapeRenderer mCapeRenderer;
- private final List mPosR;
- private final List mPosG;
- private final List mPosB;
- private final List mPosA = Arrays.asList(new Object[0]);
- private final List mNegR;
- private final List mNegG;
- private final List mNegB;
- private final List mNegA = Arrays.asList(new Object[0]);
- private final List mMoltenPosR;
- private final List mMoltenPosG;
- private final List mMoltenPosB;
- private final List mMoltenPosA = Arrays.asList(new Object[0]);
- private final List mMoltenNegR;
- private final List mMoltenNegG;
- private final List mMoltenNegB;
- private final List mMoltenNegA = Arrays.asList(new Object[0]);
- private long mAnimationTick;
- /**This is the place to def the value used below**/
- private long afterSomeTime;
- private boolean mAnimationDirection;
- private boolean isFirstClientPlayerTick;
- private String mMessage;
- public GT_Client() {
- mCapeRenderer = new GT_CapeRenderer(mCapeList);
- mAnimationTick = 0L;
- mAnimationDirection = false;
- isFirstClientPlayerTick = true;
- mMessage = "";
- mPosR = Arrays.asList(new Materials[]{
- /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
- Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone
- });
- mPosG = Arrays.asList(new Materials[]{
- /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
- Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth
- });
- mPosB = Arrays.asList(new Materials[]{
- /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis,
- Materials.InfusedWater, Materials.Thaumium
- });
- mNegR = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy, Materials.NetherStar
- });
- mNegG = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy, Materials.NetherStar
- });
- mNegB = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy, Materials.NetherStar
- });
- mMoltenPosR = Arrays.asList(new Materials[]{
- Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
- Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone
- });
- mMoltenPosG = Arrays.asList(new Materials[]{
- Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
- Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth
- });
- mMoltenPosB = Arrays.asList(new Materials[]{
- Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis,
- Materials.InfusedWater, Materials.Thaumium
- });
- mMoltenNegR = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy
- });
- mMoltenNegG = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy
- });
- mMoltenNegB = Arrays.asList(new Materials[]{
- Materials.InfusedEntropy
- });
- }
-
- private static void drawGrid(DrawBlockHighlightEvent aEvent) {
- GL11.glPushMatrix();
- GL11.glTranslated(-(aEvent.player.lastTickPosX + (aEvent.player.posX - aEvent.player.lastTickPosX) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosY + (aEvent.player.posY - aEvent.player.lastTickPosY) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosZ + (aEvent.player.posZ - aEvent.player.lastTickPosZ) * (double) aEvent.partialTicks));
- GL11.glTranslated((float) aEvent.target.blockX + 0.5F, (float) aEvent.target.blockY + 0.5F, (float) aEvent.target.blockZ + 0.5F);
- Rotation.sideRotations[aEvent.target.sideHit].glApply();
- GL11.glTranslated(0.0D, -0.501D, 0.0D);
- GL11.glLineWidth(2.0F);
- GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.5F);
- GL11.glBegin(1);
- GL11.glVertex3d(+.50D, .0D, -.25D);
- GL11.glVertex3d(-.50D, .0D, -.25D);
- GL11.glVertex3d(+.50D, .0D, +.25D);
- GL11.glVertex3d(-.50D, .0D, +.25D);
- GL11.glVertex3d(+.25D, .0D, -.50D);
- GL11.glVertex3d(+.25D, .0D, +.50D);
- GL11.glVertex3d(-.25D, .0D, -.50D);
- GL11.glVertex3d(-.25D, .0D, +.50D);
- TileEntity tTile = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ);
- if (tTile instanceof BaseMetaPipeEntity) {
- int[][] GridSwitchArr = new int[][]{
- {0, 5, 3, 1, 2, 4},
- {5, 0, 1, 3, 2, 4},
- {1, 3, 0, 5, 2, 4},
- {3, 1, 5, 0, 2, 4},
- {4, 2, 3, 1, 0, 5},
- {2, 4, 3, 1, 5, 0},
- };
- int tConnections = ((BaseMetaPipeEntity) tTile).mConnections;
- for (byte i = 0; i < 6; i++) {
- if ((tConnections & (1 << i)) != 0) {
- switch (GridSwitchArr[aEvent.target.sideHit][i]) {
- case 0:
- GL11.glVertex3d(+.25D, .0D, +.25D);
- GL11.glVertex3d(-.25D, .0D, -.25D);
- GL11.glVertex3d(-.25D, .0D, +.25D);
- GL11.glVertex3d(+.25D, .0D, -.25D);
- break;
- case 1:
- GL11.glVertex3d(-.25D, .0D, +.50D);
- GL11.glVertex3d(+.25D, .0D, +.25D);
- GL11.glVertex3d(-.25D, .0D, +.25D);
- GL11.glVertex3d(+.25D, .0D, +.50D);
- break;
- case 2:
- GL11.glVertex3d(-.50D, .0D, -.25D);
- GL11.glVertex3d(-.25D, .0D, +.25D);
- GL11.glVertex3d(-.50D, .0D, +.25D);
- GL11.glVertex3d(-.25D, .0D, -.25D);
- break;
- case 3:
- GL11.glVertex3d(-.25D, .0D, -.50D);
- GL11.glVertex3d(+.25D, .0D, -.25D);
- GL11.glVertex3d(-.25D, .0D, -.25D);
- GL11.glVertex3d(+.25D, .0D, -.50D);
- break;
- case 4:
- GL11.glVertex3d(+.50D, .0D, -.25D);
- GL11.glVertex3d(+.25D, .0D, +.25D);
- GL11.glVertex3d(+.50D, .0D, +.25D);
- GL11.glVertex3d(+.25D, .0D, -.25D);
- break;
- case 5:
- GL11.glVertex3d(+.50D, .0D, +.50D);
- GL11.glVertex3d(+.25D, .0D, +.25D);
- GL11.glVertex3d(+.50D, .0D, +.25D);
- GL11.glVertex3d(+.25D, .0D, +.50D);
- GL11.glVertex3d(+.50D, .0D, -.50D);
- GL11.glVertex3d(+.25D, .0D, -.25D);
- GL11.glVertex3d(+.50D, .0D, -.25D);
- GL11.glVertex3d(+.25D, .0D, -.50D);
- GL11.glVertex3d(-.50D, .0D, +.50D);
- GL11.glVertex3d(-.25D, .0D, +.25D);
- GL11.glVertex3d(-.50D, .0D, +.25D);
- GL11.glVertex3d(-.25D, .0D, +.50D);
- GL11.glVertex3d(-.50D, .0D, -.50D);
- GL11.glVertex3d(-.25D, .0D, -.25D);
- GL11.glVertex3d(-.50D, .0D, -.25D);
- GL11.glVertex3d(-.25D, .0D, -.50D);
- break;
- }
- }
- }
- }
- GL11.glEnd();
- GL11.glPopMatrix();
- }
-
- //TODO less bad
- //@SubscribeEvent
- //public void manipulateDensity(EntityViewRenderEvent.FogDensity event) {
- // if(GT_Pollution.mPlayerPollution > (GT_Mod.gregtechproxy.mPollutionSmogLimit)){
- // event.density = (0.15f*(Math.min(GT_Pollution.mPlayerPollution/((float)GT_Mod.gregtechproxy.mPollutionSourRainLimit),1.0f)))+0.1f;
- // event.setCanceled(true);
- // }
- //}
-
- //@SubscribeEvent
- //public void manipulateColor(EntityViewRenderEvent.FogColors event) {
- // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
- // event.red = 140f/255f;
- // event.green = 80f/255f;
- // event.blue = 40f/255f;
- // }
- //}
-
- //@SubscribeEvent
- //public void manipulateGrassColor(BiomeEvent.GetGrassColor event) {
- // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
- // event.newColor = 0xD2691E;
- // }
- //}
-
- //@SubscribeEvent
- //public void manipulateWaterColor(BiomeEvent.GetWaterColor event) {
- // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
- // event.newColor = 0x556B2F;
- // }
- //}
-
- //@SubscribeEvent
- //public void manipulateFoliageColor(BiomeEvent.GetFoliageColor event) {
- // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){
- // event.newColor = 0xCD853F;
- // }
- //}
-
- public boolean isServerSide() {
- return true;
- }
-
- public boolean isClientSide() {
- return true;
- }
-
- public boolean isBukkitSide() {
- return false;
- }
-
- public EntityPlayer getThePlayer() {
- return Minecraft.getMinecraft().thePlayer;
- }
-
- public int addArmor(String aPrefix) {
- return RenderingRegistry.addNewArmourRendererPrefix(aPrefix);
- }
-
- public void onPreLoad() {
- super.onPreLoad();
- String arr$[] = {
- "renadi", "hanakocz", "MysteryDump", "Flaver4", "x_Fame", "Peluche321", "Goshen_Ithilien", "manf", "Bimgo", "leagris",
- "IAmMinecrafter02", "Cerous", "Devilin_Pixy", "Bkarlsson87", "BadAlchemy", "CaballoCraft", "melanclock", "Resursator", "demanzke", "AndrewAmmerlaan",
- "Deathlycraft", "Jirajha", "Axlegear", "kei_kouma", "Dracion", "dungi", "Dorfschwein", "Zero Tw0", "mattiagraz85", "sebastiank30",
- "Plem", "invultri", "grillo126", "malcanteth", "Malevolence_", "Nicholas_Manuel", "Sirbab", "kehaan", "bpgames123", "semig0d",
- "9000bowser", "Sovereignty89", "Kris1432", "xander_cage_", "samuraijp", "bsaa", "SpwnX", "tworf", "Kadah", "kanni",
- "Stute", "Hegik", "Onlyme", "t3hero", "Hotchi", "jagoly", "Nullav", "BH5432", "Sibmer", "inceee",
- "foxxx0", "Hartok", "TMSama", "Shlnen", "Carsso", "zessirb", "meep310", "Seldron", "yttr1um", "hohounk",
- "freebug", "Sylphio", "jmarler", "Saberawr", "r00teniy", "Neonbeta", "yinscape", "voooon24", "Quintine", "peach774",
- "lepthymo", "bildeman", "Kremnari", "Aerosalo", "OndraSter", "oscares91", "mr10movie", "Daxx367x2", "EGERTRONx", "aka13_404",
- "Abouttabs", "Johnstaal", "djshiny99", "megatronp", "DZCreeper", "Kane_Hart", "Truculent", "vidplace7", "simon6689", "MomoNasty",
- "UnknownXLV", "goreacraft", "Fluttermine", "Daddy_Cecil", "MrMaleficus", "TigersFangs", "cublikefoot", "chainman564", "NikitaBuker", "Misha999777",
- "25FiveDetail", "AntiCivilBoy", "michaelbrady", "xXxIceFirexXx", "Speedynutty68", "GarretSidzaka", "HallowCharm977", "mastermind1919", "The_Hypersonic", "diamondguy2798",
- "zF4ll3nPr3d4t0r", "CrafterOfMines57", "XxELIT3xSNIP3RxX", "SuterusuKusanagi", "xavier0014", "adamros", "alexbegt"
- };
- int len$ = arr$.length;
- for (int i$ = 0; i$ < len$; i$++) {
- String tName = arr$[i$];
- mCapeList.add(tName.toLowerCase());
- }
- (new Thread(this)).start();
- }
-
- public void onLoad() {
- super.onLoad();
- new GT_Renderer_Block();
- new GT_MetaGenerated_Item_Renderer();
- new GT_MetaGenerated_Tool_Renderer();
- new GT_Renderer_Entity_Arrow(GT_Entity_Arrow.class, "arrow");
- new GT_Renderer_Entity_Arrow(GT_Entity_Arrow_Potion.class, "arrow_potions");
- new GT_FlaskRenderer();
- new GT_FluidDisplayStackRenderer();
- }
-
- public void onPostLoad() {
- super.onPostLoad();
- try {
- label0:
- for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++)
- do {
- if (i >= GregTech_API.METATILEENTITIES.length)
- continue label0;
- if (GregTech_API.METATILEENTITIES[i] != null)
- GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true);
- i++;
- } while (true);
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
-
-
-// super.onPostLoad();
-//
-// for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
-// try {
-// for (; i < GregTech_API.METATILEENTITIES.length; i++) if (GregTech_API.METATILEENTITIES[i] != null) GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true);
-// } catch (Throwable e) {
-// e.printStackTrace(GT_Log.err);
-// }
-// }
- }
-
- public void run() {
- try {
- GT_Log.out.println("GT_Mod: Downloading Cape List.");
- @SuppressWarnings("resource")
- Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream());
- while (tScanner.hasNextLine()) {
- String tName = tScanner.nextLine();
- if (!this.mCapeList.contains(tName.toLowerCase())) {
- this.mCapeList.add(tName.toLowerCase());
- }
- }
- } catch (Throwable e) {
- }
- try {
- GT_Log.out.println("GT New Horizons: Downloading Cape List.");
- @SuppressWarnings("resource")
- Scanner tScanner = new Scanner(new URL("https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt").openStream());
- while (tScanner.hasNextLine()) {
- String tName = tScanner.nextLine();
- if (tName.contains(":")) {
- int splitLocation = tName.indexOf(":");
- String username = tName.substring(0, splitLocation);
- if (!this.mCapeList.contains(username.toLowerCase()) && !this.mCapeList.contains(tName.toLowerCase())) {
- this.mCapeList.add(tName.toLowerCase());
- }
- } else {
- if (!this.mCapeList.contains(tName.toLowerCase())) {
- this.mCapeList.add(tName.toLowerCase());
- }
- }
- }
- } catch (Throwable e) {
- }
- /**try {
- GT_Log.out.println("GT_Mod: Downloading News.");
- @SuppressWarnings("resource")
- Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream());
- while (tScanner.hasNextLine()) {
- this.mMessage = (this.mMessage + tScanner.nextLine() + " ");
- }
- } catch (Throwable e) {
- }**/
- }
-
- @SubscribeEvent
- public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) {
- mCapeRenderer.receiveRenderSpecialsEvent(aEvent);
- }
-
- @SubscribeEvent
- public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) {
- if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) {
- afterSomeTime++;
- if(afterSomeTime>=100L){
- afterSomeTime=0;
- StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter();
- try {
- for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){
- recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName()));
- }
- }catch (Exception e){}
- }
- ArrayList<GT_PlayedSound> tList = new ArrayList();
- for (Map.Entry<GT_PlayedSound, Integer> tEntry : GT_Utility.sPlayedSoundMap.entrySet()) {
- if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix
- tList.add(tEntry.getKey());
- } else {
- tEntry.setValue(Integer.valueOf(tEntry.getValue().intValue() - 1));
- }
- }
- GT_PlayedSound tKey;
- for (Iterator i$ = tList.iterator(); i$.hasNext(); GT_Utility.sPlayedSoundMap.remove(tKey)) {
- tKey = (GT_PlayedSound) i$.next();
- }
- if(GregTech_API.mServerStarted == false)GregTech_API.mServerStarted = true;
- /*if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) {
- this.isFirstClientPlayerTick = false;
- GT_FluidStack.fixAllThoseFuckingFluidIDs();
- if ((this.mMessage.length() > 5) && (GregTech_API.sSpecialFile.get(ConfigCategories.news, this.mMessage, true))) {
- aEvent.player.addChatComponentMessage(new ChatComponentText(this.mMessage));
- }
- try {
- int tVersion = Integer.parseInt(((String) Class.forName("ic2.core.IC2").getField("VERSION").get(null)).substring(4, 7));
- if (GT_Values.D1) {
- GT_Log.out.println("Industrialcraft Version: " + tVersion);
- }
- if (tVersion < 624) {
- aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please update your IndustrialCraft here:"));
- aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/"));
- } else if (tVersion > GT_Mod.MAX_IC2) {
- aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please downgrade your IndustrialCraft here:"));
- aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + GT_Mod.MAX_IC2 + "/"));
- }
- } catch (Throwable e) {
- aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please get the recommended Version of IndustrialCraft here:"));
- aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/"));
- }
- }*/
- }
- }
-
- @SubscribeEvent
- public void onDrawBlockHighlight(DrawBlockHighlightEvent aEvent) {
- if (GT_Utility.isStackValid(aEvent.currentItem)) {
- Block aBlock = aEvent.player.worldObj.getBlock(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ);
- TileEntity aTileEntity = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ);
- try {
- Class.forName("codechicken.lib.vec.Rotation");
- if (((aTileEntity instanceof BaseMetaPipeEntity)) && (((ICoverable) aTileEntity).getCoverIDAtSide((byte) aEvent.target.sideHit) == 0) && ((GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCovers.keySet())) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCrowbarList)) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWireCutterList)) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sScrewdriverList))|| GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sSolderingToolList))) {
- drawGrid(aEvent);
- return;
- }
- if ((aTileEntity instanceof ITurnable || ROTATABLE_VANILLA_BLOCKS.contains(aBlock) || aTileEntity instanceof IWrenchable) && GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWrenchList)) {
- drawGrid(aEvent);
- return;
- }
- if (aTileEntity instanceof BaseTileEntity && (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWireCutterList) || GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sSolderingToolList))) {
- drawGrid(aEvent);
- return;
- }
- } catch (Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
-
- @SubscribeEvent
- public void receiveRenderEvent(net.minecraftforge.client.event.RenderPlayerEvent.Pre aEvent) {
- if (GT_Utility.getFullInvisibility(aEvent.entityPlayer)) {
- aEvent.setCanceled(true);
- return;
- } else {
- return;
- }
- }
-
- @SubscribeEvent
- public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) {
- if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) {
- if(changeDetected>0)changeDetected--;
- int newHideValue=shouldHeldItemHideThings();
- if(newHideValue!=hideValue){
- hideValue=newHideValue;
- changeDetected=5;
- }
- mAnimationTick++;
- if (mAnimationTick % 50L == 0L)
- {mAnimationDirection = !mAnimationDirection;}
- int tDirection = mAnimationDirection ? 1 : -1;
- for (Iterator i$ = mPosR.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[0] += tDirection;
- }
-
- for (Iterator i$ = mPosG.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[1] += tDirection;
- }
-
- for (Iterator i$ = mPosB.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[2] += tDirection;
- }
-
- for (Iterator i$ = mPosA.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[3] += tDirection;
- }
-
- for (Iterator i$ = mNegR.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[0] -= tDirection;
- }
-
- for (Iterator i$ = mNegG.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[1] -= tDirection;
- }
-
- for (Iterator i$ = mNegB.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[2] -= tDirection;
- }
-
- for (Iterator i$ = mNegA.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mRGBa[3] -= tDirection;
- }
-
- for (Iterator i$ = mMoltenPosR.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[0] += tDirection;
- }
-
- for (Iterator i$ = mMoltenPosG.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[1] += tDirection;
- }
-
- for (Iterator i$ = mMoltenPosB.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[2] += tDirection;
- }
-
- for (Iterator i$ = mMoltenPosA.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[3] += tDirection;
- }
-
- for (Iterator i$ = mMoltenNegR.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[0] -= tDirection;
- }
-
- for (Iterator i$ = mMoltenNegG.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[1] -= tDirection;
- }
-
- for (Iterator i$ = mMoltenNegB.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[2] -= tDirection;
- }
-
- for (Iterator i$ = mMoltenNegA.iterator(); i$.hasNext(); ) {
- Materials tMaterial = (Materials) i$.next();
- tMaterial.mMoltenRGBa[3] -= tDirection;
- }
-
- }
- }
-
- public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
- if (GT_Utility.isStackInvalid(aStack))
- return;
- String tString = "note.harp";
- int i = 0;
- int j = mSoundItems.size();
- do {
- if (i >= j)
- break;
- if (GT_Utility.areStacksEqual((ItemStack) mSoundItems.get(i), aStack)) {
- tString = (String) mSoundNames.get(i);
- break;
- }
- i++;
- } while (true);
- if (tString.startsWith("random.explode"))
- if (aStack.stackSize == 3)
- tString = "random.fuse";
- else if (aStack.stackSize == 2)
- tString = "random.old_explode";
- if (tString.startsWith("streaming."))
- switch (aStack.stackSize) {
- case 1: // '\001'
- tString = (new StringBuilder()).append(tString).append("13").toString();
- break;
-
- case 2: // '\002'
- tString = (new StringBuilder()).append(tString).append("cat").toString();
- break;
-
- case 3: // '\003'
- tString = (new StringBuilder()).append(tString).append("blocks").toString();
- break;
-
- case 4: // '\004'
- tString = (new StringBuilder()).append(tString).append("chirp").toString();
- break;
-
- case 5: // '\005'
- tString = (new StringBuilder()).append(tString).append("far").toString();
- break;
-
- case 6: // '\006'
- tString = (new StringBuilder()).append(tString).append("mall").toString();
- break;
-
- case 7: // '\007'
- tString = (new StringBuilder()).append(tString).append("mellohi").toString();
- break;
-
- case 8: // '\b'
- tString = (new StringBuilder()).append(tString).append("stal").toString();
- break;
-
- case 9: // '\t'
- tString = (new StringBuilder()).append(tString).append("strad").toString();
- break;
-
- case 10: // '\n'
- tString = (new StringBuilder()).append(tString).append("ward").toString();
- break;
-
- case 11: // '\013'
- tString = (new StringBuilder()).append(tString).append("11").toString();
- break;
-
- case 12: // '\f'
- tString = (new StringBuilder()).append(tString).append("wait").toString();
- break;
-
- default:
- tString = (new StringBuilder()).append(tString).append("wherearewenow").toString();
- break;
- }
- if (tString.startsWith("streaming."))
- aWorld.playRecord(tString.substring(10, tString.length()), (int) aX, (int) aY, (int) aZ);
- else
- aWorld.playSound(aX, aY, aZ, tString, 3F, tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F, false);
- }
-
- public static int hideValue=0;
- public static int changeDetected=0;
-
- private static int shouldHeldItemHideThings() {
- try {
- EntityPlayer player = Minecraft.getMinecraft().thePlayer;
- if (player == null) return 0;
- ItemStack tCurrentItem = player.getCurrentEquippedItem();
- if (tCurrentItem == null) return 0;
- int[] ids = OreDictionary.getOreIDs(tCurrentItem);
- int hide = 0;
- for (int i : ids) {
- if (OreDictionary.getOreName(i).equals("craftingToolSolderingIron")) {
- hide |= 0x1;
- break;
- }
- }
- if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)
- || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList)
- || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList)
- || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)
- || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList)
- || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)
- || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList)
- || GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) {
- hide |= 0x2;
- }
- return hide;
- }catch(Exception e){
- return 0;
- }
- }
-}
+// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. +// Jad home page: http://www.kpdus.com/jad.html +// Decompiler options: packimports(3) +// Source File Name: GT_Client.java + +package gregtech.common; + +import codechicken.lib.vec.Rotation; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.ITurnable; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_PlayedSound; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.entities.GT_Entity_Arrow; +import gregtech.common.entities.GT_Entity_Arrow_Potion; +import gregtech.common.render.*; +import ic2.api.tile.IWrenchable; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.oredict.OreDictionary; +import org.lwjgl.opengl.GL11; + +import java.net.URL; +import java.util.*; + +// Referenced classes of package gregtech.common: +// GT_Proxy + +public class GT_Client extends GT_Proxy + implements Runnable { + + private static List ROTATABLE_VANILLA_BLOCKS; + + static { + ROTATABLE_VANILLA_BLOCKS = Arrays.asList(new Block[]{ + Blocks.piston, Blocks.sticky_piston, Blocks.furnace, Blocks.lit_furnace, Blocks.dropper, Blocks.dispenser, Blocks.chest, Blocks.trapped_chest, Blocks.ender_chest, Blocks.hopper, + Blocks.pumpkin, Blocks.lit_pumpkin + }); + } + + private final HashSet mCapeList = new HashSet(); + private final GT_CapeRenderer mCapeRenderer; + private final List mPosR; + private final List mPosG; + private final List mPosB; + private final List mPosA = Arrays.asList(new Object[0]); + private final List mNegR; + private final List mNegG; + private final List mNegB; + private final List mNegA = Arrays.asList(new Object[0]); + private final List mMoltenPosR; + private final List mMoltenPosG; + private final List mMoltenPosB; + private final List mMoltenPosA = Arrays.asList(new Object[0]); + private final List mMoltenNegR; + private final List mMoltenNegG; + private final List mMoltenNegB; + private final List mMoltenNegA = Arrays.asList(new Object[0]); + private long mAnimationTick; + /**This is the place to def the value used below**/ + private long afterSomeTime; + private boolean mAnimationDirection; + private boolean isFirstClientPlayerTick; + private String mMessage; + public GT_Client() { + mCapeRenderer = new GT_CapeRenderer(mCapeList); + mAnimationTick = 0L; + mAnimationDirection = false; + isFirstClientPlayerTick = true; + mMessage = ""; + mPosR = Arrays.asList(new Materials[]{ + /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force, + Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone + }); + mPosG = Arrays.asList(new Materials[]{ + /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force, + Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth + }); + mPosB = Arrays.asList(new Materials[]{ + /**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis, + Materials.InfusedWater, Materials.Thaumium + }); + mNegR = Arrays.asList(new Materials[]{ + Materials.InfusedEntropy, Materials.NetherStar + }); + mNegG = Arrays.asList(new Materials[]{ + Materials.InfusedEntropy, Materials.NetherStar + }); + mNegB = Arrays.asList(new Materials[]{ + Materials.InfusedEntropy, Materials.NetherStar + }); + mMoltenPosR = Arrays.asList(new Materials[]{ + Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force, + Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone + }); + mMoltenPosG = Arrays.asList(new Materials[]{ + Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force, + Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.InfusedAir, Materials.InfusedEarth + }); + mMoltenPosB = Arrays.asList(new Materials[]{ + Materials.Enderium, Materials.NetherStar, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.InfusedVis, + Materials.InfusedWater, Materials.Thaumium + }); + mMoltenNegR = Arrays.asList(new Materials[]{ + Materials.InfusedEntropy + }); + mMoltenNegG = Arrays.asList(new Materials[]{ + Materials.InfusedEntropy + }); + mMoltenNegB = Arrays.asList(new Materials[]{ + Materials.InfusedEntropy + }); + } + + private static void drawGrid(DrawBlockHighlightEvent aEvent) { + GL11.glPushMatrix(); + GL11.glTranslated(-(aEvent.player.lastTickPosX + (aEvent.player.posX - aEvent.player.lastTickPosX) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosY + (aEvent.player.posY - aEvent.player.lastTickPosY) * (double) aEvent.partialTicks), -(aEvent.player.lastTickPosZ + (aEvent.player.posZ - aEvent.player.lastTickPosZ) * (double) aEvent.partialTicks)); + GL11.glTranslated((float) aEvent.target.blockX + 0.5F, (float) aEvent.target.blockY + 0.5F, (float) aEvent.target.blockZ + 0.5F); + Rotation.sideRotations[aEvent.target.sideHit].glApply(); + GL11.glTranslated(0.0D, -0.501D, 0.0D); + GL11.glLineWidth(2.0F); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.5F); + GL11.glBegin(1); + GL11.glVertex3d(+.50D, .0D, -.25D); + GL11.glVertex3d(-.50D, .0D, -.25D); + GL11.glVertex3d(+.50D, .0D, +.25D); + GL11.glVertex3d(-.50D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, -.50D); + GL11.glVertex3d(+.25D, .0D, +.50D); + GL11.glVertex3d(-.25D, .0D, -.50D); + GL11.glVertex3d(-.25D, .0D, +.50D); + TileEntity tTile = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); + if (tTile instanceof BaseMetaPipeEntity) { + int[][] GridSwitchArr = new int[][]{ + {0, 5, 3, 1, 2, 4}, + {5, 0, 1, 3, 2, 4}, + {1, 3, 0, 5, 2, 4}, + {3, 1, 5, 0, 2, 4}, + {4, 2, 3, 1, 0, 5}, + {2, 4, 3, 1, 5, 0}, + }; + int tConnections = ((BaseMetaPipeEntity) tTile).mConnections; + for (byte i = 0; i < 6; i++) { + if ((tConnections & (1 << i)) != 0) { + switch (GridSwitchArr[aEvent.target.sideHit][i]) { + case 0: + GL11.glVertex3d(+.25D, .0D, +.25D); + GL11.glVertex3d(-.25D, .0D, -.25D); + GL11.glVertex3d(-.25D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, -.25D); + break; + case 1: + GL11.glVertex3d(-.25D, .0D, +.50D); + GL11.glVertex3d(+.25D, .0D, +.25D); + GL11.glVertex3d(-.25D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, +.50D); + break; + case 2: + GL11.glVertex3d(-.50D, .0D, -.25D); + GL11.glVertex3d(-.25D, .0D, +.25D); + GL11.glVertex3d(-.50D, .0D, +.25D); + GL11.glVertex3d(-.25D, .0D, -.25D); + break; + case 3: + GL11.glVertex3d(-.25D, .0D, -.50D); + GL11.glVertex3d(+.25D, .0D, -.25D); + GL11.glVertex3d(-.25D, .0D, -.25D); + GL11.glVertex3d(+.25D, .0D, -.50D); + break; + case 4: + GL11.glVertex3d(+.50D, .0D, -.25D); + GL11.glVertex3d(+.25D, .0D, +.25D); + GL11.glVertex3d(+.50D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, -.25D); + break; + case 5: + GL11.glVertex3d(+.50D, .0D, +.50D); + GL11.glVertex3d(+.25D, .0D, +.25D); + GL11.glVertex3d(+.50D, .0D, +.25D); + GL11.glVertex3d(+.25D, .0D, +.50D); + GL11.glVertex3d(+.50D, .0D, -.50D); + GL11.glVertex3d(+.25D, .0D, -.25D); + GL11.glVertex3d(+.50D, .0D, -.25D); + GL11.glVertex3d(+.25D, .0D, -.50D); + GL11.glVertex3d(-.50D, .0D, +.50D); + GL11.glVertex3d(-.25D, .0D, +.25D); + GL11.glVertex3d(-.50D, .0D, +.25D); + GL11.glVertex3d(-.25D, .0D, +.50D); + GL11.glVertex3d(-.50D, .0D, -.50D); + GL11.glVertex3d(-.25D, .0D, -.25D); + GL11.glVertex3d(-.50D, .0D, -.25D); + GL11.glVertex3d(-.25D, .0D, -.50D); + break; + } + } + } + } + GL11.glEnd(); + GL11.glPopMatrix(); + } + + //TODO less bad + //@SubscribeEvent + //public void manipulateDensity(EntityViewRenderEvent.FogDensity event) { + // if(GT_Pollution.mPlayerPollution > (GT_Mod.gregtechproxy.mPollutionSmogLimit)){ + // event.density = (0.15f*(Math.min(GT_Pollution.mPlayerPollution/((float)GT_Mod.gregtechproxy.mPollutionSourRainLimit),1.0f)))+0.1f; + // event.setCanceled(true); + // } + //} + + //@SubscribeEvent + //public void manipulateColor(EntityViewRenderEvent.FogColors event) { + // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + // event.red = 140f/255f; + // event.green = 80f/255f; + // event.blue = 40f/255f; + // } + //} + + //@SubscribeEvent + //public void manipulateGrassColor(BiomeEvent.GetGrassColor event) { + // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + // event.newColor = 0xD2691E; + // } + //} + + //@SubscribeEvent + //public void manipulateWaterColor(BiomeEvent.GetWaterColor event) { + // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + // event.newColor = 0x556B2F; + // } + //} + + //@SubscribeEvent + //public void manipulateFoliageColor(BiomeEvent.GetFoliageColor event) { + // if(GT_Pollution.mPlayerPollution > GT_Mod.gregtechproxy.mPollutionSmogLimit){ + // event.newColor = 0xCD853F; + // } + //} + + public boolean isServerSide() { + return true; + } + + public boolean isClientSide() { + return true; + } + + public boolean isBukkitSide() { + return false; + } + + public EntityPlayer getThePlayer() { + return Minecraft.getMinecraft().thePlayer; + } + + public int addArmor(String aPrefix) { + return RenderingRegistry.addNewArmourRendererPrefix(aPrefix); + } + + public void onPreLoad() { + super.onPreLoad(); + String arr$[] = { + "renadi", "hanakocz", "MysteryDump", "Flaver4", "x_Fame", "Peluche321", "Goshen_Ithilien", "manf", "Bimgo", "leagris", + "IAmMinecrafter02", "Cerous", "Devilin_Pixy", "Bkarlsson87", "BadAlchemy", "CaballoCraft", "melanclock", "Resursator", "demanzke", "AndrewAmmerlaan", + "Deathlycraft", "Jirajha", "Axlegear", "kei_kouma", "Dracion", "dungi", "Dorfschwein", "Zero Tw0", "mattiagraz85", "sebastiank30", + "Plem", "invultri", "grillo126", "malcanteth", "Malevolence_", "Nicholas_Manuel", "Sirbab", "kehaan", "bpgames123", "semig0d", + "9000bowser", "Sovereignty89", "Kris1432", "xander_cage_", "samuraijp", "bsaa", "SpwnX", "tworf", "Kadah", "kanni", + "Stute", "Hegik", "Onlyme", "t3hero", "Hotchi", "jagoly", "Nullav", "BH5432", "Sibmer", "inceee", + "foxxx0", "Hartok", "TMSama", "Shlnen", "Carsso", "zessirb", "meep310", "Seldron", "yttr1um", "hohounk", + "freebug", "Sylphio", "jmarler", "Saberawr", "r00teniy", "Neonbeta", "yinscape", "voooon24", "Quintine", "peach774", + "lepthymo", "bildeman", "Kremnari", "Aerosalo", "OndraSter", "oscares91", "mr10movie", "Daxx367x2", "EGERTRONx", "aka13_404", + "Abouttabs", "Johnstaal", "djshiny99", "megatronp", "DZCreeper", "Kane_Hart", "Truculent", "vidplace7", "simon6689", "MomoNasty", + "UnknownXLV", "goreacraft", "Fluttermine", "Daddy_Cecil", "MrMaleficus", "TigersFangs", "cublikefoot", "chainman564", "NikitaBuker", "Misha999777", + "25FiveDetail", "AntiCivilBoy", "michaelbrady", "xXxIceFirexXx", "Speedynutty68", "GarretSidzaka", "HallowCharm977", "mastermind1919", "The_Hypersonic", "diamondguy2798", + "zF4ll3nPr3d4t0r", "CrafterOfMines57", "XxELIT3xSNIP3RxX", "SuterusuKusanagi", "xavier0014", "adamros", "alexbegt" + }; + int len$ = arr$.length; + for (int i$ = 0; i$ < len$; i$++) { + String tName = arr$[i$]; + mCapeList.add(tName.toLowerCase()); + } + (new Thread(this)).start(); + } + + public void onLoad() { + super.onLoad(); + new GT_Renderer_Block(); + new GT_MetaGenerated_Item_Renderer(); + new GT_MetaGenerated_Tool_Renderer(); + new GT_Renderer_Entity_Arrow(GT_Entity_Arrow.class, "arrow"); + new GT_Renderer_Entity_Arrow(GT_Entity_Arrow_Potion.class, "arrow_potions"); + new GT_FlaskRenderer(); + new GT_FluidDisplayStackRenderer(); + } + + public void onPostLoad() { + super.onPostLoad(); + try { + label0: + for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) + do { + if (i >= GregTech_API.METATILEENTITIES.length) + continue label0; + if (GregTech_API.METATILEENTITIES[i] != null) + GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true); + i++; + } while (true); + } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + + +// super.onPostLoad(); +// +// for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) { +// try { +// for (; i < GregTech_API.METATILEENTITIES.length; i++) if (GregTech_API.METATILEENTITIES[i] != null) GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip(null, true); +// } catch (Throwable e) { +// e.printStackTrace(GT_Log.err); +// } +// } + } + + public void run() { + try { + GT_Log.out.println("GT_Mod: Downloading Cape List."); + @SuppressWarnings("resource") + Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream()); + while (tScanner.hasNextLine()) { + String tName = tScanner.nextLine(); + if (!this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } + } catch (Throwable e) { + } + try { + GT_Log.out.println("GT New Horizons: Downloading Cape List."); + @SuppressWarnings("resource") + Scanner tScanner = new Scanner(new URL("https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt").openStream()); + while (tScanner.hasNextLine()) { + String tName = tScanner.nextLine(); + if (tName.contains(":")) { + int splitLocation = tName.indexOf(":"); + String username = tName.substring(0, splitLocation); + if (!this.mCapeList.contains(username.toLowerCase()) && !this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } else { + if (!this.mCapeList.contains(tName.toLowerCase())) { + this.mCapeList.add(tName.toLowerCase()); + } + } + } + } catch (Throwable e) { + } + /**try { + GT_Log.out.println("GT_Mod: Downloading News."); + @SuppressWarnings("resource") + Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream()); + while (tScanner.hasNextLine()) { + this.mMessage = (this.mMessage + tScanner.nextLine() + " "); + } + } catch (Throwable e) { + }**/ + } + + @SubscribeEvent + public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) { + mCapeRenderer.receiveRenderSpecialsEvent(aEvent); + } + + @SubscribeEvent + public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) { + if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) { + afterSomeTime++; + if(afterSomeTime>=100L){ + afterSomeTime=0; + StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter(); + try { + for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ + recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName())); + } + }catch (Exception e){} + } + ArrayList<GT_PlayedSound> tList = new ArrayList(); + for (Map.Entry<GT_PlayedSound, Integer> tEntry : GT_Utility.sPlayedSoundMap.entrySet()) { + if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix + tList.add(tEntry.getKey()); + } else { + tEntry.setValue(Integer.valueOf(tEntry.getValue().intValue() - 1)); + } + } + GT_PlayedSound tKey; + for (Iterator i$ = tList.iterator(); i$.hasNext(); GT_Utility.sPlayedSoundMap.remove(tKey)) { + tKey = (GT_PlayedSound) i$.next(); + } + if(GregTech_API.mServerStarted == false)GregTech_API.mServerStarted = true; + /*if ((this.isFirstClientPlayerTick) && (aEvent.player == GT_Values.GT.getThePlayer())) { + this.isFirstClientPlayerTick = false; + GT_FluidStack.fixAllThoseFuckingFluidIDs(); + if ((this.mMessage.length() > 5) && (GregTech_API.sSpecialFile.get(ConfigCategories.news, this.mMessage, true))) { + aEvent.player.addChatComponentMessage(new ChatComponentText(this.mMessage)); + } + try { + int tVersion = Integer.parseInt(((String) Class.forName("ic2.core.IC2").getField("VERSION").get(null)).substring(4, 7)); + if (GT_Values.D1) { + GT_Log.out.println("Industrialcraft Version: " + tVersion); + } + if (tVersion < 624) { + aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please update your IndustrialCraft here:")); + aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/")); + } else if (tVersion > GT_Mod.MAX_IC2) { + aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please downgrade your IndustrialCraft here:")); + aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + GT_Mod.MAX_IC2 + "/")); + } + } catch (Throwable e) { + aEvent.player.addChatComponentMessage(new ChatComponentText("GregTech: Please get the recommended Version of IndustrialCraft here:")); + aEvent.player.addChatComponentMessage(new ChatComponentText("ic2api.player.to:8080/job/IC2_experimental/" + (GT_Mod.MAX_IC2 < Integer.MAX_VALUE ? GT_Mod.MAX_IC2 : 624) + "/")); + } + }*/ + } + } + + @SubscribeEvent + public void onDrawBlockHighlight(DrawBlockHighlightEvent aEvent) { + if (GT_Utility.isStackValid(aEvent.currentItem)) { + Block aBlock = aEvent.player.worldObj.getBlock(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); + TileEntity aTileEntity = aEvent.player.worldObj.getTileEntity(aEvent.target.blockX, aEvent.target.blockY, aEvent.target.blockZ); + try { + Class.forName("codechicken.lib.vec.Rotation"); + if (((aTileEntity instanceof BaseMetaPipeEntity)) && (((ICoverable) aTileEntity).getCoverIDAtSide((byte) aEvent.target.sideHit) == 0) && ((GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCovers.keySet())) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sCrowbarList)) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWireCutterList)) || (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sScrewdriverList))|| GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sSolderingToolList))) { + drawGrid(aEvent); + return; + } + if ((aTileEntity instanceof ITurnable || ROTATABLE_VANILLA_BLOCKS.contains(aBlock) || aTileEntity instanceof IWrenchable) && GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWrenchList)) { + drawGrid(aEvent); + return; + } + if (aTileEntity instanceof BaseTileEntity && (GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sWireCutterList) || GT_Utility.isStackInList(aEvent.currentItem, GregTech_API.sSolderingToolList))) { + drawGrid(aEvent); + return; + } + } catch (Throwable e) { + if (GT_Values.D1) { + e.printStackTrace(GT_Log.err); + } + } + } + } + + @SubscribeEvent + public void receiveRenderEvent(net.minecraftforge.client.event.RenderPlayerEvent.Pre aEvent) { + if (GT_Utility.getFullInvisibility(aEvent.entityPlayer)) { + aEvent.setCanceled(true); + return; + } else { + return; + } + } + + @SubscribeEvent + public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) { + if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) { + if(changeDetected>0)changeDetected--; + int newHideValue=shouldHeldItemHideThings(); + if(newHideValue!=hideValue){ + hideValue=newHideValue; + changeDetected=5; + } + mAnimationTick++; + if (mAnimationTick % 50L == 0L) + {mAnimationDirection = !mAnimationDirection;} + int tDirection = mAnimationDirection ? 1 : -1; + for (Iterator i$ = mPosR.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mRGBa[0] += tDirection; + } + + for (Iterator i$ = mPosG.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mRGBa[1] += tDirection; + } + + for (Iterator i$ = mPosB.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mRGBa[2] += tDirection; + } + + for (Iterator i$ = mPosA.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mRGBa[3] += tDirection; + } + + for (Iterator i$ = mNegR.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mRGBa[0] -= tDirection; + } + + for (Iterator i$ = mNegG.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mRGBa[1] -= tDirection; + } + + for (Iterator i$ = mNegB.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mRGBa[2] -= tDirection; + } + + for (Iterator i$ = mNegA.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mRGBa[3] -= tDirection; + } + + for (Iterator i$ = mMoltenPosR.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mMoltenRGBa[0] += tDirection; + } + + for (Iterator i$ = mMoltenPosG.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mMoltenRGBa[1] += tDirection; + } + + for (Iterator i$ = mMoltenPosB.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mMoltenRGBa[2] += tDirection; + } + + for (Iterator i$ = mMoltenPosA.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mMoltenRGBa[3] += tDirection; + } + + for (Iterator i$ = mMoltenNegR.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mMoltenRGBa[0] -= tDirection; + } + + for (Iterator i$ = mMoltenNegG.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mMoltenRGBa[1] -= tDirection; + } + + for (Iterator i$ = mMoltenNegB.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mMoltenRGBa[2] -= tDirection; + } + + for (Iterator i$ = mMoltenNegA.iterator(); i$.hasNext(); ) { + Materials tMaterial = (Materials) i$.next(); + tMaterial.mMoltenRGBa[3] -= tDirection; + } + + } + } + + public void doSonictronSound(ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + if (GT_Utility.isStackInvalid(aStack)) + return; + String tString = "note.harp"; + int i = 0; + int j = mSoundItems.size(); + do { + if (i >= j) + break; + if (GT_Utility.areStacksEqual((ItemStack) mSoundItems.get(i), aStack)) { + tString = (String) mSoundNames.get(i); + break; + } + i++; + } while (true); + if (tString.startsWith("random.explode")) + if (aStack.stackSize == 3) + tString = "random.fuse"; + else if (aStack.stackSize == 2) + tString = "random.old_explode"; + if (tString.startsWith("streaming.")) + switch (aStack.stackSize) { + case 1: // '\001' + tString = (new StringBuilder()).append(tString).append("13").toString(); + break; + + case 2: // '\002' + tString = (new StringBuilder()).append(tString).append("cat").toString(); + break; + + case 3: // '\003' + tString = (new StringBuilder()).append(tString).append("blocks").toString(); + break; + + case 4: // '\004' + tString = (new StringBuilder()).append(tString).append("chirp").toString(); + break; + + case 5: // '\005' + tString = (new StringBuilder()).append(tString).append("far").toString(); + break; + + case 6: // '\006' + tString = (new StringBuilder()).append(tString).append("mall").toString(); + break; + + case 7: // '\007' + tString = (new StringBuilder()).append(tString).append("mellohi").toString(); + break; + + case 8: // '\b' + tString = (new StringBuilder()).append(tString).append("stal").toString(); + break; + + case 9: // '\t' + tString = (new StringBuilder()).append(tString).append("strad").toString(); + break; + + case 10: // '\n' + tString = (new StringBuilder()).append(tString).append("ward").toString(); + break; + + case 11: // '\013' + tString = (new StringBuilder()).append(tString).append("11").toString(); + break; + + case 12: // '\f' + tString = (new StringBuilder()).append(tString).append("wait").toString(); + break; + + default: + tString = (new StringBuilder()).append(tString).append("wherearewenow").toString(); + break; + } + if (tString.startsWith("streaming.")) + aWorld.playRecord(tString.substring(10, tString.length()), (int) aX, (int) aY, (int) aZ); + else + aWorld.playSound(aX, aY, aZ, tString, 3F, tString.startsWith("note.") ? (float) Math.pow(2D, (double) (aStack.stackSize - 13) / 12D) : 1.0F, false); + } + + public static int hideValue=0; + public static int changeDetected=0; + + private static int shouldHeldItemHideThings() { + try { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player == null) return 0; + ItemStack tCurrentItem = player.getCurrentEquippedItem(); + if (tCurrentItem == null) return 0; + int[] ids = OreDictionary.getOreIDs(tCurrentItem); + int hide = 0; + for (int i : ids) { + if (OreDictionary.getOreName(i).equals("craftingToolSolderingIron")) { + hide |= 0x1; + break; + } + } + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList) + || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) + || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sHardHammerList) + || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList) + || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList) + || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList) + || GT_Utility.isStackInList(tCurrentItem, GregTech_API.sCrowbarList) + || GregTech_API.sCovers.containsKey(new GT_ItemStack(tCurrentItem))) { + hide |= 0x2; + } + return hide; + }catch(Exception e){ + return 0; + } + } +} diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 49c891e91f..0f492d78a2 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -1,1383 +1,1383 @@ -package gregtech.common;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import cpw.mods.fml.common.Loader;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.interfaces.internal.IGT_RecipeAdder;
-import gregtech.api.objects.GT_FluidStack;
-import gregtech.api.objects.ItemData;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.items.GT_IntegratedCircuit_Item;
-import mods.railcraft.common.blocks.aesthetics.cube.EnumCube;
-import mods.railcraft.common.items.RailcraftToolItems;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.oredict.OreDictionary;
-import static gregtech.GT_Mod.GT_FML_LOGGER;
-
-public class GT_RecipeAdder implements IGT_RecipeAdder {
-
-
- @Deprecated
- public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) {
- return false;
- }
-
- @Override //Really?
- public boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, int aStartEU) {
- if (aInput1 == null || aInput2 == null || aOutput1 == null || aDuration < 1 || aEUt < 1 || aStartEU < 1) {
- return false;
- }
- if ((aOutput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("fusion", aOutput1.getFluid().getName(), aDuration)) <= 0)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, aDuration, aEUt, aStartEU);
- return true;
- }
-
- public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration) {
- return addCentrifugeRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, 5);
- }
-
- public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) {
- return addCentrifugeRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, aEUt);
- }
-
- public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) {
- return addCentrifugeRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, aChances, aDuration, aEUt, false);
- }
-
- public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) {
- return false;
- }
- if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("centrifuge", aInput1, aDuration)) <= 0)) {
- return false;
- }
- if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile.get("centrifuge", aFluidInput.getFluid().getName(), aDuration)) <= 0)) {
- return false;
- }
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
- GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, }, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, aCleanroom ? -100 : 0);
- return true;
- }
-
- public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("compressor", aInput1, aDuration)) <= 0)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sCompressorRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) {
- return addElectrolyzerRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, aEUt);
- }
-
- public boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) {
- return false;
- }
- if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aInput1, aDuration)) <= 0)) {
- return false;
- }
- if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aFluidInput.getFluid().getName(), aDuration)) <= 0)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6}, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration) {
- return addChemicalRecipe(aInput1, aInput2, null, null, aOutput, aDuration);
- }
-
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration, int aEUt) {
- return addChemicalRecipe(aInput1, aInput2, null, null, aOutput, aDuration, aEUt);
- }
-
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration) {
- return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, 30);
- }
-
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration) {
- return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, 30);
- }
-
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUTick) {
- return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, GT_Values.NI, aDuration, aEUTick);
- }
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) {
- return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, aEUtick, false);
- }
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) {
- return false;
- }
- if ((aOutput != null || aOutput2 != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) {
- return false;
- }
- if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
- return false;
- }
- if (aEUtick <= 0) {
- return false;
- }
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
- GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, aCleanroom ? -200 : 0);
- if (!(aInput1 != null && aInput1.getItem() instanceof GT_IntegratedCircuit_Item && aInput1.getItemDamage() >= 10)
- && !(aInput2 != null && aInput2.getItem() instanceof GT_IntegratedCircuit_Item && aInput2.getItemDamage() >= 10)) {
- GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
- }
- return true;
- }
-
- public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick){
- if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) {
- return false;
- }
- if (aEUtick <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0);
- return true;
- }
-
- public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) {
- return false;
- }
- if ((aOutput != null || aOutput2 != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) {
- return false;
- }
- if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
- return false;
- }
- if (aEUtick <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
- return true;
- }
-
- @Override
- public void addDefaultPolymerizationRecipes(Fluid aBasicMaterial, ItemStack aBasicMaterialCell, Fluid aPolymer){
- //Oxygen/Titaniumtetrafluoride -> +50% Output each
- addChemicalRecipe(ItemList.Cell_Air.get(1, new Object[0]), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 144), Materials.Empty.getCells(1), 160);
- addChemicalRecipe(Materials.Oxygen.getCells(1), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 216), Materials.Empty.getCells(1), 160);
- addChemicalRecipe(aBasicMaterialCell, GT_Utility.getIntegratedCircuit(1), Materials.Air.getGas(14000), new GT_FluidStack(aPolymer, 1000), Materials.Empty.getCells(1), 1120);
- addChemicalRecipe(aBasicMaterialCell, GT_Utility.getIntegratedCircuit(1), Materials.Oxygen.getGas(7000), new GT_FluidStack(aPolymer, 1500), Materials.Empty.getCells(1), 1120);
- addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)},
- new FluidStack[]{new GT_FluidStack(aBasicMaterial, 2160), Materials.Air.getGas(7500), Materials.Titaniumtetrachloride.getFluid(100)},
- new FluidStack[]{new GT_FluidStack(aPolymer, 3240)}, null, 800, 30);
- addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)},
- new FluidStack[]{new GT_FluidStack(aBasicMaterial, 2160), Materials.Oxygen.getGas(7500), Materials.Titaniumtetrachloride.getFluid(100)},
- new FluidStack[]{new GT_FluidStack(aPolymer, 4320)}, null, 800, 30);
- }
-
-
- public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) {
- return addBlastRecipe(aInput1, aInput2, null, null, aOutput1, aOutput2, aDuration, aEUt, aLevel);
- }
-
- public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("blastfurnace", aInput1, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2}, null, null,
- new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, aLevel);
- return true;
- }
-
- public boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, ItemStack aOutput2, int aDuration) {
- if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) {
- return false;
- }
- if (aCoalAmount <= 0) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("primitiveblastfurnace", aInput1, aDuration)) <= 0) {
- return false;
- }
- Materials[] coals = new Materials[]{Materials.Coal, Materials.Charcoal};
- for (Materials coal : coals) {
- GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getGems(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)}, null, null, null, null, aDuration, 0, 0);
- GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getDust(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)}, null, null, null, null, aDuration, 0, 0);
- }
- if (Loader.isModLoaded("Railcraft")) {
- GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2)}, new ItemStack[]{aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2)}, null, null, null, null, aDuration * 2 / 3, 0, 0);
- }
- if ((aInput1 == null || aInput1.stackSize <= 6 ) && (aInput2 == null || aInput2.stackSize <= 6 ) &&
- (aOutput1 == null || aOutput1.stackSize <= 6 ) && (aOutput2 == null || aOutput2.stackSize <= 6 )) {
- aInput1 = aInput1 == null ? null : GT_Utility.copyAmount(aInput1.stackSize * 10, aInput1);
- aInput2 = aInput2 == null ? null : GT_Utility.copyAmount(aInput2.stackSize * 10, aInput2);
- aOutput1 = aOutput1 == null ? null : GT_Utility.copyAmount(aOutput1.stackSize * 10, aOutput1);
- aOutput2 = aOutput2 == null ? null : GT_Utility.copyAmount(aOutput2.stackSize * 10, aOutput2);
- for (Materials coal : coals) {
- GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getBlocks(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)}, null, null, null, null, aDuration * 10, 0, 0);
- GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getBlocks(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)}, null, null, null, null, aDuration * 10, 0, 0);
- }
- if (Loader.isModLoaded("Railcraft")) {
- GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2)}, new ItemStack[]{aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2)}, null, null, null, null, aDuration * 20 / 3, 0, 0);
- }
- }
- return true;
- }
-
- public boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("canning", aInput1, aDuration)) <= 0) {
- return false;
- }
- new GT_Recipe(aInput1, aEUt, aInput2, aDuration, aOutput1, aOutput2);
- return true;
- }
-
- @Override
- public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) {
- return addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt, false);
- }
-
- public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden) {
- if ((aInput1 == null) || (aOutput1 == null || Materials.Graphite.contains(aInput1))) {
- return false;
- }
- if ((aInput2 == null) && ((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) || (OrePrefixes.gem.contains(aInput1)))) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("alloysmelting", aInput2 == null ? aInput1 : aOutput1, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe tRecipe =new GT_Recipe(aInput1, aInput2, aEUt, aDuration, aOutput1);
- if ((hidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- return true;
- }
-
- @Deprecated
- public boolean addCNCRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("cnc", aOutput1, aDuration)) <= 0) {
- return false;
- }
- return true;
- }
-
- public boolean addLatheRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("lathe", aInput1, aDuration)) <= 0) {
- return false;
- }
- new GT_Recipe(aInput1, aOutput1, aOutput2, aDuration, aEUt);
- return true;
- }
- @Override
- public boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
- if ((aInput == null) || (aLubricant == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("cutting", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2}, null, new FluidStack[]{aLubricant}, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) {
- return addCutterRecipe(aInput,null,aOutput1,aOutput2,aDuration,aEUt,aCleanroom);
- }
- public boolean addCutterRecipe(ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt){
- return addCutterRecipe(aInput,aCircuit,aOutput1,aOutput2,aDuration,aEUt,false);
- }
- public boolean addCutterRecipe(ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) {
- return addCutterRecipe(aInput,GT_Utility.getIntegratedCircuit(aCircuit),aOutput1,aOutput2,aDuration,aEUt,aCleanroom);
- }
-
- public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
- return addCutterRecipe(aInput, aOutput1, aOutput2, aDuration, aEUt,false);
- }
-
- public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
- return addCutterRecipe(aInput, aCircuit, aOutput1, aOutput2, aDuration, aEUt,false);
- }
-
- public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) {
- return addCutterRecipe(new ItemStack[]{aInput,aCircuit},new ItemStack[]{aOutput1,aOutput2},aDuration,aEUt,aCleanroom ? -200 : 0);
- }
-
- public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, boolean aCleanroom) {
- return addCutterRecipe(aInputs, aOutputs, aDuration, aEUt, aCleanroom ? -200 : 0);
- }
-
- public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, int aSpecial) {
- if ((aInputs == null) || (aOutputs == null) || aInputs.length == 0 || aOutputs.length == 0) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("cutting", aInputs[0], aDuration)) <= 0) {
- return false;
- }
- if (!GT_Mod.gregtechproxy.mEnableCleanroom && aSpecial == -200){
- aSpecial = 0;
- }
- GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{Materials.Water.getFluid(Math.max(4, Math.min(1000, aDuration * aEUt / 320)))}, null, aDuration * 2, aEUt, aSpecial);
- GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{GT_ModHandler.getDistilledWater(Math.max(3, Math.min(750, aDuration * aEUt / 426)))}, null, aDuration * 2, aEUt, aSpecial);
- GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{Materials.Lubricant.getFluid(Math.max(1, Math.min(250, aDuration * aEUt / 1280)))}, null, aDuration, aEUt, aSpecial);
- return true;
- }
-
-
- public boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict,int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){
- for(ItemStack tStack : GT_OreDictUnificator.getOres(aOreDict)){
- if(GT_Utility.isStackValid(tStack))
- addAssemblerRecipe(aInput1, GT_Utility.copyAmount(aAmount, tStack), aFluidInput, aOutput1, aDuration, aEUt);
- }
- return true;
- }
-
- public boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){
- for(ItemStack tStack : GT_OreDictUnificator.getOres(aOreDict)){
- if(GT_Utility.isStackValid(tStack)) {
- ItemStack[] extendedInputs = new ItemStack[aInputs.length + 1];
- System.arraycopy(aInputs, 0, extendedInputs, 0, aInputs.length);
- extendedInputs[aInputs.length] = GT_Utility.copyAmount(aAmount, tStack);
- addAssemblerRecipe(extendedInputs, aFluidInput, aOutput1, aDuration, aEUt);
- }
- }
- return true;
- }
-
- public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) {
- /*if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0);
- return true;
- */
- return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, null,aOutput1, aDuration, aEUt, false);
- }
-
- public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) {
- return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2}, aFluidInput, aOutput1, aDuration, aEUt);
- }
-
- public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) {
- /*if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) {
- return false;
- }
- if (aOutput1 == null) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0);
- */
- return addAssemblerRecipe(aInputs, aFluidInput, aOutput1, aDuration, aEUt, false);
- }
-
- public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) {
- if(aInput2==null)
- return addAssemblerRecipe(new ItemStack[]{aInput1},aFluidInput,aOutput1,aDuration,aEUt,aCleanroom);
- return addAssemblerRecipe(new ItemStack[]{aInput1,aInput2},aFluidInput,aOutput1,aDuration,aEUt,aCleanroom);
- }
-
- public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) {
-
- if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) {
- return false;
- }
-
- if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) {
- return false;
- }
-
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
-
- if (!GT_Utility.isStackValid(aOutput1)) {
- return false;
- }
-
- boolean ret = false;
-
- for (int oreID : OreDictionary.getOreIDs(aOutput1)) {
- if (OreDictionary.getOreName(oreID).contains("circuit")){
- return this.addAssemblerRecipeNonOD(aInputs, aFluidInput, aOutput1, aDuration, aEUt, aCleanroom);
- }
- }
-
- for (int i = 0; i < aInputs.length; ++i) {
- if (!GT_Utility.isStackValid(aInputs[i])) {
- GT_FML_LOGGER.debug("GT_RecipeAdder: Invalid input for (" + aOutput1.toString() + ")");
- continue;
- }
- for (int oreID : OreDictionary.getOreIDs(aInputs[i])) {
- String odName = OreDictionary.getOreName(oreID);
- if (odName.contains("circuit")) {
- for (ItemStack tStack : GT_OreDictUnificator.getOres(odName)) {
- if (!GT_Utility.isStackValid(tStack))
- continue;
- aInputs[i] = new ItemStack(tStack.getItem(),aInputs[i].stackSize,tStack.getItemDamage());
- GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0);
- ret = true;
- }
- }
- }
- }
-
- if (!ret) {
- GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0);
- ret = true;
- }
-
- return ret;
- }
-
- public boolean addAssemblerRecipeNonOD(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) {
- if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) {
- return false;
- }
-
- if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) {
- return false;
- }
-
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
-
- if (!GT_Utility.isStackValid(aOutput1)) {
- return false;
- }
-
- GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0);
- return true;
- }
-
-
- public boolean addWiremillRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("wiremill", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sWiremillRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addPolarizerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("polarizer", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sPolarizerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addBenderRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("bender", aInput1, aDuration)) <= 0) {
- return false;
- }
- new GT_Recipe(aEUt, aDuration, aInput1, aOutput1);
- return true;
- }
-
- public boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aShape == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addSlicerRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aShape == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("slicer", aOutput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sSlicerRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int aDuration, int aEUt) {
- if ((aInput == null) || (aFluidInput == null) || ((aOutput1 == null) || (aOutput2 == null) || (aOutput3 == null))) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("orewasher", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addImplosionRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aInput2 = GregTech_API.sRecipeFile.get("implosion", aInput1, aInput2)) <= 0) {
- return false;
- }
- int tExplosives = aInput2 > 0 ? aInput2 < 64 ? aInput2 : 64 : 1;
- int tGunpowder = tExplosives<<1;//Worst
- int tDynamite = Math.max(1, tExplosives>>1);//good
- int tTNT = tExplosives;//Slightly better
- int tITNT = Math.max(1, tExplosives>>2);//the best
- //new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2);
- if(tGunpowder<65){
- GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, ItemList.Block_Powderbarrel.get(tGunpowder, new Object[0])}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0);
- }
- if(tDynamite<17){
- GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, GT_ModHandler.getIC2Item("dynamite", tDynamite, null)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0);
- }
- GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, new ItemStack(Blocks.tnt,tTNT)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0);
- GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0);
-
- return true;
- }
-
- @Deprecated
- public boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) {
-// if ((aInput1 == null) || (aOutput1 == null)) {
-// return false;
-// }
-// if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput1, aDuration)) <= 0) {
-// return false;
-// }
-// new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, aDuration, aEUt);
-// return true;
- return false;
- }
-
- @Override
- public boolean addUniversalDistillationRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) {
- for (int i = 0; i < Math.min(aOutputs.length, 11); i++) {
- addDistilleryRecipe(i + 1, aInput, aOutputs[i], aOutput2, aDuration * 2, aEUt / 4, false);
-
- }
-
- return addDistillationTowerRecipe(aInput, aOutputs, aOutput2, aDuration, aEUt);
- }
-
- public boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) {
- if (aInput == null || aOutputs == null || aOutputs.length < 1 || aOutputs.length > 11) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput.getUnlocalizedName(), aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sDistillationRecipes.addRecipe(false, null, new ItemStack[]{aOutput2}, null, new FluidStack[]{aInput}, aOutputs, Math.max(1, aDuration), Math.max(1, aEUt), 0);
- return false;
- }
-
- public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("vacuumfreezer", aInput1, aDuration)) <= 0) {
- return false;
- }
- new GT_Recipe(aInput1, aOutput1, aDuration, aEUt, 0);//Since all other methods are taken
- return true;
- }
-
- public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("vacuumfreezer", aInput1, aDuration)) <= 0) {
- return false;
- }
- new GT_Recipe(aInput1, aOutput1, aDuration);
- return true;
- }
-
- @Deprecated
- public boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4) {
- return false;
- }
-
- public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) {
- if (aInput1 == null) {
- return false;
- }
- new GT_Recipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType);
- return true;
- }
-
- public boolean addSonictronSound(ItemStack aItemStack, String aSoundName) {
- if ((aItemStack == null) || (aSoundName == null) || (aSoundName.equals(""))) {
- return false;
- }
- GT_Mod.gregtechproxy.mSoundItems.add(aItemStack);
- GT_Mod.gregtechproxy.mSoundNames.add(aSoundName);
- if (aSoundName.startsWith("note.")) {
- GT_Mod.gregtechproxy.mSoundCounts.add(Integer.valueOf(25));
- } else {
- GT_Mod.gregtechproxy.mSoundCounts.add(Integer.valueOf(1));
- }
- return true;
- }
-
- public boolean addForgeHammerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) {
- if ((aInput1 == null) || (aOutput1 == null)) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addBoxingRecipe(ItemStack aContainedItem, ItemStack aEmptyBox, ItemStack aFullBox, int aDuration, int aEUt) {
- if ((aContainedItem == null) || (aFullBox == null)) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("boxing", aFullBox, true)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.addRecipe(true, new ItemStack[]{aContainedItem, aEmptyBox}, new ItemStack[]{aFullBox}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt) {
- if ((aFullBox == null) || (aContainedItem == null)) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("unboxing", aFullBox, true)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes.addRecipe(true, new ItemStack[]{aFullBox}, new ItemStack[]{aContainedItem, aEmptyBox}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput1 == null)) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("thermalcentrifuge", aInput, true)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addAmplifier(ItemStack aAmplifierItem, int aDuration, int aAmplifierAmountOutputted) {
- if ((aAmplifierItem == null) || (aAmplifierAmountOutputted <= 0)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("amplifier", aAmplifierItem, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sAmplifiers.addRecipe(true, new ItemStack[]{aAmplifierItem}, null, null, null, new FluidStack[]{Materials.UUAmplifier.getFluid(aAmplifierAmountOutputted)}, aDuration, 30, 0);
- return true;
- }
-
- public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden) {
- if ((aIngredient == null) || (aInput == null) || (aOutput == null)) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) {
- return false;
- }
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe(false, new ItemStack[]{aIngredient}, null, null, new FluidStack[]{new FluidStack(aInput, 750)}, new FluidStack[]{new FluidStack(aOutput, 750)}, aDuration, aEUt, 0);
- if ((aHidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- return true;
- }
-
- public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, boolean aHidden) {
- return addBrewingRecipe(aIngredient, aInput, aOutput, 128, 4, aHidden);
- }
-
- public boolean addBrewingRecipeCustom(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) {
- return false;
- }
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe(false, new ItemStack[]{aIngredient}, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
- if ((aHidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- return true;
- }
-
- public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("fermenting", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) {
- return false;
- }
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFermentingRecipes.addRecipe(false, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
- if ((aHidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- return true;
- }
-
- public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, boolean aHidden) {
- return addFermentingRecipe(aInput, aOutput, aDuration, 2, aHidden);
- }
-
- public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("distillery", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) {
- return false;
- }
- //reduce the batch size if fluid amount is exceeding
- int tScale = (Math.max(aInput.amount, aOutput.amount) + 999) / 1000;
- if (tScale <= 0) tScale = 1;
- if (tScale > 1){
- //trying to find whether there is a better factor
- for (int i = tScale; i <= 5; i++) {
- if (aInput.amount % i == 0 && aDuration % i == 0) {
- tScale = i;
- break;
- }
- }
- for (int i = tScale; i <= 5; i++) {
- if (aInput.amount % i == 0 && aDuration % i == 0 && aOutput.amount % i == 0) {
- tScale = i;
- break;
- }
- }
- aInput = new FluidStack(aInput.getFluid(), (aInput.amount + tScale - 1) / tScale);
- aOutput = new FluidStack(aOutput.getFluid(), aOutput.amount / tScale);
- if (aSolidOutput != null) {
- ItemData tData = GT_OreDictUnificator.getItemData(aSolidOutput);
- if (tData != null && (tData.mPrefix == OrePrefixes.dust || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix)))
- aSolidOutput = GT_OreDictUnificator.getDust(tData.mMaterial.mMaterial, tData.mMaterial.mAmount * aSolidOutput.stackSize / tScale);
- else {
- if (aSolidOutput.stackSize / tScale == 0) aSolidOutput = GT_Values.NI;
- else aSolidOutput = new ItemStack(aSolidOutput.getItem(), aSolidOutput.stackSize / tScale);
- }
- }
- aDuration = (aDuration + tScale - 1) / tScale;
- }
-
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistilleryRecipes.addRecipe(true, new ItemStack[]{aCircuit}, new ItemStack[]{aSolidOutput}, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
- if ((aHidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- return true;
-
- }
- public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) {
- return addDistilleryRecipe(aCircuit, aInput, aOutput, null, aDuration, aEUt, aHidden);
- }
-
- public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) {
- return addDistilleryRecipe(GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aSolidOutput, aDuration, aEUt, aHidden);
- }
-
- public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) {
- return addDistilleryRecipe(GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aDuration, aEUt, aHidden);
- }
-
- public boolean addFluidSolidifierRecipe(ItemStack aMold, FluidStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aMold == null) || (aInput == null) || (aOutput == null)) {
- return false;
- }
- if (aInput.isFluidEqual(Materials.PhasedGold.getMolten(144))) {
- aInput = Materials.VibrantAlloy.getMolten(aInput.amount);
- }
- if (aInput.isFluidEqual(Materials.PhasedIron.getMolten(144))) {
- aInput = Materials.PulsatingIron.getMolten(aInput.amount);
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("fluidsolidifier", aOutput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes.addRecipe(true, new ItemStack[]{aMold}, new ItemStack[]{aOutput}, null, new FluidStack[]{aInput}, null, aDuration, aEUt, 0);
- return true;
- }
-
- @Override
- public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) {
- return addFluidSmelterRecipe(aInput, aRemains, aOutput, aChance, aDuration, aEUt, false);
- }
-
- public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt, boolean hidden) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) {
- aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount);
- }
- if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) {
- aOutput = Materials.PulsatingIron.getMolten(aOutput.amount);
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("fluidsmelter", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aRemains}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
- if ((hidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- return true;
- }
-
- public boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) {
- aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount);
- }
- if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) {
- aOutput = Materials.PulsatingIron.getMolten(aOutput.amount);
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("fluidextractor", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aRemains}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput) {
- int aDuration= aFluidOutput == null ? aFluidInput.amount / 62 : aFluidOutput.amount / 62;
-
- if ((aInput != null) && (aOutput != null)) {
- if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) {
- }
- } else {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("fluidcanner", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput == null ? null : aFluidInput}, new FluidStack[]{aFluidOutput == null ? null : aFluidOutput}, aDuration, 1, 0);
- return true;
- }
-
- public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) {
- if ((aInput != null) && (aOutput != null)) {
- if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) {
- }
- } else {
- return false;
- }
- if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("fluidcanner", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput == null ? null : aFluidInput}, new FluidStack[]{aFluidOutput == null ? null : aFluidOutput}, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) {
- if ((aInput == null) || (aBathingFluid == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("chemicalbath", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, new FluidStack[]{aBathingFluid}, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput1 == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("electromagneticseparator", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("extractor", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sExtractorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aFluid == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("printer", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sPrinterRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, aSpecialSlot, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt) {
- return addAutoclaveRecipe(aInput, aFluid, aOutput, aChance, aDuration, aEUt, false);
- }
-
- public boolean addAutoclaveSpaceRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) {
- if ((aInput == null) || (aFluid == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) {
- return false;
- }
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
- GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -100 : 0);
- return true;
- }
- public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) {
- if ((aInput == null) || (aFluid == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) {
- return false;
- }
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
- GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -200 : 0);
- return true;
- }
-
-
- public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) {
- return addMixerRecipe(aInput1, aInput2, aInput3, aInput4, null, null, null, null, null, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
-
- }
- public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) {
- return addMixerRecipe(aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, null, null, null, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
-
- }
- public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8,ItemStack aInput9, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aFluidOutput == null))) {
- return false;
- }
- if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("mixer", aOutput, aDuration)) <= 0)) {
- return false;
- }
- if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("mixer", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt) {
- return addLaserEngraverRecipe( aItemToEngrave, aLens, aEngravedItem, aDuration, aEUt, false);
- }
-
- public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt, boolean aCleanroom) {
- if ((aItemToEngrave == null) || (aLens == null) || (aEngravedItem == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("laserengraving", aEngravedItem, aDuration)) <= 0) {
- return false;
- }
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
- GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.addRecipe(true, new ItemStack[]{aItemToEngrave, aLens}, new ItemStack[]{aEngravedItem}, null, null, null, aDuration, aEUt, aCleanroom ? -200 : 0);
- return true;
- }
-
- public boolean addFormingPressRecipe(ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt) {
- if ((aItemToImprint == null) || (aForm == null) || (aImprintedItem == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("press", aImprintedItem, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sPressRecipes.addRecipe(true, new ItemStack[]{aItemToImprint, aForm}, new ItemStack[]{aImprintedItem}, null, null, null, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("fluidheater", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe(true, new ItemStack[]{aCircuit}, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
- return true;
- }
-
- public boolean addSifterRecipe(ItemStack aItemToSift, ItemStack[] aSiftedItems, int[] aChances, int aDuration, int aEUt) {
- if ((aItemToSift == null) || (aSiftedItems == null)) {
- return false;
- }
- for (ItemStack tStack : aSiftedItems) {
- if (tStack != null) {
- if ((aDuration = GregTech_API.sRecipeFile.get("sifter", aItemToSift, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sSifterRecipes.addRecipe(true, new ItemStack[]{aItemToSift}, aSiftedItems, null, aChances, null, null, aDuration, aEUt, 0);
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) {
- return addArcFurnaceRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false);
- }
-
- public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) {
- if ((aInput == null) || (aOutputs == null)) {
- return false;
- }
- for (ItemStack tStack : aOutputs) {
- if (tStack != null) {
- if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe sRecipe = GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{Materials.Oxygen.getGas(aDuration)}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0);
- if ((hidden) && (sRecipe != null)) {
- sRecipe.mHidden = true;
- }
- for (Materials tMaterial : new Materials[]{Materials.Argon, Materials.Nitrogen}) {
- if (tMaterial.mPlasma != null) {
- int tPlasmaAmount = (int) Math.max(1L, aDuration / (tMaterial.getMass() * 16L));
- GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{tMaterial.getPlasma(tPlasmaAmount)}, new FluidStack[]{tMaterial.getGas(tPlasmaAmount)}, Math.max(1, aDuration / 16), Math.max(1, aEUt / 3), 0);
- if ((hidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- }
- }
- return true;
- }
- }
- return false;
- }
-
- public boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutputs == null) || aFluidInput == null) {
- return false;
- }
- for (ItemStack tStack : aOutputs) {
- if (tStack != null) {
- if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0);
- return true;
- }
- }
- return false;
- }
-
- public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutputs == null) || aFluidInput == null) {
- return false;
- }
- for (ItemStack tStack : aOutputs) {
- if (tStack != null) {
- if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0);
- return true;
- }
- }
- return false;
- }
-
- public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt) {
- if ((aInput == null) || (aOutputs == null) || aFluidInput == null) {
- return false;
- }
- for (ItemStack tStack : aOutputs) {
- if (tStack != null) {
- if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, Math.max(1, aDuration), Math.max(1, aEUt), 0);
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) {
- return addPulveriserRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false);
- }
-
- public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) {
- if ((aInput == null) || (aOutputs == null)) {
- return false;
- }
- for (ItemStack tStack : aOutputs) {
- if (tStack != null) {
- if ((aDuration = GregTech_API.sRecipeFile.get("pulveriser", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, null, null, aDuration, aEUt, 0);
- if ((hidden) && (tRecipe != null)) {
- tRecipe.mHidden = true;
- }
- return true;
- }
- }
- return false;
- }
-
- @Override
- public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt) {
- if (aInput == null) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("pyrolyse", aInput, aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.addRecipe(false, new ItemStack[]{aInput, ItemList.Circuit_Integrated.getWithDamage(0L, intCircuit, new Object[0])}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0);
- return true;
- }
-
- @Override
- @Deprecated
- public boolean addCrackingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) {
- //if ((aInput == null) || (aOutput == null)) {
- // return false;
- // }
- // if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) {
- // return false;
- // }
- // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
- // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, GT_ModHandler.getSteam(aInput.amount)}, new FluidStack[]{aOutput, Materials.Hydrogen.getGas(aInput.amount)}, aDuration, aEUt, 0);
- // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, Materials.Hydrogen.getGas(aInput.amount)}, new FluidStack[]{new FluidStack(aOutput.getFluid(), (int) (aOutput.amount * 1.3))}, aDuration, aEUt, 0);
- // return true;
- return false;
- }
-
- @Override
- public boolean addCrackingRecipe(int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt) {
- if ((aInput == null && aInput2 == null) || (aOutput == null)) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(false, new ItemStack[]{GT_Utility.getIntegratedCircuit(circuitConfig)}, null, null, null,
- new FluidStack[]{aInput, aInput2}, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
- return true;
- }
-
- @Override
- public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) {
- return false;
- }
- for(ItemStack tItem : aInputs){
- if(tItem==null){
- GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe");
- }
- }
- GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, -201);
- GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true);
- GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt));
- return true;
- }
-
- @Override
- public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) {
- if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) {
- return false;
- }
- ItemStack[] tInputs = new ItemStack[aInputs.length];
- ItemStack[][] tAlts = new ItemStack[aInputs.length][];
- for(int i = 0; i < aInputs.length; i++){
- Object obj = aInputs[i];
- if (obj instanceof ItemStack) {
- tInputs[i] = (ItemStack) obj;
- tAlts[i] = null;
- continue;
- } else if (obj instanceof ItemStack[]) {
- ItemStack[] aStacks = (ItemStack[]) obj;
- if (aStacks.length > 0) {
- tInputs[i] = aStacks[0];
- tAlts[i] = (ItemStack[]) Arrays.copyOf(aStacks, aStacks.length);
- continue;
- }
- } else if (obj instanceof Object[]) {
- Object[] objs = (Object[]) obj;
- List<ItemStack> tList;
- if (objs.length >= 2 && !(tList = GT_OreDictUnificator.getOres(objs[0])).isEmpty()) {
- try {
- int tAmount = ((Number) objs[1]).intValue();
- List<ItemStack> uList = new ArrayList<>();
- for (ItemStack tStack : tList) {
- ItemStack uStack = GT_Utility.copyAmount(tAmount, tStack);
- if (GT_Utility.isStackValid(uStack)) {
- uList.add(uStack);
- if (tInputs[i] == null)
- tInputs[i] = uStack;
- }
- }
- tAlts[i] = uList.toArray(new ItemStack[uList.size()]);
- continue;
- } catch (Exception t) {}
- }
- }
- GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe");
- }
- GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, -201);
- GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},aFluidInputs,null,aDuration,aEUt,0,tAlts,true);
- GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, tInputs, aFluidInputs, aOutput, aDuration, aEUt, tAlts));
- return true;
- }
-
- @Override
- public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt) {
- return addCircuitAssemblerRecipe(aInputs, aFluidInput, aOutput,aDuration,aEUt, false);
- }
-
- public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom) {
-
- if (this.areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) {
- return false;
- }
-
- if ((aDuration = GregTech_API.sRecipeFile.get("circuitassembler", aOutput, aDuration)) <= 0) {
- return false;
- }
-
- if (!GT_Mod.gregtechproxy.mEnableCleanroom) {
- aCleanroom = false;
- }
-
- if (!GT_Utility.isStackValid(aOutput)) {
- return false;
- }
-
- boolean ret = false;
-
- for (int oreID : OreDictionary.getOreIDs(aOutput)) {
- if (OreDictionary.getOreName(oreID).contains("circuit")){
- return this.addCircuitAssemblerRecipeNonOredicted(aInputs, aFluidInput, aOutput, aDuration, aEUt, aCleanroom);
- }
- }
-
- for (int i = 0; i < aInputs.length; ++i) {
- for (int oreID : OreDictionary.getOreIDs(aInputs[i])) {
- String odName = OreDictionary.getOreName(oreID);
- if (odName.contains("circuit")) {
- for (ItemStack tStack : GT_OreDictUnificator.getOres(odName)) {
- if (!GT_Utility.isStackValid(tStack))
- continue;
- aInputs[i] = new ItemStack(tStack.getItem(),aInputs[i].stackSize,tStack.getItemDamage());
- GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0);
- ret = true;
- }
- }
- }
- }
-
- if (!ret) {
- GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0);
- ret = true;
- }
-
- return ret;
- }
-
- public boolean addCircuitAssemblerRecipeNonOredicted(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom) {
- if ((aInputs == null) || (aOutput == null) || aInputs.length>6 || aInputs.length<1) {
- return false;
- }
- if ((aDuration = GregTech_API.sRecipeFile.get("circuitassembler", aOutput, aDuration)) <= 0) {
- return false;
- }
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
- GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0);
- return true;
- }
- private boolean areItemsAndFluidsBothNull(ItemStack[] items, FluidStack[] fluids){
- boolean itemsNull = true;
- if (items != null) {
- for (ItemStack itemStack : items) {
- if (itemStack != null) {
- itemsNull = false;
- break;
- }
- }
- }
- boolean fluidsNull = true;
- if (fluids != null) {
- for (FluidStack fluidStack : fluids) {
- if (fluidStack != null) {
- fluidsNull = false;
- break;
- }
- }
- }
- return itemsNull && fluidsNull;
-
- }
-}
+package gregtech.common; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import cpw.mods.fml.common.Loader; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.internal.IGT_RecipeAdder; +import gregtech.api.objects.GT_FluidStack; +import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.GT_IntegratedCircuit_Item; +import mods.railcraft.common.blocks.aesthetics.cube.EnumCube; +import mods.railcraft.common.items.RailcraftToolItems; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import static gregtech.GT_Mod.GT_FML_LOGGER; + +public class GT_RecipeAdder implements IGT_RecipeAdder { + + + @Deprecated + public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) { + return false; + } + + @Override //Really? + public boolean addFusionReactorRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, int aStartEU) { + if (aInput1 == null || aInput2 == null || aOutput1 == null || aDuration < 1 || aEUt < 1 || aStartEU < 1) { + return false; + } + if ((aOutput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("fusion", aOutput1.getFluid().getName(), aDuration)) <= 0)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, aDuration, aEUt, aStartEU); + return true; + } + + public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration) { + return addCentrifugeRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, 5); + } + + public boolean addCentrifugeRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) { + return addCentrifugeRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, aEUt); + } + + public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { + return addCentrifugeRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, aChances, aDuration, aEUt, false); + } + + public boolean addCentrifugeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt, boolean aCleanroom) { + if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { + return false; + } + if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("centrifuge", aInput1, aDuration)) <= 0)) { + return false; + } + if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile.get("centrifuge", aFluidInput.getFluid().getName(), aDuration)) <= 0)) { + return false; + } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, }, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, aCleanroom ? -100 : 0); + return true; + } + + public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("compressor", aInput1, aDuration)) <= 0)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sCompressorRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addElectrolyzerRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int aDuration, int aEUt) { + return addElectrolyzerRecipe(aInput1, aInput2 < 0 ? ItemList.IC2_Fuel_Can_Empty.get(-aInput2, new Object[0]) : aInput2 > 0 ? ItemList.Cell_Empty.get(aInput2, new Object[0]) : null, null, null, aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6, null, aDuration, aEUt); + } + + public boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { + if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { + return false; + } + if ((aInput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aInput1, aDuration)) <= 0)) { + return false; + } + if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile.get("electrolyzer", aFluidInput.getFluid().getName(), aDuration)) <= 0)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4, aOutput5, aOutput6}, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + return true; + } + + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration) { + return addChemicalRecipe(aInput1, aInput2, null, null, aOutput, aDuration); + } + + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int aDuration, int aEUt) { + return addChemicalRecipe(aInput1, aInput2, null, null, aOutput, aDuration, aEUt); + } + + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration) { + return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, 30); + } + + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration) { + return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, 30); + } + + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUTick) { + return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, GT_Values.NI, aDuration, aEUTick); + } + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) { + return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, aEUtick, false); + } + public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom) { + if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { + return false; + } + if ((aOutput != null || aOutput2 != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) { + return false; + } + if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + return false; + } + if (aEUtick <= 0) { + return false; + } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, aCleanroom ? -200 : 0); + if (!(aInput1 != null && aInput1.getItem() instanceof GT_IntegratedCircuit_Item && aInput1.getItemDamage() >= 10) + && !(aInput2 != null && aInput2.getItem() instanceof GT_IntegratedCircuit_Item && aInput2.getItemDamage() >= 10)) { + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0); + } + return true; + } + + public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick){ + if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) { + return false; + } + if (aEUtick <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0); + return true; + } + + public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) { + if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) { + return false; + } + if ((aOutput != null || aOutput2 != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) { + return false; + } + if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + return false; + } + if (aEUtick <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0); + return true; + } + + @Override + public void addDefaultPolymerizationRecipes(Fluid aBasicMaterial, ItemStack aBasicMaterialCell, Fluid aPolymer){ + //Oxygen/Titaniumtetrafluoride -> +50% Output each + addChemicalRecipe(ItemList.Cell_Air.get(1, new Object[0]), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 144), Materials.Empty.getCells(1), 160); + addChemicalRecipe(Materials.Oxygen.getCells(1), GT_Utility.getIntegratedCircuit(1), new GT_FluidStack(aBasicMaterial, 144), new GT_FluidStack(aPolymer, 216), Materials.Empty.getCells(1), 160); + addChemicalRecipe(aBasicMaterialCell, GT_Utility.getIntegratedCircuit(1), Materials.Air.getGas(14000), new GT_FluidStack(aPolymer, 1000), Materials.Empty.getCells(1), 1120); + addChemicalRecipe(aBasicMaterialCell, GT_Utility.getIntegratedCircuit(1), Materials.Oxygen.getGas(7000), new GT_FluidStack(aPolymer, 1500), Materials.Empty.getCells(1), 1120); + addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, + new FluidStack[]{new GT_FluidStack(aBasicMaterial, 2160), Materials.Air.getGas(7500), Materials.Titaniumtetrachloride.getFluid(100)}, + new FluidStack[]{new GT_FluidStack(aPolymer, 3240)}, null, 800, 30); + addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, + new FluidStack[]{new GT_FluidStack(aBasicMaterial, 2160), Materials.Oxygen.getGas(7500), Materials.Titaniumtetrachloride.getFluid(100)}, + new FluidStack[]{new GT_FluidStack(aPolymer, 4320)}, null, 800, 30); + } + + + public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { + return addBlastRecipe(aInput1, aInput2, null, null, aOutput1, aOutput2, aDuration, aEUt, aLevel); + } + + public boolean addBlastRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("blastfurnace", aInput1, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput1, aOutput2}, null, null, + new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, aLevel); + return true; + } + + public boolean addPrimitiveBlastRecipe(ItemStack aInput1, ItemStack aInput2, int aCoalAmount, ItemStack aOutput1, ItemStack aOutput2, int aDuration) { + if ((aInput1 == null && aInput2 == null) || (aOutput1 == null && aOutput2 == null)) { + return false; + } + if (aCoalAmount <= 0) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("primitiveblastfurnace", aInput1, aDuration)) <= 0) { + return false; + } + Materials[] coals = new Materials[]{Materials.Coal, Materials.Charcoal}; + for (Materials coal : coals) { + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getGems(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)}, null, null, null, null, aDuration, 0, 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getDust(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDustTiny(aCoalAmount)}, null, null, null, null, aDuration, 0, 0); + } + if (Loader.isModLoaded("Railcraft")) { + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, RailcraftToolItems.getCoalCoke(aCoalAmount / 2)}, new ItemStack[]{aOutput1, aOutput2, Materials.Ash.getDustTiny(aCoalAmount / 2)}, null, null, null, null, aDuration * 2 / 3, 0, 0); + } + if ((aInput1 == null || aInput1.stackSize <= 6 ) && (aInput2 == null || aInput2.stackSize <= 6 ) && + (aOutput1 == null || aOutput1.stackSize <= 6 ) && (aOutput2 == null || aOutput2.stackSize <= 6 )) { + aInput1 = aInput1 == null ? null : GT_Utility.copyAmount(aInput1.stackSize * 10, aInput1); + aInput2 = aInput2 == null ? null : GT_Utility.copyAmount(aInput2.stackSize * 10, aInput2); + aOutput1 = aOutput1 == null ? null : GT_Utility.copyAmount(aOutput1.stackSize * 10, aOutput1); + aOutput2 = aOutput2 == null ? null : GT_Utility.copyAmount(aOutput2.stackSize * 10, aOutput2); + for (Materials coal : coals) { + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getBlocks(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)}, null, null, null, null, aDuration * 10, 0, 0); + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, coal.getBlocks(aCoalAmount)}, new ItemStack[]{aOutput1, aOutput2, Materials.DarkAsh.getDust(aCoalAmount)}, null, null, null, null, aDuration * 10, 0, 0); + } + if (Loader.isModLoaded("Railcraft")) { + GT_Recipe.GT_Recipe_Map.sPrimitiveBlastRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, EnumCube.COKE_BLOCK.getItem(aCoalAmount / 2)}, new ItemStack[]{aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2)}, null, null, null, null, aDuration * 20 / 3, 0, 0); + } + } + return true; + } + + public boolean addCannerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("canning", aInput1, aDuration)) <= 0) { + return false; + } + new GT_Recipe(aInput1, aEUt, aInput2, aDuration, aOutput1, aOutput2); + return true; + } + + @Override + public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { + return addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt, false); + } + + public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden) { + if ((aInput1 == null) || (aOutput1 == null || Materials.Graphite.contains(aInput1))) { + return false; + } + if ((aInput2 == null) && ((OrePrefixes.ingot.contains(aInput1)) || (OrePrefixes.dust.contains(aInput1)) || (OrePrefixes.gem.contains(aInput1)))) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("alloysmelting", aInput2 == null ? aInput1 : aOutput1, aDuration)) <= 0) { + return false; + } + GT_Recipe tRecipe =new GT_Recipe(aInput1, aInput2, aEUt, aDuration, aOutput1); + if ((hidden) && (tRecipe != null)) { + tRecipe.mHidden = true; + } + return true; + } + + @Deprecated + public boolean addCNCRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("cnc", aOutput1, aDuration)) <= 0) { + return false; + } + return true; + } + + public boolean addLatheRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("lathe", aInput1, aDuration)) <= 0) { + return false; + } + new GT_Recipe(aInput1, aOutput1, aOutput2, aDuration, aEUt); + return true; + } + @Override + public boolean addCutterRecipe(ItemStack aInput, FluidStack aLubricant, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + if ((aInput == null) || (aLubricant == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("cutting", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2}, null, new FluidStack[]{aLubricant}, null, aDuration, aEUt, 0); + return true; + } + + public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { + return addCutterRecipe(aInput,null,aOutput1,aOutput2,aDuration,aEUt,aCleanroom); + } + public boolean addCutterRecipe(ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt){ + return addCutterRecipe(aInput,aCircuit,aOutput1,aOutput2,aDuration,aEUt,false); + } + public boolean addCutterRecipe(ItemStack aInput, int aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { + return addCutterRecipe(aInput,GT_Utility.getIntegratedCircuit(aCircuit),aOutput1,aOutput2,aDuration,aEUt,aCleanroom); + } + + public boolean addCutterRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + return addCutterRecipe(aInput, aOutput1, aOutput2, aDuration, aEUt,false); + } + + public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) { + return addCutterRecipe(aInput, aCircuit, aOutput1, aOutput2, aDuration, aEUt,false); + } + + public boolean addCutterRecipe(ItemStack aInput, ItemStack aCircuit, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, boolean aCleanroom) { + return addCutterRecipe(new ItemStack[]{aInput,aCircuit},new ItemStack[]{aOutput1,aOutput2},aDuration,aEUt,aCleanroom ? -200 : 0); + } + + public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, boolean aCleanroom) { + return addCutterRecipe(aInputs, aOutputs, aDuration, aEUt, aCleanroom ? -200 : 0); + } + + public boolean addCutterRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, int aDuration, int aEUt, int aSpecial) { + if ((aInputs == null) || (aOutputs == null) || aInputs.length == 0 || aOutputs.length == 0) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("cutting", aInputs[0], aDuration)) <= 0) { + return false; + } + if (!GT_Mod.gregtechproxy.mEnableCleanroom && aSpecial == -200){ + aSpecial = 0; + } + GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{Materials.Water.getFluid(Math.max(4, Math.min(1000, aDuration * aEUt / 320)))}, null, aDuration * 2, aEUt, aSpecial); + GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{GT_ModHandler.getDistilledWater(Math.max(3, Math.min(750, aDuration * aEUt / 426)))}, null, aDuration * 2, aEUt, aSpecial); + GT_Recipe.GT_Recipe_Map.sCutterRecipes.addRecipe(true, aInputs, aOutputs, null, new FluidStack[]{Materials.Lubricant.getFluid(Math.max(1, Math.min(250, aDuration * aEUt / 1280)))}, null, aDuration, aEUt, aSpecial); + return true; + } + + + public boolean addAssemblerRecipe(ItemStack aInput1, Object aOreDict,int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){ + for(ItemStack tStack : GT_OreDictUnificator.getOres(aOreDict)){ + if(GT_Utility.isStackValid(tStack)) + addAssemblerRecipe(aInput1, GT_Utility.copyAmount(aAmount, tStack), aFluidInput, aOutput1, aDuration, aEUt); + } + return true; + } + + public boolean addAssemblerRecipe(ItemStack[] aInputs, Object aOreDict, int aAmount, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt){ + for(ItemStack tStack : GT_OreDictUnificator.getOres(aOreDict)){ + if(GT_Utility.isStackValid(tStack)) { + ItemStack[] extendedInputs = new ItemStack[aInputs.length + 1]; + System.arraycopy(aInputs, 0, extendedInputs, 0, aInputs.length); + extendedInputs[aInputs.length] = GT_Utility.copyAmount(aAmount, tStack); + addAssemblerRecipe(extendedInputs, aFluidInput, aOutput1, aDuration, aEUt); + } + } + return true; + } + + public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) { + /*if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); + return true; + */ + return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2 == null ? aInput1 : aInput2}, null,aOutput1, aDuration, aEUt, false); + } + + public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { + return addAssemblerRecipe(new ItemStack[]{aInput1, aInput2}, aFluidInput, aOutput1, aDuration, aEUt); + } + + public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { + /*if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { + return false; + } + if (aOutput1 == null) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); + */ + return addAssemblerRecipe(aInputs, aFluidInput, aOutput1, aDuration, aEUt, false); + } + + public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { + if(aInput2==null) + return addAssemblerRecipe(new ItemStack[]{aInput1},aFluidInput,aOutput1,aDuration,aEUt,aCleanroom); + return addAssemblerRecipe(new ItemStack[]{aInput1,aInput2},aFluidInput,aOutput1,aDuration,aEUt,aCleanroom); + } + + public boolean addAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { + + if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { + return false; + } + + if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { + return false; + } + + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } + + if (!GT_Utility.isStackValid(aOutput1)) { + return false; + } + + boolean ret = false; + + for (int oreID : OreDictionary.getOreIDs(aOutput1)) { + if (OreDictionary.getOreName(oreID).contains("circuit")){ + return this.addAssemblerRecipeNonOD(aInputs, aFluidInput, aOutput1, aDuration, aEUt, aCleanroom); + } + } + + for (int i = 0; i < aInputs.length; ++i) { + if (!GT_Utility.isStackValid(aInputs[i])) { + GT_FML_LOGGER.debug("GT_RecipeAdder: Invalid input for (" + aOutput1.toString() + ")"); + continue; + } + for (int oreID : OreDictionary.getOreIDs(aInputs[i])) { + String odName = OreDictionary.getOreName(oreID); + if (odName.contains("circuit")) { + for (ItemStack tStack : GT_OreDictUnificator.getOres(odName)) { + if (!GT_Utility.isStackValid(tStack)) + continue; + aInputs[i] = new ItemStack(tStack.getItem(),aInputs[i].stackSize,tStack.getItemDamage()); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + ret = true; + } + } + } + } + + if (!ret) { + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + ret = true; + } + + return ret; + } + + public boolean addAssemblerRecipeNonOD(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt, boolean aCleanroom) { + if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { + return false; + } + + if ((aDuration = GregTech_API.sRecipeFile.get("assembling", aOutput1, aDuration)) <= 0) { + return false; + } + + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } + + if (!GT_Utility.isStackValid(aOutput1)) { + return false; + } + + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + return true; + } + + + public boolean addWiremillRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("wiremill", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sWiremillRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addPolarizerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("polarizer", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sPolarizerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addBenderRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("bender", aInput1, aDuration)) <= 0) { + return false; + } + new GT_Recipe(aEUt, aDuration, aInput1, aOutput1); + return true; + } + + public boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aShape == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addSlicerRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aShape == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("slicer", aOutput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sSlicerRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addOreWasherRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, FluidStack aFluidInput, int aDuration, int aEUt) { + if ((aInput == null) || (aFluidInput == null) || ((aOutput1 == null) || (aOutput2 == null) || (aOutput3 == null))) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("orewasher", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0); + return true; + } + + public boolean addImplosionRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aInput2 = GregTech_API.sRecipeFile.get("implosion", aInput1, aInput2)) <= 0) { + return false; + } + int tExplosives = aInput2 > 0 ? aInput2 < 64 ? aInput2 : 64 : 1; + int tGunpowder = tExplosives<<1;//Worst + int tDynamite = Math.max(1, tExplosives>>1);//good + int tTNT = tExplosives;//Slightly better + int tITNT = Math.max(1, tExplosives>>2);//the best + //new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2); + if(tGunpowder<65){ + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, ItemList.Block_Powderbarrel.get(tGunpowder, new Object[0])}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); + } + if(tDynamite<17){ + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, GT_ModHandler.getIC2Item("dynamite", tDynamite, null)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); + } + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, new ItemStack(Blocks.tnt,tTNT)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.addRecipe(true, new ItemStack[]{aInput1, GT_ModHandler.getIC2Item("industrialTnt", tITNT, null)}, new ItemStack[]{aOutput1, aOutput2}, null, null, null, null, 20, 30, 0); + + return true; + } + + @Deprecated + public boolean addDistillationRecipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt) { +// if ((aInput1 == null) || (aOutput1 == null)) { +// return false; +// } +// if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput1, aDuration)) <= 0) { +// return false; +// } +// new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, aDuration, aEUt); +// return true; + return false; + } + + @Override + public boolean addUniversalDistillationRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { + for (int i = 0; i < Math.min(aOutputs.length, 11); i++) { + addDistilleryRecipe(i + 1, aInput, aOutputs[i], aOutput2, aDuration * 2, aEUt / 4, false); + + } + + return addDistillationTowerRecipe(aInput, aOutputs, aOutput2, aDuration, aEUt); + } + + public boolean addDistillationTowerRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { + if (aInput == null || aOutputs == null || aOutputs.length < 1 || aOutputs.length > 11) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput.getUnlocalizedName(), aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sDistillationRecipes.addRecipe(false, null, new ItemStack[]{aOutput2}, null, new FluidStack[]{aInput}, aOutputs, Math.max(1, aDuration), Math.max(1, aEUt), 0); + return false; + } + + public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("vacuumfreezer", aInput1, aDuration)) <= 0) { + return false; + } + new GT_Recipe(aInput1, aOutput1, aDuration, aEUt, 0);//Since all other methods are taken + return true; + } + + public boolean addVacuumFreezerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("vacuumfreezer", aInput1, aDuration)) <= 0) { + return false; + } + new GT_Recipe(aInput1, aOutput1, aDuration); + return true; + } + + @Deprecated + public boolean addGrinderRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4) { + return false; + } + + public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) { + if (aInput1 == null) { + return false; + } + new GT_Recipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType); + return true; + } + + public boolean addSonictronSound(ItemStack aItemStack, String aSoundName) { + if ((aItemStack == null) || (aSoundName == null) || (aSoundName.equals(""))) { + return false; + } + GT_Mod.gregtechproxy.mSoundItems.add(aItemStack); + GT_Mod.gregtechproxy.mSoundNames.add(aSoundName); + if (aSoundName.startsWith("note.")) { + GT_Mod.gregtechproxy.mSoundCounts.add(Integer.valueOf(25)); + } else { + GT_Mod.gregtechproxy.mSoundCounts.add(Integer.valueOf(1)); + } + return true; + } + + public boolean addForgeHammerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { + if ((aInput1 == null) || (aOutput1 == null)) { + return false; + } + if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addBoxingRecipe(ItemStack aContainedItem, ItemStack aEmptyBox, ItemStack aFullBox, int aDuration, int aEUt) { + if ((aContainedItem == null) || (aFullBox == null)) { + return false; + } + if (!GregTech_API.sRecipeFile.get("boxing", aFullBox, true)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.addRecipe(true, new ItemStack[]{aContainedItem, aEmptyBox}, new ItemStack[]{aFullBox}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addUnboxingRecipe(ItemStack aFullBox, ItemStack aContainedItem, ItemStack aEmptyBox, int aDuration, int aEUt) { + if ((aFullBox == null) || (aContainedItem == null)) { + return false; + } + if (!GregTech_API.sRecipeFile.get("unboxing", aFullBox, true)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes.addRecipe(true, new ItemStack[]{aFullBox}, new ItemStack[]{aContainedItem, aEmptyBox}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addThermalCentrifugeRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput1 == null)) { + return false; + } + if (!GregTech_API.sRecipeFile.get("thermalcentrifuge", aInput, true)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addAmplifier(ItemStack aAmplifierItem, int aDuration, int aAmplifierAmountOutputted) { + if ((aAmplifierItem == null) || (aAmplifierAmountOutputted <= 0)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("amplifier", aAmplifierItem, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sAmplifiers.addRecipe(true, new ItemStack[]{aAmplifierItem}, null, null, null, new FluidStack[]{Materials.UUAmplifier.getFluid(aAmplifierAmountOutputted)}, aDuration, 30, 0); + return true; + } + + public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, int aDuration, int aEUt, boolean aHidden) { + if ((aIngredient == null) || (aInput == null) || (aOutput == null)) { + return false; + } + if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) { + return false; + } + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe(false, new ItemStack[]{aIngredient}, null, null, new FluidStack[]{new FluidStack(aInput, 750)}, new FluidStack[]{new FluidStack(aOutput, 750)}, aDuration, aEUt, 0); + if ((aHidden) && (tRecipe != null)) { + tRecipe.mHidden = true; + } + return true; + } + + public boolean addBrewingRecipe(ItemStack aIngredient, Fluid aInput, Fluid aOutput, boolean aHidden) { + return addBrewingRecipe(aIngredient, aInput, aOutput, 128, 4, aHidden); + } + + public boolean addBrewingRecipeCustom(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if (!GregTech_API.sRecipeFile.get("brewing", aOutput.getUnlocalizedName(), true)) { + return false; + } + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe(false, new ItemStack[]{aIngredient}, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + if ((aHidden) && (tRecipe != null)) { + tRecipe.mHidden = true; + } + return true; + } + + public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("fermenting", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) { + return false; + } + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFermentingRecipes.addRecipe(false, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + if ((aHidden) && (tRecipe != null)) { + tRecipe.mHidden = true; + } + return true; + } + + public boolean addFermentingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, boolean aHidden) { + return addFermentingRecipe(aInput, aOutput, aDuration, 2, aHidden); + } + + public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("distillery", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) { + return false; + } + //reduce the batch size if fluid amount is exceeding + int tScale = (Math.max(aInput.amount, aOutput.amount) + 999) / 1000; + if (tScale <= 0) tScale = 1; + if (tScale > 1){ + //trying to find whether there is a better factor + for (int i = tScale; i <= 5; i++) { + if (aInput.amount % i == 0 && aDuration % i == 0) { + tScale = i; + break; + } + } + for (int i = tScale; i <= 5; i++) { + if (aInput.amount % i == 0 && aDuration % i == 0 && aOutput.amount % i == 0) { + tScale = i; + break; + } + } + aInput = new FluidStack(aInput.getFluid(), (aInput.amount + tScale - 1) / tScale); + aOutput = new FluidStack(aOutput.getFluid(), aOutput.amount / tScale); + if (aSolidOutput != null) { + ItemData tData = GT_OreDictUnificator.getItemData(aSolidOutput); + if (tData != null && (tData.mPrefix == OrePrefixes.dust || OrePrefixes.dust.mFamiliarPrefixes.contains(tData.mPrefix))) + aSolidOutput = GT_OreDictUnificator.getDust(tData.mMaterial.mMaterial, tData.mMaterial.mAmount * aSolidOutput.stackSize / tScale); + else { + if (aSolidOutput.stackSize / tScale == 0) aSolidOutput = GT_Values.NI; + else aSolidOutput = new ItemStack(aSolidOutput.getItem(), aSolidOutput.stackSize / tScale); + } + } + aDuration = (aDuration + tScale - 1) / tScale; + } + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistilleryRecipes.addRecipe(true, new ItemStack[]{aCircuit}, new ItemStack[]{aSolidOutput}, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + if ((aHidden) && (tRecipe != null)) { + tRecipe.mHidden = true; + } + return true; + + } + public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { + return addDistilleryRecipe(aCircuit, aInput, aOutput, null, aDuration, aEUt, aHidden); + } + + public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { + return addDistilleryRecipe(GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aSolidOutput, aDuration, aEUt, aHidden); + } + + public boolean addDistilleryRecipe(int circuitConfig, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt, boolean aHidden) { + return addDistilleryRecipe(GT_Utility.getIntegratedCircuit(circuitConfig), aInput, aOutput, aDuration, aEUt, aHidden); + } + + public boolean addFluidSolidifierRecipe(ItemStack aMold, FluidStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + if ((aMold == null) || (aInput == null) || (aOutput == null)) { + return false; + } + if (aInput.isFluidEqual(Materials.PhasedGold.getMolten(144))) { + aInput = Materials.VibrantAlloy.getMolten(aInput.amount); + } + if (aInput.isFluidEqual(Materials.PhasedIron.getMolten(144))) { + aInput = Materials.PulsatingIron.getMolten(aInput.amount); + } + if ((aDuration = GregTech_API.sRecipeFile.get("fluidsolidifier", aOutput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes.addRecipe(true, new ItemStack[]{aMold}, new ItemStack[]{aOutput}, null, new FluidStack[]{aInput}, null, aDuration, aEUt, 0); + return true; + } + + @Override + public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) { + return addFluidSmelterRecipe(aInput, aRemains, aOutput, aChance, aDuration, aEUt, false); + } + + public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt, boolean hidden) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) { + aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount); + } + if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) { + aOutput = Materials.PulsatingIron.getMolten(aOutput.amount); + } + if ((aDuration = GregTech_API.sRecipeFile.get("fluidsmelter", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aRemains}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + if ((hidden) && (tRecipe != null)) { + tRecipe.mHidden = true; + } + return true; + } + + public boolean addFluidExtractionRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if (aOutput.isFluidEqual(Materials.PhasedGold.getMolten(1))) { + aOutput = Materials.VibrantAlloy.getMolten(aOutput.amount); + } + if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) { + aOutput = Materials.PulsatingIron.getMolten(aOutput.amount); + } + if ((aDuration = GregTech_API.sRecipeFile.get("fluidextractor", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aRemains}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + return true; + } + + public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput) { + int aDuration= aFluidOutput == null ? aFluidInput.amount / 62 : aFluidOutput.amount / 62; + + if ((aInput != null) && (aOutput != null)) { + if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) { + } + } else { + return false; + } + if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("fluidcanner", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput == null ? null : aFluidInput}, new FluidStack[]{aFluidOutput == null ? null : aFluidOutput}, aDuration, 1, 0); + return true; + } + + public boolean addFluidCannerRecipe(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) { + if ((aInput != null) && (aOutput != null)) { + if ((aFluidInput == null ? 1 : 0) != (aFluidOutput == null ? 1 : 0)) { + } + } else { + return false; + } + if (!GregTech_API.sRecipeFile.get("fluidcanner", aOutput, true)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("fluidcanner", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput == null ? null : aFluidInput}, new FluidStack[]{aFluidOutput == null ? null : aFluidOutput}, aDuration, aEUt, 0); + return true; + } + + public boolean addChemicalBathRecipe(ItemStack aInput, FluidStack aBathingFluid, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { + if ((aInput == null) || (aBathingFluid == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("chemicalbath", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, new FluidStack[]{aBathingFluid}, null, aDuration, aEUt, 0); + return true; + } + + public boolean addElectromagneticSeparatorRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, int[] aChances, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput1 == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("electromagneticseparator", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sElectroMagneticSeparatorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput1, aOutput2, aOutput3}, null, aChances, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("extractor", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sExtractorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addPrinterRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aSpecialSlot, ItemStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aFluid == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("printer", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sPrinterRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, aSpecialSlot, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0); + return true; + } + + public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt) { + return addAutoclaveRecipe(aInput, aFluid, aOutput, aChance, aDuration, aEUt, false); + } + + public boolean addAutoclaveSpaceRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + if ((aInput == null) || (aFluid == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { + return false; + } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -100 : 0); + return true; + } + public boolean addAutoclaveRecipe(ItemStack aInput, FluidStack aFluid, ItemStack aOutput, int aChance, int aDuration, int aEUt, boolean aCleanroom) { + if ((aInput == null) || (aFluid == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { + return false; + } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + return true; + } + + + public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { + return addMixerRecipe(aInput1, aInput2, aInput3, aInput4, null, null, null, null, null, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + + } + public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { + return addMixerRecipe(aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, null, null, null, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + + } + public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, ItemStack aInput5, ItemStack aInput6, ItemStack aInput7, ItemStack aInput8,ItemStack aInput9, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { + if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aFluidOutput == null))) { + return false; + } + if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("mixer", aOutput, aDuration)) <= 0)) { + return false; + } + if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("mixer", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sMixerRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + return true; + } + + public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt) { + return addLaserEngraverRecipe( aItemToEngrave, aLens, aEngravedItem, aDuration, aEUt, false); + } + + public boolean addLaserEngraverRecipe(ItemStack aItemToEngrave, ItemStack aLens, ItemStack aEngravedItem, int aDuration, int aEUt, boolean aCleanroom) { + if ((aItemToEngrave == null) || (aLens == null) || (aEngravedItem == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("laserengraving", aEngravedItem, aDuration)) <= 0) { + return false; + } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } + GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.addRecipe(true, new ItemStack[]{aItemToEngrave, aLens}, new ItemStack[]{aEngravedItem}, null, null, null, aDuration, aEUt, aCleanroom ? -200 : 0); + return true; + } + + public boolean addFormingPressRecipe(ItemStack aItemToImprint, ItemStack aForm, ItemStack aImprintedItem, int aDuration, int aEUt) { + if ((aItemToImprint == null) || (aForm == null) || (aImprintedItem == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("press", aImprintedItem, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sPressRecipes.addRecipe(true, new ItemStack[]{aItemToImprint, aForm}, new ItemStack[]{aImprintedItem}, null, null, null, aDuration, aEUt, 0); + return true; + } + + public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("fluidheater", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe(true, new ItemStack[]{aCircuit}, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + return true; + } + + public boolean addSifterRecipe(ItemStack aItemToSift, ItemStack[] aSiftedItems, int[] aChances, int aDuration, int aEUt) { + if ((aItemToSift == null) || (aSiftedItems == null)) { + return false; + } + for (ItemStack tStack : aSiftedItems) { + if (tStack != null) { + if ((aDuration = GregTech_API.sRecipeFile.get("sifter", aItemToSift, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sSifterRecipes.addRecipe(true, new ItemStack[]{aItemToSift}, aSiftedItems, null, aChances, null, null, aDuration, aEUt, 0); + return true; + } + } + return false; + } + + @Override + public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { + return addArcFurnaceRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false); + } + + public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { + if ((aInput == null) || (aOutputs == null)) { + return false; + } + for (ItemStack tStack : aOutputs) { + if (tStack != null) { + if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe sRecipe = GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{Materials.Oxygen.getGas(aDuration)}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0); + if ((hidden) && (sRecipe != null)) { + sRecipe.mHidden = true; + } + for (Materials tMaterial : new Materials[]{Materials.Argon, Materials.Nitrogen}) { + if (tMaterial.mPlasma != null) { + int tPlasmaAmount = (int) Math.max(1L, aDuration / (tMaterial.getMass() * 16L)); + GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{tMaterial.getPlasma(tPlasmaAmount)}, new FluidStack[]{tMaterial.getGas(tPlasmaAmount)}, Math.max(1, aDuration / 16), Math.max(1, aEUt / 3), 0); + if ((hidden) && (tRecipe != null)) { + tRecipe.mHidden = true; + } + } + } + return true; + } + } + return false; + } + + public boolean addSimpleArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { + if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { + return false; + } + for (ItemStack tStack : aOutputs) { + if (tStack != null) { + if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0); + return true; + } + } + return false; + } + + public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { + if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { + return false; + } + for (ItemStack tStack : aOutputs) { + if (tStack != null) { + if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0); + return true; + } + } + return false; + } + + public boolean addPlasmaArcFurnaceRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt) { + if ((aInput == null) || (aOutputs == null) || aFluidInput == null) { + return false; + } + for (ItemStack tStack : aOutputs) { + if (tStack != null) { + if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, Math.max(1, aDuration), Math.max(1, aEUt), 0); + return true; + } + } + return false; + } + + @Override + public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { + return addPulveriserRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false); + } + + public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) { + if ((aInput == null) || (aOutputs == null)) { + return false; + } + for (ItemStack tStack : aOutputs) { + if (tStack != null) { + if ((aDuration = GregTech_API.sRecipeFile.get("pulveriser", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, null, null, aDuration, aEUt, 0); + if ((hidden) && (tRecipe != null)) { + tRecipe.mHidden = true; + } + return true; + } + } + return false; + } + + @Override + public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt) { + if (aInput == null) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("pyrolyse", aInput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.addRecipe(false, new ItemStack[]{aInput, ItemList.Circuit_Integrated.getWithDamage(0L, intCircuit, new Object[0])}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + return true; + } + + @Override + @Deprecated + public boolean addCrackingRecipe(FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt) { + //if ((aInput == null) || (aOutput == null)) { + // return false; + // } + // if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) { + // return false; + // } + // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, GT_ModHandler.getSteam(aInput.amount)}, new FluidStack[]{aOutput, Materials.Hydrogen.getGas(aInput.amount)}, aDuration, aEUt, 0); + // GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, Materials.Hydrogen.getGas(aInput.amount)}, new FluidStack[]{new FluidStack(aOutput.getFluid(), (int) (aOutput.amount * 1.3))}, aDuration, aEUt, 0); + // return true; + return false; + } + + @Override + public boolean addCrackingRecipe(int circuitConfig, FluidStack aInput, FluidStack aInput2, FluidStack aOutput, int aDuration, int aEUt) { + if ((aInput == null && aInput2 == null) || (aOutput == null)) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(false, new ItemStack[]{GT_Utility.getIntegratedCircuit(circuitConfig)}, null, null, null, + new FluidStack[]{aInput, aInput2}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + return true; + } + + @Override + public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { + if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) { + return false; + } + for(ItemStack tItem : aInputs){ + if(tItem==null){ + GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + } + } + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, -201); + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true); + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt)); + return true; + } + + @Override + public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { + if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) { + return false; + } + ItemStack[] tInputs = new ItemStack[aInputs.length]; + ItemStack[][] tAlts = new ItemStack[aInputs.length][]; + for(int i = 0; i < aInputs.length; i++){ + Object obj = aInputs[i]; + if (obj instanceof ItemStack) { + tInputs[i] = (ItemStack) obj; + tAlts[i] = null; + continue; + } else if (obj instanceof ItemStack[]) { + ItemStack[] aStacks = (ItemStack[]) obj; + if (aStacks.length > 0) { + tInputs[i] = aStacks[0]; + tAlts[i] = (ItemStack[]) Arrays.copyOf(aStacks, aStacks.length); + continue; + } + } else if (obj instanceof Object[]) { + Object[] objs = (Object[]) obj; + List<ItemStack> tList; + if (objs.length >= 2 && !(tList = GT_OreDictUnificator.getOres(objs[0])).isEmpty()) { + try { + int tAmount = ((Number) objs[1]).intValue(); + List<ItemStack> uList = new ArrayList<>(); + for (ItemStack tStack : tList) { + ItemStack uStack = GT_Utility.copyAmount(tAmount, tStack); + if (GT_Utility.isStackValid(uStack)) { + uList.add(uStack); + if (tInputs[i] == null) + tInputs[i] = uStack; + } + } + tAlts[i] = uList.toArray(new ItemStack[uList.size()]); + continue; + } catch (Exception t) {} + } + } + GT_FML_LOGGER.info("addAssemblingLineRecipe "+aResearchItem.getDisplayName()+" --> "+aOutput.getUnlocalizedName()+" there is some null item in that recipe"); + } + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, null, null, aResearchTime, 30, -201); + GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe(false,tInputs,new ItemStack[]{aOutput},new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])},aFluidInputs,null,aDuration,aEUt,0,tAlts,true); + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, tInputs, aFluidInputs, aOutput, aDuration, aEUt, tAlts)); + return true; + } + + @Override + public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt) { + return addCircuitAssemblerRecipe(aInputs, aFluidInput, aOutput,aDuration,aEUt, false); + } + + public boolean addCircuitAssemblerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom) { + + if (this.areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) { + return false; + } + + if ((aDuration = GregTech_API.sRecipeFile.get("circuitassembler", aOutput, aDuration)) <= 0) { + return false; + } + + if (!GT_Mod.gregtechproxy.mEnableCleanroom) { + aCleanroom = false; + } + + if (!GT_Utility.isStackValid(aOutput)) { + return false; + } + + boolean ret = false; + + for (int oreID : OreDictionary.getOreIDs(aOutput)) { + if (OreDictionary.getOreName(oreID).contains("circuit")){ + return this.addCircuitAssemblerRecipeNonOredicted(aInputs, aFluidInput, aOutput, aDuration, aEUt, aCleanroom); + } + } + + for (int i = 0; i < aInputs.length; ++i) { + for (int oreID : OreDictionary.getOreIDs(aInputs[i])) { + String odName = OreDictionary.getOreName(oreID); + if (odName.contains("circuit")) { + for (ItemStack tStack : GT_OreDictUnificator.getOres(odName)) { + if (!GT_Utility.isStackValid(tStack)) + continue; + aInputs[i] = new ItemStack(tStack.getItem(),aInputs[i].stackSize,tStack.getItemDamage()); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + ret = true; + } + } + } + } + + if (!ret) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + ret = true; + } + + return ret; + } + + public boolean addCircuitAssemblerRecipeNonOredicted(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput, int aDuration, int aEUt, boolean aCleanroom) { + if ((aInputs == null) || (aOutput == null) || aInputs.length>6 || aInputs.length<1) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("circuitassembler", aOutput, aDuration)) <= 0) { + return false; + } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, aCleanroom ? -200 : 0); + return true; + } + private boolean areItemsAndFluidsBothNull(ItemStack[] items, FluidStack[] fluids){ + boolean itemsNull = true; + if (items != null) { + for (ItemStack itemStack : items) { + if (itemStack != null) { + itemsNull = false; + break; + } + } + } + boolean fluidsNull = true; + if (fluids != null) { + for (FluidStack fluidStack : fluids) { + if (fluidStack != null) { + fluidsNull = false; + break; + } + } + } + return itemsNull && fluidsNull; + + } +} diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index bb390faeea..995984158f 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -1,436 +1,436 @@ -package gregtech.common;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import gregtech.api.util.GT_Log;
-import gregtech.api.world.GT_Worldgen;
-import gregtech.common.blocks.GT_TileEntity_Ores;
-import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
-import net.minecraft.util.MathHelper;
-import net.minecraft.world.World;
-import net.minecraft.world.chunk.IChunkProvider;
-
-import java.util.ArrayList;
-import java.util.Random;
-
-import static gregtech.api.enums.GT_Values.debugOrevein;
-import static gregtech.api.enums.GT_Values.oreveinPlacerOres;
-import static gregtech.api.enums.GT_Values.oreveinPlacerOresMultiplier;
-
-public class GT_Worldgen_GT_Ore_Layer
- extends GT_Worldgen {
- public static ArrayList<GT_Worldgen_GT_Ore_Layer> sList = new ArrayList();
- public static int sWeight = 0;
- public final short mMinY;
- public final short mMaxY;
- public final short mWeight;
- public final short mDensity;
- public final short mSize;
- public final short mPrimaryMeta;
- public final short mSecondaryMeta;
- public final short mBetweenMeta;
- public final short mSporadicMeta;
- //public final String mBiome;
- public final String mRestrictBiome;
- public final boolean mOverworld;
- public final boolean mNether;
- public final boolean mEnd;
- public final boolean mEndAsteroid;
- public static final int WRONG_BIOME=0;
- public static final int WRONG_DIMENSION=1;
- public static final int NO_ORE_IN_BOTTOM_LAYER=2;
- public static final int NO_OVERLAP=3;
- public static final int ORE_PLACED=4;
- public static final int NO_OVERLAP_AIR_BLOCK=5;
-
- public final boolean mMoon = false, mMars = false, mAsteroid = false;
- public final String aTextWorldgen = "worldgen.";
-
-
- @Deprecated
- public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, int aPrimary, int aSecondary, int aBetween, int aSporadic) {
- super(aName, sList, aDefault);
- this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
- this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether);
- this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd);
- this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd);
- //this.mMoon = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon);
- //this.mMars = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars);
- //this.mAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid);
- this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
- short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY));
- if (mMaxY < (this.mMinY + 9)) {
- GT_Log.out.println(
- "Oremix " + this.mWorldGenName +
- " has invalid Min/Max heights!"
- );
- mMaxY = (short) (this.mMinY + 9);
- }
- this.mMaxY = mMaxY;
- this.mWeight = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
- this.mDensity = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
- this.mSize = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
- this.mPrimaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary));
- this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary));
- this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween));
- this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic));
- this.mRestrictBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
-
- //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist");
- //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist");
- //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist");
- //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist");
-
- if (this.mEnabled) {
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- sWeight += this.mWeight;
- //if(GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes){
- // blusunrize.immersiveengineering.api.tool.ExcavatorHandler.addMineral(aName.substring(8, 9).toUpperCase()+aName.substring(9), aWeight, 0.2f, new String[]{"ore"+aPrimary.mName,"ore"+aSecondary.mName,"ore"+aBetween.mName,"ore"+aSporadic.mName}, new float[]{.4f,.4f,.15f,.05f});
- //}
-
- }
- }
-
- @Deprecated
- public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) {
- this(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, aOverworld, aNether, aEnd, aPrimary, aSecondary, aBetween, aSporadic);
- }
-
- public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) {
- super(aName, sList, aDefault);
- this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld);
- this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether);
- this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd);
- this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd);
- //this.mMoon = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon);
- //this.mMars = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars);
- //this.mAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid);
- this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY));
- short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY));
- if (mMaxY < (this.mMinY + 9)) {
- GT_Log.out.println(
- "Oremix " + this.mWorldGenName +
- " has invalid Min/Max heights!"
- );
- mMaxY = (short) (this.mMinY + 9);
- }
- this.mMaxY = mMaxY;
- this.mWeight = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight));
- this.mDensity = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity));
- this.mSize = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize)));
- this.mPrimaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID));
- this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID));
- this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID));
- this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID));
- this.mRestrictBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None");
-
- //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist");
- //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist");
- //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist");
- //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist");
-
- if (this.mEnabled) {
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd);
- sWeight += this.mWeight;
- //if(GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes){
- // blusunrize.immersiveengineering.api.tool.ExcavatorHandler.addMineral(aName.substring(8, 9).toUpperCase()+aName.substring(9), aWeight, 0.2f, new String[]{"ore"+aPrimary.mName,"ore"+aSecondary.mName,"ore"+aBetween.mName,"ore"+aSporadic.mName}, new float[]{.4f,.4f,.15f,.05f});
- //}
-
- }
- }
-
- public int executeWorldgenChunkified(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, int aSeedX, int aSeedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
- if( mWorldGenName.equals("NoOresInVein") ) {
- if (debugOrevein) GT_Log.out.println(
- " NoOresInVein"
- );
- // This is a special empty orevein
- return ORE_PLACED;
- }
- if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) {
- /* // Debug code, but spams log
- if (debugOrevein) {
- GT_Log.out.println(
- "Wrong dimension"
- );
- }
- */
- return WRONG_DIMENSION;
- }
- /*if (!((aWorld.provider.getDimensionName().equalsIgnoreCase("Overworld")) || (aWorld.provider.getDimensionName().equalsIgnoreCase("Nether"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Underdark"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Twilight Forest"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Underdark"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("The End"))))
- return WRONG_DIMENSION;*/
-
- if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
- return WRONG_BIOME;
- }
- // For optimal performance, this should be done upstream. Meh
- String tDimensionName = aWorld.provider.getDimensionName();
- boolean isUnderdark = tDimensionName.equals("Underdark");
-
- int[] placeCount=new int[4];
-
- int tMinY = mMinY + aRandom.nextInt(mMaxY - mMinY - 5);
- // Determine West/East ends of orevein
- int wXVein = aSeedX - aRandom.nextInt(mSize); // West side
- int eXVein = aSeedX + 16 + aRandom.nextInt(mSize);
- // Limit Orevein to only blocks present in current chunk
- int wX = Math.max( wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
- int eX = Math.min( eXVein, aChunkX + 2 + 16);
-
- // Get a block at the center of the chunk and the bottom of the orevein.
- Block tBlock = aWorld.getBlock(aChunkX + 7, tMinY, aChunkZ + 9);
-
- if (wX >= eX) { //No overlap between orevein and this chunk exists in X
- if (tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.netherrack) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.end_stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones) ) {
- // Didn't reach, but could have placed. Save orevein for future use.
- return NO_OVERLAP;
- } else {
- // Didn't reach, but couldn't place in test spot anywys, try for another orevein
- return NO_OVERLAP_AIR_BLOCK;
- }
- }
- // Determine North/Sound ends of orevein
- int nZVein = aSeedZ - aRandom.nextInt(mSize);
- int sZVein = aSeedZ + 16 + aRandom.nextInt(mSize);
-
- int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
- int sZ = Math.min(sZVein, aChunkZ + 2 + 16);
- if (nZ >= sZ) { //No overlap between orevein and this chunk exists in Z
- if (tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.netherrack) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.end_stone) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) ||
- tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones) ) {
- // Didn't reach, but could have placed. Save orevein for future use.
- return NO_OVERLAP;
- } else {
- // Didn't reach, but couldn't place in test spot anywys, try for another orevein
- return NO_OVERLAP_AIR_BLOCK;
- }
- }
-
- if (debugOrevein) {
- GT_Log.out.print(
- "Trying Orevein:" + this.mWorldGenName +
- " Dimension=" + tDimensionName +
- " mX="+aChunkX/16+
- " mZ="+aChunkZ/16+
- " oreseedX="+ aSeedX/16 +
- " oreseedZ="+ aSeedZ/16 +
- " cY="+tMinY
- );
- }
- // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed should always be max density due to truncation of Math.sqrt().
- int localDensity = Math.max(1, this.mDensity / ((int)Math.sqrt(2 + Math.pow(aChunkX/16 - aSeedX/16, 2) + Math.pow(aChunkZ/16 - aSeedZ/16, 2))) );
-
- // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll 1 pass through the loop
- // Now we do bottom-level-first oregen, and work our way upwards.
- // Layer -1 Secondary and Sporadic
- int level = tMinY - 1; //Dunno why, but the first layer is actually played one below tMinY. Go figure.
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
- placeCount[3]++;
- }
- }
- }
- if ((placeCount[1]+placeCount[3])==0) {
- if (debugOrevein) GT_Log.out.println(
- " No ore in bottom layer"
- );
- return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer
- }
- // Layers 0 & 1 Secondary and Sporadic
- for (level = tMinY; level < (tMinY+2); level++) {
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
- placeCount[3]++;
- }
- }
- }
- }
- // Layer 2 is Secondary, in-between, and sporadic
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) {
- placeCount[2]++;
- }
- }
- else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
- placeCount[3]++;
- }
- }
- }
- level++; // Increment level to next layer
- // Layer 3 is In-between, and sporadic
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) {
- placeCount[2]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
- placeCount[3]++;
- }
- }
- }
- level++; // Increment level to next layer
- // Layer 4 is In-between, Primary and sporadic
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) {
- placeCount[2]++;
- }
- }
- else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
- placeCount[3]++;
- }
- }
- }
- level++; // Increment level to next layer
- // Layer 5 is In-between, Primary and sporadic
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) {
- placeCount[2]++;
- }
- }
- else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
- placeCount[3]++;
- }
- }
- }
- level++; // Increment level to next layer
- // Layer 6 is Primary and sporadic
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
- placeCount[3]++;
- }
- }
- }
- level++; // Increment level to next layer
- // Layer 7 is Primary and sporadic
- for (int tX = wX; tX < eX; tX++) {
- int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity);
- for (int tZ = nZ; tZ < sZ; tZ++) {
- int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
- if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) {
- placeCount[1]++;
- }
- }
- else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
- placeCount[3]++;
- }
- }
- }
- //Place small ores for the vein
- if( oreveinPlacerOres ) {
- int nSmallOres = (eX-wX)*(sZ-nZ)*this.mDensity/10 * oreveinPlacerOresMultiplier;
- //Small ores are placed in the whole chunk in which the vein appears.
- for( int nSmallOresCount = 0; nSmallOresCount < nSmallOres; nSmallOresCount++) {
- int tX = aRandom.nextInt(16) + aChunkX + 2;
- int tZ = aRandom.nextInt(16) + aChunkZ + 2;
- int tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores.
- if (this.mPrimaryMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mPrimaryMeta, true, isUnderdark);
- tX = aRandom.nextInt(16) + aChunkX + 2;
- tZ = aRandom.nextInt(16) + aChunkZ + 2;
- tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores.
- if (this.mSecondaryMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mSecondaryMeta, true, isUnderdark);
- tX = aRandom.nextInt(16) + aChunkX + 2;
- tZ = aRandom.nextInt(16) + aChunkZ + 2;
- tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores.
- if (this.mBetweenMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mBetweenMeta, true, isUnderdark);
- tX = aRandom.nextInt(16) + aChunkX + 2;
- tZ = aRandom.nextInt(16) + aChunkZ + 2;
- tY = aRandom.nextInt(190) + 10; // Y height can vary from 10 to 200 for small ores.
- if (this.mSporadicMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mSporadicMeta, true, isUnderdark);
- }
- }
- if (debugOrevein) {
- GT_Log.out.println(
- " wXVein" + wXVein +
- " eXVein" + eXVein +
- " nZVein" + nZVein +
- " sZVein" + sZVein +
- " locDen=" + localDensity +
- " Den=" + this.mDensity +
- " Sec="+placeCount[1]+
- " Spo="+placeCount[3]+
- " Bet="+placeCount[2]+
- " Pri="+placeCount[0]
- );
- }
- // Something (at least the bottom layer must have 1 block) must have been placed, return true
- return ORE_PLACED;
- }
-}
+package gregtech.common; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_Log; +import gregtech.api.world.GT_Worldgen; +import gregtech.common.blocks.GT_TileEntity_Ores; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +import java.util.ArrayList; +import java.util.Random; + +import static gregtech.api.enums.GT_Values.debugOrevein; +import static gregtech.api.enums.GT_Values.oreveinPlacerOres; +import static gregtech.api.enums.GT_Values.oreveinPlacerOresMultiplier; + +public class GT_Worldgen_GT_Ore_Layer + extends GT_Worldgen { + public static ArrayList<GT_Worldgen_GT_Ore_Layer> sList = new ArrayList(); + public static int sWeight = 0; + public final short mMinY; + public final short mMaxY; + public final short mWeight; + public final short mDensity; + public final short mSize; + public final short mPrimaryMeta; + public final short mSecondaryMeta; + public final short mBetweenMeta; + public final short mSporadicMeta; + //public final String mBiome; + public final String mRestrictBiome; + public final boolean mOverworld; + public final boolean mNether; + public final boolean mEnd; + public final boolean mEndAsteroid; + public static final int WRONG_BIOME=0; + public static final int WRONG_DIMENSION=1; + public static final int NO_ORE_IN_BOTTOM_LAYER=2; + public static final int NO_OVERLAP=3; + public static final int ORE_PLACED=4; + public static final int NO_OVERLAP_AIR_BLOCK=5; + + public final boolean mMoon = false, mMars = false, mAsteroid = false; + public final String aTextWorldgen = "worldgen."; + + + @Deprecated + public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, int aPrimary, int aSecondary, int aBetween, int aSporadic) { + super(aName, sList, aDefault); + this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); + this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); + this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); + this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd); + //this.mMoon = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon); + //this.mMars = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars); + //this.mAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid); + this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); + short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)); + if (mMaxY < (this.mMinY + 9)) { + GT_Log.out.println( + "Oremix " + this.mWorldGenName + + " has invalid Min/Max heights!" + ); + mMaxY = (short) (this.mMinY + 9); + } + this.mMaxY = mMaxY; + this.mWeight = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); + this.mDensity = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); + this.mSize = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); + this.mPrimaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary)); + this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary)); + this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween)); + this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic)); + this.mRestrictBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + + //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist"); + //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist"); + //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist"); + //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist"); + + if (this.mEnabled) { + //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); + //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); + //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); + //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); + sWeight += this.mWeight; + //if(GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes){ + // blusunrize.immersiveengineering.api.tool.ExcavatorHandler.addMineral(aName.substring(8, 9).toUpperCase()+aName.substring(9), aWeight, 0.2f, new String[]{"ore"+aPrimary.mName,"ore"+aSecondary.mName,"ore"+aBetween.mName,"ore"+aSporadic.mName}, new float[]{.4f,.4f,.15f,.05f}); + //} + + } + } + + @Deprecated + public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) { + this(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, aOverworld, aNether, aEnd, aPrimary, aSecondary, aBetween, aSporadic); + } + + public GT_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) { + super(aName, sList, aDefault); + this.mOverworld = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); + this.mNether = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); + this.mEnd = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); + this.mEndAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "EndAsteroid", aEnd); + //this.mMoon = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon); + //this.mMars = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars); + //this.mAsteroid = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid); + this.mMinY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); + short mMaxY = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY)); + if (mMaxY < (this.mMinY + 9)) { + GT_Log.out.println( + "Oremix " + this.mWorldGenName + + " has invalid Min/Max heights!" + ); + mMaxY = (short) (this.mMinY + 9); + } + this.mMaxY = mMaxY; + this.mWeight = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); + this.mDensity = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); + this.mSize = ((short) Math.max(1, GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); + this.mPrimaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID)); + this.mSecondaryMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); + this.mBetweenMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); + this.mSporadicMeta = ((short) GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); + this.mRestrictBiome = GregTech_API.sWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + + //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist"); + //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist"); + //if (mBetweenMeta != -1 && GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mBetweenMeta + " for " + mWorldGenName + " does not exist"); + //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSporadicMeta + " for " + mWorldGenName + " does not exist"); + + if (this.mEnabled) { + //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); + //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); + //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); + //GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, aOverworld, aNether, aEnd); + sWeight += this.mWeight; + //if(GregTech_API.mImmersiveEngineering && GT_Mod.gregtechproxy.mImmersiveEngineeringRecipes){ + // blusunrize.immersiveengineering.api.tool.ExcavatorHandler.addMineral(aName.substring(8, 9).toUpperCase()+aName.substring(9), aWeight, 0.2f, new String[]{"ore"+aPrimary.mName,"ore"+aSecondary.mName,"ore"+aBetween.mName,"ore"+aSporadic.mName}, new float[]{.4f,.4f,.15f,.05f}); + //} + + } + } + + public int executeWorldgenChunkified(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, int aSeedX, int aSeedZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + if( mWorldGenName.equals("NoOresInVein") ) { + if (debugOrevein) GT_Log.out.println( + " NoOresInVein" + ); + // This is a special empty orevein + return ORE_PLACED; + } + if (!isGenerationAllowed(aWorld, aDimensionType, ((aDimensionType == -1) && (this.mNether)) || ((aDimensionType == 0) && (this.mOverworld)) || ((aDimensionType == 1) && (this.mEnd)) ? aDimensionType : aDimensionType ^ 0xFFFFFFFF)) { + /* // Debug code, but spams log + if (debugOrevein) { + GT_Log.out.println( + "Wrong dimension" + ); + } + */ + return WRONG_DIMENSION; + } + /*if (!((aWorld.provider.getDimensionName().equalsIgnoreCase("Overworld")) || (aWorld.provider.getDimensionName().equalsIgnoreCase("Nether"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Underdark"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Twilight Forest"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("Underdark"))||(aWorld.provider.getDimensionName().equalsIgnoreCase("The End")))) + return WRONG_DIMENSION;*/ + + if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { + return WRONG_BIOME; + } + // For optimal performance, this should be done upstream. Meh + String tDimensionName = aWorld.provider.getDimensionName(); + boolean isUnderdark = tDimensionName.equals("Underdark"); + + int[] placeCount=new int[4]; + + int tMinY = mMinY + aRandom.nextInt(mMaxY - mMinY - 5); + // Determine West/East ends of orevein + int wXVein = aSeedX - aRandom.nextInt(mSize); // West side + int eXVein = aSeedX + 16 + aRandom.nextInt(mSize); + // Limit Orevein to only blocks present in current chunk + int wX = Math.max( wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade. + int eX = Math.min( eXVein, aChunkX + 2 + 16); + + // Get a block at the center of the chunk and the bottom of the orevein. + Block tBlock = aWorld.getBlock(aChunkX + 7, tMinY, aChunkZ + 9); + + if (wX >= eX) { //No overlap between orevein and this chunk exists in X + if (tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.stone) || + tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.netherrack) || + tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.end_stone) || + tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) || + tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones) ) { + // Didn't reach, but could have placed. Save orevein for future use. + return NO_OVERLAP; + } else { + // Didn't reach, but couldn't place in test spot anywys, try for another orevein + return NO_OVERLAP_AIR_BLOCK; + } + } + // Determine North/Sound ends of orevein + int nZVein = aSeedZ - aRandom.nextInt(mSize); + int sZVein = aSeedZ + 16 + aRandom.nextInt(mSize); + + int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade. + int sZ = Math.min(sZVein, aChunkZ + 2 + 16); + if (nZ >= sZ) { //No overlap between orevein and this chunk exists in Z + if (tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.stone) || + tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.netherrack) || + tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.end_stone) || + tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) || + tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones) ) { + // Didn't reach, but could have placed. Save orevein for future use. + return NO_OVERLAP; + } else { + // Didn't reach, but couldn't place in test spot anywys, try for another orevein + return NO_OVERLAP_AIR_BLOCK; + } + } + + if (debugOrevein) { + GT_Log.out.print( + "Trying Orevein:" + this.mWorldGenName + + " Dimension=" + tDimensionName + + " mX="+aChunkX/16+ + " mZ="+aChunkZ/16+ + " oreseedX="+ aSeedX/16 + + " oreseedZ="+ aSeedZ/16 + + " cY="+tMinY + ); + } + // Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed should always be max density due to truncation of Math.sqrt(). + int localDensity = Math.max(1, this.mDensity / ((int)Math.sqrt(2 + Math.pow(aChunkX/16 - aSeedX/16, 2) + Math.pow(aChunkZ/16 - aSeedZ/16, 2))) ); + + // To allow for early exit due to no ore placed in the bottom layer (probably because we are in the sky), unroll 1 pass through the loop + // Now we do bottom-level-first oregen, and work our way upwards. + // Layer -1 Secondary and Sporadic + int level = tMinY - 1; //Dunno why, but the first layer is actually played one below tMinY. Go figure. + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); + if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { + placeCount[1]++; + } + } + else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; + } + } + } + if ((placeCount[1]+placeCount[3])==0) { + if (debugOrevein) GT_Log.out.println( + " No ore in bottom layer" + ); + return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer + } + // Layers 0 & 1 Secondary and Sporadic + for (level = tMinY; level < (tMinY+2); level++) { + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); + if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { + placeCount[1]++; + } + } + else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; + } + } + } + } + // Layer 2 is Secondary, in-between, and sporadic + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); + if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { + placeCount[2]++; + } + } + else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) { + placeCount[1]++; + } + } + else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; + } + } + } + level++; // Increment level to next layer + // Layer 3 is In-between, and sporadic + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); + if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { + placeCount[2]++; + } + } + else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; + } + } + } + level++; // Increment level to next layer + // Layer 4 is In-between, Primary and sporadic + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); + if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { + placeCount[2]++; + } + } + else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { + placeCount[1]++; + } + } + else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; + } + } + } + level++; // Increment level to next layer + // Layer 5 is In-between, Primary and sporadic + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); + if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are reduce by 1/2 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) { + placeCount[2]++; + } + } + else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { + placeCount[1]++; + } + } + else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; + } + } + } + level++; // Increment level to next layer + // Layer 6 is Primary and sporadic + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); + if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { + placeCount[1]++; + } + } + else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; + } + } + } + level++; // Increment level to next layer + // Layer 7 is Primary and sporadic + for (int tX = wX; tX < eX; tX++) { + int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); + for (int tZ = nZ; tZ < sZ; tZ++) { + int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity); + if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) { + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) { + placeCount[1]++; + } + } + else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are reduce by 1/7 to compensate + if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark)) + placeCount[3]++; + } + } + } + //Place small ores for the vein + if( oreveinPlacerOres ) { + int nSmallOres = (eX-wX)*(sZ-nZ)*this.mDensity/10 * oreveinPlacerOresMultiplier; + //Small ores are placed in the whole chunk in which the vein appears. + for( int nSmallOresCount = 0; nSmallOresCount < nSmallOres; nSmallOresCount++) { + int tX = aRandom.nextInt(16) + aChunkX + 2; + int tZ = aRandom.nextInt(16) + aChunkZ + 2; + int tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores. + if (this.mPrimaryMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mPrimaryMeta, true, isUnderdark); + tX = aRandom.nextInt(16) + aChunkX + 2; + tZ = aRandom.nextInt(16) + aChunkZ + 2; + tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores. + if (this.mSecondaryMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mSecondaryMeta, true, isUnderdark); + tX = aRandom.nextInt(16) + aChunkX + 2; + tZ = aRandom.nextInt(16) + aChunkZ + 2; + tY = aRandom.nextInt(160) + 10; // Y height can vary from 10 to 170 for small ores. + if (this.mBetweenMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mBetweenMeta, true, isUnderdark); + tX = aRandom.nextInt(16) + aChunkX + 2; + tZ = aRandom.nextInt(16) + aChunkZ + 2; + tY = aRandom.nextInt(190) + 10; // Y height can vary from 10 to 200 for small ores. + if (this.mSporadicMeta > 0 ) GT_TileEntity_Ores.setOreBlock(aWorld, tX, tY, tZ, this.mSporadicMeta, true, isUnderdark); + } + } + if (debugOrevein) { + GT_Log.out.println( + " wXVein" + wXVein + + " eXVein" + eXVein + + " nZVein" + nZVein + + " sZVein" + sZVein + + " locDen=" + localDensity + + " Den=" + this.mDensity + + " Sec="+placeCount[1]+ + " Spo="+placeCount[3]+ + " Bet="+placeCount[2]+ + " Pri="+placeCount[0] + ); + } + // Something (at least the bottom layer must have 1 block) must have been placed, return true + return ORE_PLACED; + } +} diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 06e8697d3c..00bdb0d879 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -1,522 +1,522 @@ -package gregtech.common;
-
-import static gregtech.api.enums.GT_Values.debugOrevein;
-import static gregtech.api.enums.GT_Values.debugWorldGen;
-import static gregtech.api.enums.GT_Values.oreveinAttempts;
-import static gregtech.api.enums.GT_Values.oreveinMaxPlacementAttempts;
-import static gregtech.api.enums.GT_Values.oreveinPercentage;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Random;
-
-import cpw.mods.fml.common.IWorldGenerator;
-import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import gregtech.api.objects.XSTR;
-import gregtech.api.util.GT_Log;
-import gregtech.api.world.GT_Worldgen;
-import gregtech.common.blocks.GT_TileEntity_Ores;
-import net.minecraft.init.Blocks;
-import net.minecraft.util.MathHelper;
-import net.minecraft.world.World;
-import net.minecraft.world.chunk.Chunk;
-import net.minecraft.world.chunk.IChunkProvider;
-
-// Disabled for hardcoded value. import static gregtech.api.enums.GT_Values.oreveinMaxSize;
-
-public class GT_Worldgenerator
-implements IWorldGenerator {
- //public static boolean sAsteroids = true;
- private static int mEndAsteroidProbability = 300;
- //private static int mGCAsteroidProbability = 50;
- private static int mSize = 100;
- private static int endMinSize = 50;
- private static int endMaxSize = 200;
- //private static int gcMinSize = 100;
- //private static int gcMaxSize = 400;
- private static boolean endAsteroids = true;
- public static List<Runnable> mList = new ArrayList();
- public static HashSet<Long> ProcChunks = new HashSet<Long>();
- // This is probably not going to work. Trying to create a fake orevein to put into hashtable when there will be no ores in a vein.
- public static GT_Worldgen_GT_Ore_Layer noOresInVein = new GT_Worldgen_GT_Ore_Layer( "NoOresInVein", false, 0, 255, 0, 255, 16, false, false, false, Materials.Aluminium, Materials.Aluminium, Materials.Aluminium, Materials.Aluminium);
- public static Hashtable<Long, GT_Worldgen_GT_Ore_Layer> validOreveins = new Hashtable(1024);
- public boolean mIsGenerating = false;
- public static final Object listLock = new Object();
- //private static boolean gcAsteroids = true;
-
-
- public GT_Worldgenerator() {
- endAsteroids = GregTech_API.sWorldgenFile.get("endasteroids", "GenerateAsteroids", true);
- endMinSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMinSize", 50);
- endMaxSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMaxSize", 200);
- mEndAsteroidProbability = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidProbability", 300);
- //gcAsteroids = GregTech_API.sWorldgenFile.get("gcasteroids", "GenerateGCAsteroids", true);
- //gcMinSize = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidMinSize", 100);
- //gcMaxSize = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidMaxSize", 400);
- //mGCAsteroidProbability = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidProbability", 300);
- GameRegistry.registerWorldGenerator(this, 1073741823);
- if (debugWorldGen) {
- GT_Log.out.println(
- "GT_Worldgenerator created"
- );
- }
- }
-
- public void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
- synchronized (listLock)
- {
- this.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) +1), aX, aZ, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName));
- if (debugWorldGen) GT_Log.out.println(
- "ADD WorldSeed:"+aWorld.getSeed() +
- " DimId" + aWorld.provider.dimensionId +
- " chunk x:" + aX +
- " z:" + aZ +
- " SIZE: " + this.mList.size()
- );
- }
-
- if (!this.mIsGenerating) {
- this.mIsGenerating = true;
- int mList_sS=this.mList.size();
- mList_sS = Math.min(mList_sS, 5); // Run a maximum of 5 chunks at a time through worldgen. Extra chunks get done later.
- for (int i = 0; i < mList_sS; i++) {
- WorldGenContainer toRun = (WorldGenContainer) this.mList.get(0);
- if (debugWorldGen) GT_Log.out.println(
- "RUN WorldSeed:"+aWorld.getSeed()+
- " DimId" + aWorld.provider.dimensionId +
- " chunk x:" + toRun.mX +
- " z:" + toRun.mZ +
- " SIZE: " + this.mList.size() +
- " i: " + i
- );
- synchronized (listLock)
- {
- this.mList.remove(0);
- }
- toRun.run();
- }
- this.mIsGenerating = false;
- }
- }
-
- public static class WorldGenContainer
- implements Runnable {
- public final Random mRandom;
- public final int mX;
- public final int mZ;
- public final int mDimensionType;
- public final World mWorld;
- public final IChunkProvider mChunkGenerator;
- public final IChunkProvider mChunkProvider;
- public final String mBiome;
- // Used for outputting orevein weights and bins
- // static int test=0;
-
-
- // Local class to track which orevein seeds must be checked when doing chunkified worldgen
- class NearbySeeds {
- public int mX;
- public int mZ;
- NearbySeeds( int x, int z) {
- this.mX = x;
- this.mZ = z;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof GT_Worldgenerator.WorldGenContainer.NearbySeeds)) return false;
- GT_Worldgenerator.WorldGenContainer.NearbySeeds that = (GT_Worldgenerator.WorldGenContainer.NearbySeeds) o;
- if (this.mX != that.mX) return false;
- return this.mZ == that.mZ;
- }
-
- @Override
- public int hashCode() {
- int result = this.mX;
- result = 31 * result + this.mZ;
- return result;
- }
- };
-
- public static ArrayList<GT_Worldgenerator.WorldGenContainer.NearbySeeds> seedList = new ArrayList();
-
- // aX and aZ are now the by-chunk X and Z for the chunk of interest
- public WorldGenContainer(Random aRandom, int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider, String aBiome) {
- this.mRandom = aRandom;
- this.mX = aX;
- this.mZ = aZ;
- this.mDimensionType = aDimensionType;
- this.mWorld = aWorld;
- this.mChunkGenerator = aChunkGenerator;
- this.mChunkProvider = aChunkProvider;
- this.mBiome = aBiome;
- }
-
- // How to evaluate oregen distribution
- // - Enable debugOreveins
- // - Fly around for a while, or teleport jumping ~320 blocks at a time, with
- // a 15-30s pause for worldgen to catch up
- // - Do this across a large area, at least 2000x2000 blocks for good numbers
- // - Open logs\gregtech.log
- // - Using notepad++, do a Search | Find - enter "Added" for the search term
- // - Select Find All In Current Document
- // - In the Search window, right-click and Select All
- // - Copy and paste to a new file
- // - Delete extraneous stuff at top, and blank line at bottom. Line count is
- // # of total oreveins
- // - For simple spot checks, use Find All in Current Document for specific
- // oremixes, ie ore.mix.diamond, to check how many appear in the list.
- // - For more complex work, import file into Excel, and sort based on oremix
- // column. Drag select the oremix names, in the bottom right will be how many
- // entries to add in a seperate tab to calculate %ages.
- //
- // When using the ore weights, discount or remove the high altitude veins since
- // their high weight are offset by their rareness. I usually just use zero for them.
- // Actual spawn rates will vary based upon the average height of the stone layers
- // in the dimension. For example veins that range above and below the average height
- // will be less, and veins that are completely above the average height will be much less.
-
- public void worldGenFindVein( int oreseedX, int oreseedZ) {
- // Explanation of oreveinseed implementation.
- // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen passes, one with getSeed set to +1 the original world seed. This pushes that +1 off the low bits of oreseedZ, so that the hashes are far apart for the two passes.
- // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the dimension in the top bits of the hash, to make sure to get unique hashes per dimension
- // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in the bits 29-55. Cuts off the top few bits of the chunk so we have bits for dimension.
- // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the bits 0-27. Cuts off the top few bits of the chunk so we have bits for dimension.
- long oreveinSeed = ((long)this.mWorld.getSeed()<<16) ^ ((long)((this.mWorld.provider.dimensionId & 0xffL)<<56) |( ((long)oreseedX & 0x000000000fffffffL) << 28) | ( (long)oreseedZ & 0x000000000fffffffL )); // Use an RNG that is identical every time it is called for this oreseed.
- XSTR oreveinRNG = new XSTR( oreveinSeed );
- int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the dice, see if we get an orevein here at all
- int noOrePlacedCount=0;
- String tDimensionName = "";
- if (debugOrevein) { tDimensionName = this.mWorld.provider.getDimensionName(); }
-
- if (debugOrevein) GT_Log.out.println(
- " Finding oreveins for oreveinSeed="+ oreveinSeed +
- " mX="+ this.mX +
- " mZ="+ this.mZ +
- " oreseedX="+ oreseedX +
- " oreseedZ="+ oreseedZ +
- " worldSeed="+this.mWorld.getSeed()
- );
-
- // Search for a valid orevein for this dimension
- if( !validOreveins.containsKey(oreveinSeed) ) {
- if ( (oreveinPercentageRoll<oreveinPercentage) && (GT_Worldgen_GT_Ore_Layer.sWeight > 0) && (GT_Worldgen_GT_Ore_Layer.sList.size() > 0)) {
- int placementAttempts = 0;
- boolean oreveinFound = false;
- int i;
-
- // Used for outputting orevein weights and bins
- /*
- if( test==0 )
- {
- test = 1;
- GT_Log.out.println(
- "sWeight = " + GT_Worldgen_GT_Ore_Layer.sWeight
- );
- for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) {
- GT_Log.out.println(
- ( tWorldGen).mWorldGenName + " mWeight = " + ( tWorldGen).mWeight + " mSize = " + (tWorldGen).mSize
- );
- }
- }
- */
- for( i = 0; (i < oreveinAttempts) && (!oreveinFound) && (placementAttempts<oreveinMaxPlacementAttempts); i++ ) {
- int tRandomWeight = oreveinRNG.nextInt(GT_Worldgen_GT_Ore_Layer.sWeight);
- for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) {
- tRandomWeight -= ( tWorldGen).mWeight;
- if (tRandomWeight <= 0) {
- try {
- // Adjust the seed so that this layer has a series of unique random numbers. Otherwise multiple attempts at this same oreseed will get the same offset and X/Z values. If an orevein failed, any orevein with the
- // same minimum heights would fail as well. This prevents that, giving each orevein a unique height each pass through here.
- int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, new XSTR( oreveinSeed ^ (tWorldGen.mPrimaryMeta)), this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, oreseedX*16, oreseedZ*16, this.mChunkGenerator, this.mChunkProvider);
- switch(placementResult) {
- case GT_Worldgen_GT_Ore_Layer.ORE_PLACED:
- if (debugOrevein) GT_Log.out.println(
- " Added near oreveinSeed=" + oreveinSeed + " " +
- ( tWorldGen).mWorldGenName +
- " tries at oremix=" + i +
- " placementAttempts=" + placementAttempts +
- " dimensionName=" + tDimensionName
- );
- validOreveins.put(oreveinSeed, tWorldGen);
- oreveinFound = true;
- break;
- case GT_Worldgen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
- placementAttempts++;
- // SHould do retry in this case until out of chances
- break;
- case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP:
- if (debugOrevein) GT_Log.out.println(
- " Added far oreveinSeed=" + oreveinSeed + " " +
- ( tWorldGen).mWorldGenName +
- " tries at oremix=" + i +
- " placementAttempts=" + placementAttempts +
- " dimensionName=" + tDimensionName
- );
- validOreveins.put(oreveinSeed, tWorldGen);
- oreveinFound = true;
- break;
- case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP_AIR_BLOCK:
- if (debugOrevein) GT_Log.out.println(
- " No overlap and air block in test spot=" + oreveinSeed + " " +
- ( tWorldGen).mWorldGenName +
- " tries at oremix=" + i +
- " placementAttempts=" + placementAttempts +
- " dimensionName=" + tDimensionName
- );
- // SHould do retry in this case until out of chances
- placementAttempts++;
- break;
- }
- break; // Try the next orevein
- } catch (Throwable e) {
- if (debugOrevein) GT_Log.out.println(
- "Exception occurred on oreVein" + tWorldGen +
- " oreveinSeed="+ oreveinSeed +
- " mX="+ this.mX +
- " mZ="+ this.mZ +
- " oreseedX="+ oreseedX +
- " oreseedZ="+ oreseedZ
- );
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- // Only add an empty orevein if unable to place a vein at the oreseed chunk.
- if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)){
- if (debugOrevein) GT_Log.out.println(
- " Empty oreveinSeed="+ oreveinSeed +
- " mX="+ this.mX +
- " mZ="+ this.mZ +
- " oreseedX="+ oreseedX +
- " oreseedZ="+ oreseedZ +
- " tries at oremix=" + i +
- " placementAttempts=" + placementAttempts +
- " dimensionName=" + tDimensionName
- );
- validOreveins.put(oreveinSeed, noOresInVein );
- }
- } else if(oreveinPercentageRoll >= oreveinPercentage) {
- if (debugOrevein) GT_Log.out.println(
- " Skipped oreveinSeed="+ oreveinSeed +
- " mX="+ this.mX +
- " mZ="+ this.mZ +
- " oreseedX=" + oreseedX +
- " oreseedZ=" + oreseedZ +
- " RNG=" + oreveinPercentageRoll +
- " %=" + oreveinPercentage+
- " dimensionName=" + tDimensionName
- );
- validOreveins.put(oreveinSeed, noOresInVein);
- }
- }else {
- // oreseed is located in the previously processed table
- if (debugOrevein) GT_Log.out.print(
- " Valid oreveinSeed="+ oreveinSeed +
- " validOreveins.size()=" + validOreveins.size() + " "
- );
- GT_Worldgen_GT_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed);
- oreveinRNG.setSeed(oreveinSeed ^ (tWorldGen.mPrimaryMeta)); // Reset RNG to only be based on oreseed X/Z and type of vein
- int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, oreveinRNG, this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, oreseedX*16, oreseedZ*16, this.mChunkGenerator, this.mChunkProvider);
- switch( placementResult )
- {
- case GT_Worldgen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER:
- if (debugOrevein) GT_Log.out.println(
- " No ore in bottom layer"
- );
- break;
- case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP:
- if (debugOrevein) GT_Log.out.println(
- " No overlap"
- );
- }
- }
- }
-
- public void run() {
- long startTime = System.nanoTime();
- int oreveinMaxSize;
-
- // Do GT_Stones and GT_small_ores oregen for this chunk
- try {
- for (GT_Worldgen tWorldGen : GregTech_API.sWorldgenList) {
- /*
- if (debugWorldGen) GT_Log.out.println(
- "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName
- );
- */
- tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, this.mChunkGenerator, this.mChunkProvider);
- }
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
- long leftOverTime = System.nanoTime();
-
- // Determine bounding box on how far out to check for oreveins affecting this chunk
- // For now, manually reducing oreveinMaxSize when not in the Underdark for performance
- if(this.mWorld.provider.getDimensionName().equals("Underdark") ) {
- oreveinMaxSize=32; // Leave Deep Dark/Underdark max oregen at 32, instead of 64
- } else {
- oreveinMaxSize=32;
- }
-
- int wXbox = this.mX - (oreveinMaxSize/16);
- int eXbox = this.mX + (oreveinMaxSize/16 + 1); // Need to add 1 since it is compared using a <
- int nZbox = this.mZ - (oreveinMaxSize/16);
- int sZbox = this.mZ + (oreveinMaxSize/16 + 1);
-
- // Search for orevein seeds and add to the list;
- for( int x = wXbox; x < eXbox; x++ ) {
- for( int z = nZbox; z < sZbox; z++ ) {
- // Determine if this X/Z is an orevein seed
- if ( ( (Math.abs(x)%3) == 1) && ( (Math.abs(z)%3) == 1 ) ) {
- if (debugWorldGen) GT_Log.out.println(
- "Adding seed x="+x+
- " z="+z
- );
- seedList.add( new GT_Worldgenerator.WorldGenContainer.NearbySeeds(x,z) );
- }
- }
- }
-
- // Now process each oreseed vs this requested chunk
- for( ; seedList.size() != 0; seedList.remove(0) ) {
- if (debugWorldGen) GT_Log.out.println(
- "Processing seed x="+seedList.get(0).mX+
- " z="+seedList.get(0).mZ
- );
- worldGenFindVein( seedList.get(0).mX, seedList.get(0).mZ );
- }
-
- long oregenTime = System.nanoTime();
-
- //Asteroid Worldgen
- int tDimensionType = this.mWorld.provider.dimensionId;
- //String tDimensionName = this.mWorld.provider.getDimensionName();
- Random aRandom = new Random();
- //if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0))) || ((tDimensionName.equals("Asteroids")) && gcAsteroids && ((mGCAsteroidProbability <= 1) || (aRandom.nextInt(mGCAsteroidProbability) == 0)))) {
- if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0)))) {
- short primaryMeta = 0;
- short secondaryMeta = 0;
- short betweenMeta = 0;
- short sporadicMeta = 0;
- if ((GT_Worldgen_GT_Ore_Layer.sWeight > 0) && (GT_Worldgen_GT_Ore_Layer.sList.size() > 0)) {
- boolean temp = true;
- int tRandomWeight;
- for (int i = 0; (i < oreveinAttempts) && (temp); i++) {
- tRandomWeight = aRandom.nextInt(GT_Worldgen_GT_Ore_Layer.sWeight);
- for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) {
- tRandomWeight -= ((GT_Worldgen_GT_Ore_Layer) tWorldGen).mWeight;
- if (tRandomWeight <= 0) {
- try {
- //if ((tWorldGen.mEndAsteroid && tDimensionType == 1) || (tWorldGen.mAsteroid && tDimensionType == -30)) {
- if (tWorldGen.mEndAsteroid && tDimensionType == 1) {
- primaryMeta = tWorldGen.mPrimaryMeta;
- secondaryMeta = tWorldGen.mSecondaryMeta;
- betweenMeta = tWorldGen.mBetweenMeta;
- sporadicMeta = tWorldGen.mSporadicMeta;
- temp = false;
- break;
- }
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- }
- }
- //if(GT_Values.D1)GT_FML_LOGGER.info("do asteroid gen: "+this.mX+" "+this.mZ);
- int tX = mX * 16 + aRandom.nextInt(16);
- int tY = 50 + aRandom.nextInt(200 - 50);
- int tZ = mZ * 16 + aRandom.nextInt(16);
- if (tDimensionType == 1) {
- mSize = aRandom.nextInt((int) (endMaxSize - endMinSize));
- //} else if (tDimensionName.equals("Asteroids")) {
- // mSize = aRandom.nextInt((int) (gcMaxSize - gcMinSize));
- }
- if ((mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) {
- float var6 = aRandom.nextFloat() * 3.141593F;
- double var7 = tX + 8 + MathHelper.sin(var6) * mSize / 8.0F;
- double var9 = tX + 8 - MathHelper.sin(var6) * mSize / 8.0F;
- double var11 = tZ + 8 + MathHelper.cos(var6) * mSize / 8.0F;
- double var13 = tZ + 8 - MathHelper.cos(var6) * mSize / 8.0F;
- double var15 = tY + aRandom.nextInt(3) - 2;
- double var17 = tY + aRandom.nextInt(3) - 2;
- for (int var19 = 0; var19 <= mSize; var19++) {
- double var20 = var7 + (var9 - var7) * var19 / mSize;
- double var22 = var15 + (var17 - var15) * var19 / mSize;
- double var24 = var11 + (var13 - var11) * var19 / mSize;
- double var26 = aRandom.nextDouble() * mSize / 16.0D;
- double var28 = (MathHelper.sin(var19 * 3.141593F / mSize) + 1.0F) * var26 + 1.0D;
- double var30 = (MathHelper.sin(var19 * 3.141593F / mSize) + 1.0F) * var26 + 1.0D;
- int tMinX = MathHelper.floor_double(var20 - var28 / 2.0D);
- int tMinY = MathHelper.floor_double(var22 - var30 / 2.0D);
- int tMinZ = MathHelper.floor_double(var24 - var28 / 2.0D);
- int tMaxX = MathHelper.floor_double(var20 + var28 / 2.0D);
- int tMaxY = MathHelper.floor_double(var22 + var30 / 2.0D);
- int tMaxZ = MathHelper.floor_double(var24 + var28 / 2.0D);
- for (int eX = tMinX; eX <= tMaxX; eX++) {
- double var39 = (eX + 0.5D - var20) / (var28 / 2.0D);
- if (var39 * var39 < 1.0D) {
- for (int eY = tMinY; eY <= tMaxY; eY++) {
- double var42 = (eY + 0.5D - var22) / (var30 / 2.0D);
- if (var39 * var39 + var42 * var42 < 1.0D) {
- for (int eZ = tMinZ; eZ <= tMaxZ; eZ++) {
- double var45 = (eZ + 0.5D - var24) / (var28 / 2.0D);
- if ((var39 * var39 + var42 * var42 + var45 * var45 < 1.0D) && (mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) {
- int ranOre = aRandom.nextInt(50);
- if (ranOre < 3) {
- GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, primaryMeta, false);
- } else if (ranOre < 6) {
- GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, secondaryMeta, false);
- } else if (ranOre < 8) {
- GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, betweenMeta, false);
- } else if (ranOre < 10) {
- GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta, false);
- } else {
- //if (tDimensionType == 1) {//TODO CHECK
- mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0);
- //} else if (tDimensionName.equals("Asteroids")) {
- ////int asteroidType = aRandom.nextInt(20);
- ////if (asteroidType == 19) { //Rare Asteroid?
- ////mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3);
- ////} else {
- //mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3);
- ////}
- //}
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- }
-
-
- Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ);
- if (tChunk != null) {
- tChunk.isModified = true;
- }
- long endTime = System.nanoTime();
- long duration = (endTime - startTime);
- if (debugWorldGen) {
- GT_Log.out.println(
- " Oregen took " + (oregenTime-leftOverTime)+
- " Leftover gen took " + (leftOverTime - startTime) +
- " Worldgen took " + duration +
- " nanoseconds"
- );
- }
- }
- }
-}
+package gregtech.common; + +import static gregtech.api.enums.GT_Values.debugOrevein; +import static gregtech.api.enums.GT_Values.debugWorldGen; +import static gregtech.api.enums.GT_Values.oreveinAttempts; +import static gregtech.api.enums.GT_Values.oreveinMaxPlacementAttempts; +import static gregtech.api.enums.GT_Values.oreveinPercentage; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Random; + +import cpw.mods.fml.common.IWorldGenerator; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_Log; +import gregtech.api.world.GT_Worldgen; +import gregtech.common.blocks.GT_TileEntity_Ores; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; + +// Disabled for hardcoded value. import static gregtech.api.enums.GT_Values.oreveinMaxSize; + +public class GT_Worldgenerator +implements IWorldGenerator { + //public static boolean sAsteroids = true; + private static int mEndAsteroidProbability = 300; + //private static int mGCAsteroidProbability = 50; + private static int mSize = 100; + private static int endMinSize = 50; + private static int endMaxSize = 200; + //private static int gcMinSize = 100; + //private static int gcMaxSize = 400; + private static boolean endAsteroids = true; + public static List<Runnable> mList = new ArrayList(); + public static HashSet<Long> ProcChunks = new HashSet<Long>(); + // This is probably not going to work. Trying to create a fake orevein to put into hashtable when there will be no ores in a vein. + public static GT_Worldgen_GT_Ore_Layer noOresInVein = new GT_Worldgen_GT_Ore_Layer( "NoOresInVein", false, 0, 255, 0, 255, 16, false, false, false, Materials.Aluminium, Materials.Aluminium, Materials.Aluminium, Materials.Aluminium); + public static Hashtable<Long, GT_Worldgen_GT_Ore_Layer> validOreveins = new Hashtable(1024); + public boolean mIsGenerating = false; + public static final Object listLock = new Object(); + //private static boolean gcAsteroids = true; + + + public GT_Worldgenerator() { + endAsteroids = GregTech_API.sWorldgenFile.get("endasteroids", "GenerateAsteroids", true); + endMinSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMinSize", 50); + endMaxSize = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidMaxSize", 200); + mEndAsteroidProbability = GregTech_API.sWorldgenFile.get("endasteroids", "AsteroidProbability", 300); + //gcAsteroids = GregTech_API.sWorldgenFile.get("gcasteroids", "GenerateGCAsteroids", true); + //gcMinSize = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidMinSize", 100); + //gcMaxSize = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidMaxSize", 400); + //mGCAsteroidProbability = GregTech_API.sWorldgenFile.get("gcasteroids", "GCAsteroidProbability", 300); + GameRegistry.registerWorldGenerator(this, 1073741823); + if (debugWorldGen) { + GT_Log.out.println( + "GT_Worldgenerator created" + ); + } + } + + public void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + synchronized (listLock) + { + this.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) +1), aX, aZ, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); + if (debugWorldGen) GT_Log.out.println( + "ADD WorldSeed:"+aWorld.getSeed() + + " DimId" + aWorld.provider.dimensionId + + " chunk x:" + aX + + " z:" + aZ + + " SIZE: " + this.mList.size() + ); + } + + if (!this.mIsGenerating) { + this.mIsGenerating = true; + int mList_sS=this.mList.size(); + mList_sS = Math.min(mList_sS, 5); // Run a maximum of 5 chunks at a time through worldgen. Extra chunks get done later. + for (int i = 0; i < mList_sS; i++) { + WorldGenContainer toRun = (WorldGenContainer) this.mList.get(0); + if (debugWorldGen) GT_Log.out.println( + "RUN WorldSeed:"+aWorld.getSeed()+ + " DimId" + aWorld.provider.dimensionId + + " chunk x:" + toRun.mX + + " z:" + toRun.mZ + + " SIZE: " + this.mList.size() + + " i: " + i + ); + synchronized (listLock) + { + this.mList.remove(0); + } + toRun.run(); + } + this.mIsGenerating = false; + } + } + + public static class WorldGenContainer + implements Runnable { + public final Random mRandom; + public final int mX; + public final int mZ; + public final int mDimensionType; + public final World mWorld; + public final IChunkProvider mChunkGenerator; + public final IChunkProvider mChunkProvider; + public final String mBiome; + // Used for outputting orevein weights and bins + // static int test=0; + + + // Local class to track which orevein seeds must be checked when doing chunkified worldgen + class NearbySeeds { + public int mX; + public int mZ; + NearbySeeds( int x, int z) { + this.mX = x; + this.mZ = z; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof GT_Worldgenerator.WorldGenContainer.NearbySeeds)) return false; + GT_Worldgenerator.WorldGenContainer.NearbySeeds that = (GT_Worldgenerator.WorldGenContainer.NearbySeeds) o; + if (this.mX != that.mX) return false; + return this.mZ == that.mZ; + } + + @Override + public int hashCode() { + int result = this.mX; + result = 31 * result + this.mZ; + return result; + } + }; + + public static ArrayList<GT_Worldgenerator.WorldGenContainer.NearbySeeds> seedList = new ArrayList(); + + // aX and aZ are now the by-chunk X and Z for the chunk of interest + public WorldGenContainer(Random aRandom, int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider, String aBiome) { + this.mRandom = aRandom; + this.mX = aX; + this.mZ = aZ; + this.mDimensionType = aDimensionType; + this.mWorld = aWorld; + this.mChunkGenerator = aChunkGenerator; + this.mChunkProvider = aChunkProvider; + this.mBiome = aBiome; + } + + // How to evaluate oregen distribution + // - Enable debugOreveins + // - Fly around for a while, or teleport jumping ~320 blocks at a time, with + // a 15-30s pause for worldgen to catch up + // - Do this across a large area, at least 2000x2000 blocks for good numbers + // - Open logs\gregtech.log + // - Using notepad++, do a Search | Find - enter "Added" for the search term + // - Select Find All In Current Document + // - In the Search window, right-click and Select All + // - Copy and paste to a new file + // - Delete extraneous stuff at top, and blank line at bottom. Line count is + // # of total oreveins + // - For simple spot checks, use Find All in Current Document for specific + // oremixes, ie ore.mix.diamond, to check how many appear in the list. + // - For more complex work, import file into Excel, and sort based on oremix + // column. Drag select the oremix names, in the bottom right will be how many + // entries to add in a seperate tab to calculate %ages. + // + // When using the ore weights, discount or remove the high altitude veins since + // their high weight are offset by their rareness. I usually just use zero for them. + // Actual spawn rates will vary based upon the average height of the stone layers + // in the dimension. For example veins that range above and below the average height + // will be less, and veins that are completely above the average height will be much less. + + public void worldGenFindVein( int oreseedX, int oreseedZ) { + // Explanation of oreveinseed implementation. + // (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen passes, one with getSeed set to +1 the original world seed. This pushes that +1 off the low bits of oreseedZ, so that the hashes are far apart for the two passes. + // ((this.mWorld.provider.dimensionId & 0xffL)<<56) Puts the dimension in the top bits of the hash, to make sure to get unique hashes per dimension + // ((long)oreseedX & 0x000000000fffffffL) << 28) Puts the chunk X in the bits 29-55. Cuts off the top few bits of the chunk so we have bits for dimension. + // ( (long)oreseedZ & 0x000000000fffffffL )) Puts the chunk Z in the bits 0-27. Cuts off the top few bits of the chunk so we have bits for dimension. + long oreveinSeed = ((long)this.mWorld.getSeed()<<16) ^ ((long)((this.mWorld.provider.dimensionId & 0xffL)<<56) |( ((long)oreseedX & 0x000000000fffffffL) << 28) | ( (long)oreseedZ & 0x000000000fffffffL )); // Use an RNG that is identical every time it is called for this oreseed. + XSTR oreveinRNG = new XSTR( oreveinSeed ); + int oreveinPercentageRoll = oreveinRNG.nextInt(100); // Roll the dice, see if we get an orevein here at all + int noOrePlacedCount=0; + String tDimensionName = ""; + if (debugOrevein) { tDimensionName = this.mWorld.provider.getDimensionName(); } + + if (debugOrevein) GT_Log.out.println( + " Finding oreveins for oreveinSeed="+ oreveinSeed + + " mX="+ this.mX + + " mZ="+ this.mZ + + " oreseedX="+ oreseedX + + " oreseedZ="+ oreseedZ + + " worldSeed="+this.mWorld.getSeed() + ); + + // Search for a valid orevein for this dimension + if( !validOreveins.containsKey(oreveinSeed) ) { + if ( (oreveinPercentageRoll<oreveinPercentage) && (GT_Worldgen_GT_Ore_Layer.sWeight > 0) && (GT_Worldgen_GT_Ore_Layer.sList.size() > 0)) { + int placementAttempts = 0; + boolean oreveinFound = false; + int i; + + // Used for outputting orevein weights and bins + /* + if( test==0 ) + { + test = 1; + GT_Log.out.println( + "sWeight = " + GT_Worldgen_GT_Ore_Layer.sWeight + ); + for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) { + GT_Log.out.println( + ( tWorldGen).mWorldGenName + " mWeight = " + ( tWorldGen).mWeight + " mSize = " + (tWorldGen).mSize + ); + } + } + */ + for( i = 0; (i < oreveinAttempts) && (!oreveinFound) && (placementAttempts<oreveinMaxPlacementAttempts); i++ ) { + int tRandomWeight = oreveinRNG.nextInt(GT_Worldgen_GT_Ore_Layer.sWeight); + for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) { + tRandomWeight -= ( tWorldGen).mWeight; + if (tRandomWeight <= 0) { + try { + // Adjust the seed so that this layer has a series of unique random numbers. Otherwise multiple attempts at this same oreseed will get the same offset and X/Z values. If an orevein failed, any orevein with the + // same minimum heights would fail as well. This prevents that, giving each orevein a unique height each pass through here. + int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, new XSTR( oreveinSeed ^ (tWorldGen.mPrimaryMeta)), this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, oreseedX*16, oreseedZ*16, this.mChunkGenerator, this.mChunkProvider); + switch(placementResult) { + case GT_Worldgen_GT_Ore_Layer.ORE_PLACED: + if (debugOrevein) GT_Log.out.println( + " Added near oreveinSeed=" + oreveinSeed + " " + + ( tWorldGen).mWorldGenName + + " tries at oremix=" + i + + " placementAttempts=" + placementAttempts + + " dimensionName=" + tDimensionName + ); + validOreveins.put(oreveinSeed, tWorldGen); + oreveinFound = true; + break; + case GT_Worldgen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER: + placementAttempts++; + // SHould do retry in this case until out of chances + break; + case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP: + if (debugOrevein) GT_Log.out.println( + " Added far oreveinSeed=" + oreveinSeed + " " + + ( tWorldGen).mWorldGenName + + " tries at oremix=" + i + + " placementAttempts=" + placementAttempts + + " dimensionName=" + tDimensionName + ); + validOreveins.put(oreveinSeed, tWorldGen); + oreveinFound = true; + break; + case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP_AIR_BLOCK: + if (debugOrevein) GT_Log.out.println( + " No overlap and air block in test spot=" + oreveinSeed + " " + + ( tWorldGen).mWorldGenName + + " tries at oremix=" + i + + " placementAttempts=" + placementAttempts + + " dimensionName=" + tDimensionName + ); + // SHould do retry in this case until out of chances + placementAttempts++; + break; + } + break; // Try the next orevein + } catch (Throwable e) { + if (debugOrevein) GT_Log.out.println( + "Exception occurred on oreVein" + tWorldGen + + " oreveinSeed="+ oreveinSeed + + " mX="+ this.mX + + " mZ="+ this.mZ + + " oreseedX="+ oreseedX + + " oreseedZ="+ oreseedZ + ); + e.printStackTrace(GT_Log.err); + } + } + } + } + // Only add an empty orevein if unable to place a vein at the oreseed chunk. + if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)){ + if (debugOrevein) GT_Log.out.println( + " Empty oreveinSeed="+ oreveinSeed + + " mX="+ this.mX + + " mZ="+ this.mZ + + " oreseedX="+ oreseedX + + " oreseedZ="+ oreseedZ + + " tries at oremix=" + i + + " placementAttempts=" + placementAttempts + + " dimensionName=" + tDimensionName + ); + validOreveins.put(oreveinSeed, noOresInVein ); + } + } else if(oreveinPercentageRoll >= oreveinPercentage) { + if (debugOrevein) GT_Log.out.println( + " Skipped oreveinSeed="+ oreveinSeed + + " mX="+ this.mX + + " mZ="+ this.mZ + + " oreseedX=" + oreseedX + + " oreseedZ=" + oreseedZ + + " RNG=" + oreveinPercentageRoll + + " %=" + oreveinPercentage+ + " dimensionName=" + tDimensionName + ); + validOreveins.put(oreveinSeed, noOresInVein); + } + }else { + // oreseed is located in the previously processed table + if (debugOrevein) GT_Log.out.print( + " Valid oreveinSeed="+ oreveinSeed + + " validOreveins.size()=" + validOreveins.size() + " " + ); + GT_Worldgen_GT_Ore_Layer tWorldGen = validOreveins.get(oreveinSeed); + oreveinRNG.setSeed(oreveinSeed ^ (tWorldGen.mPrimaryMeta)); // Reset RNG to only be based on oreseed X/Z and type of vein + int placementResult = tWorldGen.executeWorldgenChunkified(this.mWorld, oreveinRNG, this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, oreseedX*16, oreseedZ*16, this.mChunkGenerator, this.mChunkProvider); + switch( placementResult ) + { + case GT_Worldgen_GT_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER: + if (debugOrevein) GT_Log.out.println( + " No ore in bottom layer" + ); + break; + case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP: + if (debugOrevein) GT_Log.out.println( + " No overlap" + ); + } + } + } + + public void run() { + long startTime = System.nanoTime(); + int oreveinMaxSize; + + // Do GT_Stones and GT_small_ores oregen for this chunk + try { + for (GT_Worldgen tWorldGen : GregTech_API.sWorldgenList) { + /* + if (debugWorldGen) GT_Log.out.println( + "tWorldGen.mWorldGenName="+tWorldGen.mWorldGenName + ); + */ + tWorldGen.executeWorldgen(this.mWorld, this.mRandom, this.mBiome, this.mDimensionType, this.mX*16, this.mZ*16, this.mChunkGenerator, this.mChunkProvider); + } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + long leftOverTime = System.nanoTime(); + + // Determine bounding box on how far out to check for oreveins affecting this chunk + // For now, manually reducing oreveinMaxSize when not in the Underdark for performance + if(this.mWorld.provider.getDimensionName().equals("Underdark") ) { + oreveinMaxSize=32; // Leave Deep Dark/Underdark max oregen at 32, instead of 64 + } else { + oreveinMaxSize=32; + } + + int wXbox = this.mX - (oreveinMaxSize/16); + int eXbox = this.mX + (oreveinMaxSize/16 + 1); // Need to add 1 since it is compared using a < + int nZbox = this.mZ - (oreveinMaxSize/16); + int sZbox = this.mZ + (oreveinMaxSize/16 + 1); + + // Search for orevein seeds and add to the list; + for( int x = wXbox; x < eXbox; x++ ) { + for( int z = nZbox; z < sZbox; z++ ) { + // Determine if this X/Z is an orevein seed + if ( ( (Math.abs(x)%3) == 1) && ( (Math.abs(z)%3) == 1 ) ) { + if (debugWorldGen) GT_Log.out.println( + "Adding seed x="+x+ + " z="+z + ); + seedList.add( new GT_Worldgenerator.WorldGenContainer.NearbySeeds(x,z) ); + } + } + } + + // Now process each oreseed vs this requested chunk + for( ; seedList.size() != 0; seedList.remove(0) ) { + if (debugWorldGen) GT_Log.out.println( + "Processing seed x="+seedList.get(0).mX+ + " z="+seedList.get(0).mZ + ); + worldGenFindVein( seedList.get(0).mX, seedList.get(0).mZ ); + } + + long oregenTime = System.nanoTime(); + + //Asteroid Worldgen + int tDimensionType = this.mWorld.provider.dimensionId; + //String tDimensionName = this.mWorld.provider.getDimensionName(); + Random aRandom = new Random(); + //if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0))) || ((tDimensionName.equals("Asteroids")) && gcAsteroids && ((mGCAsteroidProbability <= 1) || (aRandom.nextInt(mGCAsteroidProbability) == 0)))) { + if (((tDimensionType == 1) && endAsteroids && ((mEndAsteroidProbability <= 1) || (aRandom.nextInt(mEndAsteroidProbability) == 0)))) { + short primaryMeta = 0; + short secondaryMeta = 0; + short betweenMeta = 0; + short sporadicMeta = 0; + if ((GT_Worldgen_GT_Ore_Layer.sWeight > 0) && (GT_Worldgen_GT_Ore_Layer.sList.size() > 0)) { + boolean temp = true; + int tRandomWeight; + for (int i = 0; (i < oreveinAttempts) && (temp); i++) { + tRandomWeight = aRandom.nextInt(GT_Worldgen_GT_Ore_Layer.sWeight); + for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) { + tRandomWeight -= ((GT_Worldgen_GT_Ore_Layer) tWorldGen).mWeight; + if (tRandomWeight <= 0) { + try { + //if ((tWorldGen.mEndAsteroid && tDimensionType == 1) || (tWorldGen.mAsteroid && tDimensionType == -30)) { + if (tWorldGen.mEndAsteroid && tDimensionType == 1) { + primaryMeta = tWorldGen.mPrimaryMeta; + secondaryMeta = tWorldGen.mSecondaryMeta; + betweenMeta = tWorldGen.mBetweenMeta; + sporadicMeta = tWorldGen.mSporadicMeta; + temp = false; + break; + } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + } + } + } + //if(GT_Values.D1)GT_FML_LOGGER.info("do asteroid gen: "+this.mX+" "+this.mZ); + int tX = mX * 16 + aRandom.nextInt(16); + int tY = 50 + aRandom.nextInt(200 - 50); + int tZ = mZ * 16 + aRandom.nextInt(16); + if (tDimensionType == 1) { + mSize = aRandom.nextInt((int) (endMaxSize - endMinSize)); + //} else if (tDimensionName.equals("Asteroids")) { + // mSize = aRandom.nextInt((int) (gcMaxSize - gcMinSize)); + } + if ((mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) { + float var6 = aRandom.nextFloat() * 3.141593F; + double var7 = tX + 8 + MathHelper.sin(var6) * mSize / 8.0F; + double var9 = tX + 8 - MathHelper.sin(var6) * mSize / 8.0F; + double var11 = tZ + 8 + MathHelper.cos(var6) * mSize / 8.0F; + double var13 = tZ + 8 - MathHelper.cos(var6) * mSize / 8.0F; + double var15 = tY + aRandom.nextInt(3) - 2; + double var17 = tY + aRandom.nextInt(3) - 2; + for (int var19 = 0; var19 <= mSize; var19++) { + double var20 = var7 + (var9 - var7) * var19 / mSize; + double var22 = var15 + (var17 - var15) * var19 / mSize; + double var24 = var11 + (var13 - var11) * var19 / mSize; + double var26 = aRandom.nextDouble() * mSize / 16.0D; + double var28 = (MathHelper.sin(var19 * 3.141593F / mSize) + 1.0F) * var26 + 1.0D; + double var30 = (MathHelper.sin(var19 * 3.141593F / mSize) + 1.0F) * var26 + 1.0D; + int tMinX = MathHelper.floor_double(var20 - var28 / 2.0D); + int tMinY = MathHelper.floor_double(var22 - var30 / 2.0D); + int tMinZ = MathHelper.floor_double(var24 - var28 / 2.0D); + int tMaxX = MathHelper.floor_double(var20 + var28 / 2.0D); + int tMaxY = MathHelper.floor_double(var22 + var30 / 2.0D); + int tMaxZ = MathHelper.floor_double(var24 + var28 / 2.0D); + for (int eX = tMinX; eX <= tMaxX; eX++) { + double var39 = (eX + 0.5D - var20) / (var28 / 2.0D); + if (var39 * var39 < 1.0D) { + for (int eY = tMinY; eY <= tMaxY; eY++) { + double var42 = (eY + 0.5D - var22) / (var30 / 2.0D); + if (var39 * var39 + var42 * var42 < 1.0D) { + for (int eZ = tMinZ; eZ <= tMaxZ; eZ++) { + double var45 = (eZ + 0.5D - var24) / (var28 / 2.0D); + if ((var39 * var39 + var42 * var42 + var45 * var45 < 1.0D) && (mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) { + int ranOre = aRandom.nextInt(50); + if (ranOre < 3) { + GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, primaryMeta, false); + } else if (ranOre < 6) { + GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, secondaryMeta, false); + } else if (ranOre < 8) { + GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, betweenMeta, false); + } else if (ranOre < 10) { + GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta, false); + } else { + //if (tDimensionType == 1) {//TODO CHECK + mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0); + //} else if (tDimensionName.equals("Asteroids")) { + ////int asteroidType = aRandom.nextInt(20); + ////if (asteroidType == 19) { //Rare Asteroid? + ////mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3); + ////} else { + //mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3); + ////} + //} + } + } + } + } + } + } + } + } + } + + } + + + Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ); + if (tChunk != null) { + tChunk.isModified = true; + } + long endTime = System.nanoTime(); + long duration = (endTime - startTime); + if (debugWorldGen) { + GT_Log.out.println( + " Oregen took " + (oregenTime-leftOverTime)+ + " Leftover gen took " + (leftOverTime - startTime) + + " Worldgen took " + duration + + " nanoseconds" + ); + } + } + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java index c6e83f2847..8d2c976b1b 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings8.java @@ -1,47 +1,47 @@ -package gregtech.common.blocks;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Textures;
-import gregtech.api.objects.GT_CopiedBlockTexture;
-import gregtech.api.util.GT_LanguageManager;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-public class GT_Block_Casings8
- extends GT_Block_Casings_Abstract {
-
- //WATCH OUT FOR TEXTURE ID's
- public GT_Block_Casings8() {
- super(GT_Item_Casings8.class, "gt.blockcasings8", GT_Material_Casings.INSTANCE);
- for (int i = 0; i < 4; i = (i + 1)) {
- Textures.BlockIcons.casingTexturePages[1][i+48] = new GT_CopiedBlockTexture(this, 6, i);
- }
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Chemically Inert Machine Casing");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "PTFE Pipe Casing");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Mining Neutronium Casing");
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Mining Black Plutonium Casing");
-
- ItemList.Casing_Chemically_Inert.set(new ItemStack(this, 1, 0));
- ItemList.Casing_Pipe_Polytetrafluoroethylene.set(new ItemStack(this, 1, 1));
- ItemList.Casing_MiningNeutronium.set(new ItemStack(this, 1, 2));
- ItemList.Casing_MiningBlackPlutonium.set(new ItemStack(this, 1, 3));
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(int aSide, int aMeta) {
- switch (aMeta) {
- case 0:
- return Textures.BlockIcons.MACHINE_CASING_CHEMICALLY_INERT.getIcon();
- case 1:
- return Textures.BlockIcons.MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE.getIcon();
- case 2:
- return Textures.BlockIcons.MACHINE_CASING_MINING_NEUTRONIUM.getIcon();
- case 3:
- return Textures.BlockIcons.MACHINE_CASING_MINING_BLACKPLUTONIUM.getIcon();
- }
- return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon();
- }
-}
+package gregtech.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class GT_Block_Casings8 + extends GT_Block_Casings_Abstract { + + //WATCH OUT FOR TEXTURE ID's + public GT_Block_Casings8() { + super(GT_Item_Casings8.class, "gt.blockcasings8", GT_Material_Casings.INSTANCE); + for (int i = 0; i < 4; i = (i + 1)) { + Textures.BlockIcons.casingTexturePages[1][i+48] = new GT_CopiedBlockTexture(this, 6, i); + } + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Chemically Inert Machine Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "PTFE Pipe Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Mining Neutronium Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Mining Black Plutonium Casing"); + + ItemList.Casing_Chemically_Inert.set(new ItemStack(this, 1, 0)); + ItemList.Casing_Pipe_Polytetrafluoroethylene.set(new ItemStack(this, 1, 1)); + ItemList.Casing_MiningNeutronium.set(new ItemStack(this, 1, 2)); + ItemList.Casing_MiningBlackPlutonium.set(new ItemStack(this, 1, 3)); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int aSide, int aMeta) { + switch (aMeta) { + case 0: + return Textures.BlockIcons.MACHINE_CASING_CHEMICALLY_INERT.getIcon(); + case 1: + return Textures.BlockIcons.MACHINE_CASING_PIPE_POLYTETRAFLUOROETHYLENE.getIcon(); + case 2: + return Textures.BlockIcons.MACHINE_CASING_MINING_NEUTRONIUM.getIcon(); + case 3: + return Textures.BlockIcons.MACHINE_CASING_MINING_BLACKPLUTONIUM.getIcon(); + } + return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java index 8b03a10b29..830a407777 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings_Abstract.java @@ -1,122 +1,122 @@ -package gregtech.common.blocks;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.items.GT_Generic_Block;
-import gregtech.api.util.GT_LanguageManager;
-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.Entity;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import java.util.List;
-import java.util.Random;
-
-public abstract class GT_Block_Casings_Abstract
- extends GT_Generic_Block {
- public GT_Block_Casings_Abstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) {
- super(aItemClass, aName, aMaterial);
- setStepSound(soundTypeMetal);
- setCreativeTab(GregTech_API.TAB_GREGTECH);
- GregTech_API.registerMachineBlock(this, -1);
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this");
- }
-
- public String getHarvestTool(int aMeta) {
- return "wrench";
- }
-
- public int getHarvestLevel(int aMeta) {
- return 2;
- }
-
- public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
- return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ);
- }
-
- public float getExplosionResistance(Entity aTNT) {
- return Blocks.iron_block.getExplosionResistance(aTNT);
- }
-
- protected boolean canSilkHarvest() {
- return false;
- }
-
- public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
- if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- }
- }
-
- public String getUnlocalizedName() {
- return this.mUnlocalizedName;
- }
-
- public String getLocalizedName() {
- return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
- }
-
- public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
-
- public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return true;
- }
-
- public boolean renderAsNormalBlock() {
- return true;
- }
-
- public boolean isOpaqueCube() {
- return true;
- }
-
- public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) {
- if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- }
- }
-
- public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
- return false;
- }
-
- public int damageDropped(int par1) {
- return par1;
- }
-
- public int getDamageValue(World par1World, int par2, int par3, int par4) {
- return par1World.getBlockMetadata(par2, par3, par4);
- }
-
- public int quantityDropped(Random par1Random) {
- return 1;
- }
-
- public Item getItemDropped(int par1, Random par2Random, int par3) {
- return Item.getItemFromBlock(this);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister aIconRegister) {
- }
-
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
- for (int i = 0; i < 16; i++) {
- ItemStack aStack = new ItemStack(aItem, 1, i);
- if (!aStack.getDisplayName().contains(".name")) aList.add(aStack);
- }
- }
-}
+package gregtech.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.util.GT_LanguageManager; +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.Entity; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.util.List; +import java.util.Random; + +public abstract class GT_Block_Casings_Abstract + extends GT_Generic_Block { + public GT_Block_Casings_Abstract(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { + super(aItemClass, aName, aMaterial); + setStepSound(soundTypeMetal); + setCreativeTab(GregTech_API.TAB_GREGTECH); + GregTech_API.registerMachineBlock(this, -1); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); + } + + public String getHarvestTool(int aMeta) { + return "wrench"; + } + + public int getHarvestLevel(int aMeta) { + return 2; + } + + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { + return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); + } + + public float getExplosionResistance(Entity aTNT) { + return Blocks.iron_block.getExplosionResistance(aTNT); + } + + protected boolean canSilkHarvest() { + return false; + } + + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + public String getUnlocalizedName() { + return this.mUnlocalizedName; + } + + public String getLocalizedName() { + return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); + } + + public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { + return true; + } + + public boolean renderAsNormalBlock() { + return true; + } + + public boolean isOpaqueCube() { + return true; + } + + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } + + public int damageDropped(int par1) { + return par1; + } + + public int getDamageValue(World par1World, int par2, int par3, int par4) { + return par1World.getBlockMetadata(par2, par3, par4); + } + + public int quantityDropped(Random par1Random) { + return 1; + } + + public Item getItemDropped(int par1, Random par2Random, int par3) { + return Item.getItemFromBlock(this); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister aIconRegister) { + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + for (int i = 0; i < 16; i++) { + ItemStack aStack = new ItemStack(aItem, 1, i); + if (!aStack.getDisplayName().contains(".name")) aList.add(aStack); + } + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index d0ca757e3c..cc75124a05 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -1,548 +1,548 @@ -package gregtech.common.blocks;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IDebugableBlock;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_Generic_Block;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.BaseMetaTileEntity;
-import gregtech.api.metatileentity.BaseTileEntity;
-import gregtech.api.util.GT_BaseCrop;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.render.GT_Renderer_Block;
-import net.minecraft.block.Block;
-import net.minecraft.block.ITileEntityProvider;
-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.EnumCreatureType;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.MathHelper;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static gregtech.GT_Mod.GT_FML_LOGGER;
-import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
-
-public class GT_Block_Machines
- extends GT_Generic_Block
- implements IDebugableBlock, ITileEntityProvider {
- public static ThreadLocal<IGregTechTileEntity> mTemporaryTileEntity = new ThreadLocal();
-
- public GT_Block_Machines() {
- super(GT_Item_Machines.class, "gt.blockmachines", new GT_Material_Machines());
- GregTech_API.registerMachineBlock(this, -1);
- setHardness(1.0F);
- setResistance(10.0F);
- setStepSound(soundTypeMetal);
- setCreativeTab(GregTech_API.TAB_GREGTECH);
- this.isBlockContainer = true;
- }
-
- public String getHarvestTool(int aMeta) {
- if (aMeta >= 8 && aMeta <= 11) {
- return "cutter";
- }
- return "wrench";
- }
-
- public int getHarvestLevel(int aMeta) {
- return aMeta % 4;
- }
-
- protected boolean canSilkHarvest() {
- return false;
- }
-
- public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof BaseTileEntity)) {
- ((BaseTileEntity) tTileEntity).onAdjacentBlockChange(aTileX, aTileY, aTileZ);
- }
- }
-
- public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aBlock) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof BaseMetaPipeEntity)) {
- ((BaseMetaPipeEntity) tTileEntity).onNeighborBlockChange(aX, aY, aZ);
- }
- }
-
- public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
- super.onBlockAdded(aWorld, aX, aY, aZ);
- if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- }
- }
-
- public String getUnlocalizedName() {
- return "gt.blockmachines";
- }
-
- public String getLocalizedName() {
- return StatCollector.translateToLocal(getUnlocalizedName() + ".name");
- }
-
- public int getFlammability(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
- return 0;
- }
-
- public int getFireSpreadSpeed(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
- return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0) ? 100 : 0;
- }
-
- public int getRenderType() {
- if (GT_Renderer_Block.INSTANCE == null) {
- return super.getRenderType();
- }
- return GT_Renderer_Block.INSTANCE.mRenderID;
- }
-
- public boolean isFireSource(World aWorld, int aX, int aY, int aZ, ForgeDirection side) {
- return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0);
- }
-
- public boolean isFlammable(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) {
- return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0);
- }
-
- public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
-
- public boolean canConnectRedstone(IBlockAccess var1, int var2, int var3, int var4, int var5) {
- return true;
- }
-
- public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
-
- public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
-
- public boolean hasTileEntity(int aMeta) {
- return true;
- }
-
- public boolean hasComparatorInputOverride() {
- return true;
- }
-
- public boolean renderAsNormalBlock() {
- return false;
- }
-
- public boolean canProvidePower() {
- return true;
- }
-
- public boolean isOpaqueCube() {
- return false;
- }
-
- public TileEntity createNewTileEntity(World aWorld, int aMeta) {
- return createTileEntity(aWorld, aMeta);
- }
-
- public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
- return Textures.BlockIcons.MACHINE_LV_SIDE.getIcon();
- }
-
- public IIcon getIcon(int aSide, int aMeta) {
- return Textures.BlockIcons.MACHINE_LV_SIDE.getIcon();
- }
-
- public boolean onBlockEventReceived(World aWorld, int aX, int aY, int aZ, int aData1, int aData2) {
- super.onBlockEventReceived(aWorld, aX, aY, aZ, aData1, aData2);
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- return tTileEntity != null ? tTileEntity.receiveClientEvent(aData1, aData2) : false;
- }
-
- public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) {
- ((IGregTechTileEntity) tTileEntity).addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- return;
- }
- super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider);
- }
-
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) {
- return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
- return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ)
- {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) {
- return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
- return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
-
- @Override //THIS
- public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) {
- TileEntity tTileEntity = blockAccess.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) {
- AxisAlignedBB bbb=((IGregTechTileEntity)tTileEntity).getCollisionBoundingBoxFromPool(((IGregTechTileEntity)tTileEntity).getWorld(), 0, 0, 0);
- minX=bbb.minX;//This essentially sets block bounds
- minY=bbb.minY;
- minZ=bbb.minZ;
- maxX=bbb.maxX;
- maxY=bbb.maxY;
- maxZ=bbb.maxZ;
- return;
- }
- super.setBlockBoundsBasedOnState(blockAccess,aX,aY,aZ);
- }
-
- @Override
- public void setBlockBoundsForItemRender() {
- super.setBlockBounds(0,0,0,1,1,1);
- }
-
- public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) {
- ((IGregTechTileEntity) tTileEntity).onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
- return;
- }
- super.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister aIconRegister) {
- if (GregTech_API.sPostloadFinished) {
- GT_Log.out.println("GT_Mod: Setting up Icon Register for Blocks");
- GregTech_API.sBlockIcons = aIconRegister;
-
- GT_Log.out.println("GT_Mod: Registering MetaTileEntity specific Textures");
- try {
- for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) {
- if (tMetaTileEntity != null) {
- tMetaTileEntity.registerIcons(aIconRegister);
- }
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
- GT_Log.out.println("GT_Mod: Registering Crop specific Textures");
- try {
- for (GT_BaseCrop tCrop : GT_BaseCrop.sCropList) {
- tCrop.registerSprites(aIconRegister);
- }
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
- GT_Log.out.println("GT_Mod: Starting Block Icon Load Phase");
- GT_FML_LOGGER.info("GT_Mod: Starting Block Icon Load Phase");
- try {
- for (Runnable tRunnable : GregTech_API.sGTBlockIconload) {
- tRunnable.run();
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
- GT_Log.out.println("GT_Mod: Finished Block Icon Load Phase");
- GT_FML_LOGGER.info("GT_Mod: Finished Block Icon Load Phase");
- }
- }
-
- public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
- return super.getBlockHardness(aWorld, aX, aY, aZ);
- }
-
- public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof BaseMetaTileEntity)) && (((BaseMetaTileEntity) tTileEntity).privateAccess()) && (!((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true))) {
- return -1.0F;
- }
- return super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ);
- }
-
- public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, float par2, float par3) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity == null) {
- return false;
- }
- if(aPlayer.isSneaking()){
- ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem();
- if(tCurrentItem!=null){
- if(!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)){
- return false;
- }
- }else {return false;}
- }
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- if (((IGregTechTileEntity) tTileEntity).getTimer() < 50L) {
- return false;
- }
- if ((!aWorld.isRemote) && (!((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer))) {
- return true;
- }
- return ((IGregTechTileEntity) tTileEntity).onRightclick(aPlayer, (byte) aSide, par1, par2, par3);
- }
- return false;
- }
-
- public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity))) {
- ((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer);
- }
- }
-
- public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- return ((IGregTechTileEntity) tTileEntity).getMetaTileID();
- }
- return 0;
- }
-
- public void onBlockExploded(World aWorld, int aX, int aY, int aZ, Explosion aExplosion) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof BaseMetaTileEntity)) {
- GT_Log.exp.println("Explosion at :"+aX + " | " + aY+ " | " + aZ +" DIMID: " + aWorld.provider.dimensionId+ " due to near explosion!");
- ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion();
- }
- super.onBlockExploded(aWorld, aX, aY, aZ, aExplosion);
- }
-
- public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) {
- GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ);
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity;
- mTemporaryTileEntity.set(tGregTechTileEntity);
- for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) {
- ItemStack tItem = tGregTechTileEntity.getStackInSlot(i);
- if ((tItem != null) && (tItem.stackSize > 0) && (tGregTechTileEntity.isValidSlot(i))) {
- EntityItem tItemEntity = new EntityItem(aWorld, aX + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, aY + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, aZ + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
- if (tItem.hasTagCompound()) {
- tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy());
- }
- tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D);
- tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D);
- tItemEntity.motionZ = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D);
- aWorld.spawnEntityInWorld(tItemEntity);
- tItem.stackSize = 0;
- tGregTechTileEntity.setInventorySlotContents(i, null);
- }
- }
- }
- super.breakBlock(aWorld, aX, aY, aZ, par5, par6);
- aWorld.removeTileEntity(aX, aY, aZ);
- }
-
- public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- return ((IGregTechTileEntity) tTileEntity).getDrops();
- }
- return mTemporaryTileEntity.get() == null ? new ArrayList() : ((IGregTechTileEntity) mTemporaryTileEntity.get()).getDrops();
- }
- @Override
- public boolean removedByPlayer(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, boolean aWillHarvest) {
- if (aWillHarvest) {
- return true; // This delays deletion of the block until after getDrops
- } else {
- return super.removedByPlayer(aWorld, aPlayer, aX, aY, aZ, false);
- }
- }
-
- @Override
- public void harvestBlock(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, int aMeta)
- {
- super.harvestBlock(aWorld, aPlayer, aX, aY, aZ, aMeta);
- aWorld.setBlockToAir(aX, aY, aZ);
- }
-
- public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity))) {
- return ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide);
- }
- return 0;
- }
-
- public int isProvidingWeakPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
- if ((aSide < 0) || (aSide > 5)) {
- return 0;
- }
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity))) {
- return ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide));
- }
- return 0;
- }
-
- public int isProvidingStrongPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) {
- if ((aSide < 0) || (aSide > 5)) {
- return 0;
- }
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity))) {
- return ((IGregTechTileEntity) tTileEntity).getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide));
- }
- return 0;
- }
-
- public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int par5, float chance, int par7) {
- if (!aWorld.isRemote) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity != null) && (chance < 1.0F)) {
- if (((tTileEntity instanceof BaseMetaTileEntity)) && (GregTech_API.sMachineNonWrenchExplosions)) {
- GT_Log.exp.println("Explosion at :"+aX + " | " + aY+ " | " + aZ +" DIMID: "+ aWorld.provider.dimensionId+ " due to NonWrench picking/Rain!");
- ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion();
- }
- } else {
- super.dropBlockAsItemWithChance(aWorld, aX, aY, aZ, par5, chance, par7);
- }
- }
- }
-
- public boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) {
- if (aWorld.getBlockMetadata(aX, aY, aZ) == 0) {
- return true;
- }
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity != null) {
- if ((tTileEntity instanceof BaseMetaTileEntity)) {
- return true;
- }
- if (((tTileEntity instanceof BaseMetaPipeEntity)) && ((((BaseMetaPipeEntity) tTileEntity).mConnections & 0xFFFFFFC0) != 0)) {
- return true;
- }
- if (((tTileEntity instanceof ICoverable)) && (((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0)) {
- return true;
- }
- }
- return false;
- }
-
- public int getLightOpacity(IBlockAccess aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity == null) {
- return 0;
- }
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- return ((IGregTechTileEntity) tTileEntity).getLightOpacity();
- }
- return aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 255 : 0;
- }
-
- public int getLightValue(IBlockAccess aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof BaseMetaTileEntity)) {
- return ((BaseMetaTileEntity) tTileEntity).getLightValue();
- }
- return 0;
- }
-
- public TileEntity createTileEntity(World aWorld, int aMeta) {
- if (aMeta < 4) {
- return GregTech_API.constructBaseMetaTileEntity();
- }
- return new BaseMetaPipeEntity();
- }
-
- public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof IGregTechTileEntity))) {
- return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6);
- }
- return 10.0F;
- }
-
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
- for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) {
- if (GregTech_API.METATILEENTITIES[i] != null) {
- par3List.add(new ItemStack(par1, 1, i));
- }
- }
- }
-
- public void onBlockPlacedBy(World aWorld, int aX, int aY, int aZ, EntityLivingBase aPlayer, ItemStack aStack) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity == null) {
- return;
- }
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- IGregTechTileEntity var6 = (IGregTechTileEntity) tTileEntity;
- if (aPlayer == null) {
- var6.setFrontFacing((byte) 1);
- } else {
- int var7 = MathHelper.floor_double(aPlayer.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3;
- int var8 = Math.round(aPlayer.rotationPitch);
- if ((var8 >= 65) && (var6.isValidFacing((byte) 1))) {
- var6.setFrontFacing((byte) 1);
- } else if ((var8 <= -65) && (var6.isValidFacing((byte) 0))) {
- var6.setFrontFacing((byte) 0);
- } else {
- switch (var7) {
- case 0:
- var6.setFrontFacing((byte) 2);
- break;
- case 1:
- var6.setFrontFacing((byte) 5);
- break;
- case 2:
- var6.setFrontFacing((byte) 3);
- break;
- case 3:
- var6.setFrontFacing((byte) 4);
- }
- }
- }
- }
- }
-
- public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
- TileEntity tTileEntity = aPlayer.worldObj.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof BaseMetaTileEntity)) {
- return ((BaseMetaTileEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel);
- }
- if ((tTileEntity instanceof BaseMetaPipeEntity)) {
- return ((BaseMetaPipeEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel);
- }
- return null;
- }
-
- public boolean recolourBlock(World aWorld, int aX, int aY, int aZ, ForgeDirection aSide, int aColor) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof IGregTechTileEntity)) {
- if (((IGregTechTileEntity) tTileEntity).getColorization() == (byte) ((aColor ^ 0xFFFFFFFF) & 0xF)) {
- return false;
- }
- ((IGregTechTileEntity) tTileEntity).setColorization((byte) ((aColor ^ 0xFFFFFFFF) & 0xF));
- return true;
- }
- return false;
- }
-}
+package gregtech.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IDebugableBlock; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.BaseTileEntity; +import gregtech.api.util.GT_BaseCrop; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import gregtech.common.render.GT_Renderer_Block; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +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.EnumCreatureType; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import java.util.ArrayList; +import java.util.List; + +import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.objects.XSTR.XSTR_INSTANCE; + +public class GT_Block_Machines + extends GT_Generic_Block + implements IDebugableBlock, ITileEntityProvider { + public static ThreadLocal<IGregTechTileEntity> mTemporaryTileEntity = new ThreadLocal(); + + public GT_Block_Machines() { + super(GT_Item_Machines.class, "gt.blockmachines", new GT_Material_Machines()); + GregTech_API.registerMachineBlock(this, -1); + setHardness(1.0F); + setResistance(10.0F); + setStepSound(soundTypeMetal); + setCreativeTab(GregTech_API.TAB_GREGTECH); + this.isBlockContainer = true; + } + + public String getHarvestTool(int aMeta) { + if (aMeta >= 8 && aMeta <= 11) { + return "cutter"; + } + return "wrench"; + } + + public int getHarvestLevel(int aMeta) { + return aMeta % 4; + } + + protected boolean canSilkHarvest() { + return false; + } + + public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BaseTileEntity)) { + ((BaseTileEntity) tTileEntity).onAdjacentBlockChange(aTileX, aTileY, aTileZ); + } + } + + public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aBlock) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BaseMetaPipeEntity)) { + ((BaseMetaPipeEntity) tTileEntity).onNeighborBlockChange(aX, aY, aZ); + } + } + + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + super.onBlockAdded(aWorld, aX, aY, aZ); + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + public String getUnlocalizedName() { + return "gt.blockmachines"; + } + + public String getLocalizedName() { + return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); + } + + public int getFlammability(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { + return 0; + } + + public int getFireSpreadSpeed(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { + return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0) ? 100 : 0; + } + + public int getRenderType() { + if (GT_Renderer_Block.INSTANCE == null) { + return super.getRenderType(); + } + return GT_Renderer_Block.INSTANCE.mRenderID; + } + + public boolean isFireSource(World aWorld, int aX, int aY, int aZ, ForgeDirection side) { + return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0); + } + + public boolean isFlammable(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { + return (GregTech_API.sMachineFlammable) && (aWorld.getBlockMetadata(aX, aY, aZ) == 0); + } + + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + public boolean canConnectRedstone(IBlockAccess var1, int var2, int var3, int var4, int var5) { + return true; + } + + public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + public boolean hasTileEntity(int aMeta) { + return true; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean canProvidePower() { + return true; + } + + public boolean isOpaqueCube() { + return false; + } + + public TileEntity createNewTileEntity(World aWorld, int aMeta) { + return createTileEntity(aWorld, aMeta); + } + + public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) { + return Textures.BlockIcons.MACHINE_LV_SIDE.getIcon(); + } + + public IIcon getIcon(int aSide, int aMeta) { + return Textures.BlockIcons.MACHINE_LV_SIDE.getIcon(); + } + + public boolean onBlockEventReceived(World aWorld, int aX, int aY, int aZ, int aData1, int aData2) { + super.onBlockEventReceived(aWorld, aX, aY, aZ, aData1, aData2); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity != null ? tTileEntity.receiveClientEvent(aData1, aData2) : false; + } + + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + ((IGregTechTileEntity) tTileEntity).addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); + return; + } + super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); + } + + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + } + return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + } + + @Override + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) + { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + return ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + } + return super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); + } + + @Override //THIS + public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) { + TileEntity tTileEntity = blockAccess.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + AxisAlignedBB bbb=((IGregTechTileEntity)tTileEntity).getCollisionBoundingBoxFromPool(((IGregTechTileEntity)tTileEntity).getWorld(), 0, 0, 0); + minX=bbb.minX;//This essentially sets block bounds + minY=bbb.minY; + minZ=bbb.minZ; + maxX=bbb.maxX; + maxY=bbb.maxY; + maxZ=bbb.maxZ; + return; + } + super.setBlockBoundsBasedOnState(blockAccess,aX,aY,aZ); + } + + @Override + public void setBlockBoundsForItemRender() { + super.setBlockBounds(0,0,0,1,1,1); + } + + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null)) { + ((IGregTechTileEntity) tTileEntity).onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider); + return; + } + super.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister aIconRegister) { + if (GregTech_API.sPostloadFinished) { + GT_Log.out.println("GT_Mod: Setting up Icon Register for Blocks"); + GregTech_API.sBlockIcons = aIconRegister; + + GT_Log.out.println("GT_Mod: Registering MetaTileEntity specific Textures"); + try { + for (IMetaTileEntity tMetaTileEntity : GregTech_API.METATILEENTITIES) { + if (tMetaTileEntity != null) { + tMetaTileEntity.registerIcons(aIconRegister); + } + } + } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + GT_Log.out.println("GT_Mod: Registering Crop specific Textures"); + try { + for (GT_BaseCrop tCrop : GT_BaseCrop.sCropList) { + tCrop.registerSprites(aIconRegister); + } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + GT_Log.out.println("GT_Mod: Starting Block Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Starting Block Icon Load Phase"); + try { + for (Runnable tRunnable : GregTech_API.sGTBlockIconload) { + tRunnable.run(); + } + } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + GT_Log.out.println("GT_Mod: Finished Block Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Finished Block Icon Load Phase"); + } + } + + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { + return super.getBlockHardness(aWorld, aX, aY, aZ); + } + + public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof BaseMetaTileEntity)) && (((BaseMetaTileEntity) tTileEntity).privateAccess()) && (!((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true))) { + return -1.0F; + } + return super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); + } + + public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, float par2, float par3) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity == null) { + return false; + } + if(aPlayer.isSneaking()){ + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if(tCurrentItem!=null){ + if(!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWireCutterList) && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)){ + return false; + } + }else {return false;} + } + if ((tTileEntity instanceof IGregTechTileEntity)) { + if (((IGregTechTileEntity) tTileEntity).getTimer() < 50L) { + return false; + } + if ((!aWorld.isRemote) && (!((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer))) { + return true; + } + return ((IGregTechTileEntity) tTileEntity).onRightclick(aPlayer, (byte) aSide, par1, par2, par3); + } + return false; + } + + public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity))) { + ((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer); + } + } + + public int getDamageValue(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof IGregTechTileEntity)) { + return ((IGregTechTileEntity) tTileEntity).getMetaTileID(); + } + return 0; + } + + public void onBlockExploded(World aWorld, int aX, int aY, int aZ, Explosion aExplosion) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BaseMetaTileEntity)) { + GT_Log.exp.println("Explosion at :"+aX + " | " + aY+ " | " + aZ +" DIMID: " + aWorld.provider.dimensionId+ " due to near explosion!"); + ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); + } + super.onBlockExploded(aWorld, aX, aY, aZ, aExplosion); + } + + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof IGregTechTileEntity)) { + IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity; + mTemporaryTileEntity.set(tGregTechTileEntity); + for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) { + ItemStack tItem = tGregTechTileEntity.getStackInSlot(i); + if ((tItem != null) && (tItem.stackSize > 0) && (tGregTechTileEntity.isValidSlot(i))) { + EntityItem tItemEntity = new EntityItem(aWorld, aX + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, aY + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, aZ + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); + if (tItem.hasTagCompound()) { + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); + } + tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D); + tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D); + tItemEntity.motionZ = (XSTR_INSTANCE.nextGaussian() * 0.0500000007450581D); + aWorld.spawnEntityInWorld(tItemEntity); + tItem.stackSize = 0; + tGregTechTileEntity.setInventorySlotContents(i, null); + } + } + } + super.breakBlock(aWorld, aX, aY, aZ, par5, par6); + aWorld.removeTileEntity(aX, aY, aZ); + } + + public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof IGregTechTileEntity)) { + return ((IGregTechTileEntity) tTileEntity).getDrops(); + } + return mTemporaryTileEntity.get() == null ? new ArrayList() : ((IGregTechTileEntity) mTemporaryTileEntity.get()).getDrops(); + } + @Override + public boolean removedByPlayer(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, boolean aWillHarvest) { + if (aWillHarvest) { + return true; // This delays deletion of the block until after getDrops + } else { + return super.removedByPlayer(aWorld, aPlayer, aX, aY, aZ, false); + } + } + + @Override + public void harvestBlock(World aWorld, EntityPlayer aPlayer, int aX, int aY, int aZ, int aMeta) + { + super.harvestBlock(aWorld, aPlayer, aX, aY, aZ, aMeta); + aWorld.setBlockToAir(aX, aY, aZ); + } + + public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity))) { + return ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide); + } + return 0; + } + + public int isProvidingWeakPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + if ((aSide < 0) || (aSide > 5)) { + return 0; + } + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity))) { + return ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide)); + } + return 0; + } + + public int isProvidingStrongPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + if ((aSide < 0) || (aSide > 5)) { + return 0; + } + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity))) { + return ((IGregTechTileEntity) tTileEntity).getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide)); + } + return 0; + } + + public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int par5, float chance, int par7) { + if (!aWorld.isRemote) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity != null) && (chance < 1.0F)) { + if (((tTileEntity instanceof BaseMetaTileEntity)) && (GregTech_API.sMachineNonWrenchExplosions)) { + GT_Log.exp.println("Explosion at :"+aX + " | " + aY+ " | " + aZ +" DIMID: "+ aWorld.provider.dimensionId+ " due to NonWrench picking/Rain!"); + ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); + } + } else { + super.dropBlockAsItemWithChance(aWorld, aX, aY, aZ, par5, chance, par7); + } + } + } + + public boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) { + if (aWorld.getBlockMetadata(aX, aY, aZ) == 0) { + return true; + } + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity != null) { + if ((tTileEntity instanceof BaseMetaTileEntity)) { + return true; + } + if (((tTileEntity instanceof BaseMetaPipeEntity)) && ((((BaseMetaPipeEntity) tTileEntity).mConnections & 0xFFFFFFC0) != 0)) { + return true; + } + if (((tTileEntity instanceof ICoverable)) && (((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0)) { + return true; + } + } + return false; + } + + public int getLightOpacity(IBlockAccess aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity == null) { + return 0; + } + if ((tTileEntity instanceof IGregTechTileEntity)) { + return ((IGregTechTileEntity) tTileEntity).getLightOpacity(); + } + return aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 255 : 0; + } + + public int getLightValue(IBlockAccess aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BaseMetaTileEntity)) { + return ((BaseMetaTileEntity) tTileEntity).getLightValue(); + } + return 0; + } + + public TileEntity createTileEntity(World aWorld, int aMeta) { + if (aMeta < 4) { + return GregTech_API.constructBaseMetaTileEntity(); + } + return new BaseMetaPipeEntity(); + } + + public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof IGregTechTileEntity))) { + return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6); + } + return 10.0F; + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) { + if (GregTech_API.METATILEENTITIES[i] != null) { + par3List.add(new ItemStack(par1, 1, i)); + } + } + } + + public void onBlockPlacedBy(World aWorld, int aX, int aY, int aZ, EntityLivingBase aPlayer, ItemStack aStack) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity == null) { + return; + } + if ((tTileEntity instanceof IGregTechTileEntity)) { + IGregTechTileEntity var6 = (IGregTechTileEntity) tTileEntity; + if (aPlayer == null) { + var6.setFrontFacing((byte) 1); + } else { + int var7 = MathHelper.floor_double(aPlayer.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3; + int var8 = Math.round(aPlayer.rotationPitch); + if ((var8 >= 65) && (var6.isValidFacing((byte) 1))) { + var6.setFrontFacing((byte) 1); + } else if ((var8 <= -65) && (var6.isValidFacing((byte) 0))) { + var6.setFrontFacing((byte) 0); + } else { + switch (var7) { + case 0: + var6.setFrontFacing((byte) 2); + break; + case 1: + var6.setFrontFacing((byte) 5); + break; + case 2: + var6.setFrontFacing((byte) 3); + break; + case 3: + var6.setFrontFacing((byte) 4); + } + } + } + } + } + + public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) { + TileEntity tTileEntity = aPlayer.worldObj.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof BaseMetaTileEntity)) { + return ((BaseMetaTileEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel); + } + if ((tTileEntity instanceof BaseMetaPipeEntity)) { + return ((BaseMetaPipeEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel); + } + return null; + } + + public boolean recolourBlock(World aWorld, int aX, int aY, int aZ, ForgeDirection aSide, int aColor) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof IGregTechTileEntity)) { + if (((IGregTechTileEntity) tTileEntity).getColorization() == (byte) ((aColor ^ 0xFFFFFFFF) & 0xF)) { + return false; + } + ((IGregTechTileEntity) tTileEntity).setColorization((byte) ((aColor ^ 0xFFFFFFFF) & 0xF)); + return true; + } + return false; + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java index eb248dd95d..abcc92a795 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java @@ -1,43 +1,43 @@ -package gregtech.common.blocks;
-
-import cpw.mods.fml.common.Loader;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_OreDictUnificator;
-import net.minecraft.block.material.Material;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IIcon;
-
-public class GT_Block_Metal extends GT_Block_Storage {
- public Materials[] mMats;
- public OrePrefixes mPrefix;
- public IIconContainer[] mBlockIcons;
- public boolean mHideBlocks;
-
- public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) {
- super(GT_Item_Storage.class, aName, Material.iron);
- mMats = aMats;
- mPrefix = aPrefix;
- mBlockIcons = aBlockIcons;
- mHideBlocks = Loader.isModLoaded("NotEnoughItems");
-
- for (int i = 0; i < aMats.length; i++) {
- if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) {
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + (GT_LanguageManager.i18nPlaceholder ? "%material" : aMats[i].mDefaultLocalName));
- GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i));
- }
- }
- if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) {
- for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
- }
- }
-
- public IIcon getIcon(int aSide, int aMeta) {
- if ((aMeta >= 0) && (aMeta < 16) && aMeta < mMats.length) {
- return mBlockIcons[aMeta].getIcon();
- }
- return null;
- }
-}
+package gregtech.common.blocks; + +import cpw.mods.fml.common.Loader; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class GT_Block_Metal extends GT_Block_Storage { + public Materials[] mMats; + public OrePrefixes mPrefix; + public IIconContainer[] mBlockIcons; + public boolean mHideBlocks; + + public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) { + super(GT_Item_Storage.class, aName, Material.iron); + mMats = aMats; + mPrefix = aPrefix; + mBlockIcons = aBlockIcons; + mHideBlocks = Loader.isModLoaded("NotEnoughItems"); + + for (int i = 0; i < aMats.length; i++) { + if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) { + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + (GT_LanguageManager.i18nPlaceholder ? "%material" : aMats[i].mDefaultLocalName)); + GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i)); + } + } + if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) { + for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); + } + } + + public IIcon getIcon(int aSide, int aMeta) { + if ((aMeta >= 0) && (aMeta < 16) && aMeta < mMats.length) { + return mBlockIcons[aMeta].getIcon(); + } + return null; + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index 01749197a5..512136f1f8 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -1,277 +1,277 @@ -package gregtech.common.blocks;
-
-import cpw.mods.fml.common.Loader;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.items.GT_Generic_Block;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.common.render.GT_Renderer_Block;
-import net.minecraft.block.Block;
-import net.minecraft.block.ITileEntityProvider;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.boss.EntityDragon;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements ITileEntityProvider {
- public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal();
- public static boolean FUCKING_LOCK = false;
- public static boolean tHideOres;
- private final String aTextName = ".name";
- private final String aTextSmall = "Small ";
- public static Set aBlockedOres = new HashSet<Materials>();
-
- protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) {
- super(GT_Item_Ores.class, aUnlocalizedName, aMaterial);
- this.isBlockContainer = true;
- setStepSound(soundTypeStone);
- setCreativeTab(GregTech_API.TAB_GREGTECH_ORES);
- tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres;
- if(aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8;
-
- for (int i = 0; i < 16; i++) {
- GT_ModHandler.addValuableOre(this, i, 1);
- }
- for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) {
- if (GregTech_API.sGeneratedMaterials[i] != null) {
- for (int j = 0; j < aOreMetaCount; j++) {
- if (!this.getEnabledMetas()[j]) continue;
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + aTextName, GT_LanguageManager.i18nPlaceholder ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) : getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + aTextName, aTextSmall + (GT_LanguageManager.i18nPlaceholder ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) : getLocalizedName(GregTech_API.sGeneratedMaterials[i])));
- if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0 && !aBlockedOres.contains(GregTech_API.sGeneratedMaterials[i])) {
- GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000)));
- if (tHideOres) {
- if (!(j == 0 && !aHideFirstMeta)) {
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + (j * 1000)));
- }
- codechicken.nei.api.API.hideItem(new ItemStack(this, 1, (i + 16000) + (j * 1000)));
- }
- }
- }
- }
- }
- }
-
- public int getBaseBlockHarvestLevel(int aMeta) {
- return 0;
- }
-
- public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) {
- if (!FUCKING_LOCK) {
- FUCKING_LOCK = true;
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof GT_TileEntity_Ores)) {
- ((GT_TileEntity_Ores) tTileEntity).onUpdated();
- }
- }
- FUCKING_LOCK = false;
- }
-
- public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aBlock) {
- if (!FUCKING_LOCK) {
- FUCKING_LOCK = true;
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof GT_TileEntity_Ores)) {
- ((GT_TileEntity_Ores) tTileEntity).onUpdated();
- }
- }
- FUCKING_LOCK = false;
- }
-
- public String getLocalizedNameFormat(Materials aMaterial) {
- switch (aMaterial.mName) {
- case "InfusedAir":
- case "InfusedDull":
- case "InfusedEarth":
- case "InfusedEntropy":
- case "InfusedFire":
- case "InfusedOrder":
- case "InfusedVis":
- case "InfusedWater":
- return "%material Infused Stone";
- case "Vermiculite":
- case "Bentonite":
- case "Kaolinite":
- case "Talc":
- case "BasalticMineralSand":
- case "GraniticMineralSand":
- case "GlauconiteSand":
- case "CassiteriteSand":
- case "GarnetSand":
- case "QuartzSand":
- case "Pitchblende":
- case "FullersEarth":
- return "%material";
- default:
- return "%material" + OrePrefixes.ore.mLocalizedMaterialPost;
- }
- }
-
- public String getLocalizedName(Materials aMaterial) {
- return aMaterial.getDefaultLocalizedNameForItem(getLocalizedNameFormat(aMaterial));
- }
-
- public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) {
- super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_);
- TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_);
- return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false;
- }
-
- public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
- return (!(entity instanceof EntityDragon)) && (super.canEntityDestroy(world, x, y, z, entity));
- }
-
- public String getHarvestTool(int aMeta) {
- return aMeta < 8 ? "pickaxe" : "shovel";
- }
-
- public int getHarvestLevel(int aMeta) {
- return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8;
- }
-
- public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
- return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F;
- }
-
- public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) {
- return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F;
- }
-
- protected boolean canSilkHarvest() {
- return false;
- }
-
- public abstract String getUnlocalizedName();
-
- public String getLocalizedName() {
- return StatCollector.translateToLocal(getUnlocalizedName() + aTextName);
- }
-
- public int getRenderType() {
- if (GT_Renderer_Block.INSTANCE == null) {
- return super.getRenderType();
- }
- return GT_Renderer_Block.INSTANCE.mRenderID;
- }
-
- public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
-
- public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return true;
- }
-
- public boolean hasTileEntity(int aMeta) {
- return true;
- }
-
- public boolean renderAsNormalBlock() {
- return true;
- }
-
- public boolean isOpaqueCube() {
- return true;
- }
-
- public TileEntity createNewTileEntity(World aWorld, int aMeta) {
- return createTileEntity(aWorld, aMeta);
- }
-
- public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
- return Blocks.stone.getIcon(0, 0);
- }
-
- public IIcon getIcon(int aSide, int aMeta) {
- return Blocks.stone.getIcon(0, 0);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister aIconRegister) {
- }
-
- public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if (((tTileEntity instanceof GT_TileEntity_Ores))) {
- return ((GT_TileEntity_Ores) tTileEntity).getMetaData();
- }
- return 0;
- }
-
- public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof GT_TileEntity_Ores)) {
- mTemporaryTileEntity.set((GT_TileEntity_Ores) tTileEntity);
- }
- super.breakBlock(aWorld, aX, aY, aZ, par5, par6);
- aWorld.removeTileEntity(aX, aY, aZ);
- }
-
- public abstract OrePrefixes[] getProcessingPrefix(); //Must have 8 entries; an entry can be null to disable automatic recipes.
-
- public abstract boolean[] getEnabledMetas(); //Must have 8 entries.
-
- public abstract Block getDroppedBlock();
-
- public abstract Materials[] getDroppedDusts(); //Must have 8 entries; can be null.
-
- public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof GT_TileEntity_Ores)) {
- return ((GT_TileEntity_Ores) tTileEntity).getDrops(getDroppedBlock(), aFortune);
- }
- return mTemporaryTileEntity.get() == null ? new ArrayList() : ((GT_TileEntity_Ores) mTemporaryTileEntity.get()).getDrops(getDroppedBlock(), aFortune);
- }
-
- public TileEntity createTileEntity(World aWorld, int aMeta) {
- return new GT_TileEntity_Ores();
- }
-
- public abstract ITexture[] getTextureSet(); //Must have 16 entries.
-
- @Override
- public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
- for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
- Materials tMaterial = GregTech_API.sGeneratedMaterials[i];
- if ((tMaterial != null) && ((tMaterial.mTypes & 0x8) != 0)&& !aBlockedOres.contains(tMaterial)) {
- if (!(new ItemStack(aItem, 1, i).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i));
- if (!(new ItemStack(aItem, 1, i + 1000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 1000));
- if (!(new ItemStack(aItem, 1, i + 2000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 2000));
- if (!(new ItemStack(aItem, 1, i + 3000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 3000));
- if (!(new ItemStack(aItem, 1, i + 4000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 4000));
- if (!(new ItemStack(aItem, 1, i + 5000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 5000));
- if (!(new ItemStack(aItem, 1, i + 6000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 6000));
- if (!(new ItemStack(aItem, 1, i + 7000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 7000));
- if (!(new ItemStack(aItem, 1, i + 16000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 16000));
- if (!(new ItemStack(aItem, 1, i + 17000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 17000));
- if (!(new ItemStack(aItem, 1, i + 18000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 18000));
- if (!(new ItemStack(aItem, 1, i + 19000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 19000));
- if (!(new ItemStack(aItem, 1, i + 20000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 20000));
- if (!(new ItemStack(aItem, 1, i + 21000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 21000));
- if (!(new ItemStack(aItem, 1, i + 22000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 22000));
- if (!(new ItemStack(aItem, 1, i + 23000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 23000));
- }
- }
- }
+package gregtech.common.blocks; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.ITexture; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.render.GT_Renderer_Block; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements ITileEntityProvider { + public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal(); + public static boolean FUCKING_LOCK = false; + public static boolean tHideOres; + private final String aTextName = ".name"; + private final String aTextSmall = "Small "; + public static Set aBlockedOres = new HashSet<Materials>(); + + protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) { + super(GT_Item_Ores.class, aUnlocalizedName, aMaterial); + this.isBlockContainer = true; + setStepSound(soundTypeStone); + setCreativeTab(GregTech_API.TAB_GREGTECH_ORES); + tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres; + if(aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8; + + for (int i = 0; i < 16; i++) { + GT_ModHandler.addValuableOre(this, i, 1); + } + for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) { + if (GregTech_API.sGeneratedMaterials[i] != null) { + for (int j = 0; j < aOreMetaCount; j++) { + if (!this.getEnabledMetas()[j]) continue; + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + aTextName, GT_LanguageManager.i18nPlaceholder ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) : getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + aTextName, aTextSmall + (GT_LanguageManager.i18nPlaceholder ? getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]) : getLocalizedName(GregTech_API.sGeneratedMaterials[i]))); + if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0 && !aBlockedOres.contains(GregTech_API.sGeneratedMaterials[i])) { + GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000))); + if (tHideOres) { + if (!(j == 0 && !aHideFirstMeta)) { + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + (j * 1000))); + } + codechicken.nei.api.API.hideItem(new ItemStack(this, 1, (i + 16000) + (j * 1000))); + } + } + } + } + } + } + + public int getBaseBlockHarvestLevel(int aMeta) { + return 0; + } + + public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) { + if (!FUCKING_LOCK) { + FUCKING_LOCK = true; + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof GT_TileEntity_Ores)) { + ((GT_TileEntity_Ores) tTileEntity).onUpdated(); + } + } + FUCKING_LOCK = false; + } + + public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aBlock) { + if (!FUCKING_LOCK) { + FUCKING_LOCK = true; + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof GT_TileEntity_Ores)) { + ((GT_TileEntity_Ores) tTileEntity).onUpdated(); + } + } + FUCKING_LOCK = false; + } + + public String getLocalizedNameFormat(Materials aMaterial) { + switch (aMaterial.mName) { + case "InfusedAir": + case "InfusedDull": + case "InfusedEarth": + case "InfusedEntropy": + case "InfusedFire": + case "InfusedOrder": + case "InfusedVis": + case "InfusedWater": + return "%material Infused Stone"; + case "Vermiculite": + case "Bentonite": + case "Kaolinite": + case "Talc": + case "BasalticMineralSand": + case "GraniticMineralSand": + case "GlauconiteSand": + case "CassiteriteSand": + case "GarnetSand": + case "QuartzSand": + case "Pitchblende": + case "FullersEarth": + return "%material"; + default: + return "%material" + OrePrefixes.ore.mLocalizedMaterialPost; + } + } + + public String getLocalizedName(Materials aMaterial) { + return aMaterial.getDefaultLocalizedNameForItem(getLocalizedNameFormat(aMaterial)); + } + + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { + super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); + TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); + return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false; + } + + public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { + return (!(entity instanceof EntityDragon)) && (super.canEntityDestroy(world, x, y, z, entity)); + } + + public String getHarvestTool(int aMeta) { + return aMeta < 8 ? "pickaxe" : "shovel"; + } + + public int getHarvestLevel(int aMeta) { + return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8; + } + + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { + return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F; + } + + public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) { + return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F; + } + + protected boolean canSilkHarvest() { + return false; + } + + public abstract String getUnlocalizedName(); + + public String getLocalizedName() { + return StatCollector.translateToLocal(getUnlocalizedName() + aTextName); + } + + public int getRenderType() { + if (GT_Renderer_Block.INSTANCE == null) { + return super.getRenderType(); + } + return GT_Renderer_Block.INSTANCE.mRenderID; + } + + public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { + return true; + } + + public boolean hasTileEntity(int aMeta) { + return true; + } + + public boolean renderAsNormalBlock() { + return true; + } + + public boolean isOpaqueCube() { + return true; + } + + public TileEntity createNewTileEntity(World aWorld, int aMeta) { + return createTileEntity(aWorld, aMeta); + } + + public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) { + return Blocks.stone.getIcon(0, 0); + } + + public IIcon getIcon(int aSide, int aMeta) { + return Blocks.stone.getIcon(0, 0); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister aIconRegister) { + } + + public int getDamageValue(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (((tTileEntity instanceof GT_TileEntity_Ores))) { + return ((GT_TileEntity_Ores) tTileEntity).getMetaData(); + } + return 0; + } + + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof GT_TileEntity_Ores)) { + mTemporaryTileEntity.set((GT_TileEntity_Ores) tTileEntity); + } + super.breakBlock(aWorld, aX, aY, aZ, par5, par6); + aWorld.removeTileEntity(aX, aY, aZ); + } + + public abstract OrePrefixes[] getProcessingPrefix(); //Must have 8 entries; an entry can be null to disable automatic recipes. + + public abstract boolean[] getEnabledMetas(); //Must have 8 entries. + + public abstract Block getDroppedBlock(); + + public abstract Materials[] getDroppedDusts(); //Must have 8 entries; can be null. + + public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof GT_TileEntity_Ores)) { + return ((GT_TileEntity_Ores) tTileEntity).getDrops(getDroppedBlock(), aFortune); + } + return mTemporaryTileEntity.get() == null ? new ArrayList() : ((GT_TileEntity_Ores) mTemporaryTileEntity.get()).getDrops(getDroppedBlock(), aFortune); + } + + public TileEntity createTileEntity(World aWorld, int aMeta) { + return new GT_TileEntity_Ores(); + } + + public abstract ITexture[] getTextureSet(); //Must have 16 entries. + + @Override + public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { + for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) { + Materials tMaterial = GregTech_API.sGeneratedMaterials[i]; + if ((tMaterial != null) && ((tMaterial.mTypes & 0x8) != 0)&& !aBlockedOres.contains(tMaterial)) { + if (!(new ItemStack(aItem, 1, i).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i)); + if (!(new ItemStack(aItem, 1, i + 1000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 1000)); + if (!(new ItemStack(aItem, 1, i + 2000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 2000)); + if (!(new ItemStack(aItem, 1, i + 3000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 3000)); + if (!(new ItemStack(aItem, 1, i + 4000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 4000)); + if (!(new ItemStack(aItem, 1, i + 5000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 5000)); + if (!(new ItemStack(aItem, 1, i + 6000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 6000)); + if (!(new ItemStack(aItem, 1, i + 7000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 7000)); + if (!(new ItemStack(aItem, 1, i + 16000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 16000)); + if (!(new ItemStack(aItem, 1, i + 17000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 17000)); + if (!(new ItemStack(aItem, 1, i + 18000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 18000)); + if (!(new ItemStack(aItem, 1, i + 19000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 19000)); + if (!(new ItemStack(aItem, 1, i + 20000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 20000)); + if (!(new ItemStack(aItem, 1, i + 21000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 21000)); + if (!(new ItemStack(aItem, 1, i + 22000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 22000)); + if (!(new ItemStack(aItem, 1, i + 23000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 23000)); + } + } + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java index 064f684168..c9c31dae54 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java @@ -1,150 +1,150 @@ -package gregtech.common.blocks;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.interfaces.IOreRecipeRegistrator;
-import gregtech.api.items.GT_Generic_Block;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.block.material.Material;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.EnumCreatureType;
-import net.minecraft.init.Blocks;
-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;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-
-import java.util.List;
-import java.util.Random;
-
-public class GT_Block_Stones_Abstract
- extends GT_Generic_Block
- implements IOreRecipeRegistrator {
- public GT_Block_Stones_Abstract(Class<? extends ItemBlock> aItemClass, String aName) {
- super(aItemClass, aName, Material.rock);
- OrePrefixes.crafting.add(this);
- setStepSound(soundTypeStone);
- setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS);
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 7));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 1), new ItemStack(this, 1, 0));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 2), new ItemStack(this, 1, 0));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 3), new ItemStack(this, 1, 0));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 4), new ItemStack(this, 1, 0));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 5), new ItemStack(this, 1, 0));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 6), new ItemStack(this, 1, 0));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 7), new ItemStack(this, 1, 0));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 8), new ItemStack(this, 1, 15));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 9), new ItemStack(this, 1, 8));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 10), new ItemStack(this, 1, 8));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 11), new ItemStack(this, 1, 8));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 12), new ItemStack(this, 1, 8));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 13), new ItemStack(this, 1, 8));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 14), new ItemStack(this, 1, 8));
- GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 15), new ItemStack(this, 1, 8));
- GT_Values.RA.addAssemblerRecipe(new ItemStack(this, 1, 0), ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), new ItemStack(this, 1, 3), 50, 4);
- GT_Values.RA.addAssemblerRecipe(new ItemStack(this, 1, 8), ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), new ItemStack(this, 1, 11), 50, 4);
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", 'X', new ItemStack(this, 1, 7)});
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 14), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", 'X', new ItemStack(this, 1, 15)});
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 3)});
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 12), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 11)});
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 0)});
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 9), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 8)});
- GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 3), new ItemStack(this, 1, 4), 16, 10);
- GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 11), new ItemStack(this, 1, 12), 16, 10);
- GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 1), 16, 10);
- GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 8), new ItemStack(this, 1, 9), 16, 10);
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 0)});
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 8)});
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 7)});
- GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 15)});
- }
-
- public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
- if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) {
- GT_Values.RA.addLaserEngraverRecipe(new ItemStack(this, 1, 7), GT_Utility.copyAmount(0L, new Object[]{aStack}), new ItemStack(this, 1, 6), 50, 16);
- GT_Values.RA.addLaserEngraverRecipe(new ItemStack(this, 1, 15), GT_Utility.copyAmount(0L, new Object[]{aStack}), new ItemStack(this, 1, 14), 50, 16);
- }
- }
- @Override
- public String getHarvestTool(int aMeta) {
- return "pickaxe";
- }
- @Override
- public int getHarvestLevel(int aMeta) {
- return 1;
- }
- @Override
- public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
- return this.blockHardness = Blocks.stone.getBlockHardness(aWorld, aX, aY, aZ) * 3.0F;
- }
- @Override
- public String getUnlocalizedName() {
- return this.mUnlocalizedName;
- }
- @Override
- public String getLocalizedName() {
- return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
- }
- @Override
- public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return false;
- }
- @Override
- public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
- return true;
- }
- @Override
- public boolean renderAsNormalBlock() {
- return true;
- }
- @Override
- public boolean isOpaqueCube() {
- return true;
- }
- @Override
- public IIcon getIcon(int aSide, int aMeta) {
- if ((aMeta >= 0) && (aMeta < 16)) {
- return gregtech.api.enums.Textures.BlockIcons.GRANITES[aMeta].getIcon();
- }
- return null;
- }
-
- @Override
- public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
- return world.getBlockMetadata(x, y, z) % 8 < 3;
- }
- @Override
- public int damageDropped(int par1) {
- return par1 % 8 == 0 ? par1 + 1 : par1;
- }
- @Override
- public int getDamageValue(World par1World, int par2, int par3, int par4) {
- return par1World.getBlockMetadata(par2, par3, par4);
- }
- @Override
- public int quantityDropped(Random par1Random) {
- return 1;
- }
-
- public Item getItemDropped(int par1, Random par2Random, int par3) {
- return Item.getItemFromBlock(this);
- }
-
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister aIconRegister) {
- }
-
- @SideOnly(Side.CLIENT)
- public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
- for (int i = 0; i < 16; i++) {
- aList.add(new ItemStack(aItem, 1, i));
- }
- }
-}
+package gregtech.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.*; +import gregtech.api.interfaces.IOreRecipeRegistrator; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +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; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import java.util.List; +import java.util.Random; + +public class GT_Block_Stones_Abstract + extends GT_Generic_Block + implements IOreRecipeRegistrator { + public GT_Block_Stones_Abstract(Class<? extends ItemBlock> aItemClass, String aName) { + super(aItemClass, aName, Material.rock); + OrePrefixes.crafting.add(this); + setStepSound(soundTypeStone); + setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 7)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 1), new ItemStack(this, 1, 0)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 2), new ItemStack(this, 1, 0)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 3), new ItemStack(this, 1, 0)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 4), new ItemStack(this, 1, 0)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 5), new ItemStack(this, 1, 0)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 6), new ItemStack(this, 1, 0)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 7), new ItemStack(this, 1, 0)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 8), new ItemStack(this, 1, 15)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 9), new ItemStack(this, 1, 8)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 10), new ItemStack(this, 1, 8)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 11), new ItemStack(this, 1, 8)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 12), new ItemStack(this, 1, 8)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 13), new ItemStack(this, 1, 8)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 14), new ItemStack(this, 1, 8)); + GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 15), new ItemStack(this, 1, 8)); + GT_Values.RA.addAssemblerRecipe(new ItemStack(this, 1, 0), ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), new ItemStack(this, 1, 3), 50, 4); + GT_Values.RA.addAssemblerRecipe(new ItemStack(this, 1, 8), ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), new ItemStack(this, 1, 11), 50, 4); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", 'X', new ItemStack(this, 1, 7)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 14), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"f", "X", 'X', new ItemStack(this, 1, 15)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 3)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 12), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 11)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 0)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 1, 9), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"h", "X", 'X', new ItemStack(this, 1, 8)}); + GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 3), new ItemStack(this, 1, 4), 16, 10); + GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 11), new ItemStack(this, 1, 12), 16, 10); + GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 1), 16, 10); + GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 8), new ItemStack(this, 1, 9), 16, 10); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 0)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 8)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 7)}); + GT_ModHandler.addCraftingRecipe(new ItemStack(this, 4, 11), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"XX", "XX", 'X', new ItemStack(this, 4, 15)}); + } + + public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) { + GT_Values.RA.addLaserEngraverRecipe(new ItemStack(this, 1, 7), GT_Utility.copyAmount(0L, new Object[]{aStack}), new ItemStack(this, 1, 6), 50, 16); + GT_Values.RA.addLaserEngraverRecipe(new ItemStack(this, 1, 15), GT_Utility.copyAmount(0L, new Object[]{aStack}), new ItemStack(this, 1, 14), 50, 16); + } + } + @Override + public String getHarvestTool(int aMeta) { + return "pickaxe"; + } + @Override + public int getHarvestLevel(int aMeta) { + return 1; + } + @Override + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { + return this.blockHardness = Blocks.stone.getBlockHardness(aWorld, aX, aY, aZ) * 3.0F; + } + @Override + public String getUnlocalizedName() { + return this.mUnlocalizedName; + } + @Override + public String getLocalizedName() { + return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); + } + @Override + public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + @Override + public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { + return true; + } + @Override + public boolean renderAsNormalBlock() { + return true; + } + @Override + public boolean isOpaqueCube() { + return true; + } + @Override + public IIcon getIcon(int aSide, int aMeta) { + if ((aMeta >= 0) && (aMeta < 16)) { + return gregtech.api.enums.Textures.BlockIcons.GRANITES[aMeta].getIcon(); + } + return null; + } + + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return world.getBlockMetadata(x, y, z) % 8 < 3; + } + @Override + public int damageDropped(int par1) { + return par1 % 8 == 0 ? par1 + 1 : par1; + } + @Override + public int getDamageValue(World par1World, int par2, int par3, int par4) { + return par1World.getBlockMetadata(par2, par3, par4); + } + @Override + public int quantityDropped(Random par1Random) { + return 1; + } + + public Item getItemDropped(int par1, Random par2Random, int par3) { + return Item.getItemFromBlock(this); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister aIconRegister) { + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { + for (int i = 0; i < 16; i++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java index 66498a0481..f1609ef684 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings8.java @@ -1,10 +1,10 @@ -package gregtech.common.blocks;
-
-import net.minecraft.block.Block;
-
-public class GT_Item_Casings8
- extends GT_Item_Casings_Abstract {
- public GT_Item_Casings8(Block par1) {
- super(par1);
- }
-}
+package gregtech.common.blocks; + +import net.minecraft.block.Block; + +public class GT_Item_Casings8 + extends GT_Item_Casings_Abstract { + public GT_Item_Casings8(Block par1) { + super(par1); + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index 1424a016e8..bf6b12b5cd 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -1,203 +1,203 @@ -package gregtech.common.blocks;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Materials;
-import gregtech.api.interfaces.metatileentity.IConnectable;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
-import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
-import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame;
-import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item;
-import gregtech.api.util.GT_ItsNotMyFaultException;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-
-import java.util.List;
-
-public class GT_Item_Machines
- extends ItemBlock {
-
- private static final String[] directionNames = {"Bottom", "Top", "North", "South", "West", "East"};
-
- public GT_Item_Machines(Block par1) {
- super(par1);
- setMaxDamage(0);
- setHasSubtypes(true);
- setCreativeTab(GregTech_API.TAB_GREGTECH);
- }
-
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) {
- try {
- int tDamage = getDamage(aStack);
- if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) {
- return;
- }
-
- if (GregTech_API.METATILEENTITIES[tDamage] != null) {
- IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity();
- if (tTileEntity.getDescription() != null) {
- int i = 0;
- for (String tDescription : tTileEntity.getDescription()) {
- if (GT_Utility.isStringValid(tDescription)) {
- if(tDescription.contains("%%%")){
- String[] tString = tDescription.split("%%%");
- if(tString.length>=2){
- StringBuffer tBuffer = new StringBuffer();
- Object tRep[] = new String[tString.length / 2];
- for (int j = 0; j < tString.length; j++)
- if (j % 2 == 0) tBuffer.append(tString[j]);
- else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];}
- aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep));
- }
- }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished );
- aList.add(tTranslated.equals("") ? tDescription : tTranslated);}
- }else i++;
- }
- }
- if (tTileEntity.getEUCapacity() > 0L) {
- if (tTileEntity.getInputVoltage() > 0L) {
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY);
- }
- if (tTileEntity.getOutputVoltage() > 0L) {
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY);
- }
- if (tTileEntity.getOutputAmperage() > 1L) {
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY);
- }
- aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY);
- }
- }
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (aNBT != null) {
- if (aNBT.getBoolean("mMuffler")) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished ));
- }
- if (aNBT.getBoolean("mSteamConverter")) {
- aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished ));
- }
- int tAmount = 0;
- if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) {
- aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished ));
- }
-
- addInstalledCoversInformation(aNBT, aList);
- }
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- }
- }
-
- private void addInstalledCoversInformation(NBTTagCompound aNBT, List<String> aList) {
- if (aNBT.hasKey("mCoverSides")){
- int[] mCoverSides = aNBT.getIntArray("mCoverSides");
- if (mCoverSides != null && mCoverSides.length == 6) {
- for (byte i = 0; i < 6; i++) {
- int coverId = mCoverSides[i];
- ItemStack coverStack = GT_Utility.intToStack(coverId);
- if (coverStack != null) {
- aList.add(String.format("Cover on %s side: %s", directionNames[i], coverStack.getDisplayName()));
- }
- }
- }
- }
- }
-
- public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
- return false;
- }
-
- public String getUnlocalizedName(ItemStack aStack) {
- short tDamage = (short) getDamage(aStack);
- if ((tDamage < 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) {
- return "";
- }
- if (GregTech_API.METATILEENTITIES[tDamage] != null) {
- return getUnlocalizedName() + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName();
- }
- return "";
- }
-
- public String getItemStackDisplayName(ItemStack aStack) {
- String aName = super.getItemStackDisplayName(aStack);
- short aDamage = (short) getDamage(aStack);
- if (aDamage >= 0 && aDamage < GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[aDamage] != null) {
- Materials aMaterial = null;
- if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Item) {
- aMaterial = ((GT_MetaPipeEntity_Item) GregTech_API.METATILEENTITIES[aDamage]).mMaterial;
- } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Fluid) {
- aMaterial = ((GT_MetaPipeEntity_Fluid) GregTech_API.METATILEENTITIES[aDamage]).mMaterial;
- } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Cable) {
- aMaterial = ((GT_MetaPipeEntity_Cable) GregTech_API.METATILEENTITIES[aDamage]).mMaterial;
- } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Frame) {
- aMaterial = ((GT_MetaPipeEntity_Frame) GregTech_API.METATILEENTITIES[aDamage]).mMaterial;
- }
- if (aMaterial != null) {
- aName = aMaterial.getLocalizedNameForItem(aName);
- }
- }
- return aName;
- }
-
- public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
- super.onCreated(aStack, aWorld, aPlayer);
- short tDamage = (short) getDamage(aStack);
- if ((tDamage < 0) || ((tDamage >= GregTech_API.METATILEENTITIES.length) && (GregTech_API.METATILEENTITIES[tDamage] != null))) {
- GregTech_API.METATILEENTITIES[tDamage].onCreated(aStack, aWorld, aPlayer);
- }
- }
-
- public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) {
- short tDamage = (short) getDamage(aStack);
- if (tDamage > 0) {
- if (GregTech_API.METATILEENTITIES[tDamage] == null) {
- return false;
- }
- int tMetaData = GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType();
- if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tMetaData, 3)) {
- return false;
- }
- if (aWorld.getBlock(aX, aY, aZ) != this.field_150939_a) {
- throw new GT_ItsNotMyFaultException("Failed to place Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don't report this Bug to me, I don't know how to fix it.");
- }
- if (aWorld.getBlockMetadata(aX, aY, aZ) != tMetaData) {
- throw new GT_ItsNotMyFaultException("Failed to set the MetaValue of the Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don't report this Bug to me, I don't know how to fix it.");
- }
- IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aWorld.getTileEntity(aX, aY, aZ);
- if (tTileEntity != null) {
- tTileEntity.setInitialValuesAsNBT(tTileEntity.isServerSide() ? aStack.getTagCompound() : null, tDamage);
- if (aPlayer != null) {
- tTileEntity.setOwnerName(aPlayer.getDisplayName());
- tTileEntity.setOwnerUuid(aPlayer.getUniqueID());
- }
- tTileEntity.getMetaTileEntity().initDefaultModes(aStack.getTagCompound());
- final byte aSide = GT_Utility.getOppositeSide(side);
- if (tTileEntity.getMetaTileEntity() instanceof IConnectable) {
- // If we're connectable, try connecting to whatever we're up against
- ((IConnectable) tTileEntity.getMetaTileEntity()).connect(aSide);
- } else if (aPlayer != null && aPlayer.isSneaking()) {
- // If we're being placed against something that is connectable, try telling it to connect to us
- IGregTechTileEntity aTileEntity = tTileEntity.getIGregTechTileEntityAtSide(aSide);
- if (aTileEntity != null && aTileEntity.getMetaTileEntity() instanceof IConnectable) {
- ((IConnectable) aTileEntity.getMetaTileEntity()).connect((byte)side);
- }
- }
- }
- } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) {
- return false;
- }
- if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) {
- this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack);
- this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage);
- }
- return true;
- }
-}
+package gregtech.common.blocks; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.metatileentity.IConnectable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame; +import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item; +import gregtech.api.util.GT_ItsNotMyFaultException; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +import java.util.List; + +public class GT_Item_Machines + extends ItemBlock { + + private static final String[] directionNames = {"Bottom", "Top", "North", "South", "West", "East"}; + + public GT_Item_Machines(Block par1) { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + setCreativeTab(GregTech_API.TAB_GREGTECH); + } + + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) { + try { + int tDamage = getDamage(aStack); + if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) { + return; + } + + if (GregTech_API.METATILEENTITIES[tDamage] != null) { + IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity(); + if (tTileEntity.getDescription() != null) { + int i = 0; + for (String tDescription : tTileEntity.getDescription()) { + if (GT_Utility.isStringValid(tDescription)) { + if(tDescription.contains("%%%")){ + String[] tString = tDescription.split("%%%"); + if(tString.length>=2){ + StringBuffer tBuffer = new StringBuffer(); + Object tRep[] = new String[tString.length / 2]; + for (int j = 0; j < tString.length; j++) + if (j % 2 == 0) tBuffer.append(tString[j]); + else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];} + aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep)); + } + }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished ); + aList.add(tTranslated.equals("") ? tDescription : tTranslated);} + }else i++; + } + } + if (tTileEntity.getEUCapacity() > 0L) { + if (tTileEntity.getInputVoltage() > 0L) { + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); + } + if (tTileEntity.getOutputVoltage() > 0L) { + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY); + } + if (tTileEntity.getOutputAmperage() > 1L) { + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY); + } + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY); + } + } + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + if (aNBT.getBoolean("mMuffler")) { + aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished )); + } + if (aNBT.getBoolean("mSteamConverter")) { + aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished )); + } + int tAmount = 0; + if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) { + aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished )); + } + + addInstalledCoversInformation(aNBT, aList); + } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + } + + private void addInstalledCoversInformation(NBTTagCompound aNBT, List<String> aList) { + if (aNBT.hasKey("mCoverSides")){ + int[] mCoverSides = aNBT.getIntArray("mCoverSides"); + if (mCoverSides != null && mCoverSides.length == 6) { + for (byte i = 0; i < 6; i++) { + int coverId = mCoverSides[i]; + ItemStack coverStack = GT_Utility.intToStack(coverId); + if (coverStack != null) { + aList.add(String.format("Cover on %s side: %s", directionNames[i], coverStack.getDisplayName())); + } + } + } + } + } + + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + return false; + } + + public String getUnlocalizedName(ItemStack aStack) { + short tDamage = (short) getDamage(aStack); + if ((tDamage < 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) { + return ""; + } + if (GregTech_API.METATILEENTITIES[tDamage] != null) { + return getUnlocalizedName() + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName(); + } + return ""; + } + + public String getItemStackDisplayName(ItemStack aStack) { + String aName = super.getItemStackDisplayName(aStack); + short aDamage = (short) getDamage(aStack); + if (aDamage >= 0 && aDamage < GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[aDamage] != null) { + Materials aMaterial = null; + if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Item) { + aMaterial = ((GT_MetaPipeEntity_Item) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; + } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Fluid) { + aMaterial = ((GT_MetaPipeEntity_Fluid) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; + } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Cable) { + aMaterial = ((GT_MetaPipeEntity_Cable) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; + } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Frame) { + aMaterial = ((GT_MetaPipeEntity_Frame) GregTech_API.METATILEENTITIES[aDamage]).mMaterial; + } + if (aMaterial != null) { + aName = aMaterial.getLocalizedNameForItem(aName); + } + } + return aName; + } + + public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + super.onCreated(aStack, aWorld, aPlayer); + short tDamage = (short) getDamage(aStack); + if ((tDamage < 0) || ((tDamage >= GregTech_API.METATILEENTITIES.length) && (GregTech_API.METATILEENTITIES[tDamage] != null))) { + GregTech_API.METATILEENTITIES[tDamage].onCreated(aStack, aWorld, aPlayer); + } + } + + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { + short tDamage = (short) getDamage(aStack); + if (tDamage > 0) { + if (GregTech_API.METATILEENTITIES[tDamage] == null) { + return false; + } + int tMetaData = GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType(); + if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tMetaData, 3)) { + return false; + } + if (aWorld.getBlock(aX, aY, aZ) != this.field_150939_a) { + throw new GT_ItsNotMyFaultException("Failed to place Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don't report this Bug to me, I don't know how to fix it."); + } + if (aWorld.getBlockMetadata(aX, aY, aZ) != tMetaData) { + throw new GT_ItsNotMyFaultException("Failed to set the MetaValue of the Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don't report this Bug to me, I don't know how to fix it."); + } + IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity != null) { + tTileEntity.setInitialValuesAsNBT(tTileEntity.isServerSide() ? aStack.getTagCompound() : null, tDamage); + if (aPlayer != null) { + tTileEntity.setOwnerName(aPlayer.getDisplayName()); + tTileEntity.setOwnerUuid(aPlayer.getUniqueID()); + } + tTileEntity.getMetaTileEntity().initDefaultModes(aStack.getTagCompound()); + final byte aSide = GT_Utility.getOppositeSide(side); + if (tTileEntity.getMetaTileEntity() instanceof IConnectable) { + // If we're connectable, try connecting to whatever we're up against + ((IConnectable) tTileEntity.getMetaTileEntity()).connect(aSide); + } else if (aPlayer != null && aPlayer.isSneaking()) { + // If we're being placed against something that is connectable, try telling it to connect to us + IGregTechTileEntity aTileEntity = tTileEntity.getIGregTechTileEntityAtSide(aSide); + if (aTileEntity != null && aTileEntity.getMetaTileEntity() instanceof IConnectable) { + ((IConnectable) aTileEntity.getMetaTileEntity()).connect((byte)side); + } + } + } + } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { + return false; + } + if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { + this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); + this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); + } + return true; + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java index 10d71bfcc9..8d53cfe513 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java @@ -1,54 +1,54 @@ -package gregtech.common.blocks;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-public class GT_Item_Ores
- extends ItemBlock {
- public GT_Item_Ores(Block par1) {
- super(par1);
- setMaxDamage(0);
- setHasSubtypes(true);
- setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS);
- }
-
- public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
- return false;
- }
-
- public String getUnlocalizedName(ItemStack aStack) {
- return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack);
- }
-
- public String getItemStackDisplayName(ItemStack aStack) {
- String aName = super.getItemStackDisplayName(aStack);
- if (this.field_150939_a instanceof GT_Block_Ores_Abstract) {
- aName = Materials.getLocalizedNameForItem(aName, aStack.getItemDamage() % 1000);
- }
- return aName;
- }
-
- public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) {
- short tDamage = (short) getDamage(aStack);
- if (tDamage > 0) {
- if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, GT_TileEntity_Ores.getHarvestData(tDamage, ((GT_Block_Ores_Abstract) field_150939_a).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), 3)) {
- return false;
- }
- GT_TileEntity_Ores tTileEntity = (GT_TileEntity_Ores) aWorld.getTileEntity(aX, aY, aZ);
- tTileEntity.mMetaData = tDamage;
- tTileEntity.mNatural = false;
- } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) {
- return false;
- }
- if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) {
- this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack);
- this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage);
- }
- return true;
- }
-}
+package gregtech.common.blocks; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class GT_Item_Ores + extends ItemBlock { + public GT_Item_Ores(Block par1) { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); + } + + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + return false; + } + + public String getUnlocalizedName(ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); + } + + public String getItemStackDisplayName(ItemStack aStack) { + String aName = super.getItemStackDisplayName(aStack); + if (this.field_150939_a instanceof GT_Block_Ores_Abstract) { + aName = Materials.getLocalizedNameForItem(aName, aStack.getItemDamage() % 1000); + } + return aName; + } + + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { + short tDamage = (short) getDamage(aStack); + if (tDamage > 0) { + if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, GT_TileEntity_Ores.getHarvestData(tDamage, ((GT_Block_Ores_Abstract) field_150939_a).getBaseBlockHarvestLevel(aMeta % 16000 / 1000)), 3)) { + return false; + } + GT_TileEntity_Ores tTileEntity = (GT_TileEntity_Ores) aWorld.getTileEntity(aX, aY, aZ); + tTileEntity.mMetaData = tDamage; + tTileEntity.mNatural = false; + } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) { + return false; + } + if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { + this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); + this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); + } + return true; + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java index 84cbcba6f1..8cf838f538 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java @@ -1,41 +1,41 @@ -package gregtech.common.blocks;
-
-import gregtech.api.GregTech_API;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-
-import java.util.List;
-
-public class GT_Item_Storage extends ItemBlock {
- public GT_Item_Storage(Block par1) {
- super(par1);
- setMaxDamage(0);
- setHasSubtypes(true);
- setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS);
- }
-
- public String getUnlocalizedName(ItemStack aStack) {
- return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack);
- }
-
- public String getItemStackDisplayName(ItemStack aStack) {
- String aName = super.getItemStackDisplayName(aStack);
- if (this.field_150939_a instanceof GT_Block_Metal) {
- int aDamage = aStack.getItemDamage();
- if (aDamage >= 0 && aDamage < ((GT_Block_Metal) this.field_150939_a).mMats.length) {
- aName = ((GT_Block_Metal) this.field_150939_a).mMats[aDamage].getLocalizedNameForItem(aName);
- }
- }
- return aName;
- }
-
- public int getMetadata(int aMeta) {
- return aMeta;
- }
-
- public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
- super.addInformation(aStack, aPlayer, aList, aF3_H);
- }
+package gregtech.common.blocks; + +import gregtech.api.GregTech_API; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +import java.util.List; + +public class GT_Item_Storage extends ItemBlock { + public GT_Item_Storage(Block par1) { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); + } + + public String getUnlocalizedName(ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); + } + + public String getItemStackDisplayName(ItemStack aStack) { + String aName = super.getItemStackDisplayName(aStack); + if (this.field_150939_a instanceof GT_Block_Metal) { + int aDamage = aStack.getItemDamage(); + if (aDamage >= 0 && aDamage < ((GT_Block_Metal) this.field_150939_a).mMats.length) { + aName = ((GT_Block_Metal) this.field_150939_a).mMats[aDamage].getLocalizedNameForItem(aName); + } + } + return aName; + } + + public int getMetadata(int aMeta) { + return aMeta; + } + + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + super.addInformation(aStack, aPlayer, aList, aF3_H); + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java index 83bac2a9ad..40706721c9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -1,79 +1,79 @@ -package gregtech.common.covers;
-
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.util.GT_CoverBehavior;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
-
-public class GT_Cover_ItemMeter
- extends GT_CoverBehavior {
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
- int[] tSlots;
- if (aCoverVariable < 2) {
- tSlots = aTileEntity.getAccessibleSlotsFromSide(aSide);
- } else {
- tSlots = new int[]{aCoverVariable - 2};
- }
- int tMax = 0;
- int tUsed = 0;
- for (int i : tSlots) {
- if (i >= 0 && i < aTileEntity.getSizeInventory()) {
- tMax+=64;
- ItemStack tStack = aTileEntity.getStackInSlot(i);
- if (tStack != null)
- tUsed += (tStack.stackSize<<6)/tStack.getMaxStackSize();
- }
- }
- if(tUsed==0)//nothing
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 15 : 0));
- else if(tUsed >= tMax)//full
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 0 : 15));
- else//1-14 range
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 14-((14*tUsed)/tMax) : 1+((14*tUsed)/tMax)) );
- return aCoverVariable;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (2 + aTileEntity.getSizeInventory());
- switch(aCoverVariable) {
- case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("051", "Normal")); break;
- case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("052", "Inverted")); break;
- default: GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (aCoverVariable - 2)); break;
- }
- return aCoverVariable;
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return 5;
- }
-}
+package gregtech.common.covers; + +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + +public class GT_Cover_ItemMeter + extends GT_CoverBehavior { + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + int[] tSlots; + if (aCoverVariable < 2) { + tSlots = aTileEntity.getAccessibleSlotsFromSide(aSide); + } else { + tSlots = new int[]{aCoverVariable - 2}; + } + int tMax = 0; + int tUsed = 0; + for (int i : tSlots) { + if (i >= 0 && i < aTileEntity.getSizeInventory()) { + tMax+=64; + ItemStack tStack = aTileEntity.getStackInSlot(i); + if (tStack != null) + tUsed += (tStack.stackSize<<6)/tStack.getMaxStackSize(); + } + } + if(tUsed==0)//nothing + aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 15 : 0)); + else if(tUsed >= tMax)//full + aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 0 : 15)); + else//1-14 range + aTileEntity.setOutputRedstoneSignal(aSide, (byte)(aCoverVariable == 1 ? 14-((14*tUsed)/tMax) : 1+((14*tUsed)/tMax)) ); + return aCoverVariable; + } + + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { + aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (2 + aTileEntity.getSizeInventory()); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, trans("051", "Normal")); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, trans("052", "Inverted")); break; + default: GT_Utility.sendChatToPlayer(aPlayer, trans("053", "Slot: ") + (aCoverVariable - 2)); break; + } + return aCoverVariable; + } + + public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return true; + } + + public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) { + return true; + } + + public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return true; + } + + public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) { + return true; + } + + public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return true; + } + + public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + return 5; + } +} diff --git a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java index 6a3d7b2f47..ecd371893d 100644 --- a/src/main/java/gregtech/common/gui/GT_Container_Regulator.java +++ b/src/main/java/gregtech/common/gui/GT_Container_Regulator.java @@ -1,167 +1,167 @@ -package gregtech.common.gui;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.gui.GT_ContainerMetaTile_Machine;
-import gregtech.api.gui.GT_Slot_Holo;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.tileentities.automation.GT_MetaTileEntity_Regulator;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-import java.util.Iterator;
-
-public class GT_Container_Regulator
- extends GT_ContainerMetaTile_Machine {
- public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0};
-
- public GT_Container_Regulator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- this.mTargetSlots = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0};
-
- addSlotToContainer(new Slot(this.mTileEntity, 0, 8, 6));
- addSlotToContainer(new Slot(this.mTileEntity, 1, 26, 6));
- addSlotToContainer(new Slot(this.mTileEntity, 2, 44, 6));
- addSlotToContainer(new Slot(this.mTileEntity, 3, 8, 24));
- addSlotToContainer(new Slot(this.mTileEntity, 4, 26, 24));
- addSlotToContainer(new Slot(this.mTileEntity, 5, 44, 24));
- addSlotToContainer(new Slot(this.mTileEntity, 6, 8, 42));
- addSlotToContainer(new Slot(this.mTileEntity, 7, 26, 42));
- addSlotToContainer(new Slot(this.mTileEntity, 8, 44, 42));
-
- addSlotToContainer(new Slot(this.mTileEntity, 19, 44, 63));
-
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 9, 64, 7, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 81, 7, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 11, 98, 7, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 12, 64, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 13, 81, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 14, 98, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 15, 64, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 16, 81, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 17, 98, 41, false, true, 1));
-
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 7, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 7, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 7, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 24, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 41, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 41, false, true, 1));
-
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 8, 63, false, true, 1));
- }
-
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex < 10) {
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
- Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
- if (tSlot != null) {
- if (this.mTileEntity.getMetaTileEntity() == null) {
- return null;
- }
- if (aSlotIndex == 28) {
- ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput);
- if (((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, trans("116", "Emit Energy to Outputside"));
- } else {
- GT_Utility.sendChatToPlayer(aPlayer, trans("117", "Don't emit Energy"));
- }
- return null;
- }
- if ((aSlotIndex < 19)) {
- ItemStack tStack = aPlayer.inventory.getItemStack();
- if (tStack != null) {
- tSlot.putStack(GT_Utility.copy(new Object[]{tStack}));
- } else if (tSlot.getStack() != null) {
- if (aMouseclick == 0) {
- tSlot.getStack().stackSize -= (aShifthold == 1 ? 8 : 1);
- if (tSlot.getStack().stackSize <= 0) {
- tSlot.putStack(null);
- }
- } else {
- tSlot.getStack().stackSize += (aShifthold == 1 ? 8 : 1);
- if (tSlot.getStack().stackSize > tSlot.getStack().getMaxStackSize()) {
- tSlot.getStack().stackSize = tSlot.getStack().getMaxStackSize();
- }
- }
- }
- return null;
- }
- if ((aSlotIndex < 28)) {
- ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 19)] = Math.min(99, Math.max(0, ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 19)] + (aMouseclick == 0 ? -1 : 1) * (aShifthold == 0 ? 1 : 16)));
- return null;
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) {
- return;
- }
- this.mTargetSlots = new int[9];
- for (int i = 0; i < 9; i++) {
- this.mTargetSlots[i] = ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[i];
- }
- Iterator var2 = this.crafters.iterator();
- while (var2.hasNext()) {
- ICrafting var1 = (ICrafting) var2.next();
- for (int i = 0; i < 9; i++) {
- var1.sendProgressBarUpdate(this, 100 + i, this.mTargetSlots[i]);
- }
- }
- }
-
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 100:
- this.mTargetSlots[0] = par2;
- break;
- case 101:
- this.mTargetSlots[1] = par2;
- break;
- case 102:
- this.mTargetSlots[2] = par2;
- break;
- case 103:
- this.mTargetSlots[3] = par2;
- break;
- case 104:
- this.mTargetSlots[4] = par2;
- break;
- case 105:
- this.mTargetSlots[5] = par2;
- break;
- case 106:
- this.mTargetSlots[6] = par2;
- break;
- case 107:
- this.mTargetSlots[7] = par2;
- break;
- case 108:
- this.mTargetSlots[8] = par2;
- }
- }
-
- public int getSlotCount() {
- return 10;
- }
-
- public int getShiftClickSlotCount() {
- return 10;
- }
-}
+package gregtech.common.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.automation.GT_MetaTileEntity_Regulator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +import java.util.Iterator; + +public class GT_Container_Regulator + extends GT_ContainerMetaTile_Machine { + public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0}; + + public GT_Container_Regulator(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + this.mTargetSlots = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0}; + + addSlotToContainer(new Slot(this.mTileEntity, 0, 8, 6)); + addSlotToContainer(new Slot(this.mTileEntity, 1, 26, 6)); + addSlotToContainer(new Slot(this.mTileEntity, 2, 44, 6)); + addSlotToContainer(new Slot(this.mTileEntity, 3, 8, 24)); + addSlotToContainer(new Slot(this.mTileEntity, 4, 26, 24)); + addSlotToContainer(new Slot(this.mTileEntity, 5, 44, 24)); + addSlotToContainer(new Slot(this.mTileEntity, 6, 8, 42)); + addSlotToContainer(new Slot(this.mTileEntity, 7, 26, 42)); + addSlotToContainer(new Slot(this.mTileEntity, 8, 44, 42)); + + addSlotToContainer(new Slot(this.mTileEntity, 19, 44, 63)); + + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 9, 64, 7, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 81, 7, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 11, 98, 7, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 12, 64, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 13, 81, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 14, 98, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 15, 64, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 16, 81, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 17, 98, 41, false, true, 1)); + + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 7, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 7, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 7, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 119, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 136, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 153, 41, false, true, 1)); + + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 18, 8, 63, false, true, 1)); + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex < 10) { + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex); + if (tSlot != null) { + if (this.mTileEntity.getMetaTileEntity() == null) { + return null; + } + if (aSlotIndex == 28) { + ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput); + if (((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).bOutput) { + GT_Utility.sendChatToPlayer(aPlayer, trans("116", "Emit Energy to Outputside")); + } else { + GT_Utility.sendChatToPlayer(aPlayer, trans("117", "Don't emit Energy")); + } + return null; + } + if ((aSlotIndex < 19)) { + ItemStack tStack = aPlayer.inventory.getItemStack(); + if (tStack != null) { + tSlot.putStack(GT_Utility.copy(new Object[]{tStack})); + } else if (tSlot.getStack() != null) { + if (aMouseclick == 0) { + tSlot.getStack().stackSize -= (aShifthold == 1 ? 8 : 1); + if (tSlot.getStack().stackSize <= 0) { + tSlot.putStack(null); + } + } else { + tSlot.getStack().stackSize += (aShifthold == 1 ? 8 : 1); + if (tSlot.getStack().stackSize > tSlot.getStack().getMaxStackSize()) { + tSlot.getStack().stackSize = tSlot.getStack().getMaxStackSize(); + } + } + } + return null; + } + if ((aSlotIndex < 28)) { + ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 19)] = Math.min(99, Math.max(0, ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[(aSlotIndex - 19)] + (aMouseclick == 0 ? -1 : 1) * (aShifthold == 0 ? 1 : 16))); + return null; + } + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) { + return; + } + this.mTargetSlots = new int[9]; + for (int i = 0; i < 9; i++) { + this.mTargetSlots[i] = ((GT_MetaTileEntity_Regulator) this.mTileEntity.getMetaTileEntity()).mTargetSlots[i]; + } + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting) var2.next(); + for (int i = 0; i < 9; i++) { + var1.sendProgressBarUpdate(this, 100 + i, this.mTargetSlots[i]); + } + } + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100: + this.mTargetSlots[0] = par2; + break; + case 101: + this.mTargetSlots[1] = par2; + break; + case 102: + this.mTargetSlots[2] = par2; + break; + case 103: + this.mTargetSlots[3] = par2; + break; + case 104: + this.mTargetSlots[4] = par2; + break; + case 105: + this.mTargetSlots[5] = par2; + break; + case 106: + this.mTargetSlots[6] = par2; + break; + case 107: + this.mTargetSlots[7] = par2; + break; + case 108: + this.mTargetSlots[8] = par2; + } + } + + public int getSlotCount() { + return 10; + } + + public int getShiftClickSlotCount() { + return 10; + } +} diff --git a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java index f381ffc9d7..ace4306608 100644 --- a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java +++ b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java @@ -1,92 +1,92 @@ -package gregtech.common.items;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
-import gregtech.api.items.GT_Generic_Item;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.IIcon;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-
-import java.util.List;
-
-public class GT_FluidDisplayItem
- extends GT_Generic_Item {
- public GT_FluidDisplayItem() {
- super("GregTech_FluidDisplay", "Fluid Display", null);
- ItemList.Display_Fluid.set(this);
- }
-
- protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- NBTTagCompound aNBT = aStack.getTagCompound();
- if (GT_Values.D1) {
- Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage());
- if (tFluid != null) {
- aList.add("Registry: " + tFluid.getName());
- }
- }
- if (aNBT != null) {
- long tToolTipAmount = aNBT.getLong("mFluidDisplayAmount");
- if (tToolTipAmount > 0L) {
- aList.add(EnumChatFormatting.BLUE + String.format(trans("016", "Amount: %s L"), "" + tToolTipAmount) + EnumChatFormatting.GRAY);
- }
- aList.add(EnumChatFormatting.RED + String.format(trans("017", "Temperature: %s K"), "" + aNBT.getLong("mFluidDisplayHeat")) + EnumChatFormatting.GRAY);
- aList.add(EnumChatFormatting.GREEN + String.format(trans("018", "State: %s"), aNBT.getBoolean("mFluidState") ? "Gas" : "Liquid") + EnumChatFormatting.GRAY);
- }
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister aIconRegister) {
- }
-
- public IIcon getIconFromDamage(int aMeta) {
- Fluid tFluid = FluidRegistry.getFluid(aMeta);
- return tFluid == null ? FluidRegistry.WATER.getStillIcon() : tFluid.getStillIcon();
- }
-
- @SideOnly(Side.CLIENT)
- public int getColorFromItemStack(ItemStack aStack, int aRenderPass) {
- Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage());
- return tFluid == null ? 16777215 : tFluid.getColor();
- }
-
- public int getSpriteNumber() {
- return 0;
- }
-
- public String getUnlocalizedName(ItemStack aStack) {
- if (aStack != null) {
- return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), false);
- }
- return "";
- }
-
- public String getItemStackDisplayName(ItemStack aStack) {
- if (aStack != null) {
- return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), true);
- }
- return "";
- }
-
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item aItem, CreativeTabs aTab, List aList) {
- if (GT_Values.D1) {
- int i = 0;
- for (int j = FluidRegistry.getMaxID(); i < j; i++) {
- ItemStack tStack = GT_Utility.getFluidDisplayStack(FluidRegistry.getFluid(i));
- if (tStack != null) {
- aList.add(tStack);
- }
- }
- }
- }
-}
+package gregtech.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.items.GT_Generic_Item; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +import java.util.List; + +public class GT_FluidDisplayItem + extends GT_Generic_Item { + public GT_FluidDisplayItem() { + super("GregTech_FluidDisplay", "Fluid Display", null); + ItemList.Display_Fluid.set(this); + } + + protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (GT_Values.D1) { + Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage()); + if (tFluid != null) { + aList.add("Registry: " + tFluid.getName()); + } + } + if (aNBT != null) { + long tToolTipAmount = aNBT.getLong("mFluidDisplayAmount"); + if (tToolTipAmount > 0L) { + aList.add(EnumChatFormatting.BLUE + String.format(trans("016", "Amount: %s L"), "" + tToolTipAmount) + EnumChatFormatting.GRAY); + } + aList.add(EnumChatFormatting.RED + String.format(trans("017", "Temperature: %s K"), "" + aNBT.getLong("mFluidDisplayHeat")) + EnumChatFormatting.GRAY); + aList.add(EnumChatFormatting.GREEN + String.format(trans("018", "State: %s"), aNBT.getBoolean("mFluidState") ? "Gas" : "Liquid") + EnumChatFormatting.GRAY); + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aIconRegister) { + } + + public IIcon getIconFromDamage(int aMeta) { + Fluid tFluid = FluidRegistry.getFluid(aMeta); + return tFluid == null ? FluidRegistry.WATER.getStillIcon() : tFluid.getStillIcon(); + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack aStack, int aRenderPass) { + Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage()); + return tFluid == null ? 16777215 : tFluid.getColor(); + } + + public int getSpriteNumber() { + return 0; + } + + public String getUnlocalizedName(ItemStack aStack) { + if (aStack != null) { + return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), false); + } + return ""; + } + + public String getItemStackDisplayName(ItemStack aStack) { + if (aStack != null) { + return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), true); + } + return ""; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item aItem, CreativeTabs aTab, List aList) { + if (GT_Values.D1) { + int i = 0; + for (int j = FluidRegistry.getMaxID(); i < j; i++) { + ItemStack tStack = GT_Utility.getFluidDisplayStack(FluidRegistry.getFluid(i)); + if (tStack != null) { + aList.add(tStack); + } + } + } + } +} diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index 10658125bf..92eb3af4d2 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -1,112 +1,112 @@ -package gregtech.common.items;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.items.GT_Generic_Item;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_ModHandler;
-import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
-import java.util.List;
-
-import static gregtech.GT_Mod.GT_FML_LOGGER;
-
-public class GT_IntegratedCircuit_Item extends GT_Generic_Item {
- private final static String aTextEmptyRow = " ";
- public GT_IntegratedCircuit_Item() {
- super("integrated_circuit", "Programmed Circuit", "");
- setHasSubtypes(true);
- setMaxDamage(0);
-
- ItemList.Circuit_Integrated.set(this);
-
-
- GT_ModHandler.addShapelessCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 0L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{OrePrefixes.circuit.get(Materials.Basic)});
- long bits = GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE;
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 1L, new Object[0]), bits, new Object[]{"d ", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 2L, new Object[0]), bits, new Object[]{" d ", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 3L, new Object[0]), bits, new Object[]{" d", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 4L, new Object[0]), bits, new Object[]{aTextEmptyRow, " Pd", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 5L, new Object[0]), bits, new Object[]{aTextEmptyRow, " P ", " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 6L, new Object[0]), bits, new Object[]{aTextEmptyRow, " P ", " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 7L, new Object[0]), bits, new Object[]{aTextEmptyRow, " P ", "d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 8L, new Object[0]), bits, new Object[]{aTextEmptyRow, "dP ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
-
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 9L, new Object[0]), bits, new Object[]{"P d", aTextEmptyRow, aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 10L, new Object[0]), bits, new Object[]{"P ", " d", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 11L, new Object[0]), bits, new Object[]{"P ", aTextEmptyRow, " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 12L, new Object[0]), bits, new Object[]{"P ", aTextEmptyRow, " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 13L, new Object[0]), bits, new Object[]{" P", aTextEmptyRow, " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 14L, new Object[0]), bits, new Object[]{" P", aTextEmptyRow, " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 15L, new Object[0]), bits, new Object[]{" P", aTextEmptyRow, "d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 16L, new Object[0]), bits, new Object[]{" P", "d ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 17L, new Object[0]), bits, new Object[]{aTextEmptyRow, aTextEmptyRow, "d P", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 18L, new Object[0]), bits, new Object[]{aTextEmptyRow, "d ", " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 19L, new Object[0]), bits, new Object[]{"d ", aTextEmptyRow, " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 20L, new Object[0]), bits, new Object[]{" d ", aTextEmptyRow, " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 21L, new Object[0]), bits, new Object[]{"d ", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 22L, new Object[0]), bits, new Object[]{" d ", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 23L, new Object[0]), bits, new Object[]{" d", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 24L, new Object[0]), bits, new Object[]{aTextEmptyRow, " d", "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])});
- }
-
- private static String getModeString(int aMetaData) {
- switch ((byte) (aMetaData >>> 8)) {
- case 0:
- return "==";
- case 1:
- return "<=";
- case 2:
- return ">=";
- case 3:
- return "<";
- case 4:
- return ">";
- }
- return "";
- }
-
- private static String getConfigurationString(int aMetaData) {
- return getModeString(aMetaData) + " " + (byte) (aMetaData & 0xFF);
- }
-
- public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- super.addAdditionalToolTips(aList, aStack, aPlayer);
- aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".configuration").toString(), "Configuration: ") + getConfigurationString(getDamage(aStack)));
- }
-
- public String getUnlocalizedName(ItemStack aStack) {
- return getUnlocalizedName();
- }
-
- @SideOnly(Side.CLIENT)
- public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
- aList.add(new ItemStack(this, 1, 0));
- }
-
- @SideOnly(Side.CLIENT)
- public void registerIcons(IIconRegister aIconRegister) {
- super.registerIcons(aIconRegister);
- if (GregTech_API.sPostloadFinished) {
- GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase");
- GT_FML_LOGGER.info("GT_Mod: Starting Item Icon Load Phase");
- GregTech_API.sItemIcons = aIconRegister;
- try {
- for (Runnable tRunnable : GregTech_API.sGTItemIconload) {
- tRunnable.run();
- }
- } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
- GT_Log.out.println("GT_Mod: Finished Item Icon Load Phase");
- GT_FML_LOGGER.info("GT_Mod: Finished Item Icon Load Phase");
- }
- }
-}
+package gregtech.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.items.GT_Generic_Item; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.List; + +import static gregtech.GT_Mod.GT_FML_LOGGER; + +public class GT_IntegratedCircuit_Item extends GT_Generic_Item { + private final static String aTextEmptyRow = " "; + public GT_IntegratedCircuit_Item() { + super("integrated_circuit", "Programmed Circuit", ""); + setHasSubtypes(true); + setMaxDamage(0); + + ItemList.Circuit_Integrated.set(this); + + + GT_ModHandler.addShapelessCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 0L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{OrePrefixes.circuit.get(Materials.Basic)}); + long bits = GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE; + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 1L, new Object[0]), bits, new Object[]{"d ", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 2L, new Object[0]), bits, new Object[]{" d ", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 3L, new Object[0]), bits, new Object[]{" d", " P ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 4L, new Object[0]), bits, new Object[]{aTextEmptyRow, " Pd", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 5L, new Object[0]), bits, new Object[]{aTextEmptyRow, " P ", " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 6L, new Object[0]), bits, new Object[]{aTextEmptyRow, " P ", " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 7L, new Object[0]), bits, new Object[]{aTextEmptyRow, " P ", "d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 8L, new Object[0]), bits, new Object[]{aTextEmptyRow, "dP ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 9L, new Object[0]), bits, new Object[]{"P d", aTextEmptyRow, aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 10L, new Object[0]), bits, new Object[]{"P ", " d", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 11L, new Object[0]), bits, new Object[]{"P ", aTextEmptyRow, " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 12L, new Object[0]), bits, new Object[]{"P ", aTextEmptyRow, " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 13L, new Object[0]), bits, new Object[]{" P", aTextEmptyRow, " d", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 14L, new Object[0]), bits, new Object[]{" P", aTextEmptyRow, " d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 15L, new Object[0]), bits, new Object[]{" P", aTextEmptyRow, "d ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 16L, new Object[0]), bits, new Object[]{" P", "d ", aTextEmptyRow, 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 17L, new Object[0]), bits, new Object[]{aTextEmptyRow, aTextEmptyRow, "d P", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 18L, new Object[0]), bits, new Object[]{aTextEmptyRow, "d ", " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 19L, new Object[0]), bits, new Object[]{"d ", aTextEmptyRow, " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 20L, new Object[0]), bits, new Object[]{" d ", aTextEmptyRow, " P", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 21L, new Object[0]), bits, new Object[]{"d ", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 22L, new Object[0]), bits, new Object[]{" d ", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 23L, new Object[0]), bits, new Object[]{" d", aTextEmptyRow, "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + GT_ModHandler.addCraftingRecipe(ItemList.Circuit_Integrated.getWithDamage(1L, 24L, new Object[0]), bits, new Object[]{aTextEmptyRow, " d", "P ", 'P', ItemList.Circuit_Integrated.getWildcard(1L, new Object[0])}); + } + + private static String getModeString(int aMetaData) { + switch ((byte) (aMetaData >>> 8)) { + case 0: + return "=="; + case 1: + return "<="; + case 2: + return ">="; + case 3: + return "<"; + case 4: + return ">"; + } + return ""; + } + + private static String getConfigurationString(int aMetaData) { + return getModeString(aMetaData) + " " + (byte) (aMetaData & 0xFF); + } + + public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + super.addAdditionalToolTips(aList, aStack, aPlayer); + aList.add(GT_LanguageManager.addStringLocalization(new StringBuilder().append(getUnlocalizedName()).append(".configuration").toString(), "Configuration: ") + getConfigurationString(getDamage(aStack))); + } + + public String getUnlocalizedName(ItemStack aStack) { + return getUnlocalizedName(); + } + + @SideOnly(Side.CLIENT) + public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { + aList.add(new ItemStack(this, 1, 0)); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aIconRegister) { + super.registerIcons(aIconRegister); + if (GregTech_API.sPostloadFinished) { + GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Starting Item Icon Load Phase"); + GregTech_API.sItemIcons = aIconRegister; + try { + for (Runnable tRunnable : GregTech_API.sGTItemIconload) { + tRunnable.run(); + } + } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + GT_Log.out.println("GT_Mod: Finished Item Icon Load Phase"); + GT_FML_LOGGER.info("GT_Mod: Finished Item Icon Load Phase"); + } + } +} diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java index 2708e3777e..d1bc513328 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java @@ -1,481 +1,481 @@ -package gregtech.common.items;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.items.GT_MetaGenerated_Item_X32;
-import gregtech.api.objects.GT_CopiedBlockTexture;
-import gregtech.api.objects.ItemData;
-import gregtech.api.util.*;
-import gregtech.common.items.behaviors.Behaviour_Arrow;
-import net.minecraft.dispenser.IBlockSource;
-import net.minecraft.enchantment.Enchantment;
-import net.minecraft.enchantment.EnumEnchantmentType;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-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.EnumAction;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.potion.Potion;
-import net.minecraft.world.World;
-
-public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 {
- public static GT_MetaGenerated_Item_02 INSTANCE;
- private final static String aTextCover = "Usable as Cover"; private final static String aTextForestry = "Forestry";
-
- public GT_MetaGenerated_Item_02() {
- super("metaitem.02", OrePrefixes.toolHeadSword, OrePrefixes.toolHeadPickaxe, OrePrefixes.toolHeadShovel, OrePrefixes.toolHeadAxe, OrePrefixes.toolHeadHoe, OrePrefixes.toolHeadHammer, OrePrefixes.toolHeadFile, OrePrefixes.toolHeadSaw, OrePrefixes.toolHeadDrill, OrePrefixes.toolHeadChainsaw, OrePrefixes.toolHeadWrench, OrePrefixes.toolHeadUniversalSpade, OrePrefixes.toolHeadSense, OrePrefixes.toolHeadPlow, OrePrefixes.toolHeadArrow, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, null, OrePrefixes.itemCasing, OrePrefixes.wireFine, OrePrefixes.gearGtSmall, OrePrefixes.rotor, OrePrefixes.stickLong, OrePrefixes.springSmall, OrePrefixes.spring, OrePrefixes.arrowGtWood, OrePrefixes.arrowGtPlastic, OrePrefixes.gemChipped, OrePrefixes.gemFlawed, OrePrefixes.gemFlawless, OrePrefixes.gemExquisite, OrePrefixes.gearGt);
- INSTANCE = this;
-
- int tLastID = 0;
-
- ItemList.ThermosCan_Dark_Coffee.set(addItem(tLastID = 0, "Dark Coffee", "Coffee, dark, without anything else", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 1, 70, Potion.digSpeed.id, 400, 1, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L)));
- ItemList.ThermosCan_Dark_Cafe_au_lait.set(addItem(tLastID = 1, "Dark Coffee au lait", "Keeping you awake the whole night", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 2, 90, Potion.digSpeed.id, 400, 2, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 3L)));
- ItemList.ThermosCan_Coffee.set(addItem(tLastID = 2, "Coffee", "Just the regular morning Coffee", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 0, 50, Potion.digSpeed.id, 400, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L)));
- ItemList.ThermosCan_Cafe_au_lait.set(addItem(tLastID = 3, "Cafe au lait", "Sweet Coffee", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 1, 70, Potion.digSpeed.id, 400, 1, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L)));
- ItemList.ThermosCan_Lait_au_cafe.set(addItem(tLastID = 4, "Lait au cafe", "You want Coffee to your Sugar?", SubTag.INVISIBLE, new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 2, 90, Potion.digSpeed.id, 400, 2, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 3L)));
- ItemList.ThermosCan_Dark_Chocolate_Milk.set(addItem(tLastID = 5, "Dark Chocolate Milk", "A bit bitter, better add a bit Sugar", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 50, 1, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
- ItemList.ThermosCan_Chocolate_Milk.set(addItem(tLastID = 6, "Chocolate Milk", "Sweet Goodness", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 50, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 2L)));
- ItemList.ThermosCan_Tea.set(addItem(tLastID = 7, "Tea", "Keep calm and carry on", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 300, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L)));
- ItemList.ThermosCan_Sweet_Tea.set(addItem(tLastID = 8, "Sweet Tea", "How about a Tea Party? In Boston?", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L)));
- ItemList.ThermosCan_Ice_Tea.set(addItem(tLastID = 9, "Ice Tea", "Better than this purple Junk Drink from failed Potions", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 300, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L)));
-
- ItemList.GelledToluene.set(addItem(tLastID = 10, "Gelled Toluene", "Raw Explosive"));
-
- ItemList.Bottle_Purple_Drink.set(addItem(tLastID = 100, "Purple Drink", "How about Lemonade. Or some Ice Tea? I got Purple Drink!", new GT_FoodStat(8, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 400, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 1L)));
- ItemList.Bottle_Grape_Juice.set(addItem(tLastID = 101, "Grape Juice", "This has a cleaning effect on your internals.", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 1, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
- ItemList.Bottle_Wine.set(addItem(tLastID = 102, "Wine", "Ordinary", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 60, Potion.heal.id, 0, 0, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
- ItemList.Bottle_Vinegar.set(addItem(tLastID = 103, "Vinegar", "Exquisite", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 90, Potion.heal.id, 0, 1, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
- ItemList.Bottle_Potato_Juice.set(addItem(tLastID = 104, "Potato Juice", "Ever seen Potato Juice in stores? No? That has a reason.", SubTag.INVISIBLE, new GT_FoodStat(3, 0.3F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L)));
- ItemList.Bottle_Vodka.set(addItem(tLastID = 105, "Vodka", "Not to confuse with Water", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 500, 0, 60, Potion.damageBoost.id, 500, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L)));
- ItemList.Bottle_Leninade.set(addItem(tLastID = 106, "Leninade", "Let the Communism flow through you!", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 500, 1, 90, Potion.damageBoost.id, 500, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L)));
- ItemList.Bottle_Mineral_Water.set(addItem(tLastID = 107, "Mineral Water", "The best Stuff you can drink to stay healthy", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 100, 1, 10), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
- ItemList.Bottle_Salty_Water.set(addItem(tLastID = 108, "Salty Water", "Like Sea Water but less dirty", SubTag.INVISIBLE, new GT_FoodStat(1, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 2, 95), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TEMPESTAS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Bottle_Reed_Water.set(addItem(tLastID = 109, "Reed Water", "I guess this tastes better when fermented", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L)));
- ItemList.Bottle_Rum.set(addItem(tLastID = 110, "Rum", "A buddle o' rum", SubTag.INVISIBLE, new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 0, 60, Potion.damageBoost.id, 300, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L)));
- ItemList.Bottle_Pirate_Brew.set(addItem(tLastID = 111, "Pirate Brew", "Set the Sails, we are going to Torrentuga!", SubTag.INVISIBLE, new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 1, 90, Potion.damageBoost.id, 300, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 2L)));
- ItemList.Bottle_Hops_Juice.set(addItem(tLastID = 112, "Hops Juice", "Every Beer has a start", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L)));
- ItemList.Bottle_Dark_Beer.set(addItem(tLastID = 113, "Dark Beer", "Dark Beer, for the real Men", new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 1, 60, Potion.damageBoost.id, 300, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L)));
- ItemList.Bottle_Dragon_Blood.set(addItem(tLastID = 114, "Dragon Blood", "FUS RO DAH!", SubTag.INVISIBLE, new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 2, 90, Potion.damageBoost.id, 300, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L)));
- ItemList.Bottle_Wheaty_Juice.set(addItem(tLastID = 115, "Wheaty Juice", "Is this liquefied Bread or what?", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L)));
- ItemList.Bottle_Scotch.set(addItem(tLastID = 116, "Scotch", "Technically this is just a Whisky", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.resistance.id, 400, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)));
- ItemList.Bottle_Glen_McKenner.set(addItem(tLastID = 117, "Glen McKenner", "Don't hand to easily surprised people, they will shatter it.", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 90, Potion.resistance.id, 400, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)));
- ItemList.Bottle_Wheaty_Hops_Juice.set(addItem(tLastID = 118, "Wheaty Hops Juice", "Also known as 'Duff-Lite'", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 2L)));
- ItemList.Bottle_Beer.set(addItem(tLastID = 119, "Beer", "Good old Beer", new GT_FoodStat(6, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.digSpeed.id, 400, 2, 60, Potion.poison.id, 100, 0, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L)));
- ItemList.Bottle_Chilly_Sauce.set(addItem(tLastID = 120, "Chilly Sauce", "Spicy", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 1000, 0, 10, Potion.fireResistance.id, 1000, 0, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Bottle_Hot_Sauce.set(addItem(tLastID = 121, "Hot Sauce", "Very Spicy, I guess?", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 2000, 0, 30, Potion.fireResistance.id, 2000, 0, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L)));
- ItemList.Bottle_Diabolo_Sauce.set(addItem(tLastID = 122, "Diabolo Sauce", "As if the Devil made this Sauce", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 3000, 1, 50, Potion.fireResistance.id, 3000, 0, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 3L)));
- ItemList.Bottle_Diablo_Sauce.set(addItem(tLastID = 123, "Diablo Sauce", "Diablo always comes back!", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 4000, 1, 70, Potion.fireResistance.id, 4000, 0, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 4L)));
- ItemList.Bottle_Snitches_Glitch_Sauce.set(addItem(tLastID = 124, "Old Man Snitches glitched Diablo Sauce", "[Missing No]", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 9999, 2, 999, Potion.fireResistance.id, 9999, 9, 999), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 5L)));
- ItemList.Bottle_Apple_Juice.set(addItem(tLastID = 125, "Apple Juice", "Made of the Apples from our best Oak Farms", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 0, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L)));
- ItemList.Bottle_Cider.set(addItem(tLastID = 126, "Cider", "If you have nothing better to do with your Apples", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.resistance.id, 400, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)));
- ItemList.Bottle_Golden_Apple_Juice.set(addItem(tLastID = 127, "Golden Apple Juice", "A golden Apple in liquid form", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 0, 20, Potion.field_76444_x.id, 2400, 0, 100, Potion.regeneration.id, 100, 1, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
- ItemList.Bottle_Golden_Cider.set(addItem(tLastID = 128, "Golden Cider", "More Resistance, less Regeneration", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.field_76444_x.id, 2400, 1, 95, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)));
- ItemList.Bottle_Iduns_Apple_Juice.set(addItem(tLastID = 129, "Idun's Apple Juice", "So you got the Idea of using Notch Apples for a drink?", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 600, 4, 100, Potion.field_76444_x.id, 2400, 0, 100, Potion.resistance.id, 6000, 0, 100, Potion.fireResistance.id, 6000, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 9L)));
- ItemList.Bottle_Notches_Brew.set(addItem(tLastID = 130, "Notches Brew", "This is just overpowered", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 700, 4, 95, Potion.field_76444_x.id, 3000, 1, 95, Potion.resistance.id, 7000, 1, 95, Potion.fireResistance.id, 7000, 0, 95, Potion.harm.id, 0, 2, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 9L)));
- ItemList.Bottle_Lemon_Juice.set(addItem(tLastID = 131, "Lemon Juice", "Maybe adding Sugar will make it less sour", new GT_FoodStat(2, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 1200, 0, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L)));
- ItemList.Bottle_Limoncello.set(addItem(tLastID = 132, "Limoncello", "An alcoholic Drink which tastes like Lemons", SubTag.INVISIBLE, new GT_FoodStat(2, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 1200, 0, 90, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L)));
- ItemList.Bottle_Lemonade.set(addItem(tLastID = 133, "Lemonade", "Cold and refreshing Lemonade", new GT_FoodStat(4, 0.3F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 900, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L)));
- ItemList.Bottle_Alcopops.set(addItem(tLastID = 134, "Alcopops", "Don't let your Children drink this junk!", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 900, 1, 90, Potion.poison.id, 300, 2, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 1L)));
- ItemList.Bottle_Cave_Johnsons_Grenade_Juice.set(addItem(tLastID = 135, "Cave Johnson's Grenade Juice", "When life gives you Lemons, make Life take them Lemons back!", SubTag.INVISIBLE, new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false).setExplosive(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MORTUUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 1L)));
- ItemList.Bottle_Milk.set(addItem(tLastID = 136, "Milk", "Got Milk?", OrePrefixes.bottle.get(Materials.Milk), new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false).setMilk(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
- ItemList.Bottle_Holy_Water.set(addItem(tLastID = 137, "Holy Water", "May the holy Planks be with you", OrePrefixes.bottle.get(Materials.HolyWater), new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.poison.id, 100, 1, 100).setMilk(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L)));
-
-
-
- ItemList.Food_Potato_On_Stick.set(addItem(tLastID = 200, "Potato on a Stick", "Totally looks like a Crab Claw", new GT_FoodStat(1, 0.3F, EnumAction.eat, new ItemStack(Items.stick, 1), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- ItemList.Food_Potato_On_Stick_Roasted.set(addItem(tLastID = 201, "Roasted Potato on a Stick", "Still looks like a Crab Claw", new GT_FoodStat(6, 0.6F, EnumAction.eat, new ItemStack(Items.stick, 1), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Raw_Fries.set(addItem(tLastID = 202, "Potato Strips", "It's Potato in Stripe Form", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
- ItemList.Food_Fries.set(addItem(tLastID = 203, "Fries", "Not to confuse with Fry the Delivery Boy", new GT_FoodStat(7, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
- ItemList.Food_Packaged_Fries.set(addItem(tLastID = 204, "Fries", "Ketchup not included", new GT_FoodStat(7, 0.5F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Paper, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Raw_PotatoChips.set(addItem(tLastID = 205, "Potato Chips (Raw)", "Just like a Potato", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
- ItemList.Food_PotatoChips.set(addItem(tLastID = 206, "Potato Chips", "Crunchy", new GT_FoodStat(7, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
- ItemList.Food_ChiliChips.set(addItem(tLastID = 207, "Chili Chips", "Spicy", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
- ItemList.Food_Packaged_PotatoChips.set(addItem(tLastID = 208, "Bag of Potato Chips", "Full of delicious Air", new GT_FoodStat(7, 0.5F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Packaged_ChiliChips.set(addItem(tLastID = 209, "Bag of Chili Chips", "Stop making noises Baj!", new GT_FoodStat(7, 0.6F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Chum.set(addItem(tLastID = 210, "Chum", "Chum is Fum!", new GT_FoodStat(5, 0.2F, EnumAction.eat, null, true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Chum_On_Stick.set(addItem(tLastID = 211, "Chum on a Stick", "Don't forget to try our Chum-balaya", new GT_FoodStat(5, 0.2F, EnumAction.eat, new ItemStack(Items.stick, 1), true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Dough_Sugar.set(addItem(tLastID = 212, "Sugary Dough", "Don't eat the Dough before it is baken", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Dough_Chocolate.set(addItem(tLastID = 213, "Chocolate Dough", "I said don't eat the Dough!", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Raw_Cookie.set(addItem(tLastID = 214, "Cookie shaped Dough", "For baking Cookies", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
-
- ItemList.Food_Sliced_Buns.set(addItem(tLastID = 220, "Buns", "Pre Sliced", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Burger_Veggie.set(addItem(tLastID = 221, "Veggieburger", "No matter how you call this, this is NOT a Burger!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Burger_Cheese.set(addItem(tLastID = 222, "Cheeseburger", "Cheesy!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new ItemData(Materials.Cheese, 907200L)));
- ItemList.Food_Burger_Meat.set(addItem(tLastID = 223, "Hamburger", "The Mc Burger Queen Burger", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Burger_Chum.set(addItem(tLastID = 224, "Chumburger", "Fum is Chum!", new GT_FoodStat(5, 0.2F, EnumAction.eat, null, true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
-
- ItemList.Food_Sliced_Breads.set(addItem(tLastID = 230, "Breads", "Pre Sliced", new GT_FoodStat(5, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Sandwich_Veggie.set(addItem(tLastID = 231, "Veggie Sandwich", "Meatless", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 32L);
- ItemList.Food_Sandwich_Cheese.set(addItem(tLastID = 232, "Cheese Sandwich", "Say Cheese!", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 32L);
- ItemList.Food_Sandwich_Bacon.set(addItem(tLastID = 233, "Bacon Sandwich", "The best Sandwich ever!", new GT_FoodStat(10, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 32L);
- ItemList.Food_Sandwich_Steak.set(addItem(tLastID = 234, "Steak Sandwich", "Not a 'Steam Sandwich'", new GT_FoodStat(10, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 32L);
-
- ItemList.Food_Sliced_Baguettes.set(addItem(tLastID = 240, "Baguettes", "Pre Sliced", new GT_FoodStat(8, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Large_Sandwich_Veggie.set(addItem(tLastID = 241, "Large Veggie Sandwich", "Just not worth it", new GT_FoodStat(15, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
- ItemList.Food_Large_Sandwich_Cheese.set(addItem(tLastID = 242, "Large Cheese Sandwich", "I need another cheesy tooltip for this", new GT_FoodStat(15, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
- ItemList.Food_Large_Sandwich_Bacon.set(addItem(tLastID = 243, "Large Bacon Sandwich", "For Men! (and manly Women)", new GT_FoodStat(20, 1.0F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
- ItemList.Food_Large_Sandwich_Steak.set(addItem(tLastID = 244, "Large Steak Sandwich", "Yes, I once accidentially called it 'Steam Sandwich'", new GT_FoodStat(20, 1.0F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- setFluidContainerStats(32000 + tLastID, 0L, 16L);
-
- ItemList.Food_Raw_Pizza_Veggie.set(addItem(tLastID = 250, "Raw Veggie Pizza", "Into the Oven with it!", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Raw_Pizza_Cheese.set(addItem(tLastID = 251, "Raw Cheese Pizza", "Into the Oven with it!", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Raw_Pizza_Meat.set(addItem(tLastID = 252, "Raw Mince Meat Pizza", "Into the Oven with it!", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
-
- ItemList.Food_Baked_Pizza_Veggie.set(addItem(tLastID = 260, "Veggie Pizza", "The next they want is Gluten Free Pizzas...", new GT_FoodStat(3, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Baked_Pizza_Cheese.set(addItem(tLastID = 261, "Cheese Pizza", "Pizza Magarita", new GT_FoodStat(4, 0.4F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Baked_Pizza_Meat.set(addItem(tLastID = 262, "Mince Meat Pizza", "Emo Pizza, it cuts itself!", new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
-
-
- ItemList.Dye_Indigo.set(addItem(tLastID = 410, "Indigo Dye", "Blue Dye", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), Dyes.dyeBlue));
- for (byte i = 0; i < 16; i = (byte) (i + 1)) {
- ItemList.DYE_ONLY_ITEMS[i].set(addItem(tLastID = 414 + i, Dyes.get(i).mName + " Dye", "", Dyes.get(i).name(), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L)));
- }
- ItemList.Plank_Oak.set(addItem(tLastID = 470, "Oak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Spruce.set(addItem(tLastID = 471, "Spruce Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Birch.set(addItem(tLastID = 472, "Birch Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Jungle.set(addItem(tLastID = 473, "Jungle Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Acacia.set(addItem(tLastID = 474, "Acacia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_DarkOak.set(addItem(tLastID = 475, "Dark Oak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Larch.set(addItem(tLastID = 476, "Larch Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Teak.set(addItem(tLastID = 477, "Teak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Acacia_Green.set(addItem(tLastID = 478, "Green Acacia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Lime.set(addItem(tLastID = 479, "Lime Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Chestnut.set(addItem(tLastID = 480, "Chestnut Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Wenge.set(addItem(tLastID = 481, "Wenge Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Baobab.set(addItem(tLastID = 482, "Baobab Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Sequoia.set(addItem(tLastID = 483, "Sequoia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Kapok.set(addItem(tLastID = 484, "Kapok Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Ebony.set(addItem(tLastID = 485, "Ebony Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Mahagony.set(addItem(tLastID = 486, "Mahagony Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Balsa.set(addItem(tLastID = 487, "Balsa Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Willow.set(addItem(tLastID = 488, "Willow Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Walnut.set(addItem(tLastID = 489, "Walnut Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Greenheart.set(addItem(tLastID = 490, "Greenheart Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Cherry.set(addItem(tLastID = 491, "Cherry Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Mahoe.set(addItem(tLastID = 492, "Mahoe Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Poplar.set(addItem(tLastID = 493, "Poplar Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Palm.set(addItem(tLastID = 494, "Palm Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Papaya.set(addItem(tLastID = 495, "Papaya Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Pine.set(addItem(tLastID = 496, "Pine Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Plum.set(addItem(tLastID = 497, "Plum Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Maple.set(addItem(tLastID = 498, "Maple Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
- ItemList.Plank_Citrus.set(addItem(tLastID = 499, "Citrus Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 75);
-
- ItemList.SFMixture.set(addItem(tLastID = 270, "Super Fuel Binder", "Raw Material"));
- ItemList.MSFMixture.set(addItem(tLastID = 271, "Magic Super Fuel Binder", "Raw Material"));
-
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Oak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 0)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Spruce.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 1)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Birch.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 2)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Jungle.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 3)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Acacia.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 4)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_DarkOak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 5)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Larch.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 0)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Teak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 1)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Acacia_Green.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 2)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Lime.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 3)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Chestnut.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 4)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Wenge.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 5)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Baobab.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 6)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Sequoia.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 7)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Kapok.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 0)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Ebony.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 1)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Mahagony.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 2)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Balsa.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 3)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Willow.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 4)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Walnut.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 5)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Greenheart.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 6)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Cherry.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 7)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Mahoe.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 0)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Poplar.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 1)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Palm.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 2)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Papaya.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 3)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Pine.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 4)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Plum.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 5)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Maple.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 6)});
- GT_ModHandler.addCraftingRecipe(ItemList.Plank_Citrus.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 7)});
-
- GregTech_API.registerCover(ItemList.Plank_Oak.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 0), null);
- GregTech_API.registerCover(ItemList.Plank_Spruce.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 1), null);
- GregTech_API.registerCover(ItemList.Plank_Birch.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 2), null);
- GregTech_API.registerCover(ItemList.Plank_Jungle.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 3), null);
- GregTech_API.registerCover(ItemList.Plank_Acacia.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 4), null);
- GregTech_API.registerCover(ItemList.Plank_DarkOak.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 5), null);
- GregTech_API.registerCover(ItemList.Plank_Larch.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 0, new ItemStack(Blocks.planks, 1, 0))), 0, 0), null);
- GregTech_API.registerCover(ItemList.Plank_Teak.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 1, new ItemStack(Blocks.planks, 1, 0))), 0, 1), null);
- GregTech_API.registerCover(ItemList.Plank_Acacia_Green.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 2, new ItemStack(Blocks.planks, 1, 0))), 0, 2), null);
- GregTech_API.registerCover(ItemList.Plank_Lime.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 3, new ItemStack(Blocks.planks, 1, 0))), 0, 3), null);
- GregTech_API.registerCover(ItemList.Plank_Chestnut.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 4, new ItemStack(Blocks.planks, 1, 0))), 0, 4), null);
- GregTech_API.registerCover(ItemList.Plank_Wenge.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 5, new ItemStack(Blocks.planks, 1, 0))), 0, 5), null);
- GregTech_API.registerCover(ItemList.Plank_Baobab.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 6, new ItemStack(Blocks.planks, 1, 0))), 0, 6), null);
- GregTech_API.registerCover(ItemList.Plank_Sequoia.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 7, new ItemStack(Blocks.planks, 1, 0))), 0, 7), null);
- GregTech_API.registerCover(ItemList.Plank_Kapok.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 8, new ItemStack(Blocks.planks, 1, 0))), 0, 8), null);
- GregTech_API.registerCover(ItemList.Plank_Ebony.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 9, new ItemStack(Blocks.planks, 1, 0))), 0, 9), null);
- GregTech_API.registerCover(ItemList.Plank_Mahagony.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 10, new ItemStack(Blocks.planks, 1, 0))), 0, 10), null);
- GregTech_API.registerCover(ItemList.Plank_Balsa.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 11, new ItemStack(Blocks.planks, 1, 0))), 0, 11), null);
- GregTech_API.registerCover(ItemList.Plank_Willow.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 12, new ItemStack(Blocks.planks, 1, 0))), 0, 12), null);
- GregTech_API.registerCover(ItemList.Plank_Walnut.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 13, new ItemStack(Blocks.planks, 1, 0))), 0, 13), null);
- GregTech_API.registerCover(ItemList.Plank_Greenheart.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 14, new ItemStack(Blocks.planks, 1, 0))), 0, 14), null);
- GregTech_API.registerCover(ItemList.Plank_Cherry.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 15, new ItemStack(Blocks.planks, 1, 0))), 0, 15), null);
- GregTech_API.registerCover(ItemList.Plank_Mahoe.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 16, new ItemStack(Blocks.planks, 1, 0))), 0, 0), null);
- GregTech_API.registerCover(ItemList.Plank_Poplar.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 17, new ItemStack(Blocks.planks, 1, 0))), 0, 1), null);
- GregTech_API.registerCover(ItemList.Plank_Palm.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 18, new ItemStack(Blocks.planks, 1, 0))), 0, 2), null);
- GregTech_API.registerCover(ItemList.Plank_Papaya.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 19, new ItemStack(Blocks.planks, 1, 0))), 0, 3), null);
- GregTech_API.registerCover(ItemList.Plank_Pine.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 20, new ItemStack(Blocks.planks, 1, 0))), 0, 4), null);
- GregTech_API.registerCover(ItemList.Plank_Plum.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 21, new ItemStack(Blocks.planks, 1, 0))), 0, 5), null);
- GregTech_API.registerCover(ItemList.Plank_Maple.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 22, new ItemStack(Blocks.planks, 1, 0))), 0, 6), null);
- GregTech_API.registerCover(ItemList.Plank_Citrus.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 23, new ItemStack(Blocks.planks, 1, 0))), 0, 7), null);
-
- ItemList.Crop_Drop_Plumbilia.set(addItem(tLastID = 500, "Plumbilia Leaf", "Source of Lead", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 1L)));
- ItemList.Crop_Drop_Argentia.set(addItem(tLastID = 501, "Argentia Leaf", "Source of Silver", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L)));
- ItemList.Crop_Drop_Indigo.set(addItem(tLastID = 502, "Indigo Blossom", "Used for making Blue Dye", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L)));
- ItemList.Crop_Drop_Ferru.set(addItem(tLastID = 503, "Ferru Leaf", "Source of Iron", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L)));
- ItemList.Crop_Drop_Aurelia.set(addItem(tLastID = 504, "Aurelia Leaf", "Source of Gold", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L)));
- ItemList.Crop_Drop_TeaLeaf.set(addItem(tLastID = 505, "Tea Leaf", "Source of Tea", "cropTea", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
-
- ItemList.Crop_Drop_OilBerry.set(addItem(tLastID = 510, "Oil Berry", "Oil in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L)));
- ItemList.Crop_Drop_BobsYerUncleRanks.set(addItem(tLastID = 511, "Bobs-Yer-Uncle-Berry", "Source of Emeralds", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L)));
- ItemList.Crop_Drop_UUMBerry.set(addItem(tLastID = 512, "UUM Berry", "UUM in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L)));
- ItemList.Crop_Drop_UUABerry.set(addItem(tLastID = 513, "UUA Berry", "UUA in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L)));
-
- ItemList.Crop_Drop_MilkWart.set(addItem(tLastID = 520, "Milk Wart", "Source of Milk", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L)));
-
- ItemList.Crop_Drop_Coppon.set(addItem(tLastID = 530, "Coppon Fiber", "ORANGE WOOOOOOOL!!!", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 1L)));
-
- ItemList.Crop_Drop_Tine.set(addItem(tLastID = 540, "Tine Twig", "Source of Tin", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 100);
-
- ItemList.Crop_Drop_Mica.set(addItem(tLastID = 538, "Micadia Twig", "Source of Mica", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L)));
- setBurnValue(32000 + tLastID, 240);
-
- ItemList.Crop_Drop_Bauxite.set(addItem(tLastID = 521, "Bauxia Leaf", "Source of Aluminium"));
- ItemList.Crop_Drop_Ilmenite.set(addItem(tLastID = 522, "Titania Leaf", "Source of Titanium"));
- ItemList.Crop_Drop_Pitchblende.set(addItem(tLastID = 523, "Reactoria Leaf", "Source of Uranium"));
- ItemList.Crop_Drop_Uraninite.set(addItem(tLastID = 524, "Uranium Leaf", "Source of Uranite"));
- ItemList.Crop_Drop_Thorium.set(addItem(tLastID = 526, "Thunder Leaf", "Source of Thorium"));
- ItemList.Crop_Drop_Nickel.set(addItem(tLastID = 527, "Nickelback Leaf", "Source of Nickel"));
- ItemList.Crop_Drop_Zinc.set(addItem(tLastID = 528, "Galvania Leaf", "Source of Zinc"));
- ItemList.Crop_Drop_Manganese.set(addItem(tLastID = 529, "Pyrolusium Leaf", "Source of Manganese"));
- ItemList.Crop_Drop_Scheelite.set(addItem(tLastID = 531, "Scheelinium Leaf", "Source of Tungsten"));
- ItemList.Crop_Drop_Platinum.set(addItem(tLastID = 532, "Platina Leaf", "Source of Platinum"));
- ItemList.Crop_Drop_Iridium.set(addItem(tLastID = 533, "Quantaria Leaf", "Source of Iridium"));
- ItemList.Crop_Drop_Osmium.set(addItem(tLastID = 534, "Quantaria Leaf", "Source of Osmium"));
- ItemList.Crop_Drop_Naquadah.set(addItem(tLastID = 535, "Stargatium Leaf", "Source of Naquadah"));
-
- ItemList.Crop_Drop_Chilly.set(addItem(tLastID = 550, "Chilly Pepper", "It is red and hot", "cropChilipepper", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false, Potion.confusion.id, 200, 1, 40), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Crop_Drop_Lemon.set(addItem(tLastID = 551, "Lemon", "Don't make Lemonade", "cropLemon", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Crop_Drop_Tomato.set(addItem(tLastID = 552, "Tomato", "Solid Ketchup", "cropTomato", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Crop_Drop_MTomato.set(addItem(tLastID = 553, "Max Tomato", "Full Health in one Tomato", "cropTomato", new GT_FoodStat(9, 1.0F, EnumAction.eat, null, false, true, false, Potion.regeneration.id, 100, 100, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Crop_Drop_Grapes.set(addItem(tLastID = 554, "Grapes", "Source of Wine", "cropGrape", new GT_FoodStat(2, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Crop_Drop_Onion.set(addItem(tLastID = 555, "Onion", "Taking over the whole Taste", "cropOnion", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Crop_Drop_Cucumber.set(addItem(tLastID = 556, "Cucumber", "Not a Sea Cucumber!", "cropCucumber", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Crop_Drop_Rape.set(addItem(tLastID = 557, "Rape", "Time to oil up!", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L)));
-
- ItemList.Food_Cheese.set(addItem(tLastID = 558, "Cheese", "Click the Cheese", "foodCheese", new GT_FoodStat(3, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L)));
- ItemList.Food_Dough.set(addItem(tLastID = 559, "Dough", "For making Breads", "foodDough", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Flat_Dough.set(addItem(tLastID = 560, "Flattened Dough", "For making Pizza", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Raw_Bread.set(addItem(tLastID = 561, "Dough", "In Bread Shape", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Raw_Bun.set(addItem(tLastID = 562, "Dough", "In Bun Shape", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Raw_Baguette.set(addItem(tLastID = 563, "Dough", "In Baguette Shape", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Baked_Bun.set(addItem(tLastID = 564, "Bun", "Do not teleport Bread!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Baked_Baguette.set(addItem(tLastID = 565, "Baguette", "I teleported nothing BUT Bread!!!", new GT_FoodStat(8, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Sliced_Bread.set(addItem(tLastID = 566, "Sliced Bread", "Just half a Bread", new GT_FoodStat(2, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Sliced_Bun.set(addItem(tLastID = 567, "Sliced Bun", "Just half a Bun", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Sliced_Baguette.set(addItem(tLastID = 568, "Sliced Baguette", "Just half a Baguette", new GT_FoodStat(4, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)));
- ItemList.Food_Raw_Cake.set(addItem(tLastID = 569, "Cake Bottom", "For making Cake", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Baked_Cake.set(addItem(tLastID = 570, "Baked Cake Bottom", "I know I promised you an actual Cake, but well...", new GT_FoodStat(3, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
- ItemList.Food_Sliced_Lemon.set(addItem(tLastID = 571, "Lemon Slice", "Ideal to put on your Drink", new GT_FoodStat(1, 0.075F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L)));
- ItemList.Food_Sliced_Tomato.set(addItem(tLastID = 572, "Tomato Slice", "Solid Ketchup", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L)));
- ItemList.Food_Sliced_Onion.set(addItem(tLastID = 573, "Onion Slice", "ONIONS, UNITE!", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L)));
- ItemList.Food_Sliced_Cucumber.set(addItem(tLastID = 574, "Cucumber Slice", "QUEWWW-CUMMM-BERRR!!!", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L)));
-
- ItemList.Food_Sliced_Cheese.set(addItem(tLastID = 576, "Cheese Slice", "ALIEN ATTACK!!!, throw the CHEEEEESE!!!", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L)));
-
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 0), new ItemStack(Items.dye, 2, 1));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 1), new ItemStack(Items.dye, 2, 12));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 2), new ItemStack(Items.dye, 2, 13));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 3), new ItemStack(Items.dye, 2, 7));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 4), new ItemStack(Items.dye, 2, 1));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 5), new ItemStack(Items.dye, 2, 14));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 6), new ItemStack(Items.dye, 2, 7));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 7), new ItemStack(Items.dye, 2, 9));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 8), new ItemStack(Items.dye, 2, 7));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.yellow_flower, 1, 0), new ItemStack(Items.dye, 2, 11));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 0), new ItemStack(Items.dye, 3, 11));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 1), new ItemStack(Items.dye, 3, 13));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 4), new ItemStack(Items.dye, 3, 1));
- GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 5), new ItemStack(Items.dye, 3, 9));
- GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Plumbilia.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lead, 1L));
- GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Argentia.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Silver, 1L));
- GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Indigo.get(1L), ItemList.Dye_Indigo.get(1L));
- GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_MilkWart.get(1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Milk, 1L));
- GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Coppon.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Copper, 1L));
- GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Tine.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Tin, 1L));
-
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Coppon.get(4L), new ItemStack(Blocks.wool, 1, 1));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Plumbilia.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Argentia.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Indigo.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Ferru.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Aurelia.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_OilBerry.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_BobsYerUncleRanks.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Tine.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Rape.get(4L), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(new ItemStack(Blocks.red_flower, 8, 32767), ItemList.IC2_PlantballCompressed.get(1L));
- GT_ModHandler.addCompressionRecipe(new ItemStack(Blocks.yellow_flower, 8, 32767), ItemList.IC2_PlantballCompressed.get(1L));
-
- GT_ModHandler.addPulverisationRecipe(ItemList.Food_Sliced_Cheese.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Cheese, 1L));
- GT_ModHandler.addPulverisationRecipe(ItemList.Dye_Cocoa.get(1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cocoa, 1L));
- GT_ModHandler.addPulverisationRecipe(ItemList.Crop_Drop_Tine.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L));
- GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.reeds, 1), new ItemStack(Items.sugar, 1), null, 0, false);
- GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.melon_block, 1, 0), new ItemStack(Items.melon, 8, 0), new ItemStack(Items.melon_seeds, 1), 80, false);
- GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.pumpkin, 1, 0), new ItemStack(Items.pumpkin_seeds, 4, 0), null, 0, false);
- GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.melon, 1, 0), new ItemStack(Items.melon_seeds, 1, 0), null, 0, false);
- GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.wheat, 1, 0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), null, 0, false);
- GT_ModHandler.addPulverisationRecipe(GT_ModHandler.getIC2Item("crop", 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), null, 0, false);
- GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.stick, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L), null, 0, false);
- GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.wool, 1, 32767), new ItemStack(Items.string, 2), new ItemStack(Items.string, 1), 50, false);
- try {
- ic2.api.crops.CropCard tCrop;
- GT_Utility.getField(tCrop = ic2.api.crops.Crops.instance.getCropList()[13], "mDrop").set(tCrop, ItemList.Crop_Drop_Ferru.get(1L));
- GT_Utility.getField(tCrop = ic2.api.crops.Crops.instance.getCropList()[14], "mDrop").set(tCrop, ItemList.Crop_Drop_Aurelia.get(1L));
- } catch (Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- ItemList.Display_ITS_FREE.set(addItem(tLastID = 766, "ITS FREE", "(or at least almost free)", SubTag.INVISIBLE, new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L)));
-}
-
- public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
- super.onLeftClickEntity(aStack, aPlayer, aEntity);
- int aDamage = aStack.getItemDamage();
- if ((aDamage >= 25000) && (aDamage < 27000)) {
- if (aDamage >= 26000) {
- return Behaviour_Arrow.DEFAULT_PLASTIC.onLeftClickEntity(this, aStack, aPlayer, aEntity);
- }
- return Behaviour_Arrow.DEFAULT_WOODEN.onLeftClickEntity(this, aStack, aPlayer, aEntity);
- }
- return false;
- }
-
- public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) {
- int aDamage = aStack.getItemDamage();
- return ((aDamage >= 25000) && (aDamage < 27000)) || (super.hasProjectile(aProjectileType, aStack));
- }
-
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) {
- int aDamage = aStack.getItemDamage();
- if ((aDamage >= 25000) && (aDamage < 27000)) {
- if (aDamage >= 26000) {
- return Behaviour_Arrow.DEFAULT_PLASTIC.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ);
- }
- return Behaviour_Arrow.DEFAULT_WOODEN.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ);
- }
- return super.getProjectile(aProjectileType, aStack, aWorld, aX, aY, aZ);
- }
-
- public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) {
- int aDamage = aStack.getItemDamage();
- if ((aDamage >= 25000) && (aDamage < 27000)) {
- if (aDamage >= 26000) {
- return Behaviour_Arrow.DEFAULT_PLASTIC.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed);
- }
- return Behaviour_Arrow.DEFAULT_WOODEN.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed);
- }
- return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed);
- }
-
- public boolean isItemStackUsable(ItemStack aStack) {
- int aDamage = aStack.getItemDamage();
- Materials aMaterial = GregTech_API.sGeneratedMaterials[(aDamage % 1000)];
- if ((aDamage >= 25000) && (aDamage < 27000) && (aMaterial != null) && (aMaterial.mEnchantmentTools != null)) {
- Enchantment tEnchant = aMaterial.mEnchantmentTools == Enchantment.fortune ? Enchantment.looting : aMaterial.mEnchantmentTools;
- if (tEnchant.type == EnumEnchantmentType.weapon) {
- NBTTagCompound tNBT = GT_Utility.ItemNBT.getNBT(aStack);
- if (!tNBT.getBoolean("GT.HasBeenUpdated")) {
- tNBT.setBoolean("GT.HasBeenUpdated", true);
- GT_Utility.ItemNBT.setNBT(aStack, tNBT);
- GT_Utility.ItemNBT.addEnchantment(aStack, tEnchant, aMaterial.mEnchantmentToolsLevel);
- }
- }
- }
- return super.isItemStackUsable(aStack);
- }
-
- public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
- return (aDoShowAllItems) || (!aPrefix.name().startsWith("toolHead"));
- }
-
- public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) {
- int aDamage = aStack.getItemDamage();
- if ((aDamage >= 25000) && (aDamage < 27000)) {
- if (aDamage >= 26000) {
- return Behaviour_Arrow.DEFAULT_PLASTIC.onDispense(this, aSource, aStack);
- }
- return Behaviour_Arrow.DEFAULT_WOODEN.onDispense(this, aSource, aStack);
- }
- return super.onDispense(aSource, aStack);
- }
-
- public final ItemStack getContainerItem(ItemStack aStack) {
- int aDamage = aStack.getItemDamage();
- if (aDamage < 32000) {
- return null;
- }
- if (aDamage < 32100) {
- return ItemList.ThermosCan_Empty.get(1L);
- }
- if (aDamage < 32200) {
- return ItemList.Bottle_Empty.get(1L);
- }
- return null;
- }
-}
+package gregtech.common.items; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.*; +import gregtech.api.items.GT_MetaGenerated_Item_X32; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; +import gregtech.common.items.behaviors.Behaviour_Arrow; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +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.EnumAction; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.world.World; + +public class GT_MetaGenerated_Item_02 extends GT_MetaGenerated_Item_X32 { + public static GT_MetaGenerated_Item_02 INSTANCE; + private final static String aTextCover = "Usable as Cover"; private final static String aTextForestry = "Forestry"; + + public GT_MetaGenerated_Item_02() { + super("metaitem.02", OrePrefixes.toolHeadSword, OrePrefixes.toolHeadPickaxe, OrePrefixes.toolHeadShovel, OrePrefixes.toolHeadAxe, OrePrefixes.toolHeadHoe, OrePrefixes.toolHeadHammer, OrePrefixes.toolHeadFile, OrePrefixes.toolHeadSaw, OrePrefixes.toolHeadDrill, OrePrefixes.toolHeadChainsaw, OrePrefixes.toolHeadWrench, OrePrefixes.toolHeadUniversalSpade, OrePrefixes.toolHeadSense, OrePrefixes.toolHeadPlow, OrePrefixes.toolHeadArrow, OrePrefixes.toolHeadBuzzSaw, OrePrefixes.turbineBlade, null, OrePrefixes.itemCasing, OrePrefixes.wireFine, OrePrefixes.gearGtSmall, OrePrefixes.rotor, OrePrefixes.stickLong, OrePrefixes.springSmall, OrePrefixes.spring, OrePrefixes.arrowGtWood, OrePrefixes.arrowGtPlastic, OrePrefixes.gemChipped, OrePrefixes.gemFlawed, OrePrefixes.gemFlawless, OrePrefixes.gemExquisite, OrePrefixes.gearGt); + INSTANCE = this; + + int tLastID = 0; + + ItemList.ThermosCan_Dark_Coffee.set(addItem(tLastID = 0, "Dark Coffee", "Coffee, dark, without anything else", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 1, 70, Potion.digSpeed.id, 400, 1, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); + ItemList.ThermosCan_Dark_Cafe_au_lait.set(addItem(tLastID = 1, "Dark Coffee au lait", "Keeping you awake the whole night", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 2, 90, Potion.digSpeed.id, 400, 2, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 3L))); + ItemList.ThermosCan_Coffee.set(addItem(tLastID = 2, "Coffee", "Just the regular morning Coffee", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 0, 50, Potion.digSpeed.id, 400, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L))); + ItemList.ThermosCan_Cafe_au_lait.set(addItem(tLastID = 3, "Cafe au lait", "Sweet Coffee", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 1, 70, Potion.digSpeed.id, 400, 1, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L))); + ItemList.ThermosCan_Lait_au_cafe.set(addItem(tLastID = 4, "Lait au cafe", "You want Coffee to your Sugar?", SubTag.INVISIBLE, new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSpeed.id, 400, 2, 90, Potion.digSpeed.id, 400, 2, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 3L))); + ItemList.ThermosCan_Dark_Chocolate_Milk.set(addItem(tLastID = 5, "Dark Chocolate Milk", "A bit bitter, better add a bit Sugar", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 50, 1, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.ThermosCan_Chocolate_Milk.set(addItem(tLastID = 6, "Chocolate Milk", "Sweet Goodness", new GT_FoodStat(3, 0.4F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 50, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 2L))); + ItemList.ThermosCan_Tea.set(addItem(tLastID = 7, "Tea", "Keep calm and carry on", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 300, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.ThermosCan_Sweet_Tea.set(addItem(tLastID = 8, "Sweet Tea", "How about a Tea Party? In Boston?", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + ItemList.ThermosCan_Ice_Tea.set(addItem(tLastID = 9, "Ice Tea", "Better than this purple Junk Drink from failed Potions", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.ThermosCan_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 300, 0, 50), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L))); + + ItemList.GelledToluene.set(addItem(tLastID = 10, "Gelled Toluene", "Raw Explosive")); + + ItemList.Bottle_Purple_Drink.set(addItem(tLastID = 100, "Purple Drink", "How about Lemonade. Or some Ice Tea? I got Purple Drink!", new GT_FoodStat(8, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.moveSlowdown.id, 400, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 1L))); + ItemList.Bottle_Grape_Juice.set(addItem(tLastID = 101, "Grape Juice", "This has a cleaning effect on your internals.", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 1, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Wine.set(addItem(tLastID = 102, "Wine", "Ordinary", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 60, Potion.heal.id, 0, 0, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Vinegar.set(addItem(tLastID = 103, "Vinegar", "Exquisite", new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 90, Potion.heal.id, 0, 1, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Potato_Juice.set(addItem(tLastID = 104, "Potato Juice", "Ever seen Potato Juice in stores? No? That has a reason.", SubTag.INVISIBLE, new GT_FoodStat(3, 0.3F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); + ItemList.Bottle_Vodka.set(addItem(tLastID = 105, "Vodka", "Not to confuse with Water", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 500, 0, 60, Potion.damageBoost.id, 500, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L))); + ItemList.Bottle_Leninade.set(addItem(tLastID = 106, "Leninade", "Let the Communism flow through you!", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 500, 1, 90, Potion.damageBoost.id, 500, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L))); + ItemList.Bottle_Mineral_Water.set(addItem(tLastID = 107, "Mineral Water", "The best Stuff you can drink to stay healthy", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 100, 1, 10), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Salty_Water.set(addItem(tLastID = 108, "Salty Water", "Like Sea Water but less dirty", SubTag.INVISIBLE, new GT_FoodStat(1, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 2, 95), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TEMPESTAS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Bottle_Reed_Water.set(addItem(tLastID = 109, "Reed Water", "I guess this tastes better when fermented", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Bottle_Rum.set(addItem(tLastID = 110, "Rum", "A buddle o' rum", SubTag.INVISIBLE, new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 0, 60, Potion.damageBoost.id, 300, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Bottle_Pirate_Brew.set(addItem(tLastID = 111, "Pirate Brew", "Set the Sails, we are going to Torrentuga!", SubTag.INVISIBLE, new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 1, 90, Potion.damageBoost.id, 300, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 2L))); + ItemList.Bottle_Hops_Juice.set(addItem(tLastID = 112, "Hops Juice", "Every Beer has a start", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); + ItemList.Bottle_Dark_Beer.set(addItem(tLastID = 113, "Dark Beer", "Dark Beer, for the real Men", new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 1, 60, Potion.damageBoost.id, 300, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Bottle_Dragon_Blood.set(addItem(tLastID = 114, "Dragon Blood", "FUS RO DAH!", SubTag.INVISIBLE, new GT_FoodStat(4, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 300, 2, 90, Potion.damageBoost.id, 300, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L))); + ItemList.Bottle_Wheaty_Juice.set(addItem(tLastID = 115, "Wheaty Juice", "Is this liquefied Bread or what?", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L))); + ItemList.Bottle_Scotch.set(addItem(tLastID = 116, "Scotch", "Technically this is just a Whisky", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.resistance.id, 400, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); + ItemList.Bottle_Glen_McKenner.set(addItem(tLastID = 117, "Glen McKenner", "Don't hand to easily surprised people, they will shatter it.", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 1, 90, Potion.resistance.id, 400, 2, 90, Potion.poison.id, 200, 2, 10, Potion.harm.id, 0, 2, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L))); + ItemList.Bottle_Wheaty_Hops_Juice.set(addItem(tLastID = 118, "Wheaty Hops Juice", "Also known as 'Duff-Lite'", new GT_FoodStat(1, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 2L))); + ItemList.Bottle_Beer.set(addItem(tLastID = 119, "Beer", "Good old Beer", new GT_FoodStat(6, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.digSpeed.id, 400, 2, 60, Potion.poison.id, 100, 0, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); + ItemList.Bottle_Chilly_Sauce.set(addItem(tLastID = 120, "Chilly Sauce", "Spicy", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 1000, 0, 10, Potion.fireResistance.id, 1000, 0, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Bottle_Hot_Sauce.set(addItem(tLastID = 121, "Hot Sauce", "Very Spicy, I guess?", new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 2000, 0, 30, Potion.fireResistance.id, 2000, 0, 70), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 2L))); + ItemList.Bottle_Diabolo_Sauce.set(addItem(tLastID = 122, "Diabolo Sauce", "As if the Devil made this Sauce", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 3000, 1, 50, Potion.fireResistance.id, 3000, 0, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 3L))); + ItemList.Bottle_Diablo_Sauce.set(addItem(tLastID = 123, "Diablo Sauce", "Diablo always comes back!", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 4000, 1, 70, Potion.fireResistance.id, 4000, 0, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 4L))); + ItemList.Bottle_Snitches_Glitch_Sauce.set(addItem(tLastID = 124, "Old Man Snitches glitched Diablo Sauce", "[Missing No]", SubTag.INVISIBLE, new GT_FoodStat(2, 0.1F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 9999, 2, 999, Potion.fireResistance.id, 9999, 9, 999), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 5L))); + ItemList.Bottle_Apple_Juice.set(addItem(tLastID = 125, "Apple Juice", "Made of the Apples from our best Oak Farms", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 0, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Bottle_Cider.set(addItem(tLastID = 126, "Cider", "If you have nothing better to do with your Apples", new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.resistance.id, 400, 1, 60, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); + ItemList.Bottle_Golden_Apple_Juice.set(addItem(tLastID = 127, "Golden Apple Juice", "A golden Apple in liquid form", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.hunger.id, 400, 0, 20, Potion.field_76444_x.id, 2400, 0, 100, Potion.regeneration.id, 100, 1, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Golden_Cider.set(addItem(tLastID = 128, "Golden Cider", "More Resistance, less Regeneration", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.confusion.id, 400, 0, 60, Potion.field_76444_x.id, 2400, 1, 95, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L))); + ItemList.Bottle_Iduns_Apple_Juice.set(addItem(tLastID = 129, "Idun's Apple Juice", "So you got the Idea of using Notch Apples for a drink?", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 600, 4, 100, Potion.field_76444_x.id, 2400, 0, 100, Potion.resistance.id, 6000, 0, 100, Potion.fireResistance.id, 6000, 0, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 9L))); + ItemList.Bottle_Notches_Brew.set(addItem(tLastID = 130, "Notches Brew", "This is just overpowered", SubTag.INVISIBLE, new GT_FoodStat(4, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.regeneration.id, 700, 4, 95, Potion.field_76444_x.id, 3000, 1, 95, Potion.resistance.id, 7000, 1, 95, Potion.fireResistance.id, 7000, 0, 95, Potion.harm.id, 0, 2, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.NEBRISUM, 9L))); + ItemList.Bottle_Lemon_Juice.set(addItem(tLastID = 131, "Lemon Juice", "Maybe adding Sugar will make it less sour", new GT_FoodStat(2, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 1200, 0, 60), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); + ItemList.Bottle_Limoncello.set(addItem(tLastID = 132, "Limoncello", "An alcoholic Drink which tastes like Lemons", SubTag.INVISIBLE, new GT_FoodStat(2, 0.4F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 1200, 0, 90, Potion.poison.id, 200, 1, 5), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); + ItemList.Bottle_Lemonade.set(addItem(tLastID = 133, "Lemonade", "Cold and refreshing Lemonade", new GT_FoodStat(4, 0.3F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 900, 1, 90), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 1L))); + ItemList.Bottle_Alcopops.set(addItem(tLastID = 134, "Alcopops", "Don't let your Children drink this junk!", SubTag.INVISIBLE, new GT_FoodStat(2, 0.2F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.digSpeed.id, 900, 1, 90, Potion.poison.id, 300, 2, 20), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VENENUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VINCULUM, 1L))); + ItemList.Bottle_Cave_Johnsons_Grenade_Juice.set(addItem(tLastID = 135, "Cave Johnson's Grenade Juice", "When life gives you Lemons, make Life take them Lemons back!", SubTag.INVISIBLE, new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false).setExplosive(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MORTUUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 1L))); + ItemList.Bottle_Milk.set(addItem(tLastID = 136, "Milk", "Got Milk?", OrePrefixes.bottle.get(Materials.Milk), new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false).setMilk(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + ItemList.Bottle_Holy_Water.set(addItem(tLastID = 137, "Holy Water", "May the holy Planks be with you", OrePrefixes.bottle.get(Materials.HolyWater), new GT_FoodStat(0, 0.0F, EnumAction.drink, ItemList.Bottle_Empty.get(1L), GregTech_API.sDrinksAlwaysDrinkable, false, false, Potion.poison.id, 100, 1, 100).setMilk(), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AURAM, 1L))); + + + + ItemList.Food_Potato_On_Stick.set(addItem(tLastID = 200, "Potato on a Stick", "Totally looks like a Crab Claw", new GT_FoodStat(1, 0.3F, EnumAction.eat, new ItemStack(Items.stick, 1), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + ItemList.Food_Potato_On_Stick_Roasted.set(addItem(tLastID = 201, "Roasted Potato on a Stick", "Still looks like a Crab Claw", new GT_FoodStat(6, 0.6F, EnumAction.eat, new ItemStack(Items.stick, 1), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Fries.set(addItem(tLastID = 202, "Potato Strips", "It's Potato in Stripe Form", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + ItemList.Food_Fries.set(addItem(tLastID = 203, "Fries", "Not to confuse with Fry the Delivery Boy", new GT_FoodStat(7, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + ItemList.Food_Packaged_Fries.set(addItem(tLastID = 204, "Fries", "Ketchup not included", new GT_FoodStat(7, 0.5F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Paper, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_PotatoChips.set(addItem(tLastID = 205, "Potato Chips (Raw)", "Just like a Potato", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + ItemList.Food_PotatoChips.set(addItem(tLastID = 206, "Potato Chips", "Crunchy", new GT_FoodStat(7, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + ItemList.Food_ChiliChips.set(addItem(tLastID = 207, "Chili Chips", "Spicy", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + ItemList.Food_Packaged_PotatoChips.set(addItem(tLastID = 208, "Bag of Potato Chips", "Full of delicious Air", new GT_FoodStat(7, 0.5F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Packaged_ChiliChips.set(addItem(tLastID = 209, "Bag of Chili Chips", "Stop making noises Baj!", new GT_FoodStat(7, 0.6F, EnumAction.eat, GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Aluminium, 1L), false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Chum.set(addItem(tLastID = 210, "Chum", "Chum is Fum!", new GT_FoodStat(5, 0.2F, EnumAction.eat, null, true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Chum_On_Stick.set(addItem(tLastID = 211, "Chum on a Stick", "Don't forget to try our Chum-balaya", new GT_FoodStat(5, 0.2F, EnumAction.eat, new ItemStack(Items.stick, 1), true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Dough_Sugar.set(addItem(tLastID = 212, "Sugary Dough", "Don't eat the Dough before it is baken", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Dough_Chocolate.set(addItem(tLastID = 213, "Chocolate Dough", "I said don't eat the Dough!", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Raw_Cookie.set(addItem(tLastID = 214, "Cookie shaped Dough", "For baking Cookies", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + + ItemList.Food_Sliced_Buns.set(addItem(tLastID = 220, "Buns", "Pre Sliced", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Burger_Veggie.set(addItem(tLastID = 221, "Veggieburger", "No matter how you call this, this is NOT a Burger!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Burger_Cheese.set(addItem(tLastID = 222, "Cheeseburger", "Cheesy!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new ItemData(Materials.Cheese, 907200L))); + ItemList.Food_Burger_Meat.set(addItem(tLastID = 223, "Hamburger", "The Mc Burger Queen Burger", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Burger_Chum.set(addItem(tLastID = 224, "Chumburger", "Fum is Chum!", new GT_FoodStat(5, 0.2F, EnumAction.eat, null, true, false, true, Potion.hunger.id, 1000, 4, 100, Potion.confusion.id, 300, 1, 80), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + + ItemList.Food_Sliced_Breads.set(addItem(tLastID = 230, "Breads", "Pre Sliced", new GT_FoodStat(5, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sandwich_Veggie.set(addItem(tLastID = 231, "Veggie Sandwich", "Meatless", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 32L); + ItemList.Food_Sandwich_Cheese.set(addItem(tLastID = 232, "Cheese Sandwich", "Say Cheese!", new GT_FoodStat(7, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 32L); + ItemList.Food_Sandwich_Bacon.set(addItem(tLastID = 233, "Bacon Sandwich", "The best Sandwich ever!", new GT_FoodStat(10, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 32L); + ItemList.Food_Sandwich_Steak.set(addItem(tLastID = 234, "Steak Sandwich", "Not a 'Steam Sandwich'", new GT_FoodStat(10, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 32L); + + ItemList.Food_Sliced_Baguettes.set(addItem(tLastID = 240, "Baguettes", "Pre Sliced", new GT_FoodStat(8, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Large_Sandwich_Veggie.set(addItem(tLastID = 241, "Large Veggie Sandwich", "Just not worth it", new GT_FoodStat(15, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + ItemList.Food_Large_Sandwich_Cheese.set(addItem(tLastID = 242, "Large Cheese Sandwich", "I need another cheesy tooltip for this", new GT_FoodStat(15, 0.8F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + ItemList.Food_Large_Sandwich_Bacon.set(addItem(tLastID = 243, "Large Bacon Sandwich", "For Men! (and manly Women)", new GT_FoodStat(20, 1.0F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + ItemList.Food_Large_Sandwich_Steak.set(addItem(tLastID = 244, "Large Steak Sandwich", "Yes, I once accidentially called it 'Steam Sandwich'", new GT_FoodStat(20, 1.0F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + setFluidContainerStats(32000 + tLastID, 0L, 16L); + + ItemList.Food_Raw_Pizza_Veggie.set(addItem(tLastID = 250, "Raw Veggie Pizza", "Into the Oven with it!", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Pizza_Cheese.set(addItem(tLastID = 251, "Raw Cheese Pizza", "Into the Oven with it!", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Pizza_Meat.set(addItem(tLastID = 252, "Raw Mince Meat Pizza", "Into the Oven with it!", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + + ItemList.Food_Baked_Pizza_Veggie.set(addItem(tLastID = 260, "Veggie Pizza", "The next they want is Gluten Free Pizzas...", new GT_FoodStat(3, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Baked_Pizza_Cheese.set(addItem(tLastID = 261, "Cheese Pizza", "Pizza Magarita", new GT_FoodStat(4, 0.4F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Baked_Pizza_Meat.set(addItem(tLastID = 262, "Mince Meat Pizza", "Emo Pizza, it cuts itself!", new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + + + ItemList.Dye_Indigo.set(addItem(tLastID = 410, "Indigo Dye", "Blue Dye", new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), Dyes.dyeBlue)); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + ItemList.DYE_ONLY_ITEMS[i].set(addItem(tLastID = 414 + i, Dyes.get(i).mName + " Dye", "", Dyes.get(i).name(), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); + } + ItemList.Plank_Oak.set(addItem(tLastID = 470, "Oak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Spruce.set(addItem(tLastID = 471, "Spruce Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Birch.set(addItem(tLastID = 472, "Birch Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Jungle.set(addItem(tLastID = 473, "Jungle Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Acacia.set(addItem(tLastID = 474, "Acacia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_DarkOak.set(addItem(tLastID = 475, "Dark Oak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Larch.set(addItem(tLastID = 476, "Larch Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Teak.set(addItem(tLastID = 477, "Teak Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Acacia_Green.set(addItem(tLastID = 478, "Green Acacia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Lime.set(addItem(tLastID = 479, "Lime Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Chestnut.set(addItem(tLastID = 480, "Chestnut Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Wenge.set(addItem(tLastID = 481, "Wenge Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Baobab.set(addItem(tLastID = 482, "Baobab Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Sequoia.set(addItem(tLastID = 483, "Sequoia Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Kapok.set(addItem(tLastID = 484, "Kapok Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Ebony.set(addItem(tLastID = 485, "Ebony Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Mahagony.set(addItem(tLastID = 486, "Mahagony Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Balsa.set(addItem(tLastID = 487, "Balsa Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Willow.set(addItem(tLastID = 488, "Willow Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Walnut.set(addItem(tLastID = 489, "Walnut Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Greenheart.set(addItem(tLastID = 490, "Greenheart Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Cherry.set(addItem(tLastID = 491, "Cherry Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Mahoe.set(addItem(tLastID = 492, "Mahoe Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Poplar.set(addItem(tLastID = 493, "Poplar Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Palm.set(addItem(tLastID = 494, "Palm Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Papaya.set(addItem(tLastID = 495, "Papaya Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Pine.set(addItem(tLastID = 496, "Pine Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Plum.set(addItem(tLastID = 497, "Plum Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Maple.set(addItem(tLastID = 498, "Maple Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + ItemList.Plank_Citrus.set(addItem(tLastID = 499, "Citrus Plank", aTextCover, new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 75); + + ItemList.SFMixture.set(addItem(tLastID = 270, "Super Fuel Binder", "Raw Material")); + ItemList.MSFMixture.set(addItem(tLastID = 271, "Magic Super Fuel Binder", "Raw Material")); + + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Oak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 0)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Spruce.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 1)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Birch.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 2)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Jungle.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 3)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Acacia.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 4)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_DarkOak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', new ItemStack(Blocks.wooden_slab, 1, 5)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Larch.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 0)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Teak.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 1)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Acacia_Green.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 2)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Lime.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 3)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Chestnut.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 4)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Wenge.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 5)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Baobab.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 6)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Sequoia.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs1", 1L, 7)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Kapok.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 0)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Ebony.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 1)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Mahagony.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 2)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Balsa.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 3)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Willow.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 4)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Walnut.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 5)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Greenheart.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 6)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Cherry.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs2", 1L, 7)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Mahoe.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 0)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Poplar.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 1)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Palm.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 2)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Papaya.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 3)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Pine.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 4)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Plum.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 5)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Maple.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 6)}); + GT_ModHandler.addCraftingRecipe(ItemList.Plank_Citrus.get(2L), GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"s ", " P", 'P', GT_ModHandler.getModItem(aTextForestry, "slabs3", 1L, 7)}); + + GregTech_API.registerCover(ItemList.Plank_Oak.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 0), null); + GregTech_API.registerCover(ItemList.Plank_Spruce.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 1), null); + GregTech_API.registerCover(ItemList.Plank_Birch.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 2), null); + GregTech_API.registerCover(ItemList.Plank_Jungle.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 3), null); + GregTech_API.registerCover(ItemList.Plank_Acacia.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 4), null); + GregTech_API.registerCover(ItemList.Plank_DarkOak.get(1L), new GT_CopiedBlockTexture(Blocks.planks, 0, 5), null); + GregTech_API.registerCover(ItemList.Plank_Larch.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 0, new ItemStack(Blocks.planks, 1, 0))), 0, 0), null); + GregTech_API.registerCover(ItemList.Plank_Teak.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 1, new ItemStack(Blocks.planks, 1, 0))), 0, 1), null); + GregTech_API.registerCover(ItemList.Plank_Acacia_Green.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 2, new ItemStack(Blocks.planks, 1, 0))), 0, 2), null); + GregTech_API.registerCover(ItemList.Plank_Lime.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 3, new ItemStack(Blocks.planks, 1, 0))), 0, 3), null); + GregTech_API.registerCover(ItemList.Plank_Chestnut.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 4, new ItemStack(Blocks.planks, 1, 0))), 0, 4), null); + GregTech_API.registerCover(ItemList.Plank_Wenge.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 5, new ItemStack(Blocks.planks, 1, 0))), 0, 5), null); + GregTech_API.registerCover(ItemList.Plank_Baobab.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 6, new ItemStack(Blocks.planks, 1, 0))), 0, 6), null); + GregTech_API.registerCover(ItemList.Plank_Sequoia.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 7, new ItemStack(Blocks.planks, 1, 0))), 0, 7), null); + GregTech_API.registerCover(ItemList.Plank_Kapok.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 8, new ItemStack(Blocks.planks, 1, 0))), 0, 8), null); + GregTech_API.registerCover(ItemList.Plank_Ebony.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 9, new ItemStack(Blocks.planks, 1, 0))), 0, 9), null); + GregTech_API.registerCover(ItemList.Plank_Mahagony.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 10, new ItemStack(Blocks.planks, 1, 0))), 0, 10), null); + GregTech_API.registerCover(ItemList.Plank_Balsa.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 11, new ItemStack(Blocks.planks, 1, 0))), 0, 11), null); + GregTech_API.registerCover(ItemList.Plank_Willow.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 12, new ItemStack(Blocks.planks, 1, 0))), 0, 12), null); + GregTech_API.registerCover(ItemList.Plank_Walnut.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 13, new ItemStack(Blocks.planks, 1, 0))), 0, 13), null); + GregTech_API.registerCover(ItemList.Plank_Greenheart.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 14, new ItemStack(Blocks.planks, 1, 0))), 0, 14), null); + GregTech_API.registerCover(ItemList.Plank_Cherry.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 15, new ItemStack(Blocks.planks, 1, 0))), 0, 15), null); + GregTech_API.registerCover(ItemList.Plank_Mahoe.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 16, new ItemStack(Blocks.planks, 1, 0))), 0, 0), null); + GregTech_API.registerCover(ItemList.Plank_Poplar.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 17, new ItemStack(Blocks.planks, 1, 0))), 0, 1), null); + GregTech_API.registerCover(ItemList.Plank_Palm.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 18, new ItemStack(Blocks.planks, 1, 0))), 0, 2), null); + GregTech_API.registerCover(ItemList.Plank_Papaya.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 19, new ItemStack(Blocks.planks, 1, 0))), 0, 3), null); + GregTech_API.registerCover(ItemList.Plank_Pine.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 20, new ItemStack(Blocks.planks, 1, 0))), 0, 4), null); + GregTech_API.registerCover(ItemList.Plank_Plum.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 21, new ItemStack(Blocks.planks, 1, 0))), 0, 5), null); + GregTech_API.registerCover(ItemList.Plank_Maple.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 22, new ItemStack(Blocks.planks, 1, 0))), 0, 6), null); + GregTech_API.registerCover(ItemList.Plank_Citrus.get(1L), new GT_CopiedBlockTexture(GT_Utility.getBlockFromStack(GT_ModHandler.getModItem(aTextForestry, "planks", 1L, 23, new ItemStack(Blocks.planks, 1, 0))), 0, 7), null); + + ItemList.Crop_Drop_Plumbilia.set(addItem(tLastID = 500, "Plumbilia Leaf", "Source of Lead", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 1L))); + ItemList.Crop_Drop_Argentia.set(addItem(tLastID = 501, "Argentia Leaf", "Source of Silver", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Crop_Drop_Indigo.set(addItem(tLastID = 502, "Indigo Blossom", "Used for making Blue Dye", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L))); + ItemList.Crop_Drop_Ferru.set(addItem(tLastID = 503, "Ferru Leaf", "Source of Iron", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L))); + ItemList.Crop_Drop_Aurelia.set(addItem(tLastID = 504, "Aurelia Leaf", "Source of Gold", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Crop_Drop_TeaLeaf.set(addItem(tLastID = 505, "Tea Leaf", "Source of Tea", "cropTea", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + + ItemList.Crop_Drop_OilBerry.set(addItem(tLastID = 510, "Oil Berry", "Oil in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Crop_Drop_BobsYerUncleRanks.set(addItem(tLastID = 511, "Bobs-Yer-Uncle-Berry", "Source of Emeralds", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); + ItemList.Crop_Drop_UUMBerry.set(addItem(tLastID = 512, "UUM Berry", "UUM in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + ItemList.Crop_Drop_UUABerry.set(addItem(tLastID = 513, "UUA Berry", "UUA in Berry form", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + + ItemList.Crop_Drop_MilkWart.set(addItem(tLastID = 520, "Milk Wart", "Source of Milk", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 1L))); + + ItemList.Crop_Drop_Coppon.set(addItem(tLastID = 530, "Coppon Fiber", "ORANGE WOOOOOOOL!!!", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERMUTATIO, 1L))); + + ItemList.Crop_Drop_Tine.set(addItem(tLastID = 540, "Tine Twig", "Source of Tin", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 100); + + ItemList.Crop_Drop_Mica.set(addItem(tLastID = 538, "Micadia Twig", "Source of Mica", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 1L))); + setBurnValue(32000 + tLastID, 240); + + ItemList.Crop_Drop_Bauxite.set(addItem(tLastID = 521, "Bauxia Leaf", "Source of Aluminium")); + ItemList.Crop_Drop_Ilmenite.set(addItem(tLastID = 522, "Titania Leaf", "Source of Titanium")); + ItemList.Crop_Drop_Pitchblende.set(addItem(tLastID = 523, "Reactoria Leaf", "Source of Uranium")); + ItemList.Crop_Drop_Uraninite.set(addItem(tLastID = 524, "Uranium Leaf", "Source of Uranite")); + ItemList.Crop_Drop_Thorium.set(addItem(tLastID = 526, "Thunder Leaf", "Source of Thorium")); + ItemList.Crop_Drop_Nickel.set(addItem(tLastID = 527, "Nickelback Leaf", "Source of Nickel")); + ItemList.Crop_Drop_Zinc.set(addItem(tLastID = 528, "Galvania Leaf", "Source of Zinc")); + ItemList.Crop_Drop_Manganese.set(addItem(tLastID = 529, "Pyrolusium Leaf", "Source of Manganese")); + ItemList.Crop_Drop_Scheelite.set(addItem(tLastID = 531, "Scheelinium Leaf", "Source of Tungsten")); + ItemList.Crop_Drop_Platinum.set(addItem(tLastID = 532, "Platina Leaf", "Source of Platinum")); + ItemList.Crop_Drop_Iridium.set(addItem(tLastID = 533, "Quantaria Leaf", "Source of Iridium")); + ItemList.Crop_Drop_Osmium.set(addItem(tLastID = 534, "Quantaria Leaf", "Source of Osmium")); + ItemList.Crop_Drop_Naquadah.set(addItem(tLastID = 535, "Stargatium Leaf", "Source of Naquadah")); + + ItemList.Crop_Drop_Chilly.set(addItem(tLastID = 550, "Chilly Pepper", "It is red and hot", "cropChilipepper", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false, Potion.confusion.id, 200, 1, 40), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Lemon.set(addItem(tLastID = 551, "Lemon", "Don't make Lemonade", "cropLemon", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Tomato.set(addItem(tLastID = 552, "Tomato", "Solid Ketchup", "cropTomato", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_MTomato.set(addItem(tLastID = 553, "Max Tomato", "Full Health in one Tomato", "cropTomato", new GT_FoodStat(9, 1.0F, EnumAction.eat, null, false, true, false, Potion.regeneration.id, 100, 100, 100), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SANO, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Grapes.set(addItem(tLastID = 554, "Grapes", "Source of Wine", "cropGrape", new GT_FoodStat(2, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Onion.set(addItem(tLastID = 555, "Onion", "Taking over the whole Taste", "cropOnion", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Cucumber.set(addItem(tLastID = 556, "Cucumber", "Not a Sea Cucumber!", "cropCucumber", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Crop_Drop_Rape.set(addItem(tLastID = 557, "Rape", "Time to oil up!", new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L))); + + ItemList.Food_Cheese.set(addItem(tLastID = 558, "Cheese", "Click the Cheese", "foodCheese", new GT_FoodStat(3, 0.6F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 2L))); + ItemList.Food_Dough.set(addItem(tLastID = 559, "Dough", "For making Breads", "foodDough", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Flat_Dough.set(addItem(tLastID = 560, "Flattened Dough", "For making Pizza", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Raw_Bread.set(addItem(tLastID = 561, "Dough", "In Bread Shape", new GT_FoodStat(1, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Raw_Bun.set(addItem(tLastID = 562, "Dough", "In Bun Shape", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Raw_Baguette.set(addItem(tLastID = 563, "Dough", "In Baguette Shape", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Baked_Bun.set(addItem(tLastID = 564, "Bun", "Do not teleport Bread!", new GT_FoodStat(3, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Baked_Baguette.set(addItem(tLastID = 565, "Baguette", "I teleported nothing BUT Bread!!!", new GT_FoodStat(8, 0.5F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sliced_Bread.set(addItem(tLastID = 566, "Sliced Bread", "Just half a Bread", new GT_FoodStat(2, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sliced_Bun.set(addItem(tLastID = 567, "Sliced Bun", "Just half a Bun", new GT_FoodStat(1, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Sliced_Baguette.set(addItem(tLastID = 568, "Sliced Baguette", "Just half a Baguette", new GT_FoodStat(4, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L))); + ItemList.Food_Raw_Cake.set(addItem(tLastID = 569, "Cake Bottom", "For making Cake", new GT_FoodStat(2, 0.2F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Baked_Cake.set(addItem(tLastID = 570, "Baked Cake Bottom", "I know I promised you an actual Cake, but well...", new GT_FoodStat(3, 0.3F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + ItemList.Food_Sliced_Lemon.set(addItem(tLastID = 571, "Lemon Slice", "Ideal to put on your Drink", new GT_FoodStat(1, 0.075F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Food_Sliced_Tomato.set(addItem(tLastID = 572, "Tomato Slice", "Solid Ketchup", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Food_Sliced_Onion.set(addItem(tLastID = 573, "Onion Slice", "ONIONS, UNITE!", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + ItemList.Food_Sliced_Cucumber.set(addItem(tLastID = 574, "Cucumber Slice", "QUEWWW-CUMMM-BERRR!!!", new GT_FoodStat(1, 0.05F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 1L))); + + ItemList.Food_Sliced_Cheese.set(addItem(tLastID = 576, "Cheese Slice", "ALIEN ATTACK!!!, throw the CHEEEEESE!!!", new GT_FoodStat(1, 0.1F, EnumAction.eat, null, false, true, false), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L))); + + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 0), new ItemStack(Items.dye, 2, 1)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 1), new ItemStack(Items.dye, 2, 12)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 2), new ItemStack(Items.dye, 2, 13)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 3), new ItemStack(Items.dye, 2, 7)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 4), new ItemStack(Items.dye, 2, 1)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 5), new ItemStack(Items.dye, 2, 14)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 6), new ItemStack(Items.dye, 2, 7)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 7), new ItemStack(Items.dye, 2, 9)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.red_flower, 1, 8), new ItemStack(Items.dye, 2, 7)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.yellow_flower, 1, 0), new ItemStack(Items.dye, 2, 11)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 0), new ItemStack(Items.dye, 3, 11)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 1), new ItemStack(Items.dye, 3, 13)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 4), new ItemStack(Items.dye, 3, 1)); + GT_ModHandler.addExtractionRecipe(new ItemStack(Blocks.double_plant, 1, 5), new ItemStack(Items.dye, 3, 9)); + GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Plumbilia.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lead, 1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Argentia.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Silver, 1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Indigo.get(1L), ItemList.Dye_Indigo.get(1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_MilkWart.get(1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Milk, 1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Coppon.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Copper, 1L)); + GT_ModHandler.addExtractionRecipe(ItemList.Crop_Drop_Tine.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Tin, 1L)); + + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Coppon.get(4L), new ItemStack(Blocks.wool, 1, 1)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Plumbilia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Argentia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Indigo.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Ferru.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Aurelia.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_OilBerry.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_BobsYerUncleRanks.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Tine.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(ItemList.Crop_Drop_Rape.get(4L), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(new ItemStack(Blocks.red_flower, 8, 32767), ItemList.IC2_PlantballCompressed.get(1L)); + GT_ModHandler.addCompressionRecipe(new ItemStack(Blocks.yellow_flower, 8, 32767), ItemList.IC2_PlantballCompressed.get(1L)); + + GT_ModHandler.addPulverisationRecipe(ItemList.Food_Sliced_Cheese.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Cheese, 1L)); + GT_ModHandler.addPulverisationRecipe(ItemList.Dye_Cocoa.get(1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cocoa, 1L)); + GT_ModHandler.addPulverisationRecipe(ItemList.Crop_Drop_Tine.get(1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L)); + GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.reeds, 1), new ItemStack(Items.sugar, 1), null, 0, false); + GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.melon_block, 1, 0), new ItemStack(Items.melon, 8, 0), new ItemStack(Items.melon_seeds, 1), 80, false); + GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.pumpkin, 1, 0), new ItemStack(Items.pumpkin_seeds, 4, 0), null, 0, false); + GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.melon, 1, 0), new ItemStack(Items.melon_seeds, 1, 0), null, 0, false); + GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.wheat, 1, 0), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), null, 0, false); + GT_ModHandler.addPulverisationRecipe(GT_ModHandler.getIC2Item("crop", 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), null, 0, false); + GT_ModHandler.addPulverisationRecipe(new ItemStack(Items.stick, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wood, 2L), null, 0, false); + GT_ModHandler.addPulverisationRecipe(new ItemStack(Blocks.wool, 1, 32767), new ItemStack(Items.string, 2), new ItemStack(Items.string, 1), 50, false); + try { + ic2.api.crops.CropCard tCrop; + GT_Utility.getField(tCrop = ic2.api.crops.Crops.instance.getCropList()[13], "mDrop").set(tCrop, ItemList.Crop_Drop_Ferru.get(1L)); + GT_Utility.getField(tCrop = ic2.api.crops.Crops.instance.getCropList()[14], "mDrop").set(tCrop, ItemList.Crop_Drop_Aurelia.get(1L)); + } catch (Throwable e) { + if (GT_Values.D1) { + e.printStackTrace(GT_Log.err); + } + } + ItemList.Display_ITS_FREE.set(addItem(tLastID = 766, "ITS FREE", "(or at least almost free)", SubTag.INVISIBLE, new TC_Aspects.TC_AspectStack(TC_Aspects.LUCRUM, 1L))); +} + + public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) { + super.onLeftClickEntity(aStack, aPlayer, aEntity); + int aDamage = aStack.getItemDamage(); + if ((aDamage >= 25000) && (aDamage < 27000)) { + if (aDamage >= 26000) { + return Behaviour_Arrow.DEFAULT_PLASTIC.onLeftClickEntity(this, aStack, aPlayer, aEntity); + } + return Behaviour_Arrow.DEFAULT_WOODEN.onLeftClickEntity(this, aStack, aPlayer, aEntity); + } + return false; + } + + public boolean hasProjectile(SubTag aProjectileType, ItemStack aStack) { + int aDamage = aStack.getItemDamage(); + return ((aDamage >= 25000) && (aDamage < 27000)) || (super.hasProjectile(aProjectileType, aStack)); + } + + public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) { + int aDamage = aStack.getItemDamage(); + if ((aDamage >= 25000) && (aDamage < 27000)) { + if (aDamage >= 26000) { + return Behaviour_Arrow.DEFAULT_PLASTIC.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ); + } + return Behaviour_Arrow.DEFAULT_WOODEN.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ); + } + return super.getProjectile(aProjectileType, aStack, aWorld, aX, aY, aZ); + } + + public EntityArrow getProjectile(SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) { + int aDamage = aStack.getItemDamage(); + if ((aDamage >= 25000) && (aDamage < 27000)) { + if (aDamage >= 26000) { + return Behaviour_Arrow.DEFAULT_PLASTIC.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); + } + return Behaviour_Arrow.DEFAULT_WOODEN.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); + } + return super.getProjectile(aProjectileType, aStack, aWorld, aEntity, aSpeed); + } + + public boolean isItemStackUsable(ItemStack aStack) { + int aDamage = aStack.getItemDamage(); + Materials aMaterial = GregTech_API.sGeneratedMaterials[(aDamage % 1000)]; + if ((aDamage >= 25000) && (aDamage < 27000) && (aMaterial != null) && (aMaterial.mEnchantmentTools != null)) { + Enchantment tEnchant = aMaterial.mEnchantmentTools == Enchantment.fortune ? Enchantment.looting : aMaterial.mEnchantmentTools; + if (tEnchant.type == EnumEnchantmentType.weapon) { + NBTTagCompound tNBT = GT_Utility.ItemNBT.getNBT(aStack); + if (!tNBT.getBoolean("GT.HasBeenUpdated")) { + tNBT.setBoolean("GT.HasBeenUpdated", true); + GT_Utility.ItemNBT.setNBT(aStack, tNBT); + GT_Utility.ItemNBT.addEnchantment(aStack, tEnchant, aMaterial.mEnchantmentToolsLevel); + } + } + } + return super.isItemStackUsable(aStack); + } + + public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) { + return (aDoShowAllItems) || (!aPrefix.name().startsWith("toolHead")); + } + + public ItemStack onDispense(IBlockSource aSource, ItemStack aStack) { + int aDamage = aStack.getItemDamage(); + if ((aDamage >= 25000) && (aDamage < 27000)) { + if (aDamage >= 26000) { + return Behaviour_Arrow.DEFAULT_PLASTIC.onDispense(this, aSource, aStack); + } + return Behaviour_Arrow.DEFAULT_WOODEN.onDispense(this, aSource, aStack); + } + return super.onDispense(aSource, aStack); + } + + public final ItemStack getContainerItem(ItemStack aStack) { + int aDamage = aStack.getItemDamage(); + if (aDamage < 32000) { + return null; + } + if (aDamage < 32100) { + return ItemList.ThermosCan_Empty.get(1L); + } + if (aDamage < 32200) { + return ItemList.Bottle_Empty.get(1L); + } + return null; + } +} diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java index 7fd41f9117..682f04bf57 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java @@ -1,241 +1,241 @@ -package gregtech.common.items;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.items.GT_MetaGenerated_Item_X32;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.common.covers.GT_Cover_SolarPanel;
-
-public class GT_MetaGenerated_Item_03
- extends GT_MetaGenerated_Item_X32 {
- public static GT_MetaGenerated_Item_03 INSTANCE;
-
- public GT_MetaGenerated_Item_03() {
- super("metaitem.03", new OrePrefixes[]{OrePrefixes.crateGtDust, OrePrefixes.crateGtIngot, OrePrefixes.crateGtGem, OrePrefixes.crateGtPlate});
- INSTANCE = this;
- int tLastID = 0;
- Object[] o = new Object[0];
-
- /**
- * circuit boards tier 1-7:
- * coated circuit board / wood plate + resin
- * Plastic Circuit Board / Plastic + Copper Foil + Sulfuric Acid
- * phenolic circuit board /carton+glue+chemical bath
- * epoxy circuit board /epoxy plate + copper foil + sulfuric acid
- * fiberglass circuit board (simple + multilayer) / glass + plastic + electrum foil + sulfurci acid
- * wetware lifesupport board / fiberglass CB + teflon +
- */
-// ItemList.Circuit_Board_Coated.set(addItem(tLastID = 1, "Coated Circuit Board", "A basic Board", o));
-// ItemList.Circuit_Board_Phenolic.set(addItem(tLastID = 2, "Phenolic Circuit Board", "A good Board", o));
-// ItemList.Circuit_Board_Epoxy.set(addItem(tLastID = 3, "Epoxy Circuit Board", "An advanced Board", o));
-// ItemList.Circuit_Board_Fiberglass.set(addItem(tLastID = 4, "Fiberglass Circuit Board", "An advanced Board", o));
-// ItemList.Circuit_Board_Multifiberglass.set(addItem(tLastID = 5, "Multilayer Fiberglass Circuit Board", "A elite Board", o));
- ItemList.Circuit_Board_Wetware.set(addItem(tLastID = 6, "Wetware Lifesupport Circuit Board", "The Board that keeps life", o));
- ItemList.Circuit_Board_Plastic.set(addItem(tLastID = 7, "Plastic Circuit Board", "A Good Board", o));
- ItemList.Circuit_Board_Bio.set(addItem(tLastID = 8, "Bio Circuit Board", "Bio genetic mutated Board", o));
-
- /**
- * electronic components:
- * vacuum tube (glass tube + red alloy cables)
- * basic electronic circuits normal+smd
- * coils
- * diodes normal+smd
- * transistors normal+smd
- * capacitors normal+smd
- * Glass Fibers
- */
-// ItemList.Circuit_Parts_Resistor.set(addItem(tLastID = 10, "Resistor", "Basic Electronic Component", o)); //wiring mv
- ItemList.Circuit_Parts_ResistorSMD.set(addItem(tLastID = 11, "SMD Resistor", "Electronic Component", o));
- ItemList.Circuit_Parts_Glass_Tube.set(addItem(tLastID = 12, "Glass Tube", "", o));
-// ItemList.Circuit_Parts_Vacuum_Tube.set(addItem(tLastID = 13, "Vacuum Tube", "Basic Electronic Component", o)); //Circuit_Primitive
- ItemList.Circuit_Parts_Coil.set(addItem(tLastID = 14, "Small Coil", "Basic Electronic Component", o));
-// ItemList.Circuit_Parts_Diode.set(addItem(tLastID = 15, "Diode", "Basic Electronic Component", o));
- ItemList.Circuit_Parts_DiodeSMD.set(addItem(tLastID = 16, "SMD Diode", "Electronic Component", o));
-// ItemList.Circuit_Parts_Transistor.set(addItem(tLastID = 17, "Transistor", "Basic Electronic Component", o)); //wiring hv
- ItemList.Circuit_Parts_TransistorSMD.set(addItem(tLastID = 18, "SMD Transistor", "Electronic Component", o));
-// ItemList.Circuit_Parts_Capacitor.set(addItem(tLastID = 19, "Capacitor", "Electronic Component", o)); //wiring ev
- ItemList.Circuit_Parts_CapacitorSMD.set(addItem(tLastID = 20, "SMD Capacitor", "Electronic Component", o));
- ItemList.Circuit_Parts_GlassFiber.set(addItem(tLastID = 21, "Glass Fiber", Materials.BorosilicateGlass.mChemicalFormula, o));
- ItemList.Circuit_Parts_PetriDish.set(addItem(tLastID = 22, "Petri Dish", "For cultivating cells", o));
- ItemList.Circuit_Parts_Reinforced_Glass_Tube.set(addItem(tLastID = 23, "Reinforced Glass Tube", "", o));
-//
-
- /**
- * ICs
- * Lenses made from perfect crystals first instead of plates
- * Monocrystalline silicon ingot (normal+glowstone+naquadah) EBF, normal silicon no EBF need anymore
- * wafer(normal+glowstone+naquadah) cut mono silicon ingot in cutting machine
- *
- * Integrated Logic Circuit(8bit DIP)
- * RAM
- * NAND Memory
- * NOR Memory
- * CPU (4 sizes)
- * SoCs(2 sizes, high tier cheap low tech component)
- * Power IC/High Power IC/Ultra High power
- *
- * nanotube interconnected circuit (H-IC + nanotubes)
- *
- * quantum chips
- */
- ItemList.Circuit_Silicon_Ingot.set(addItem(tLastID = 30, "Monocrystalline Silicon Boule", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Ingot2.set(addItem(tLastID = 31, "Glowstone doped Monocrystalline Silicon Boule", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Ingot3.set(addItem(tLastID = 32, "Naquadah doped Monocrystalline Silicon Boule", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Ingot4.set(addItem(tLastID = 150, "Europium doped Monocrystalline Silicon Boule", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Ingot5.set(addItem(tLastID = 152, "Americium doped Monocrystalline Silicon Boule", "Raw Circuit", o));
-
- ItemList.Circuit_Silicon_Wafer.set(addItem(tLastID = 33, "Wafer", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Wafer2.set(addItem(tLastID = 34, "Glowstone doped Wafer", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Wafer3.set(addItem(tLastID = 35, "Naquadah doped Wafer", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Wafer4.set(addItem(tLastID = 151, "Europium doped Wafer", "Raw Circuit", o));
- ItemList.Circuit_Silicon_Wafer5.set(addItem(tLastID = 153, "Americium doped Wafer", "Raw Circuit", o));
-
- ItemList.Circuit_Wafer_ILC.set(addItem(tLastID = 36, "Integrated Logic Circuit (Wafer)", "Raw Circuit", o));
- ItemList.Circuit_Chip_ILC.set(addItem(tLastID = 37, "Integrated Logic Circuit", "Integrated Circuit", o));
-
- ItemList.Circuit_Wafer_Ram.set(addItem(tLastID = 38, "Random Access Memory Chip (Wafer)", "Raw Circuit", o));
- ItemList.Circuit_Chip_Ram.set(addItem(tLastID = 39, "Random Access Memory Chip", "Integrated Circuit", o));
-
- ItemList.Circuit_Wafer_NAND.set(addItem(tLastID = 40, "NAND Memory Chip (Wafer)", "Raw Circuit", o));
- ItemList.Circuit_Chip_NAND.set(addItem(tLastID = 41, "NAND Memory Chip", "Integrated Circuit", o));
-
- ItemList.Circuit_Wafer_NOR.set(addItem(tLastID = 42, "NOR Memory Chip (Wafer)", "Raw Circuit", o));
- ItemList.Circuit_Chip_NOR.set(addItem(tLastID = 43, "NOR Memory Chip", "Integrated Circuit", o));
-
- ItemList.Circuit_Wafer_CPU.set(addItem(tLastID = 44, "Central Processing Unit (Wafer)", "Raw Circuit", o));
- ItemList.Circuit_Chip_CPU.set(addItem(tLastID = 45, "Central Processing Unit", "Integrated Circuit", o));
-
- ItemList.Circuit_Wafer_SoC.set(addItem(tLastID = 46, "SoC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_SoC.set(addItem(tLastID = 47, "SoC", "System on a Chip", o));
-
- ItemList.Circuit_Wafer_SoC2.set(addItem(tLastID = 48, "ASoC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_SoC2.set(addItem(tLastID = 49, "ASoC", "Advanced System on a Chip", o));
-
- ItemList.Circuit_Wafer_PIC.set(addItem(tLastID = 50, "PIC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_PIC.set(addItem(tLastID = 51, "Power IC", "Power Circuit", o));
-
- ItemList.Circuit_Wafer_HPIC.set(addItem(tLastID = 52, "HPIC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_HPIC.set(addItem(tLastID = 53, "High Power IC", "High Power Circuit", o));
-
- ItemList.Circuit_Wafer_NanoCPU.set(addItem(tLastID = 54, "NanoCPU Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_NanoCPU.set(addItem(tLastID = 55, "Nanocomponent Central Processing Unit", "Power Circuit", o));
-
- ItemList.Circuit_Wafer_QuantumCPU.set(addItem(tLastID = 56, "QBit Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_QuantumCPU.set(addItem(tLastID = 57, "QBit Processing Unit", "Quantum CPU", o));
-
- ItemList.Circuit_Wafer_UHPIC.set(addItem(tLastID = 58, "UHPIC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_UHPIC.set(addItem(tLastID = 59, "Ultra High Power IC", "Ultra High Power Circuit", o));
-
- ItemList.Circuit_Wafer_Simple_SoC.set(addItem(tLastID = 60, "Simple SoC Wafer", "Raw Primitive Circuit", o));
- ItemList.Circuit_Chip_Simple_SoC.set(addItem(tLastID = 61, "Simple SoC", "Simple System on a Chip", o));
-
- ItemList.Circuit_Wafer_ULPIC.set(addItem(tLastID = 62, "ULPIC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_ULPIC.set(addItem(tLastID = 63, "Ultra Low Power IC", "Ultra Low Power Circuit", o));
-
- ItemList.Circuit_Wafer_LPIC.set(addItem(tLastID = 64, "LPIC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_LPIC.set(addItem(tLastID = 65, "Low Power IC", "Low Power Circuit", o));
-
- ItemList.Circuit_Wafer_NPIC.set(addItem(tLastID = 160, "NPIC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_NPIC.set(addItem(tLastID = 161, "Nano Power IC", "Nano Power Circuit", o));
-
- ItemList.Circuit_Wafer_PPIC.set(addItem(tLastID = 162, "PPIC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_PPIC.set(addItem(tLastID = 163, "Piko Power IC", "Piko Power Circuit", o));
-
- ItemList.Circuit_Wafer_QPIC.set(addItem(tLastID = 164, "QPIC Wafer", "Raw Circuit", o));
- ItemList.Circuit_Chip_QPIC.set(addItem(tLastID = 165, "Quantum Power IC", "Quantum Power Circuit", o));
- /**
- * Engraved Crystal Chip
- * Engraved Lapotron Chip
- * Crystal CPU
- * SoCrystal
- * stem cells (disassemble eggs)
- */
- ItemList.Circuit_Chip_CrystalSoC2.set(addItem(tLastID = 68, "Raw Advanced Crystal Chip", "Raw Advanced Crystal Processor", o));
- ItemList.Circuit_Parts_RawCrystalChip.set(addItem(tLastID = 69, "Raw Crystal Chip", "Raw Crystal Processor", o));
- ItemList.Circuit_Chip_CrystalCPU.set(addItem(tLastID = 70, "Crystal Processing Unit", "Crystal CPU", o)); //Crystal chip elite part
- ItemList.Circuit_Chip_CrystalSoC.set(addItem(tLastID = 71, "Crystal SoC", "Crystal System on a Chip", o));
- ItemList.Circuit_Chip_NeuroCPU.set(addItem(tLastID = 72, "Neuro Processing Unit", "Neuro CPU", o));
- ItemList.Circuit_Chip_Stemcell.set(addItem(tLastID = 73, "Stemcells", "Raw inteligence", o));
- ItemList.Circuit_Parts_RawCrystalParts.set(addItem(tLastID = 74, "Raw Crystal Chip Parts", "Raw Crystal Processor Parts", o));
- ItemList.Circuit_Chip_Biocell.set(addItem(tLastID = 76, "Biocells", "Mutated Raw inteligence", o));
- ItemList.Circuit_Chip_BioCPU.set(addItem(tLastID = 77, "Bio Processing Unit", "Bio CPU", o));
-
- //Nand Chip
- ItemList.NandChip.set(addItem(tLastID = 75, "Nand Chip", "A very simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive), SubTag.NO_UNIFICATION}));
-
- //Vacuum Tube Item01
- //Basic Circuit IC2
- //Good Circuit Item01
-
- //Integrated Logic Circuit Item01
- ItemList.Circuit_Integrated_Good.set(addItem(tLastID = 79, "Good Integrated Circuit", "Good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION}));
- //Good Integrated Circuit Item01
- //Advanced Circuit IC2
-
- ItemList.Circuit_Microprocessor.set(addItem(tLastID = 78, "Microprocessor", "A Basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Processor.set(addItem(tLastID = 80, "Integrated Processor", "A Good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION}));
- //ItemList.Circuit_Computer.set(addItem(tLastID = 81, "Processor Assembly", "Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION}));
- //Workstation/ Item01 Datacircuit
- //Mainframe Item01 DataProcessor
-
- ItemList.Circuit_Nanoprocessor.set(addItem(tLastID = 82, "Nanoprocessor", "An Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Nanocomputer.set(addItem(tLastID = 83, "Nanoprocessor Assembly", "An Extreme Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Elitenanocomputer.set(addItem(tLastID = 84, "Elite Nanocomputer", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION}));
- //Nanoprocessor Mainframe Item01 Energy Flow Circuit
-
- ItemList.Circuit_Quantumprocessor.set(addItem(tLastID = 85, "Quantumprocessor", "An Extreme Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Quantumcomputer.set(addItem(tLastID = 86, "Quantumprocessor Assembly", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Masterquantumcomputer.set(addItem(tLastID = 87, "Master Quantumcomputer", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Quantummainframe.set(addItem(tLastID = 88, "Quantumprocessor Mainframe", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION}));
-
- ItemList.Circuit_Crystalprocessor.set(addItem(tLastID = 89, "Crystalprocessor", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Crystalcomputer.set(addItem(tLastID = 96, "Crystalprocessor Assembly", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Ultimatecrystalcomputer.set(addItem(tLastID = 90, "Ultimate Crystalcomputer", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Crystalmainframe.set(addItem(tLastID = 91, "Crystalprocessor Mainframe", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION}));
-
- ItemList.Circuit_Neuroprocessor.set(addItem(tLastID = 92, "Wetwareprocessor", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Wetwarecomputer.set(addItem(tLastID = 93, "Wetwareprocessor Assembly", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Wetwaresupercomputer.set(addItem(tLastID = 94, "Wetware Supercomputer", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Wetwaremainframe.set(addItem(tLastID = 95, "Wetware Mainframe", "An Infinite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Ultimate.set(ItemList.Circuit_Ultimatecrystalcomputer.get(1L, new Object[0]));//maybe should be removed
- ItemList.Circuit_Biowarecomputer.set(addItem(tLastID = 98, "Biowareprocessor Assembly", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION}));
- ItemList.Circuit_Biowaresupercomputer.set(addItem(tLastID = 99, "Bioware Supercomputer", "An Infinite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION}));
-
- ItemList.Circuit_Bioprocessor.set(addItem(tLastID = 97, "Bioprocessor", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION}));
-
- ItemList.Circuit_Board_Coated_Basic.set(addItem(tLastID = 100, "Circuit Board", "A basic Circuit Board", o));
- ItemList.Circuit_Board_Phenolic_Good.set(addItem(tLastID = 101, "Good Circuit Board", "A good Circuit Board", o));
- ItemList.Circuit_Board_Epoxy_Advanced.set(addItem(tLastID = 102, "Advanced Circuit Board", "A advanced Circuit Board", o));
- ItemList.Circuit_Board_Fiberglass_Advanced.set(addItem(tLastID = 103, "More Advanced Circuit Board", "A more advanced Circuit Board", o));
- ItemList.Circuit_Board_Multifiberglass_Elite.set(addItem(tLastID = 104, "Elite Circuit Board", "A elite Circuit Board", o));
- ItemList.Circuit_Board_Wetware_Extreme.set(addItem(tLastID = 105, "Extreme Wetware Lifesupport Circuit Board", "The Board that keeps life", o));
- ItemList.Circuit_Board_Plastic_Advanced.set(addItem(tLastID = 106, "Plastic Circuit Board", "A good Board", o));
- ItemList.Circuit_Board_Bio_Ultra.set(addItem(tLastID = 107, "Ultra Bio Mutated Circuit Board", "Bio genetic mutated Board", o));
- ItemList.Circuit_Biomainframe.set(addItem(tLastID = 120, "Bio Mainframe", "A Bio Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Bio), SubTag.NO_UNIFICATION}));
-
- ItemList.Tube_Wires.set(addItem(tLastID = 110, "Tube Wires", "For the Vacuum Tubes", o));
-
- ItemList.Cover_SolarPanel_UHV.set(addItem(tLastID = 130, "Solar Panel (UHV)", "Ultimate High Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 128L)}));
- ItemList.Cover_SolarPanel_UEV.set(addItem(tLastID = 131, "Solar Panel (UEV)", "Ultimate Extreme Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 256L)}));
- ItemList.Cover_SolarPanel_UIV.set(addItem(tLastID = 132, "Solar Panel (UIV)", "Ultimate Insane Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 512L)}));
-
- GregTech_API.registerCover(ItemList.Cover_SolarPanel_UHV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UHV), new GT_Cover_SolarPanel(2097152));
- GregTech_API.registerCover(ItemList.Cover_SolarPanel_UEV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UEV), new GT_Cover_SolarPanel(8388608));
- GregTech_API.registerCover(ItemList.Cover_SolarPanel_UIV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UIV), new GT_Cover_SolarPanel(33554432));
-
- ItemList.ULV_Coil.set(addItem(tLastID = 140, "Ultra Low Voltage Coil", "Primitive Coil", o));
- ItemList.LV_Coil.set(addItem(tLastID = 141, "Low Voltage Coil", "Basic Coil", o));
- ItemList.MV_Coil.set(addItem(tLastID = 142, "Medium Voltage Coil", "Good Coil", o));
- ItemList.HV_Coil.set(addItem(tLastID = 143, "High Voltage Coil", "Advanced Coil", o));
- ItemList.EV_Coil.set(addItem(tLastID = 144, "Extreme Voltage Coil", "Extreme Coil", o));
- ItemList.IV_Coil.set(addItem(tLastID = 145, "Insane Voltage Coil", "Elite Coil", o));
- ItemList.LuV_Coil.set(addItem(tLastID = 146, "Ludicrous Voltage Coil", "Master Coil", o));
- ItemList.ZPM_Coil.set(addItem(tLastID = 147, "ZPM Voltage Coil", "Ultimate Coil", o));
- ItemList.UV_Coil.set(addItem(tLastID = 148, "Ultimate Voltage Coil", "Super Coil", o));
- ItemList.UHV_Coil.set(addItem(tLastID = 149, "Highly Ultimate Voltage Coil", "Infinite Coil", o));
- }
-
- public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) {
- return aDoShowAllItems;
- }
+package gregtech.common.items; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.*; +import gregtech.api.items.GT_MetaGenerated_Item_X32; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.common.covers.GT_Cover_SolarPanel; + +public class GT_MetaGenerated_Item_03 + extends GT_MetaGenerated_Item_X32 { + public static GT_MetaGenerated_Item_03 INSTANCE; + + public GT_MetaGenerated_Item_03() { + super("metaitem.03", new OrePrefixes[]{OrePrefixes.crateGtDust, OrePrefixes.crateGtIngot, OrePrefixes.crateGtGem, OrePrefixes.crateGtPlate}); + INSTANCE = this; + int tLastID = 0; + Object[] o = new Object[0]; + + /** + * circuit boards tier 1-7: + * coated circuit board / wood plate + resin + * Plastic Circuit Board / Plastic + Copper Foil + Sulfuric Acid + * phenolic circuit board /carton+glue+chemical bath + * epoxy circuit board /epoxy plate + copper foil + sulfuric acid + * fiberglass circuit board (simple + multilayer) / glass + plastic + electrum foil + sulfurci acid + * wetware lifesupport board / fiberglass CB + teflon + + */ +// ItemList.Circuit_Board_Coated.set(addItem(tLastID = 1, "Coated Circuit Board", "A basic Board", o)); +// ItemList.Circuit_Board_Phenolic.set(addItem(tLastID = 2, "Phenolic Circuit Board", "A good Board", o)); +// ItemList.Circuit_Board_Epoxy.set(addItem(tLastID = 3, "Epoxy Circuit Board", "An advanced Board", o)); +// ItemList.Circuit_Board_Fiberglass.set(addItem(tLastID = 4, "Fiberglass Circuit Board", "An advanced Board", o)); +// ItemList.Circuit_Board_Multifiberglass.set(addItem(tLastID = 5, "Multilayer Fiberglass Circuit Board", "A elite Board", o)); + ItemList.Circuit_Board_Wetware.set(addItem(tLastID = 6, "Wetware Lifesupport Circuit Board", "The Board that keeps life", o)); + ItemList.Circuit_Board_Plastic.set(addItem(tLastID = 7, "Plastic Circuit Board", "A Good Board", o)); + ItemList.Circuit_Board_Bio.set(addItem(tLastID = 8, "Bio Circuit Board", "Bio genetic mutated Board", o)); + + /** + * electronic components: + * vacuum tube (glass tube + red alloy cables) + * basic electronic circuits normal+smd + * coils + * diodes normal+smd + * transistors normal+smd + * capacitors normal+smd + * Glass Fibers + */ +// ItemList.Circuit_Parts_Resistor.set(addItem(tLastID = 10, "Resistor", "Basic Electronic Component", o)); //wiring mv + ItemList.Circuit_Parts_ResistorSMD.set(addItem(tLastID = 11, "SMD Resistor", "Electronic Component", o)); + ItemList.Circuit_Parts_Glass_Tube.set(addItem(tLastID = 12, "Glass Tube", "", o)); +// ItemList.Circuit_Parts_Vacuum_Tube.set(addItem(tLastID = 13, "Vacuum Tube", "Basic Electronic Component", o)); //Circuit_Primitive + ItemList.Circuit_Parts_Coil.set(addItem(tLastID = 14, "Small Coil", "Basic Electronic Component", o)); +// ItemList.Circuit_Parts_Diode.set(addItem(tLastID = 15, "Diode", "Basic Electronic Component", o)); + ItemList.Circuit_Parts_DiodeSMD.set(addItem(tLastID = 16, "SMD Diode", "Electronic Component", o)); +// ItemList.Circuit_Parts_Transistor.set(addItem(tLastID = 17, "Transistor", "Basic Electronic Component", o)); //wiring hv + ItemList.Circuit_Parts_TransistorSMD.set(addItem(tLastID = 18, "SMD Transistor", "Electronic Component", o)); +// ItemList.Circuit_Parts_Capacitor.set(addItem(tLastID = 19, "Capacitor", "Electronic Component", o)); //wiring ev + ItemList.Circuit_Parts_CapacitorSMD.set(addItem(tLastID = 20, "SMD Capacitor", "Electronic Component", o)); + ItemList.Circuit_Parts_GlassFiber.set(addItem(tLastID = 21, "Glass Fiber", Materials.BorosilicateGlass.mChemicalFormula, o)); + ItemList.Circuit_Parts_PetriDish.set(addItem(tLastID = 22, "Petri Dish", "For cultivating cells", o)); + ItemList.Circuit_Parts_Reinforced_Glass_Tube.set(addItem(tLastID = 23, "Reinforced Glass Tube", "", o)); +// + + /** + * ICs + * Lenses made from perfect crystals first instead of plates + * Monocrystalline silicon ingot (normal+glowstone+naquadah) EBF, normal silicon no EBF need anymore + * wafer(normal+glowstone+naquadah) cut mono silicon ingot in cutting machine + * + * Integrated Logic Circuit(8bit DIP) + * RAM + * NAND Memory + * NOR Memory + * CPU (4 sizes) + * SoCs(2 sizes, high tier cheap low tech component) + * Power IC/High Power IC/Ultra High power + * + * nanotube interconnected circuit (H-IC + nanotubes) + * + * quantum chips + */ + ItemList.Circuit_Silicon_Ingot.set(addItem(tLastID = 30, "Monocrystalline Silicon Boule", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Ingot2.set(addItem(tLastID = 31, "Glowstone doped Monocrystalline Silicon Boule", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Ingot3.set(addItem(tLastID = 32, "Naquadah doped Monocrystalline Silicon Boule", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Ingot4.set(addItem(tLastID = 150, "Europium doped Monocrystalline Silicon Boule", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Ingot5.set(addItem(tLastID = 152, "Americium doped Monocrystalline Silicon Boule", "Raw Circuit", o)); + + ItemList.Circuit_Silicon_Wafer.set(addItem(tLastID = 33, "Wafer", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Wafer2.set(addItem(tLastID = 34, "Glowstone doped Wafer", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Wafer3.set(addItem(tLastID = 35, "Naquadah doped Wafer", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Wafer4.set(addItem(tLastID = 151, "Europium doped Wafer", "Raw Circuit", o)); + ItemList.Circuit_Silicon_Wafer5.set(addItem(tLastID = 153, "Americium doped Wafer", "Raw Circuit", o)); + + ItemList.Circuit_Wafer_ILC.set(addItem(tLastID = 36, "Integrated Logic Circuit (Wafer)", "Raw Circuit", o)); + ItemList.Circuit_Chip_ILC.set(addItem(tLastID = 37, "Integrated Logic Circuit", "Integrated Circuit", o)); + + ItemList.Circuit_Wafer_Ram.set(addItem(tLastID = 38, "Random Access Memory Chip (Wafer)", "Raw Circuit", o)); + ItemList.Circuit_Chip_Ram.set(addItem(tLastID = 39, "Random Access Memory Chip", "Integrated Circuit", o)); + + ItemList.Circuit_Wafer_NAND.set(addItem(tLastID = 40, "NAND Memory Chip (Wafer)", "Raw Circuit", o)); + ItemList.Circuit_Chip_NAND.set(addItem(tLastID = 41, "NAND Memory Chip", "Integrated Circuit", o)); + + ItemList.Circuit_Wafer_NOR.set(addItem(tLastID = 42, "NOR Memory Chip (Wafer)", "Raw Circuit", o)); + ItemList.Circuit_Chip_NOR.set(addItem(tLastID = 43, "NOR Memory Chip", "Integrated Circuit", o)); + + ItemList.Circuit_Wafer_CPU.set(addItem(tLastID = 44, "Central Processing Unit (Wafer)", "Raw Circuit", o)); + ItemList.Circuit_Chip_CPU.set(addItem(tLastID = 45, "Central Processing Unit", "Integrated Circuit", o)); + + ItemList.Circuit_Wafer_SoC.set(addItem(tLastID = 46, "SoC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_SoC.set(addItem(tLastID = 47, "SoC", "System on a Chip", o)); + + ItemList.Circuit_Wafer_SoC2.set(addItem(tLastID = 48, "ASoC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_SoC2.set(addItem(tLastID = 49, "ASoC", "Advanced System on a Chip", o)); + + ItemList.Circuit_Wafer_PIC.set(addItem(tLastID = 50, "PIC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_PIC.set(addItem(tLastID = 51, "Power IC", "Power Circuit", o)); + + ItemList.Circuit_Wafer_HPIC.set(addItem(tLastID = 52, "HPIC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_HPIC.set(addItem(tLastID = 53, "High Power IC", "High Power Circuit", o)); + + ItemList.Circuit_Wafer_NanoCPU.set(addItem(tLastID = 54, "NanoCPU Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_NanoCPU.set(addItem(tLastID = 55, "Nanocomponent Central Processing Unit", "Power Circuit", o)); + + ItemList.Circuit_Wafer_QuantumCPU.set(addItem(tLastID = 56, "QBit Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_QuantumCPU.set(addItem(tLastID = 57, "QBit Processing Unit", "Quantum CPU", o)); + + ItemList.Circuit_Wafer_UHPIC.set(addItem(tLastID = 58, "UHPIC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_UHPIC.set(addItem(tLastID = 59, "Ultra High Power IC", "Ultra High Power Circuit", o)); + + ItemList.Circuit_Wafer_Simple_SoC.set(addItem(tLastID = 60, "Simple SoC Wafer", "Raw Primitive Circuit", o)); + ItemList.Circuit_Chip_Simple_SoC.set(addItem(tLastID = 61, "Simple SoC", "Simple System on a Chip", o)); + + ItemList.Circuit_Wafer_ULPIC.set(addItem(tLastID = 62, "ULPIC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_ULPIC.set(addItem(tLastID = 63, "Ultra Low Power IC", "Ultra Low Power Circuit", o)); + + ItemList.Circuit_Wafer_LPIC.set(addItem(tLastID = 64, "LPIC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_LPIC.set(addItem(tLastID = 65, "Low Power IC", "Low Power Circuit", o)); + + ItemList.Circuit_Wafer_NPIC.set(addItem(tLastID = 160, "NPIC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_NPIC.set(addItem(tLastID = 161, "Nano Power IC", "Nano Power Circuit", o)); + + ItemList.Circuit_Wafer_PPIC.set(addItem(tLastID = 162, "PPIC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_PPIC.set(addItem(tLastID = 163, "Piko Power IC", "Piko Power Circuit", o)); + + ItemList.Circuit_Wafer_QPIC.set(addItem(tLastID = 164, "QPIC Wafer", "Raw Circuit", o)); + ItemList.Circuit_Chip_QPIC.set(addItem(tLastID = 165, "Quantum Power IC", "Quantum Power Circuit", o)); + /** + * Engraved Crystal Chip + * Engraved Lapotron Chip + * Crystal CPU + * SoCrystal + * stem cells (disassemble eggs) + */ + ItemList.Circuit_Chip_CrystalSoC2.set(addItem(tLastID = 68, "Raw Advanced Crystal Chip", "Raw Advanced Crystal Processor", o)); + ItemList.Circuit_Parts_RawCrystalChip.set(addItem(tLastID = 69, "Raw Crystal Chip", "Raw Crystal Processor", o)); + ItemList.Circuit_Chip_CrystalCPU.set(addItem(tLastID = 70, "Crystal Processing Unit", "Crystal CPU", o)); //Crystal chip elite part + ItemList.Circuit_Chip_CrystalSoC.set(addItem(tLastID = 71, "Crystal SoC", "Crystal System on a Chip", o)); + ItemList.Circuit_Chip_NeuroCPU.set(addItem(tLastID = 72, "Neuro Processing Unit", "Neuro CPU", o)); + ItemList.Circuit_Chip_Stemcell.set(addItem(tLastID = 73, "Stemcells", "Raw inteligence", o)); + ItemList.Circuit_Parts_RawCrystalParts.set(addItem(tLastID = 74, "Raw Crystal Chip Parts", "Raw Crystal Processor Parts", o)); + ItemList.Circuit_Chip_Biocell.set(addItem(tLastID = 76, "Biocells", "Mutated Raw inteligence", o)); + ItemList.Circuit_Chip_BioCPU.set(addItem(tLastID = 77, "Bio Processing Unit", "Bio CPU", o)); + + //Nand Chip + ItemList.NandChip.set(addItem(tLastID = 75, "Nand Chip", "A very simple Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Primitive), SubTag.NO_UNIFICATION})); + + //Vacuum Tube Item01 + //Basic Circuit IC2 + //Good Circuit Item01 + + //Integrated Logic Circuit Item01 + ItemList.Circuit_Integrated_Good.set(addItem(tLastID = 79, "Good Integrated Circuit", "Good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION})); + //Good Integrated Circuit Item01 + //Advanced Circuit IC2 + + ItemList.Circuit_Microprocessor.set(addItem(tLastID = 78, "Microprocessor", "A Basic Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Basic), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Processor.set(addItem(tLastID = 80, "Integrated Processor", "A Good Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Good), SubTag.NO_UNIFICATION})); + //ItemList.Circuit_Computer.set(addItem(tLastID = 81, "Processor Assembly", "Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION})); + //Workstation/ Item01 Datacircuit + //Mainframe Item01 DataProcessor + + ItemList.Circuit_Nanoprocessor.set(addItem(tLastID = 82, "Nanoprocessor", "An Advanced Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Advanced), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Nanocomputer.set(addItem(tLastID = 83, "Nanoprocessor Assembly", "An Extreme Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Elitenanocomputer.set(addItem(tLastID = 84, "Elite Nanocomputer", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION})); + //Nanoprocessor Mainframe Item01 Energy Flow Circuit + + ItemList.Circuit_Quantumprocessor.set(addItem(tLastID = 85, "Quantumprocessor", "An Extreme Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Quantumcomputer.set(addItem(tLastID = 86, "Quantumprocessor Assembly", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Masterquantumcomputer.set(addItem(tLastID = 87, "Master Quantumcomputer", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Quantummainframe.set(addItem(tLastID = 88, "Quantumprocessor Mainframe", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION})); + + ItemList.Circuit_Crystalprocessor.set(addItem(tLastID = 89, "Crystalprocessor", "An Elite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Elite), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Crystalcomputer.set(addItem(tLastID = 96, "Crystalprocessor Assembly", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Ultimatecrystalcomputer.set(addItem(tLastID = 90, "Ultimate Crystalcomputer", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Crystalmainframe.set(addItem(tLastID = 91, "Crystalprocessor Mainframe", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION})); + + ItemList.Circuit_Neuroprocessor.set(addItem(tLastID = 92, "Wetwareprocessor", "A Master Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Master), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Wetwarecomputer.set(addItem(tLastID = 93, "Wetwareprocessor Assembly", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Wetwaresupercomputer.set(addItem(tLastID = 94, "Wetware Supercomputer", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Wetwaremainframe.set(addItem(tLastID = 95, "Wetware Mainframe", "An Infinite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Ultimate.set(ItemList.Circuit_Ultimatecrystalcomputer.get(1L, new Object[0]));//maybe should be removed + ItemList.Circuit_Biowarecomputer.set(addItem(tLastID = 98, "Biowareprocessor Assembly", "A Super Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), SubTag.NO_UNIFICATION})); + ItemList.Circuit_Biowaresupercomputer.set(addItem(tLastID = 99, "Bioware Supercomputer", "An Infinite Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Infinite), SubTag.NO_UNIFICATION})); + + ItemList.Circuit_Bioprocessor.set(addItem(tLastID = 97, "Bioprocessor", "An Ultimate Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION})); + + ItemList.Circuit_Board_Coated_Basic.set(addItem(tLastID = 100, "Circuit Board", "A basic Circuit Board", o)); + ItemList.Circuit_Board_Phenolic_Good.set(addItem(tLastID = 101, "Good Circuit Board", "A good Circuit Board", o)); + ItemList.Circuit_Board_Epoxy_Advanced.set(addItem(tLastID = 102, "Advanced Circuit Board", "A advanced Circuit Board", o)); + ItemList.Circuit_Board_Fiberglass_Advanced.set(addItem(tLastID = 103, "More Advanced Circuit Board", "A more advanced Circuit Board", o)); + ItemList.Circuit_Board_Multifiberglass_Elite.set(addItem(tLastID = 104, "Elite Circuit Board", "A elite Circuit Board", o)); + ItemList.Circuit_Board_Wetware_Extreme.set(addItem(tLastID = 105, "Extreme Wetware Lifesupport Circuit Board", "The Board that keeps life", o)); + ItemList.Circuit_Board_Plastic_Advanced.set(addItem(tLastID = 106, "Plastic Circuit Board", "A good Board", o)); + ItemList.Circuit_Board_Bio_Ultra.set(addItem(tLastID = 107, "Ultra Bio Mutated Circuit Board", "Bio genetic mutated Board", o)); + ItemList.Circuit_Biomainframe.set(addItem(tLastID = 120, "Bio Mainframe", "A Bio Circuit", new Object[]{OrePrefixes.circuit.get(Materials.Bio), SubTag.NO_UNIFICATION})); + + ItemList.Tube_Wires.set(addItem(tLastID = 110, "Tube Wires", "For the Vacuum Tubes", o)); + + ItemList.Cover_SolarPanel_UHV.set(addItem(tLastID = 130, "Solar Panel (UHV)", "Ultimate High Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 128L)})); + ItemList.Cover_SolarPanel_UEV.set(addItem(tLastID = 131, "Solar Panel (UEV)", "Ultimate Extreme Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 256L)})); + ItemList.Cover_SolarPanel_UIV.set(addItem(tLastID = 132, "Solar Panel (UIV)", "Ultimate Insane Voltage Solar Panel (Needs cleaning with right click)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TENEBRAE, 512L)})); + + GregTech_API.registerCover(ItemList.Cover_SolarPanel_UHV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UHV), new GT_Cover_SolarPanel(2097152)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_UEV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UEV), new GT_Cover_SolarPanel(8388608)); + GregTech_API.registerCover(ItemList.Cover_SolarPanel_UIV.get(1L, new Object[0]), new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UIV), new GT_Cover_SolarPanel(33554432)); + + ItemList.ULV_Coil.set(addItem(tLastID = 140, "Ultra Low Voltage Coil", "Primitive Coil", o)); + ItemList.LV_Coil.set(addItem(tLastID = 141, "Low Voltage Coil", "Basic Coil", o)); + ItemList.MV_Coil.set(addItem(tLastID = 142, "Medium Voltage Coil", "Good Coil", o)); + ItemList.HV_Coil.set(addItem(tLastID = 143, "High Voltage Coil", "Advanced Coil", o)); + ItemList.EV_Coil.set(addItem(tLastID = 144, "Extreme Voltage Coil", "Extreme Coil", o)); + ItemList.IV_Coil.set(addItem(tLastID = 145, "Insane Voltage Coil", "Elite Coil", o)); + ItemList.LuV_Coil.set(addItem(tLastID = 146, "Ludicrous Voltage Coil", "Master Coil", o)); + ItemList.ZPM_Coil.set(addItem(tLastID = 147, "ZPM Voltage Coil", "Ultimate Coil", o)); + ItemList.UV_Coil.set(addItem(tLastID = 148, "Ultimate Voltage Coil", "Super Coil", o)); + ItemList.UHV_Coil.set(addItem(tLastID = 149, "Highly Ultimate Voltage Coil", "Infinite Coil", o)); + } + + public boolean doesShowInCreative(OrePrefixes aPrefix, Materials aMaterial, boolean aDoShowAllItems) { + return aDoShowAllItems; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java index d612563b56..7bfdfad6a9 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java @@ -1,182 +1,182 @@ -package gregtech.common.items;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.common.tools.*;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-
-public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool {
- public static final short SWORD = 0;
- public static final short PICKAXE = 2;
- public static final short SHOVEL = 4;
- public static final short AXE = 6;
- public static final short HOE = 8;
- public static final short SAW = 10;
- public static final short HARDHAMMER = 12;
- public static final short SOFTMALLET = 14;
- @Deprecated
- public static final short SOFTHAMMER = SOFTMALLET;
- public static final short WRENCH = 16;
- public static final short FILE = 18;
- public static final short CROWBAR = 20;
- public static final short SCREWDRIVER = 22;
- public static final short MORTAR = 24;
- public static final short WIRECUTTER = 26;
- public static final short SCOOP = 28;
- public static final short BRANCHCUTTER = 30;
- public static final short UNIVERSALSPADE = 32;
- public static final short KNIFE = 34;
- public static final short BUTCHERYKNIFE = 36;
- @Deprecated
- public static final short SICKLE = 38;
- public static final short SENSE = 40;
- public static final short PLOW = 42;
- public static final short PLUNGER = 44;
- public static final short ROLLING_PIN = 46;
- public static final short DRILL_LV = 100;
- public static final short DRILL_MV = 102;
- public static final short DRILL_HV = 104;
- public static final short CHAINSAW_LV = 110;
- public static final short CHAINSAW_MV = 112;
- public static final short CHAINSAW_HV = 114;
- public static final short WRENCH_LV = 120;
- public static final short WRENCH_MV = 122;
- public static final short WRENCH_HV = 124;
- public static final short JACKHAMMER = 130;
- public static final short BUZZSAW_LV = 140;
- public static final short BUZZSAW_MV = 142;
- public static final short BUZZSAW_HV = 144;
- @Deprecated
- public static final short BUZZSAW = BUZZSAW_LV;
- public static final short SCREWDRIVER_LV = 150;
- public static final short SCREWDRIVER_MV = 152;
- public static final short SCREWDRIVER_HV = 154;
- public static final short SOLDERING_IRON_LV = 160;
- public static final short SOLDERING_IRON_MV = 162;
- public static final short SOLDERING_IRON_HV = 164;
- public static final short TURBINE_SMALL = 170;
- public static final short TURBINE = 172;
- public static final short TURBINE_LARGE = 174;
- public static final short TURBINE_HUGE = 176;
- @Deprecated
- public static final short TURBINE_BLADE = 178;
- public static GT_MetaGenerated_Tool_01 INSTANCE;
-
- public GT_MetaGenerated_Tool_01() {
- super("metatool.01");
- INSTANCE = this;
- addTool(SWORD, "Sword", "", new GT_Tool_Sword(), ToolDictNames.craftingToolSword, ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 4L));
- addTool(PICKAXE, "Pickaxe", "", new GT_Tool_Pickaxe(), ToolDictNames.craftingToolPickaxe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L));
- addTool(SHOVEL, "Shovel", "", new GT_Tool_Shovel(), ToolDictNames.craftingToolShovel, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L));
- addTool(AXE, "Axe", "", new GT_Tool_Axe(), ToolDictNames.craftingToolAxe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L));
- addTool(HOE, "Hoe", "", new GT_Tool_Hoe(), ToolDictNames.craftingToolHoe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 4L));
- addTool(SAW, "Saw", "Can also harvest Ice", new GT_Tool_Saw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L));
- GregTech_API.registerTool(addTool(HARDHAMMER, "Hammer", "Crushes Ores instead of harvesting them", new GT_Tool_HardHammer(), ToolDictNames.craftingToolHardHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sHardHammerList);
- GregTech_API.registerTool(addTool(SOFTMALLET, "Soft Mallet", "", new GT_Tool_SoftHammer(), ToolDictNames.craftingToolSoftHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)), GregTech_API.sSoftHammerList);
- GregTech_API.registerTool(addTool(WRENCH, "Wrench", "Hold Leftclick to dismantle Machines", new GT_Tool_Wrench(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList);
- addTool(FILE, "File", "", new GT_Tool_File(), ToolDictNames.craftingToolFile, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L));
- GregTech_API.registerTool(addTool(CROWBAR, "Crowbar", "Dismounts Covers and Rotates Rails", new GT_Tool_Crowbar(), ToolDictNames.craftingToolCrowbar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L)), GregTech_API.sCrowbarList);
- GregTech_API.registerTool(addTool(SCREWDRIVER, "Screwdriver", "Adjusts Covers and Machines", new GT_Tool_Screwdriver(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList);
- addTool(MORTAR, "Mortar", "", new GT_Tool_Mortar(), ToolDictNames.craftingToolMortar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L));
- GregTech_API.registerTool(addTool(WIRECUTTER, "Wire Cutter", "", new GT_Tool_WireCutter(), ToolDictNames.craftingToolWireCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWireCutterList);
- addTool(SCOOP, "Scoop", "", new GT_Tool_Scoop(), ToolDictNames.craftingToolScoop, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.BESTIA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PANNUS, 2L));
- addTool(BRANCHCUTTER, "Branch Cutter", "", new GT_Tool_BranchCutter(), ToolDictNames.craftingToolBranchCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L));
- GregTech_API.registerTool(addTool(UNIVERSALSPADE, "Universal Spade", "", new GT_Tool_UniversalSpade(), ToolDictNames.craftingToolBlade, ToolDictNames.craftingToolShovel, ToolDictNames.craftingToolCrowbar, ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)), GregTech_API.sCrowbarList);
- addTool(KNIFE, "Knife", "", new GT_Tool_Knife(), ToolDictNames.craftingToolBlade, ToolDictNames.craftingToolKnife, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L));
- addTool(BUTCHERYKNIFE, "Butchery Knife", "Has a slow Attack Rate", new GT_Tool_ButcheryKnife(), ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 4L));
-
- addTool(SENSE, "Sense", "Because a Scythe doesn't make Sense", new GT_Tool_Sense(), ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MORTUUS, 2L));
- addTool(PLOW, "Plow", "Used to get rid of Snow", new GT_Tool_Plow(), ToolDictNames.craftingToolPlow, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 2L));
- addTool(PLUNGER, "Plunger", "", new GT_Tool_Plunger(), ToolDictNames.craftingToolPlunger, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L));
- addTool(ROLLING_PIN, "Rolling Pin", "", new GT_Tool_RollingPin(), ToolDictNames.craftingToolRollingPin, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L));
-
- addTool(DRILL_LV, "Drill (LV)", "", new GT_Tool_Drill_LV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L));
- addTool(DRILL_MV, "Drill (MV)", "", new GT_Tool_Drill_MV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L));
- addTool(DRILL_HV, "Drill (HV)", "", new GT_Tool_Drill_HV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L));
- addTool(CHAINSAW_LV, "Chainsaw (LV)", "Can also harvest Ice", new GT_Tool_Chainsaw_LV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L));
- addTool(CHAINSAW_MV, "Chainsaw (MV)", "Can also harvest Ice", new GT_Tool_Chainsaw_MV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L));
- addTool(CHAINSAW_HV, "Chainsaw (HV)", "Can also harvest Ice", new GT_Tool_Chainsaw_HV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L));
- GregTech_API.registerTool(addTool(WRENCH_LV, "Wrench (LV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_LV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList);
- GregTech_API.registerTool(addTool(WRENCH_MV, "Wrench (MV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_MV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList);
- GregTech_API.registerTool(addTool(WRENCH_HV, "Wrench (HV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_HV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList);
- addTool(JACKHAMMER, "JackHammer (HV)", "Breaks Rocks into pieces", new GT_Tool_JackHammer(), ToolDictNames.craftingToolJackHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L));
- addTool(BUZZSAW_LV, "Buzzsaw (LV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L));
- addTool(BUZZSAW_MV, "Buzzsaw (MV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L));
- addTool(BUZZSAW_HV, "Buzzsaw (HV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L));
- GregTech_API.registerTool(addTool(SCREWDRIVER_LV, "Screwdriver (LV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList);
- GregTech_API.registerTool(addTool(SCREWDRIVER_MV, "Screwdriver (MV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList);
- GregTech_API.registerTool(addTool(SCREWDRIVER_HV, "Screwdriver (HV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList);
- GregTech_API.registerTool(addTool(SOLDERING_IRON_LV, "Soldering Iron (LV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList);
- GregTech_API.registerTool(addTool(SOLDERING_IRON_MV, "Soldering Iron (MV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList);
- GregTech_API.registerTool(addTool(SOLDERING_IRON_HV, "Soldering Iron (HV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList);
-
- addTool(TURBINE_SMALL, "Small Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Small());
- addTool(TURBINE, "Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Normal());
- addTool(TURBINE_LARGE, "Large Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Large());
- addTool(TURBINE_HUGE, "Huge Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Huge());
-
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', new ItemStack(Items.flint, 1), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Bronze), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Iron), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Steel), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.WroughtIron), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.RedSteel), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlueSteel), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlackSteel), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.DamascusSteel), 'S', OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Thaumium), 'S', OrePrefixes.stone});
-
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.stick.get(Materials.Wood)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Plastic), 'S', OrePrefixes.stick.get(Materials.Plastic)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Aluminium), 'S', OrePrefixes.stick.get(Materials.Aluminium)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.StainlessSteel), 'S', OrePrefixes.stick.get(Materials.StainlessSteel)});
-
-
- if (!GregTech_API.sSpecialFile.get(ConfigCategories.general, "DisableFlintTools", false)) {
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(SWORD, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(PICKAXE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FFF", " S ", " S ", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(SHOVEL, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "S", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(AXE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FF", "FS", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(HOE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FF", " S", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(KNIFE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)});
-
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), new ItemStack(Items.flint, 1), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Bronze), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Iron), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.WroughtIron), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.RedSteel), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.BlueSteel), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.BlackSteel), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.DamascusSteel), Character.valueOf('S'), OrePrefixes.stone});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Thaumium), Character.valueOf('S'), OrePrefixes.stone});
-
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.plank.get(Materials.Wood), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Wood)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Plastic), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Plastic)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Aluminium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel)});
- GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.IronWood, Materials.IronWood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.IronWood), Character.valueOf('S'), OrePrefixes.stick.get(Materials.IronWood)});
-
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Coal", true)) {
- GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coal, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.coal, 1)});
- }
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Clay", true)) {
- GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Clay, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Blocks.clay, 1)});
- }
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Wheat", true)) {
- GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.wheat, 1)});
- }
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Flint", true)) {
- GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.flint, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Blocks.gravel, 1)});
- }
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Blaze", true)) {
- GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.blaze_powder, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.blaze_rod, 1)});
- }
- }
- }
-}
+package gregtech.common.items; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.*; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.tools.*; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool { + public static final short SWORD = 0; + public static final short PICKAXE = 2; + public static final short SHOVEL = 4; + public static final short AXE = 6; + public static final short HOE = 8; + public static final short SAW = 10; + public static final short HARDHAMMER = 12; + public static final short SOFTMALLET = 14; + @Deprecated + public static final short SOFTHAMMER = SOFTMALLET; + public static final short WRENCH = 16; + public static final short FILE = 18; + public static final short CROWBAR = 20; + public static final short SCREWDRIVER = 22; + public static final short MORTAR = 24; + public static final short WIRECUTTER = 26; + public static final short SCOOP = 28; + public static final short BRANCHCUTTER = 30; + public static final short UNIVERSALSPADE = 32; + public static final short KNIFE = 34; + public static final short BUTCHERYKNIFE = 36; + @Deprecated + public static final short SICKLE = 38; + public static final short SENSE = 40; + public static final short PLOW = 42; + public static final short PLUNGER = 44; + public static final short ROLLING_PIN = 46; + public static final short DRILL_LV = 100; + public static final short DRILL_MV = 102; + public static final short DRILL_HV = 104; + public static final short CHAINSAW_LV = 110; + public static final short CHAINSAW_MV = 112; + public static final short CHAINSAW_HV = 114; + public static final short WRENCH_LV = 120; + public static final short WRENCH_MV = 122; + public static final short WRENCH_HV = 124; + public static final short JACKHAMMER = 130; + public static final short BUZZSAW_LV = 140; + public static final short BUZZSAW_MV = 142; + public static final short BUZZSAW_HV = 144; + @Deprecated + public static final short BUZZSAW = BUZZSAW_LV; + public static final short SCREWDRIVER_LV = 150; + public static final short SCREWDRIVER_MV = 152; + public static final short SCREWDRIVER_HV = 154; + public static final short SOLDERING_IRON_LV = 160; + public static final short SOLDERING_IRON_MV = 162; + public static final short SOLDERING_IRON_HV = 164; + public static final short TURBINE_SMALL = 170; + public static final short TURBINE = 172; + public static final short TURBINE_LARGE = 174; + public static final short TURBINE_HUGE = 176; + @Deprecated + public static final short TURBINE_BLADE = 178; + public static GT_MetaGenerated_Tool_01 INSTANCE; + + public GT_MetaGenerated_Tool_01() { + super("metatool.01"); + INSTANCE = this; + addTool(SWORD, "Sword", "", new GT_Tool_Sword(), ToolDictNames.craftingToolSword, ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 4L)); + addTool(PICKAXE, "Pickaxe", "", new GT_Tool_Pickaxe(), ToolDictNames.craftingToolPickaxe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool(SHOVEL, "Shovel", "", new GT_Tool_Shovel(), ToolDictNames.craftingToolShovel, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool(AXE, "Axe", "", new GT_Tool_Axe(), ToolDictNames.craftingToolAxe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool(HOE, "Hoe", "", new GT_Tool_Hoe(), ToolDictNames.craftingToolHoe, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MESSIS, 4L)); + addTool(SAW, "Saw", "Can also harvest Ice", new GT_Tool_Saw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + GregTech_API.registerTool(addTool(HARDHAMMER, "Hammer", "Crushes Ores instead of harvesting them", new GT_Tool_HardHammer(), ToolDictNames.craftingToolHardHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sHardHammerList); + GregTech_API.registerTool(addTool(SOFTMALLET, "Soft Mallet", "", new GT_Tool_SoftHammer(), ToolDictNames.craftingToolSoftHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)), GregTech_API.sSoftHammerList); + GregTech_API.registerTool(addTool(WRENCH, "Wrench", "Hold Leftclick to dismantle Machines", new GT_Tool_Wrench(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList); + addTool(FILE, "File", "", new GT_Tool_File(), ToolDictNames.craftingToolFile, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)); + GregTech_API.registerTool(addTool(CROWBAR, "Crowbar", "Dismounts Covers and Rotates Rails", new GT_Tool_Crowbar(), ToolDictNames.craftingToolCrowbar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L)), GregTech_API.sCrowbarList); + GregTech_API.registerTool(addTool(SCREWDRIVER, "Screwdriver", "Adjusts Covers and Machines", new GT_Tool_Screwdriver(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList); + addTool(MORTAR, "Mortar", "", new GT_Tool_Mortar(), ToolDictNames.craftingToolMortar, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L)); + GregTech_API.registerTool(addTool(WIRECUTTER, "Wire Cutter", "", new GT_Tool_WireCutter(), ToolDictNames.craftingToolWireCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWireCutterList); + addTool(SCOOP, "Scoop", "", new GT_Tool_Scoop(), ToolDictNames.craftingToolScoop, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.BESTIA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PANNUS, 2L)); + addTool(BRANCHCUTTER, "Branch Cutter", "", new GT_Tool_BranchCutter(), ToolDictNames.craftingToolBranchCutter, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L)); + GregTech_API.registerTool(addTool(UNIVERSALSPADE, "Universal Spade", "", new GT_Tool_UniversalSpade(), ToolDictNames.craftingToolBlade, ToolDictNames.craftingToolShovel, ToolDictNames.craftingToolCrowbar, ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 1L)), GregTech_API.sCrowbarList); + addTool(KNIFE, "Knife", "", new GT_Tool_Knife(), ToolDictNames.craftingToolBlade, ToolDictNames.craftingToolKnife, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TELUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 2L)); + addTool(BUTCHERYKNIFE, "Butchery Knife", "Has a slow Attack Rate", new GT_Tool_ButcheryKnife(), ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 4L)); + + addTool(SENSE, "Sense", "Because a Scythe doesn't make Sense", new GT_Tool_Sense(), ToolDictNames.craftingToolBlade, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.HERBA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MORTUUS, 2L)); + addTool(PLOW, "Plow", "Used to get rid of Snow", new GT_Tool_Plow(), ToolDictNames.craftingToolPlow, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.GELUM, 2L)); + addTool(PLUNGER, "Plunger", "", new GT_Tool_Plunger(), ToolDictNames.craftingToolPlunger, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L)); + addTool(ROLLING_PIN, "Rolling Pin", "", new GT_Tool_RollingPin(), ToolDictNames.craftingToolRollingPin, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LIMUS, 4L)); + + addTool(DRILL_LV, "Drill (LV)", "", new GT_Tool_Drill_LV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool(DRILL_MV, "Drill (MV)", "", new GT_Tool_Drill_MV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool(DRILL_HV, "Drill (HV)", "", new GT_Tool_Drill_HV(), ToolDictNames.craftingToolMiningDrill, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 4L)); + addTool(CHAINSAW_LV, "Chainsaw (LV)", "Can also harvest Ice", new GT_Tool_Chainsaw_LV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool(CHAINSAW_MV, "Chainsaw (MV)", "Can also harvest Ice", new GT_Tool_Chainsaw_MV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool(CHAINSAW_HV, "Chainsaw (HV)", "Can also harvest Ice", new GT_Tool_Chainsaw_HV(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + GregTech_API.registerTool(addTool(WRENCH_LV, "Wrench (LV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_LV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList); + GregTech_API.registerTool(addTool(WRENCH_MV, "Wrench (MV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_MV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList); + GregTech_API.registerTool(addTool(WRENCH_HV, "Wrench (HV)", "Hold Left Button to dismantle Machines", new GT_Tool_Wrench_HV(), ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sWrenchList); + addTool(JACKHAMMER, "JackHammer (HV)", "Breaks Rocks into pieces", new GT_Tool_JackHammer(), ToolDictNames.craftingToolJackHammer, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERFODIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L)); + addTool(BUZZSAW_LV, "Buzzsaw (LV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool(BUZZSAW_MV, "Buzzsaw (MV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + addTool(BUZZSAW_HV, "Buzzsaw (HV)", "Not suitable for harvesting Blocks", new GT_Tool_BuzzSaw(), ToolDictNames.craftingToolSaw, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ARBOR, 2L)); + GregTech_API.registerTool(addTool(SCREWDRIVER_LV, "Screwdriver (LV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList); + GregTech_API.registerTool(addTool(SCREWDRIVER_MV, "Screwdriver (MV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList); + GregTech_API.registerTool(addTool(SCREWDRIVER_HV, "Screwdriver (HV)", "Adjusts Covers and Machines", new GT_Tool_Screwdriver_LV(), ToolDictNames.craftingToolScrewdriver, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sScrewdriverList); + GregTech_API.registerTool(addTool(SOLDERING_IRON_LV, "Soldering Iron (LV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList); + GregTech_API.registerTool(addTool(SOLDERING_IRON_MV, "Soldering Iron (MV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList); + GregTech_API.registerTool(addTool(SOLDERING_IRON_HV, "Soldering Iron (HV)", "Fixes burned out Circuits. Needs soldering materials in inventory.", new GT_Tool_Soldering_Iron(), ToolDictNames.craftingToolSolderingIron, new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)), GregTech_API.sSolderingToolList); + + addTool(TURBINE_SMALL, "Small Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Small()); + addTool(TURBINE, "Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Normal()); + addTool(TURBINE_LARGE, "Large Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Large()); + addTool(TURBINE_HUGE, "Huge Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Huge()); + + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', new ItemStack(Items.flint, 1), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Bronze), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Iron), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Steel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.WroughtIron), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.RedSteel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlueSteel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.BlackSteel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.DamascusSteel), 'S', OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", 'I', OrePrefixes.ingot.get(Materials.Thaumium), 'S', OrePrefixes.stone}); + + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.plank.get(Materials.Wood), 'S', OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Plastic), 'S', OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.Aluminium), 'S', OrePrefixes.stick.get(Materials.Aluminium)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", 'I', OrePrefixes.ingot.get(Materials.StainlessSteel), 'S', OrePrefixes.stick.get(Materials.StainlessSteel)}); + + + if (!GregTech_API.sSpecialFile.get(ConfigCategories.general, "DisableFlintTools", false)) { + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(SWORD, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(PICKAXE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FFF", " S ", " S ", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(SHOVEL, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "S", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(AXE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FF", "FS", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(HOE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"FF", " S", " S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(KNIFE, 1, Materials.Flint, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"F", "S", 'S', OrePrefixes.stick.get(Materials.Wood), 'F', new ItemStack(Items.flint, 1)}); + + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Flint, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), new ItemStack(Items.flint, 1), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Bronze, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Bronze), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Iron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Iron), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Steel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Steel), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.WroughtIron, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.WroughtIron), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.RedSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.RedSteel), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlueSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.BlueSteel), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.BlackSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.BlackSteel), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.DamascusSteel, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.DamascusSteel), Character.valueOf('S'), OrePrefixes.stone}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(MORTAR, 1, Materials.Thaumium, Materials.Stone, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" I ", "SIS", "SSS", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Thaumium), Character.valueOf('S'), OrePrefixes.stone}); + + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Wood, Materials.Wood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.plank.get(Materials.Wood), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Wood)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Plastic, Materials.Plastic, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Plastic), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Plastic)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.Aluminium, Materials.Aluminium, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.Aluminium), Character.valueOf('S'), OrePrefixes.stick.get(Materials.Aluminium)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.StainlessSteel, Materials.StainlessSteel, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.StainlessSteel), Character.valueOf('S'), OrePrefixes.stick.get(Materials.StainlessSteel)}); + GT_ModHandler.addCraftingRecipe(INSTANCE.getToolWithStats(ROLLING_PIN, 1, Materials.IronWood, Materials.IronWood, null), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{" S", " I ", "S f", Character.valueOf('I'), OrePrefixes.ingot.get(Materials.IronWood), Character.valueOf('S'), OrePrefixes.stick.get(Materials.IronWood)}); + + if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Coal", true)) { + GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Coal, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.coal, 1)}); + } + if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Clay", true)) { + GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Clay, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Blocks.clay, 1)}); + } + if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Wheat", true)) { + GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.wheat, 1)}); + } + if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Flint", true)) { + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.flint, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Blocks.gravel, 1)}); + } + if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, "Blaze", true)) { + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.blaze_powder, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{ToolDictNames.craftingToolMortar, new ItemStack(Items.blaze_rod, 1)}); + } + } + } +} diff --git a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java index 6bf524d2a6..87be9515ae 100644 --- a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java +++ b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java @@ -1,96 +1,96 @@ -package gregtech.common.items;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation;
-import gregtech.api.items.GT_Generic_Item;
-import gregtech.api.util.GT_LanguageManager;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.ChunkCoordinates;
-import net.minecraft.world.World;
-import shedar.mods.ic2.nuclearcontrol.api.*;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.UUID;
-
-public class GT_SensorCard_Item
- extends GT_Generic_Item
- implements IRemoteSensor, IPanelDataSource {
- private static final UUID CARD_TYPE = new UUID(0L, 41L);
-
- private int strCount;
-
- public GT_SensorCard_Item(String aUnlocalized, String aEnglish) {
- super(aUnlocalized, aEnglish, "Insert into Display Panel");
- setMaxStackSize(1);
- }
-
- public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
- super.addAdditionalToolTips(aList, aStack, aPlayer);
- if (aStack != null) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- aList.add(trans("014", "Missing Coodinates!"));
- } else {
- aList.add(trans("015", "Device at:"));
- aList.add(String.format("x: %d, y: %d, z: %d", new Object[]{Integer.valueOf(tNBT.getInteger("x")), Integer.valueOf(tNBT.getInteger("y")), Integer.valueOf(tNBT.getInteger("z"))}));
- }
- }
- }
-
- @Override
- public CardState update(TileEntity aPanel, ICardWrapper aCard, int aMaxRange) {
- return update(aPanel.getWorldObj(), aCard, aMaxRange);
- }
-
- @Override
- public CardState update(World world, ICardWrapper aCard, int aMaxRange) {
- ChunkCoordinates target = aCard.getTarget();
-
- TileEntity tTileEntity = world.getTileEntity(target.posX, target.posY, target.posZ);
- if (((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) {
- String[] tInfoData = ((IGregTechDeviceInformation) tTileEntity).getInfoData();
- for (int i = 0; i < tInfoData.length; i++) {
- aCard.setString("mString" + i, tInfoData[i]);
- }
- aCard.setInt("mString",strCount=tInfoData.length);
- return CardState.OK;
- }
- return CardState.NO_TARGET;
- }
-
- public List<PanelString> getStringData(int aSettings, ICardWrapper aCard, boolean aLabels) {
- List<PanelString> rList = new LinkedList<>();
- for (int i = 0; i < (strCount=aCard.getInt("mString")); i++) {
- if ((aSettings & 1 << i) != 0) {
- PanelString line = new PanelString();
- line.textLeft = GT_LanguageManager.getTranslation(aCard.getString("mString" + i), "\\\\");
- rList.add(line);
- }
- }
- return rList;
- }
-
- public List<PanelSetting> getSettingsList() {
- List<PanelSetting> rList = new ArrayList<>();
- for (int i = 0; i < strCount; i++) {
- rList.add(new PanelSetting(String.valueOf((i + 1)), 1 << i, getCardType()));
- }
- return rList;
- }
-
- public UUID getCardType() {
- return CARD_TYPE;
- }
-
- @SideOnly(Side.CLIENT)
- public void getSubItems(Item var1, CreativeTabs aTab, List aList) {
- }
-}
+package gregtech.common.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation; +import gregtech.api.items.GT_Generic_Item; +import gregtech.api.util.GT_LanguageManager; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import shedar.mods.ic2.nuclearcontrol.api.*; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.UUID; + +public class GT_SensorCard_Item + extends GT_Generic_Item + implements IRemoteSensor, IPanelDataSource { + private static final UUID CARD_TYPE = new UUID(0L, 41L); + + private int strCount; + + public GT_SensorCard_Item(String aUnlocalized, String aEnglish) { + super(aUnlocalized, aEnglish, "Insert into Display Panel"); + setMaxStackSize(1); + } + + public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + super.addAdditionalToolTips(aList, aStack, aPlayer); + if (aStack != null) { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + aList.add(trans("014", "Missing Coodinates!")); + } else { + aList.add(trans("015", "Device at:")); + aList.add(String.format("x: %d, y: %d, z: %d", new Object[]{Integer.valueOf(tNBT.getInteger("x")), Integer.valueOf(tNBT.getInteger("y")), Integer.valueOf(tNBT.getInteger("z"))})); + } + } + } + + @Override + public CardState update(TileEntity aPanel, ICardWrapper aCard, int aMaxRange) { + return update(aPanel.getWorldObj(), aCard, aMaxRange); + } + + @Override + public CardState update(World world, ICardWrapper aCard, int aMaxRange) { + ChunkCoordinates target = aCard.getTarget(); + + TileEntity tTileEntity = world.getTileEntity(target.posX, target.posY, target.posZ); + if (((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { + String[] tInfoData = ((IGregTechDeviceInformation) tTileEntity).getInfoData(); + for (int i = 0; i < tInfoData.length; i++) { + aCard.setString("mString" + i, tInfoData[i]); + } + aCard.setInt("mString",strCount=tInfoData.length); + return CardState.OK; + } + return CardState.NO_TARGET; + } + + public List<PanelString> getStringData(int aSettings, ICardWrapper aCard, boolean aLabels) { + List<PanelString> rList = new LinkedList<>(); + for (int i = 0; i < (strCount=aCard.getInt("mString")); i++) { + if ((aSettings & 1 << i) != 0) { + PanelString line = new PanelString(); + line.textLeft = GT_LanguageManager.getTranslation(aCard.getString("mString" + i), "\\\\"); + rList.add(line); + } + } + return rList; + } + + public List<PanelSetting> getSettingsList() { + List<PanelSetting> rList = new ArrayList<>(); + for (int i = 0; i < strCount; i++) { + rList.add(new PanelSetting(String.valueOf((i + 1)), 1 << i, getCardType())); + } + return rList; + } + + public UUID getCardType() { + return CARD_TYPE; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item var1, CreativeTabs aTab, List aList) { + } +} diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java index bd866ba994..0ff54e2168 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java @@ -1,64 +1,64 @@ -package gregtech.common.items.behaviors;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaBase_Item;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.IFluidHandler;
-
-import java.util.List;
-
-public class Behaviour_Plunger_Fluid
- extends Behaviour_None {
- private final int mCosts;
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.fluid", "Clears 1000 Liters of Fluid from Tanks");
-
- public Behaviour_Plunger_Fluid(int aCosts) {
- this.mCosts = aCosts;
- }
-
- public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((aTileEntity instanceof IFluidHandler)) {
- for (ForgeDirection tDirection : ForgeDirection.VALID_DIRECTIONS) {
- if (((IFluidHandler) aTileEntity).drain(tDirection, 1000, false) != null) {
- if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
- ((IFluidHandler) aTileEntity).drain(tDirection, 1000, true);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ);
- return true;
- }
- }
- }
-
- }
- if (aTileEntity instanceof IGregTechTileEntity) {
- IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aTileEntity;
- IMetaTileEntity mTileEntity = tTileEntity.getMetaTileEntity();
- if (mTileEntity instanceof GT_MetaTileEntity_BasicTank) {
- GT_MetaTileEntity_BasicTank machine = (GT_MetaTileEntity_BasicTank) mTileEntity;
- if(machine.mFluid!=null&&machine.mFluid.amount>0)
- machine.mFluid.amount = machine.mFluid.amount - Math.min(machine.mFluid.amount, 1000);
- GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ);
- return true;
- }
- }
- return false;
- }
-
- public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
- aList.add(this.mTooltip);
- return aList;
- }
-}
+package gregtech.common.items.behaviors; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.IFluidHandler; + +import java.util.List; + +public class Behaviour_Plunger_Fluid + extends Behaviour_None { + private final int mCosts; + private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.fluid", "Clears 1000 Liters of Fluid from Tanks"); + + public Behaviour_Plunger_Fluid(int aCosts) { + this.mCosts = aCosts; + } + + public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + if (aWorld.isRemote) { + return false; + } + TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((aTileEntity instanceof IFluidHandler)) { + for (ForgeDirection tDirection : ForgeDirection.VALID_DIRECTIONS) { + if (((IFluidHandler) aTileEntity).drain(tDirection, 1000, false) != null) { + if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + ((IFluidHandler) aTileEntity).drain(tDirection, 1000, true); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + return true; + } + } + } + + } + if (aTileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aTileEntity; + IMetaTileEntity mTileEntity = tTileEntity.getMetaTileEntity(); + if (mTileEntity instanceof GT_MetaTileEntity_BasicTank) { + GT_MetaTileEntity_BasicTank machine = (GT_MetaTileEntity_BasicTank) mTileEntity; + if(machine.mFluid!=null&&machine.mFluid.amount>0) + machine.mFluid.amount = machine.mFluid.amount - Math.min(machine.mFluid.amount, 1000); + GT_Utility.sendSoundToPlayers(aWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + return true; + } + } + return false; + } + + public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { + aList.add(this.mTooltip); + return aList; + } +} diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java index 451bf982c2..289cc452e8 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Sense.java @@ -1,47 +1,47 @@ -package gregtech.common.items.behaviors;
-
-import gregtech.api.items.GT_MetaBase_Item;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_LanguageManager;
-import ic2.api.crops.ICropTile;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-import java.util.List;
-
-public class Behaviour_Sense
- extends Behaviour_None {
- private final int mCosts;
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.sense", "Rightclick to harvest Crop Sticks");
-
- public Behaviour_Sense(int aCosts) {
- this.mCosts = aCosts;
- }
-
- public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
- if (aWorld.isRemote) {
- return false;
- }
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof ICropTile)) {
- for (int i = -2; i < 3; i++) {
- for (int j = -2; j < 3; j++) {
- for (int k = -2; k < 3; k++) {
- if ((aStack.stackSize > 0) && (((tTileEntity = aWorld.getTileEntity(aX + i, aY + j, aZ + k)) instanceof ICropTile)) && (((ICropTile) tTileEntity).harvest(true)) && (!aPlayer.capabilities.isCreativeMode)) {
- ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts/20);
- }
- }
- }
- }
- return true;
- }
- return false;
- }
-
- public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) {
- aList.add(this.mTooltip);
- return aList;
- }
-}
+package gregtech.common.items.behaviors; + +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_LanguageManager; +import ic2.api.crops.ICropTile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import java.util.List; + +public class Behaviour_Sense + extends Behaviour_None { + private final int mCosts; + private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.sense", "Rightclick to harvest Crop Sticks"); + + public Behaviour_Sense(int aCosts) { + this.mCosts = aCosts; + } + + public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { + if (aWorld.isRemote) { + return false; + } + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof ICropTile)) { + for (int i = -2; i < 3; i++) { + for (int j = -2; j < 3; j++) { + for (int k = -2; k < 3; k++) { + if ((aStack.stackSize > 0) && (((tTileEntity = aWorld.getTileEntity(aX + i, aY + j, aZ + k)) instanceof ICropTile)) && (((ICropTile) tTileEntity).harvest(true)) && (!aPlayer.capabilities.isCreativeMode)) { + ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts/20); + } + } + } + } + return true; + } + return false; + } + + public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) { + aList.add(this.mTooltip); + return aList; + } +} diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java index b4c819346c..b5a33bfb81 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java @@ -1,137 +1,137 @@ -package gregtech.common.tileentities.automation;
-
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.gui.GT_Container_Regulator;
-import gregtech.common.gui.GT_GUIContainer_Regulator;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-import java.util.Arrays;
-
-public class GT_MetaTileEntity_Regulator
- extends GT_MetaTileEntity_Buffer {
- public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0};
- private boolean charge = false, decharge = false;
-
- public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 20, new String[]{
- "Filters up to 9 different Items",
- "Allows Item-specific output stack size",
- "Allows Item-specific output slot",
- "Consumes 1EU per moved Item"});
- }
-
- public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Regulator(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures);
- }
-
- public ITexture getOverlayIcon() {
- return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_REGULATOR);
- }
-
- public boolean isValidSlot(int aIndex) {
- return aIndex < 9;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_Regulator(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_Regulator(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setInteger("mTargetSlot1", this.mTargetSlots[0]);
- aNBT.setInteger("mTargetSlot2", this.mTargetSlots[1]);
- aNBT.setInteger("mTargetSlot3", this.mTargetSlots[2]);
- aNBT.setInteger("mTargetSlot4", this.mTargetSlots[3]);
- aNBT.setInteger("mTargetSlot5", this.mTargetSlots[4]);
- aNBT.setInteger("mTargetSlot6", this.mTargetSlots[5]);
- aNBT.setInteger("mTargetSlot7", this.mTargetSlots[6]);
- aNBT.setInteger("mTargetSlot8", this.mTargetSlots[7]);
- aNBT.setInteger("mTargetSlot9", this.mTargetSlots[8]);
- }
-
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mTargetSlots[0] = aNBT.getInteger("mTargetSlot1");
- this.mTargetSlots[1] = aNBT.getInteger("mTargetSlot2");
- this.mTargetSlots[2] = aNBT.getInteger("mTargetSlot3");
- this.mTargetSlots[3] = aNBT.getInteger("mTargetSlot4");
- this.mTargetSlots[4] = aNBT.getInteger("mTargetSlot5");
- this.mTargetSlots[5] = aNBT.getInteger("mTargetSlot6");
- this.mTargetSlots[6] = aNBT.getInteger("mTargetSlot7");
- this.mTargetSlots[7] = aNBT.getInteger("mTargetSlot8");
- this.mTargetSlots[8] = aNBT.getInteger("mTargetSlot9");
- }
-
- @Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- //Regulation per Screwdriver is overridden by GUI regulation.
- }
-
- public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
- int i = 0;
- for (int tCosts = 0; i < 9; i++) {
- if (this.mInventory[(i + 9)] != null) {
- tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Arrays.asList(new ItemStack[]{this.mInventory[(i + 9)]}), false, (byte) this.mInventory[(i + 9)].stackSize, (byte) this.mInventory[(i + 9)].stackSize, (byte) 64, (byte) 1) * 3;
- if (tCosts > 0) {
- this.mSuccess = 50;
- getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCosts, true);
- break;
- }
- }
- }
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]));
- }
-
- @Override
- public int rechargerSlotStartIndex() {
- return 19;
- }
-
- @Override
- public int dechargerSlotStartIndex() {
- return 19;
- }
-
- @Override
- public int rechargerSlotCount() {
- return charge ? 1 : 0;
- }
-
- @Override
- public int dechargerSlotCount() {
- return decharge ? 1 : 0;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isServerSide()) {
- charge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3;
- decharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
- }
- }
-}
+package gregtech.common.tileentities.automation; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gregtech.common.gui.GT_Container_Regulator; +import gregtech.common.gui.GT_GUIContainer_Regulator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.Arrays; + +public class GT_MetaTileEntity_Regulator + extends GT_MetaTileEntity_Buffer { + public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0}; + private boolean charge = false, decharge = false; + + public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 20, new String[]{ + "Filters up to 9 different Items", + "Allows Item-specific output stack size", + "Allows Item-specific output slot", + "Consumes 1EU per moved Item"}); + } + + public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Regulator(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + } + + public ITexture getOverlayIcon() { + return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_REGULATOR); + } + + public boolean isValidSlot(int aIndex) { + return aIndex < 9; + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_Regulator(aPlayerInventory, aBaseMetaTileEntity); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_Regulator(aPlayerInventory, aBaseMetaTileEntity); + } + + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("mTargetSlot1", this.mTargetSlots[0]); + aNBT.setInteger("mTargetSlot2", this.mTargetSlots[1]); + aNBT.setInteger("mTargetSlot3", this.mTargetSlots[2]); + aNBT.setInteger("mTargetSlot4", this.mTargetSlots[3]); + aNBT.setInteger("mTargetSlot5", this.mTargetSlots[4]); + aNBT.setInteger("mTargetSlot6", this.mTargetSlots[5]); + aNBT.setInteger("mTargetSlot7", this.mTargetSlots[6]); + aNBT.setInteger("mTargetSlot8", this.mTargetSlots[7]); + aNBT.setInteger("mTargetSlot9", this.mTargetSlots[8]); + } + + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mTargetSlots[0] = aNBT.getInteger("mTargetSlot1"); + this.mTargetSlots[1] = aNBT.getInteger("mTargetSlot2"); + this.mTargetSlots[2] = aNBT.getInteger("mTargetSlot3"); + this.mTargetSlots[3] = aNBT.getInteger("mTargetSlot4"); + this.mTargetSlots[4] = aNBT.getInteger("mTargetSlot5"); + this.mTargetSlots[5] = aNBT.getInteger("mTargetSlot6"); + this.mTargetSlots[6] = aNBT.getInteger("mTargetSlot7"); + this.mTargetSlots[7] = aNBT.getInteger("mTargetSlot8"); + this.mTargetSlots[8] = aNBT.getInteger("mTargetSlot9"); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + //Regulation per Screwdriver is overridden by GUI regulation. + } + + public void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + int i = 0; + for (int tCosts = 0; i < 9; i++) { + if (this.mInventory[(i + 9)] != null) { + tCosts = GT_Utility.moveOneItemStackIntoSlot(getBaseMetaTileEntity(), getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), this.mTargetSlots[i], Arrays.asList(new ItemStack[]{this.mInventory[(i + 9)]}), false, (byte) this.mInventory[(i + 9)].stackSize, (byte) this.mInventory[(i + 9)].stackSize, (byte) 64, (byte) 1) * 3; + if (tCosts > 0) { + this.mSuccess = 50; + getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCosts, true); + break; + } + } + } + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)])); + } + + @Override + public int rechargerSlotStartIndex() { + return 19; + } + + @Override + public int dechargerSlotStartIndex() { + return 19; + } + + @Override + public int rechargerSlotCount() { + return charge ? 1 : 0; + } + + @Override + public int dechargerSlotCount() { + return decharge ? 1 : 0; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (aBaseMetaTileEntity.isServerSide()) { + charge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3; + decharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3; + } + } +} diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java index 1d632ce7f2..9b9f782601 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java @@ -1,142 +1,142 @@ -package gregtech.common.tileentities.automation;
-
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.objects.ItemData;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.gui.GT_Container_TypeFilter;
-import gregtech.common.gui.GT_GUIContainer_TypeFilter;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class GT_MetaTileEntity_TypeFilter
- extends GT_MetaTileEntity_Buffer {
- public boolean bNBTAllowed = false;
- public boolean bInvertFilter = false;
- public int mRotationIndex = 0;
- public OrePrefixes mPrefix = OrePrefixes.ore;
-
- public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 11, new String[]{
- "Filters 1 Item Type",
- "Use Screwdriver to regulate output stack size",
- "Consumes 1 EU per moved Item"});
- }
-
- public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aInvSlotCount, aDescription, aTextures);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TypeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures);
- }
-
- public ITexture getOverlayIcon() {
- return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_TYPEFILTER);
- }
-
- public boolean isValidSlot(int aIndex) {
- return aIndex < 9;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_TypeFilter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_TypeFilter(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- public void clickTypeIcon(boolean aRightClick) {
- if (getBaseMetaTileEntity().isServerSide()) {
- for (int i = 0; i < OrePrefixes.values().length; i++) {
- if (this.mPrefix == OrePrefixes.values()[i]) {
- for (this.mPrefix = null; this.mPrefix == null; this.mPrefix = OrePrefixes.values()[i]) {
- if (aRightClick) {
- do {
- i--;
- if (i < 0) {
- i = OrePrefixes.values().length - 1;
- }
- } while (OrePrefixes.values()[i].mPrefixedItems.isEmpty());
- } else {
- do {
- i++;
- if (i >= OrePrefixes.values().length) {
- i = 0;
- }
- } while (OrePrefixes.values()[i].mPrefixedItems.isEmpty());
- }
- if (!OrePrefixes.values()[i].mPrefixedItems.isEmpty() && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i])
- mPrefix = OrePrefixes.values()[i];
- }
- }
- }
- this.mRotationIndex = 0;
- }
- }
-
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if ((getBaseMetaTileEntity().isServerSide()) && (aTick % 8L == 0L)) {
- if (this.mPrefix.mPrefixedItems.isEmpty()) {
- this.mInventory[9] = null;
- } else {
- this.mInventory[9] = GT_Utility.copyAmount(1L, new Object[]{this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())});
- if (this.mInventory[9].getItemDamage() == 32767) {
- this.mInventory[9].setItemDamage(0);
- }
- this.mInventory[9].setStackDisplayName(this.mPrefix.toString());
- }
- }
- }
-
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setString("mPrefix", this.mPrefix.toString());
- aNBT.setBoolean("bInvertFilter", this.bInvertFilter);
- aNBT.setBoolean("bNBTAllowed", this.bNBTAllowed);
- }
-
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- this.mPrefix = OrePrefixes.getPrefix(aNBT.getString("mPrefix"), this.mPrefix);
- this.bInvertFilter = aNBT.getBoolean("bInvertFilter");
- this.bNBTAllowed = aNBT.getBoolean("bNBTAllowed");
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- boolean tAllowPrefix = this.mPrefix.contains(aStack);
- if (this.mPrefix == OrePrefixes.ore) {
- ItemData tData = GT_OreDictUnificator.getItemData(aStack);
- if (tData != null && tData.mPrefix != null) {
- OrePrefixes tFix = tData.mPrefix;
- if (tFix == OrePrefixes.oreBlackgranite ||
- tFix == OrePrefixes.oreDense ||
- tFix == OrePrefixes.oreEnd ||
- tFix == OrePrefixes.oreEndstone ||
- tFix == OrePrefixes.oreNether ||
- tFix == OrePrefixes.oreNetherrack ||
- tFix == OrePrefixes.oreNormal ||
- tFix == OrePrefixes.orePoor ||
- tFix == OrePrefixes.oreRedgranite ||
- tFix == OrePrefixes.oreRich ||
- tFix == OrePrefixes.oreSmall ||
- tFix == OrePrefixes.oreBasalt ||
- tFix == OrePrefixes.oreMarble) tAllowPrefix = true;
- }
- }
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) && (tAllowPrefix != this.bInvertFilter);
- }
-}
+package gregtech.common.tileentities.automation; + +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.common.gui.GT_Container_TypeFilter; +import gregtech.common.gui.GT_GUIContainer_TypeFilter; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_TypeFilter + extends GT_MetaTileEntity_Buffer { + public boolean bNBTAllowed = false; + public boolean bInvertFilter = false; + public int mRotationIndex = 0; + public OrePrefixes mPrefix = OrePrefixes.ore; + + public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 11, new String[]{ + "Filters 1 Item Type", + "Use Screwdriver to regulate output stack size", + "Consumes 1 EU per moved Item"}); + } + + public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_TypeFilter(this.mName, this.mTier, this.mInventory.length, this.mDescriptionArray, this.mTextures); + } + + public ITexture getOverlayIcon() { + return new GT_RenderedTexture(Textures.BlockIcons.AUTOMATION_TYPEFILTER); + } + + public boolean isValidSlot(int aIndex) { + return aIndex < 9; + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_TypeFilter(aPlayerInventory, aBaseMetaTileEntity); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_TypeFilter(aPlayerInventory, aBaseMetaTileEntity); + } + + public void clickTypeIcon(boolean aRightClick) { + if (getBaseMetaTileEntity().isServerSide()) { + for (int i = 0; i < OrePrefixes.values().length; i++) { + if (this.mPrefix == OrePrefixes.values()[i]) { + for (this.mPrefix = null; this.mPrefix == null; this.mPrefix = OrePrefixes.values()[i]) { + if (aRightClick) { + do { + i--; + if (i < 0) { + i = OrePrefixes.values().length - 1; + } + } while (OrePrefixes.values()[i].mPrefixedItems.isEmpty()); + } else { + do { + i++; + if (i >= OrePrefixes.values().length) { + i = 0; + } + } while (OrePrefixes.values()[i].mPrefixedItems.isEmpty()); + } + if (!OrePrefixes.values()[i].mPrefixedItems.isEmpty() && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i]) + mPrefix = OrePrefixes.values()[i]; + } + } + } + this.mRotationIndex = 0; + } + } + + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + if ((getBaseMetaTileEntity().isServerSide()) && (aTick % 8L == 0L)) { + if (this.mPrefix.mPrefixedItems.isEmpty()) { + this.mInventory[9] = null; + } else { + this.mInventory[9] = GT_Utility.copyAmount(1L, new Object[]{this.mPrefix.mPrefixedItems.get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())}); + if (this.mInventory[9].getItemDamage() == 32767) { + this.mInventory[9].setItemDamage(0); + } + this.mInventory[9].setStackDisplayName(this.mPrefix.toString()); + } + } + } + + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setString("mPrefix", this.mPrefix.toString()); + aNBT.setBoolean("bInvertFilter", this.bInvertFilter); + aNBT.setBoolean("bNBTAllowed", this.bNBTAllowed); + } + + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mPrefix = OrePrefixes.getPrefix(aNBT.getString("mPrefix"), this.mPrefix); + this.bInvertFilter = aNBT.getBoolean("bInvertFilter"); + this.bNBTAllowed = aNBT.getBoolean("bNBTAllowed"); + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + boolean tAllowPrefix = this.mPrefix.contains(aStack); + if (this.mPrefix == OrePrefixes.ore) { + ItemData tData = GT_OreDictUnificator.getItemData(aStack); + if (tData != null && tData.mPrefix != null) { + OrePrefixes tFix = tData.mPrefix; + if (tFix == OrePrefixes.oreBlackgranite || + tFix == OrePrefixes.oreDense || + tFix == OrePrefixes.oreEnd || + tFix == OrePrefixes.oreEndstone || + tFix == OrePrefixes.oreNether || + tFix == OrePrefixes.oreNetherrack || + tFix == OrePrefixes.oreNormal || + tFix == OrePrefixes.orePoor || + tFix == OrePrefixes.oreRedgranite || + tFix == OrePrefixes.oreRich || + tFix == OrePrefixes.oreSmall || + tFix == OrePrefixes.oreBasalt || + tFix == OrePrefixes.oreMarble) tAllowPrefix = true; + } + } + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) && (tAllowPrefix != this.bInvertFilter); + } +} diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index 8135d97736..d6e3d71b81 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -1,147 +1,147 @@ -package gregtech.common.tileentities.boilers;
-
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.common.GT_Pollution;
-import gregtech.common.gui.GT_Container_Boiler;
-import gregtech.common.gui.GT_GUIContainer_Boiler;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidHandler;
-
-public class GT_MetaTileEntity_Boiler_Lava
- extends GT_MetaTileEntity_Boiler {
- public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, new String[]{
- "A Boiler running off Lava",
- "Produces 600L of Steam per second",
- "Causes 20 Pollution per second"});
- }
-
- public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- ITexture[][][] rTextures = new ITexture[5][17][];
- for (byte i = -1; i < 16; i++) {
- rTextures[0][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
- rTextures[1][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
- rTextures[2][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
- rTextures[3][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT)};
- rTextures[4][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE)};
- }
- return rTextures;
- }
-
- public int maxProgresstime() {
- return 1000;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Boiler_Lava(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
- if (this.mTemperature <= 20) {
- this.mTemperature = 20;
- this.mLossTimer = 0;
- }
- if (++this.mLossTimer > 20) {
- this.mTemperature -= 1;
- this.mLossTimer = 0;
- }
- for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) {
- if (i != aBaseMetaTileEntity.getFrontFacing()) {
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i);
- if (tTileEntity != null) {
- FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false);
- if (tDrained != null) {
- int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false);
- if (tFilledAmount > 0) {
- tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true);
- }
- }
- }
- }
- }
- if (aTick % 10L == 0L) {
- if (this.mTemperature > 100) {
- if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
- this.mHadNoWater = true;
- } else {
- if (this.mHadNoWater) {
- GT_Log.exp.println("Boiler "+this.mName+" had no Water!");
- aBaseMetaTileEntity.doExplosion(2048L);
- return;
- }
- this.mFluid.amount -= 1;
- if (this.mSteam == null) {
- this.mSteam = GT_ModHandler.getSteam(300L);
- } else if (GT_ModHandler.isSteam(this.mSteam)) {
- this.mSteam.amount += 300;
- } else {
- this.mSteam = GT_ModHandler.getSteam(300L);
- }
- }
- } else {
- this.mHadNoWater = false;
- }
- }
- if ((this.mSteam != null) &&
- (this.mSteam.amount > 32000)) {
- sendSound((byte) 1);
- this.mSteam.amount = 24000;
- }
- if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) &&
- (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(Materials.Lava)))) {
- this.mProcessingEnergy += 1000;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
- }
- if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 8L == 0L)) {
- this.mProcessingEnergy -= 3;
- this.mTemperature += 1;
- }
-
- if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) {
- GT_Pollution.addPollution(getBaseMetaTileEntity(), 20);
- }
- aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
- }
- }
-
- public final int fill(FluidStack aFluid, boolean doFill) {
- if ((GT_ModHandler.isLava(aFluid)) && (this.mProcessingEnergy < 50)) {
- int tFilledAmount = Math.min(50, aFluid.amount);
- if (doFill) {
- this.mProcessingEnergy += tFilledAmount;
- }
- return tFilledAmount;
- }
- return super.fill(aFluid, doFill);
- }
-}
+package gregtech.common.tileentities.boilers; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.GT_Pollution; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_MetaTileEntity_Boiler_Lava + extends GT_MetaTileEntity_Boiler { + public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, new String[]{ + "A Boiler running off Lava", + "Produces 600L of Steam per second", + "Causes 20 Pollution per second"}); + } + + public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[5][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[0][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[1][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[2][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[3][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT)}; + rTextures[4][(i + 1)] = new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE)}; + } + return rTextures; + } + + public int maxProgresstime() { + return 1000; + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_Lava(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { + if (this.mTemperature <= 20) { + this.mTemperature = 20; + this.mLossTimer = 0; + } + if (++this.mLossTimer > 20) { + this.mTemperature -= 1; + this.mLossTimer = 0; + } + for (byte i = 1; (this.mSteam != null) && (i < 6); i = (byte) (i + 1)) { + if (i != aBaseMetaTileEntity.getFrontFacing()) { + IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); + if (tTileEntity != null) { + FluidStack tDrained = aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); + if (tDrained != null) { + int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); + if (tFilledAmount > 0) { + tTileEntity.fill(ForgeDirection.getOrientation(i).getOpposite(), aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); + } + } + } + } + } + if (aTick % 10L == 0L) { + if (this.mTemperature > 100) { + if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) { + this.mHadNoWater = true; + } else { + if (this.mHadNoWater) { + GT_Log.exp.println("Boiler "+this.mName+" had no Water!"); + aBaseMetaTileEntity.doExplosion(2048L); + return; + } + this.mFluid.amount -= 1; + if (this.mSteam == null) { + this.mSteam = GT_ModHandler.getSteam(300L); + } else if (GT_ModHandler.isSteam(this.mSteam)) { + this.mSteam.amount += 300; + } else { + this.mSteam = GT_ModHandler.getSteam(300L); + } + } + } else { + this.mHadNoWater = false; + } + } + if ((this.mSteam != null) && + (this.mSteam.amount > 32000)) { + sendSound((byte) 1); + this.mSteam.amount = 24000; + } + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && + (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(Materials.Lava)))) { + this.mProcessingEnergy += 1000; + aBaseMetaTileEntity.decrStackSize(2, 1); + aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L)); + } + if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && (aTick % 8L == 0L)) { + this.mProcessingEnergy -= 3; + this.mTemperature += 1; + } + + if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { + GT_Pollution.addPollution(getBaseMetaTileEntity(), 20); + } + aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); + } + } + + public final int fill(FluidStack aFluid, boolean doFill) { + if ((GT_ModHandler.isLava(aFluid)) && (this.mProcessingEnergy < 50)) { + int tFilledAmount = Math.min(50, aFluid.amount); + if (doFill) { + this.mProcessingEnergy += tFilledAmount; + } + return tFilledAmount; + } + return super.fill(aFluid, doFill); + } +} diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 703887435a..5655bb47c5 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -1,68 +1,68 @@ -package gregtech.common.tileentities.boilers;
-
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.common.gui.GT_Container_Boiler;
-import gregtech.common.gui.GT_GUIContainer_Boiler;
-import net.minecraft.entity.player.InventoryPlayer;
-
-public class GT_MetaTileEntity_Boiler_Steel
- extends GT_MetaTileEntity_Boiler_Bronze {//TODO CHECK POLLUTION VALUES AND DESCRIPTIONS FOR POLLUTION SPOILERS
-
-
- public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, new String[]{
- "Faster than the Bronze Boiler",
- "Produces 300L of Steam per second",
- "Causes 30 Pollution per second"});
- }
-
- public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- ITexture[][][] rTextures = new ITexture[5][17][];
- for (byte i = -1; i < 16; i = (byte) (i + 1)) {
- ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))};
- rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
- rTextures[1][(i + 1)] = tmp1;
- ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)};
- rTextures[2][(i + 1)] = tmp2;
- ITexture[] tmp4 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)};
- rTextures[3][(i + 1)] = tmp4;
- ITexture[] tmp5 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)};
- rTextures[4][(i + 1)] = tmp5;
- }
- return rTextures;
- }
-
- public int maxProgresstime() {
- return 1000;
- }
-
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Boiler_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.singleBlockBoilerLogic(aBaseMetaTileEntity,aTick,2,40,10L,30);
- }
-}
+package gregtech.common.tileentities.boilers; + +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.common.gui.GT_Container_Boiler; +import gregtech.common.gui.GT_GUIContainer_Boiler; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_MetaTileEntity_Boiler_Steel + extends GT_MetaTileEntity_Boiler_Bronze {//TODO CHECK POLLUTION VALUES AND DESCRIPTIONS FOR POLLUTION SPOILERS + + + public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, new String[]{ + "Faster than the Bronze Boiler", + "Produces 300L of Steam per second", + "Causes 30 Pollution per second"}); + } + + public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[5][17][]; + for (byte i = -1; i < 16; i = (byte) (i + 1)) { + ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; + rTextures[0][(i + 1)] = tmp0; + ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[1][(i + 1)] = tmp1; + ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; + rTextures[2][(i + 1)] = tmp2; + ITexture[] tmp4 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT)}; + rTextures[3][(i + 1)] = tmp4; + ITexture[] tmp5 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE)}; + rTextures[4][(i + 1)] = tmp5; + } + return rTextures; + } + + public int maxProgresstime() { + return 1000; + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SteelBoiler.png", 32000); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.singleBlockBoilerLogic(aBaseMetaTileEntity,aTick,2,40,10L,30); + } +} diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index c75eb60661..c745bfae20 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -1,132 +1,132 @@ -package gregtech.common.tileentities.generators;
-
-import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
-
-public class GT_MetaTileEntity_DieselGenerator
- extends GT_MetaTileEntity_BasicGenerator {
-
- public static final int BASE_POLLUTION = 2;
-
- public int mEfficiency;
-
- public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, new String[]{
- "Requires liquid Fuel",
- "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"});
- onConfigLoad();
- }
-
- public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- onConfigLoad();
- }
-
- public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- onConfigLoad();
- }
-
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_DieselGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
-
- public int getCapacity() {
- return 16000;
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, (100 - this.mTier * 5));
- }
-
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- public int getFuelValue(ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0;
- long rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
- if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
- rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
- }
- if(rValue> Integer.MAX_VALUE){
- throw new ArithmeticException("Integer LOOPBACK!");
- }
- return (int)rValue;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if(aTick%100==0 && mFluid!=null && mFluid.amount>this.getCapacity()){
- GT_Log.err.println("Dupe Abuse: "+aBaseMetaTileEntity.getOwnerName()+" Coords: "+aBaseMetaTileEntity.getXCoord()+" "+aBaseMetaTileEntity.getYCoord()+" "+aBaseMetaTileEntity.getZCoord());
- aBaseMetaTileEntity.setToFire();
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
- public ITexture[] getFront(byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
- }
-
- public ITexture[] getBack(byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK)};
- }
-
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)};
- }
-
- public ITexture[] getTop(byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)};
- }
-
- public ITexture[] getSides(byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE)};
- }
-
- public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
- }
-
- public ITexture[] getBackActive(byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE)};
- }
-
- public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)};
- }
-
- public ITexture[] getTopActive(byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)};
- }
-
- public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE)};
- }
-
- @Override
- public int getPollution() {
- return (int) (GT_MetaTileEntity_DieselGenerator.BASE_POLLUTION * Math.pow(2, mTier - 1));
- }
-}
+package gregtech.common.tileentities.generators; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_DieselGenerator + extends GT_MetaTileEntity_BasicGenerator { + + public static final int BASE_POLLUTION = 2; + + public int mEfficiency; + + public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, new String[]{ + "Requires liquid Fuel", + "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"}); + onConfigLoad(); + } + + public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } + + public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } + + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_DieselGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public GT_Recipe.GT_Recipe_Map getRecipes() { + return GT_Recipe.GT_Recipe_Map.sDieselFuels; + } + + public int getCapacity() { + return 16000; + } + + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, (100 - this.mTier * 5)); + } + + public int getEfficiency() { + return this.mEfficiency; + } + + public int getFuelValue(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0; + long rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack)); + if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) { + rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3); + } + if(rValue> Integer.MAX_VALUE){ + throw new ArithmeticException("Integer LOOPBACK!"); + } + return (int)rValue; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if(aTick%100==0 && mFluid!=null && mFluid.amount>this.getCapacity()){ + GT_Log.err.println("Dupe Abuse: "+aBaseMetaTileEntity.getOwnerName()+" Coords: "+aBaseMetaTileEntity.getXCoord()+" "+aBaseMetaTileEntity.getYCoord()+" "+aBaseMetaTileEntity.getZCoord()); + aBaseMetaTileEntity.setToFire(); + } + super.onPostTick(aBaseMetaTileEntity, aTick); + } + + public ITexture[] getFront(byte aColor) { + return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBack(byte aColor) { + return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK)}; + } + + public ITexture[] getBottom(byte aColor) { + return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)}; + } + + public ITexture[] getTop(byte aColor) { + return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP)}; + } + + public ITexture[] getSides(byte aColor) { + return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE)}; + } + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBackActive(byte aColor) { + return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE)}; + } + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE)}; + } + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE)}; + } + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE)}; + } + + @Override + public int getPollution() { + return (int) (GT_MetaTileEntity_DieselGenerator.BASE_POLLUTION * Math.pow(2, mTier - 1)); + } +} diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java index e63fbe0579..b248dc5aae 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java @@ -1,136 +1,136 @@ -package gregtech.common.tileentities.generators;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGenerator {
-
- public int mEfficiency;
-
- public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, new String[]{
- "Converts Steam into EU",
- "Base rate: 2L of Steam -> 1 EU"});
- onConfigLoad();
- }
-
- public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- onConfigLoad();
- }
-
- public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, aDescription, aTextures);
- onConfigLoad();
- }
-
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes() {
- return null;
- }
-
- @Override
- public String[] getDescription() {
- String[] desc = new String[mDescriptionArray.length + 2];
- System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
- desc[mDescriptionArray.length] = "Fuel Efficiency: " + (600 / getEfficiency()) + "%";
- desc[mDescriptionArray.length + 1] = String.format("Consumes up to %sL of Steam per second",
- (int) (4000 * (8 * Math.pow(4, mTier) + Math.pow(2, mTier)) / (600 / getEfficiency())));
- return desc;
- }
-
- public int getCapacity() {
- return 24000 * this.mTier;
- }
-
- public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + this.mTier);
- }
-
- public int getEfficiency() {
- return this.mEfficiency;
- }
-
- public int getFuelValue(FluidStack aLiquid) {
- if (aLiquid == null) return 0;
- String fluidName = aLiquid.getFluid().getUnlocalizedName(aLiquid);
- return GT_ModHandler.isSteam(aLiquid) || fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name") ? 3 : 0;
- }
-
- public int consumedFluidPerOperation(FluidStack aLiquid) {
- return this.mEfficiency;
- }
-
- public ITexture[] getFront(byte aColor) {
- return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
- }
-
- public ITexture[] getBack(byte aColor) {
- return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK)};
- }
-
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM)};
- }
-
- public ITexture[] getTop(byte aColor) {
- return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP)};
- }
-
- public ITexture[] getSides(byte aColor) {
- return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE)};
- }
-
- public ITexture[] getFrontActive(byte aColor) {
- return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT_ACTIVE),
- Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
- }
-
- public ITexture[] getBackActive(byte aColor) {
- return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK_ACTIVE)};
- }
-
- public ITexture[] getBottomActive(byte aColor) {
- return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM_ACTIVE)};
- }
-
- public ITexture[] getTopActive(byte aColor) {
- return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP_ACTIVE)};
- }
-
- public ITexture[] getSidesActive(byte aColor) {
- return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE)};
- }
-
- @Override
- public int getPollution() {
- return 0;
- }
-
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- if (aFluid.getFluid().getUnlocalizedName(aFluid).equals("ic2.fluidSuperheatedSteam")) {
- aFluid.amount = 0;
- aFluid = null;
- return false;
- }
- return super.isFluidInputAllowed(aFluid);
- }
-}
+package gregtech.common.tileentities.generators; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGenerator { + + public int mEfficiency; + + public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, new String[]{ + "Converts Steam into EU", + "Base rate: 2L of Steam -> 1 EU"}); + onConfigLoad(); + } + + public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } + + public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } + + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + public GT_Recipe.GT_Recipe_Map getRecipes() { + return null; + } + + @Override + public String[] getDescription() { + String[] desc = new String[mDescriptionArray.length + 2]; + System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length); + desc[mDescriptionArray.length] = "Fuel Efficiency: " + (600 / getEfficiency()) + "%"; + desc[mDescriptionArray.length + 1] = String.format("Consumes up to %sL of Steam per second", + (int) (4000 * (8 * Math.pow(4, mTier) + Math.pow(2, mTier)) / (600 / getEfficiency()))); + return desc; + } + + public int getCapacity() { + return 24000 * this.mTier; + } + + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + this.mTier); + } + + public int getEfficiency() { + return this.mEfficiency; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null) return 0; + String fluidName = aLiquid.getFluid().getUnlocalizedName(aLiquid); + return GT_ModHandler.isSteam(aLiquid) || fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name") ? 3 : 0; + } + + public int consumedFluidPerOperation(FluidStack aLiquid) { + return this.mEfficiency; + } + + public ITexture[] getFront(byte aColor) { + return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBack(byte aColor) { + return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK)}; + } + + public ITexture[] getBottom(byte aColor) { + return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM)}; + } + + public ITexture[] getTop(byte aColor) { + return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP)}; + } + + public ITexture[] getSides(byte aColor) { + return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE)}; + } + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_FRONT_ACTIVE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + } + + public ITexture[] getBackActive(byte aColor) { + return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BACK_ACTIVE)}; + } + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_BOTTOM_ACTIVE)}; + } + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_TOP_ACTIVE)}; + } + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE)}; + } + + @Override + public int getPollution() { + return 0; + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + if (aFluid.getFluid().getUnlocalizedName(aFluid).equals("ic2.fluidSuperheatedSteam")) { + aFluid.amount = 0; + aFluid = null; + return false; + } + return super.isFluidInputAllowed(aFluid); + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java index 8b947a740b..ce1812a9cf 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java @@ -1,107 +1,107 @@ -package gregtech.common.tileentities.machines.basic;
-
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-
-public class GT_MetaTileEntity_Disassembler
- extends GT_MetaTileEntity_BasicMachine {
- public GT_MetaTileEntity_Disassembler(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + Math.min(50 + 10 * aTier,100) + "% Efficiency", 1, 9, "Disassembler.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER)});
- }
-
- public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName);
- }
-
- public GT_MetaTileEntity_Disassembler(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Disassembler(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public int checkRecipe() {
- //if ((getInputAt(0) != null) && (isOutputEmpty())) {
- // if(GT_Utility.areStacksEqual(getInputAt(0), new ItemStack(Items.egg))){
- // getInputAt(0).stackSize -= 1;
- // this.mEUt = (16 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
- // this.mMaxProgresstime = 2400;
- // this.mMaxProgresstime = this.mMaxProgresstime >> (mTier);
- //if (getBaseMetaTileEntity().getRandomNumber(100) < (this.mTier+1)) {
- // this.mOutputItems[0] = ItemList.Circuit_Chip_Stemcell.get(1, new Object[0]);
- //}
- //return 2;
- //}
- NBTTagCompound tNBT = getInputAt(0).getTagCompound();
- if (tNBT != null) {
- tNBT = tNBT.getCompoundTag("GT.CraftingComponents");
- if (tNBT != null) {
- boolean isAnyOutput=false;
- calculateOverclockedNessDisassembler(16);
- this.mMaxProgresstime = 80;
- //In case recipe is too OP for that machine
- if (mEUt == Integer.MAX_VALUE - 1)//&& mMaxProgresstime==Integer.MAX_VALUE-1
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- for (int i = 0; i < this.mOutputItems.length; i++) {
- if (getBaseMetaTileEntity().getRandomNumber(100) < 50 + 10 * this.mTier) {
- this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i);
- if (this.mOutputItems[i] != null) {
- this.mMaxProgresstime *= 1.7F;
- isAnyOutput=true;
- }
- }
- }
- if(!isAnyOutput)
- return DID_NOT_FIND_RECIPE;
- for(int i=mTier-5;i>0;i--){
- this.mMaxProgresstime>>=1;
- if(this.mMaxProgresstime==0)
- this.mEUt = this.mEUt>>1;
- }
- if(this.mEUt==0)
- mEUt = 1;
- if(this.mMaxProgresstime==0)
- this.mMaxProgresstime = 1;
- getInputAt(0).stackSize -= 1;
- return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
- }
- }
-
- return DID_NOT_FIND_RECIPE;
- }
-
- private void calculateOverclockedNessDisassembler(int aEUt) {
- if(mTier==0){
- mEUt=aEUt>>2;
- }else{
- //Long EUt calculation
- long xEUt=aEUt;
- //Isnt too low EUt check?
- long tempEUt = xEUt<GT_Values.V[1] ? GT_Values.V[1] : xEUt;
-
- while (tempEUt <= GT_Values.V[mTier -1] * (long)mAmperage) {
- tempEUt<<=2;//this actually controls overclocking
- xEUt<<=2;//this is effect of overclocking
- }
- if(xEUt>Integer.MAX_VALUE-1){
- mEUt = Integer.MAX_VALUE-1;
- }else{
- mEUt = (int)xEUt;
- }
- }
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return //(aIndex == 4 && GT_Utility.areStacksEqual(aStack, new ItemStack(Items.egg))) ||
- (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null);
- }
-}
+package gregtech.common.tileentities.machines.basic; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_Disassembler + extends GT_MetaTileEntity_BasicMachine { + public GT_MetaTileEntity_Disassembler(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, "Disassembles Machines at " + Math.min(50 + 10 * aTier,100) + "% Efficiency", 1, 9, "Disassembler.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_DISASSEMBLER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_DISASSEMBLER)}); + } + + public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName); + } + + public GT_MetaTileEntity_Disassembler(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Disassembler(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + } + + public int checkRecipe() { + //if ((getInputAt(0) != null) && (isOutputEmpty())) { + // if(GT_Utility.areStacksEqual(getInputAt(0), new ItemStack(Items.egg))){ + // getInputAt(0).stackSize -= 1; + // this.mEUt = (16 * (1 << this.mTier - 1) * (1 << this.mTier - 1)); + // this.mMaxProgresstime = 2400; + // this.mMaxProgresstime = this.mMaxProgresstime >> (mTier); + //if (getBaseMetaTileEntity().getRandomNumber(100) < (this.mTier+1)) { + // this.mOutputItems[0] = ItemList.Circuit_Chip_Stemcell.get(1, new Object[0]); + //} + //return 2; + //} + NBTTagCompound tNBT = getInputAt(0).getTagCompound(); + if (tNBT != null) { + tNBT = tNBT.getCompoundTag("GT.CraftingComponents"); + if (tNBT != null) { + boolean isAnyOutput=false; + calculateOverclockedNessDisassembler(16); + this.mMaxProgresstime = 80; + //In case recipe is too OP for that machine + if (mEUt == Integer.MAX_VALUE - 1)//&& mMaxProgresstime==Integer.MAX_VALUE-1 + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < this.mOutputItems.length; i++) { + if (getBaseMetaTileEntity().getRandomNumber(100) < 50 + 10 * this.mTier) { + this.mOutputItems[i] = GT_Utility.loadItem(tNBT, "Ingredient." + i); + if (this.mOutputItems[i] != null) { + this.mMaxProgresstime *= 1.7F; + isAnyOutput=true; + } + } + } + if(!isAnyOutput) + return DID_NOT_FIND_RECIPE; + for(int i=mTier-5;i>0;i--){ + this.mMaxProgresstime>>=1; + if(this.mMaxProgresstime==0) + this.mEUt = this.mEUt>>1; + } + if(this.mEUt==0) + mEUt = 1; + if(this.mMaxProgresstime==0) + this.mMaxProgresstime = 1; + getInputAt(0).stackSize -= 1; + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + } + + return DID_NOT_FIND_RECIPE; + } + + private void calculateOverclockedNessDisassembler(int aEUt) { + if(mTier==0){ + mEUt=aEUt>>2; + }else{ + //Long EUt calculation + long xEUt=aEUt; + //Isnt too low EUt check? + long tempEUt = xEUt<GT_Values.V[1] ? GT_Values.V[1] : xEUt; + + while (tempEUt <= GT_Values.V[mTier -1] * (long)mAmperage) { + tempEUt<<=2;//this actually controls overclocking + xEUt<<=2;//this is effect of overclocking + } + if(xEUt>Integer.MAX_VALUE-1){ + mEUt = Integer.MAX_VALUE-1; + }else{ + mEUt = (int)xEUt; + } + } + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return //(aIndex == 4 && GT_Utility.areStacksEqual(aStack, new ItemStack(Items.egg))) || + (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (aStack.getTagCompound() != null) && (aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != null); + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java index 79c3e5399d..1ffcd3f4f3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -1,125 +1,125 @@ -package gregtech.common.tileentities.machines.basic;
-
-import gregtech.api.enums.*;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Config;
-import gregtech.api.util.GT_Recipe;
-import net.minecraftforge.fluids.FluidStack;
-
-import static gregtech.api.enums.GT_Values.V;
-
-public class GT_MetaTileEntity_Massfabricator
- extends GT_MetaTileEntity_BasicMachine {
- public static int sUUAperUUM = 1;
- public static int sUUASpeedBonus = 4;
- public static int sDurationMultiplier = 3215;
- public static boolean sRequiresUUA = false;
-
- public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)});
- }
-
- public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public void onConfigLoad(GT_Config aConfig) {
- super.onConfigLoad(aConfig);
- sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier);
- sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM);
- sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus);
- sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA);
- Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
- }
-
- @Override
- public long maxAmperesIn() {
- return 10;
- }
-
- @Override
- public long maxEUStore() {
- return V[mTier] * 512L;
- }
-
- public int checkRecipe() {
- FluidStack tFluid = getDrainableStack();
- if ((tFluid == null) || (tFluid.amount < getCapacity())) {
- this.mOutputFluid = Materials.UUMatter.getFluid(1L);
- calculateOverclockedNessMassFabricator();
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- if (((tFluid = getFillableStack()) != null) && (tFluid.amount >= sUUAperUUM) && (tFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)))) {
- tFluid.amount -= sUUAperUUM;
- this.mMaxProgresstime /= sUUASpeedBonus;
- return 2;
- }
- return (sRequiresUUA) || (ItemList.Circuit_Integrated.isStackEqual(getInputAt(0), true, true)) ? 1 : 2;
- }
- return 0;
- }
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes;
- }
-
- private void calculateOverclockedNessMassFabricator() {
- if(mTier==0){
- //Long time calculation
- long xMaxProgresstime = ((long)sDurationMultiplier)<<1;
- if(xMaxProgresstime>Integer.MAX_VALUE-1){
- //make impossible if too long
- mEUt=Integer.MAX_VALUE-1;
- mMaxProgresstime=Integer.MAX_VALUE-1;
- }else{
- mEUt= (int)(GT_Values.V[1]<<2);//2^2=4 so shift <<2
- mMaxProgresstime=(int)xMaxProgresstime;
- }
- }else{
- //Long EUt calculation
- long xEUt=GT_Values.V[1] * (long)Math.pow(2,mTier+2);
-
- long tempEUt = GT_Values.V[1];
-
- mMaxProgresstime = sDurationMultiplier;
-
- while (tempEUt <= V[mTier -1]) {
- tempEUt<<=2;//this actually controls overclocking
- mMaxProgresstime>>=1;//this is effect of overclocking
- if(mMaxProgresstime==0)
- xEUt = (long)(xEUt/1.1D);//U know, if the time is less than 1 tick make the machine use less power
- }
- if(xEUt>Integer.MAX_VALUE-1){
- mEUt = Integer.MAX_VALUE-1;
- mMaxProgresstime = Integer.MAX_VALUE-1;
- }else{
- mEUt = (int)xEUt;
- if(mEUt==0)
- mEUt = 1;
- if(mMaxProgresstime==0)
- mMaxProgresstime = 1;//set time to 1 tick
- }
- }
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L));
- }
-
- public int getCapacity() {
- return Math.max(sUUAperUUM, 1000);
- }
-}
+package gregtech.common.tileentities.machines.basic; + +import gregtech.api.enums.*; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_Recipe; +import net.minecraftforge.fluids.FluidStack; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_MetaTileEntity_Massfabricator + extends GT_MetaTileEntity_BasicMachine { + public static int sUUAperUUM = 1; + public static int sUUASpeedBonus = 4; + public static int sDurationMultiplier = 3215; + public static boolean sRequiresUUA = false; + + public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, "UUM = Matter * Fabrication Squared", 1, 1, "Massfabricator.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_MASSFAB), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)}); + } + + public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Massfabricator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + } + + public void onConfigLoad(GT_Config aConfig) { + super.onConfigLoad(aConfig); + sDurationMultiplier = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); + sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM); + sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus); + sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA); + Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus); + } + + @Override + public long maxAmperesIn() { + return 10; + } + + @Override + public long maxEUStore() { + return V[mTier] * 512L; + } + + public int checkRecipe() { + FluidStack tFluid = getDrainableStack(); + if ((tFluid == null) || (tFluid.amount < getCapacity())) { + this.mOutputFluid = Materials.UUMatter.getFluid(1L); + calculateOverclockedNessMassFabricator(); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (((tFluid = getFillableStack()) != null) && (tFluid.amount >= sUUAperUUM) && (tFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)))) { + tFluid.amount -= sUUAperUUM; + this.mMaxProgresstime /= sUUASpeedBonus; + return 2; + } + return (sRequiresUUA) || (ItemList.Circuit_Integrated.isStackEqual(getInputAt(0), true, true)) ? 1 : 2; + } + return 0; + } + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes; + } + + private void calculateOverclockedNessMassFabricator() { + if(mTier==0){ + //Long time calculation + long xMaxProgresstime = ((long)sDurationMultiplier)<<1; + if(xMaxProgresstime>Integer.MAX_VALUE-1){ + //make impossible if too long + mEUt=Integer.MAX_VALUE-1; + mMaxProgresstime=Integer.MAX_VALUE-1; + }else{ + mEUt= (int)(GT_Values.V[1]<<2);//2^2=4 so shift <<2 + mMaxProgresstime=(int)xMaxProgresstime; + } + }else{ + //Long EUt calculation + long xEUt=GT_Values.V[1] * (long)Math.pow(2,mTier+2); + + long tempEUt = GT_Values.V[1]; + + mMaxProgresstime = sDurationMultiplier; + + while (tempEUt <= V[mTier -1]) { + tempEUt<<=2;//this actually controls overclocking + mMaxProgresstime>>=1;//this is effect of overclocking + if(mMaxProgresstime==0) + xEUt = (long)(xEUt/1.1D);//U know, if the time is less than 1 tick make the machine use less power + } + if(xEUt>Integer.MAX_VALUE-1){ + mEUt = Integer.MAX_VALUE-1; + mMaxProgresstime = Integer.MAX_VALUE-1; + }else{ + mEUt = (int)xEUt; + if(mEUt==0) + mEUt = 1; + if(mMaxProgresstime==0) + mMaxProgresstime = 1;//set time to 1 tick + } + } + } + + public boolean isFluidInputAllowed(FluidStack aFluid) { + return aFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L)); + } + + public int getCapacity() { + return Math.max(sUUAperUUM, 1000); + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java index 5439ad3963..07dc22960b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -1,111 +1,111 @@ -package gregtech.common.tileentities.machines.basic;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.items.behaviors.Behaviour_DataOrb;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-
-import java.util.HashMap;
-import java.util.NoSuchElementException;
-
-public class GT_MetaTileEntity_Replicator
- extends GT_MetaTileEntity_BasicMachine {
- private static int sHeaviestElementMass = 0;
- public static final HashMap<Materials,Long> MASS_OVERRIDES =new HashMap<>();
- static{
- //put overrides here
- //ex.
- //MASS_OVERRIDES.put(Materials.get("cake"),Materials.get("cake").getMass());
- //MASS_OVERRIDES.put(Materials.get("otherCake"),1235234L);
- //MASS_OVERRIDES.put(Materials.Kalendrite,1235234L);
- //MASS_OVERRIDES.put(Materials.Kalendrite,Materials.Kalendrite.getMass()*2);
- }
-
- public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR));
- }
-
- public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public GT_MetaTileEntity_Replicator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public int checkRecipe() {
- FluidStack tFluid = getFillableStack();
- if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) {
- ItemStack tDataOrb = getSpecialSlot();
- if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) {
- Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0);
- long tMass = MASS_OVERRIDES.getOrDefault(tMaterial,tMaterial.getMass());
- if ((tFluid.amount >= tMass) && (tMass > 0L)) {
-
- this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.V[this.mTier],1);
- this.mMaxProgresstime = GT_Utility.safeInt(tMass * 1024L / (1 << this.mTier),1);
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 || mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
-
-
- if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) {
- if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) {
- if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) == null) {
- if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) {
- if (canOutput(this.mOutputItems[0])) {
- getInputAt(0).stackSize -= 1;
- tFluid.amount = ((int) (tFluid.amount - tMass));
- return 2;
- }
- }
- } else {
- this.mOutputItems[0] = null;
- if ((getDrainableStack() == null) || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) && (getDrainableStack().amount < 16000))) {
- tFluid.amount = ((int) (tFluid.amount - tMass));
- return 2;
- }
- }
- }
- } else if (canOutput(this.mOutputItems[0])) {
- tFluid.amount = ((int) (tFluid.amount - tMass));
- return 2;
- }
- }
- }
- }
- return 0;
- }
-
- @Override
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack));
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return aFluid.isFluidEqual(Materials.UUMatter.getFluid(1L));
- }
-
- public int getCapacity() {
- if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) {
- sHeaviestElementMass = Materials.getMaterialsMap().values().stream().mapToInt(material -> (int)material.getMass()).max().orElseThrow(NoSuchElementException::new);
- }
- return sHeaviestElementMass;
- }
-}
+package gregtech.common.tileentities.machines.basic; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.*; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.HashMap; +import java.util.NoSuchElementException; + +public class GT_MetaTileEntity_Replicator + extends GT_MetaTileEntity_BasicMachine { + private static int sHeaviestElementMass = 0; + public static final HashMap<Materials,Long> MASS_OVERRIDES =new HashMap<>(); + static{ + //put overrides here + //ex. + //MASS_OVERRIDES.put(Materials.get("cake"),Materials.get("cake").getMass()); + //MASS_OVERRIDES.put(Materials.get("otherCake"),1235234L); + //MASS_OVERRIDES.put(Materials.Kalendrite,1235234L); + //MASS_OVERRIDES.put(Materials.Kalendrite,Materials.Kalendrite.getMass()*2); + } + + public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, "Producing Elemental Matter", 1, 1, "Replicator.png", "", new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_REPLICATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_REPLICATOR)); + } + + public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + public GT_MetaTileEntity_Replicator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Replicator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + } + + public int checkRecipe() { + FluidStack tFluid = getFillableStack(); + if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) { + ItemStack tDataOrb = getSpecialSlot(); + if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) { + Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0); + long tMass = MASS_OVERRIDES.getOrDefault(tMaterial,tMaterial.getMass()); + if ((tFluid.amount >= tMass) && (tMass > 0L)) { + + this.mEUt = GT_Utility.safeInt(gregtech.api.enums.GT_Values.V[this.mTier],1); + this.mMaxProgresstime = GT_Utility.safeInt(tMass * 1024L / (1 << this.mTier),1); + if (mMaxProgresstime == Integer.MAX_VALUE - 1 || mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + + + if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) { + if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) { + if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) == null) { + if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) { + if (canOutput(this.mOutputItems[0])) { + getInputAt(0).stackSize -= 1; + tFluid.amount = ((int) (tFluid.amount - tMass)); + return 2; + } + } + } else { + this.mOutputItems[0] = null; + if ((getDrainableStack() == null) || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) && (getDrainableStack().amount < 16000))) { + tFluid.amount = ((int) (tFluid.amount - tMass)); + return 2; + } + } + } + } else if (canOutput(this.mOutputItems[0])) { + tFluid.amount = ((int) (tFluid.amount - tMass)); + return 2; + } + } + } + } + return 0; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes; + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (ItemList.Cell_Empty.isStackEqual(aStack)); + } + + public boolean isFluidInputAllowed(FluidStack aFluid) { + return aFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)); + } + + public int getCapacity() { + if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) { + sHeaviestElementMass = Materials.getMaterialsMap().values().stream().mapToInt(material -> (int)material.getMass()).max().orElseThrow(NoSuchElementException::new); + } + return sHeaviestElementMass; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index d035ba4d38..1d627e3878 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -1,366 +1,366 @@ -package gregtech.common.tileentities.machines.basic;
-
-import cpw.mods.fml.common.FMLCommonHandler;
-import forestry.api.genetics.AlleleManager;
-import forestry.api.genetics.IIndividual;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.objects.ItemData;
-import gregtech.api.util.GT_Assemblyline_Server;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.items.behaviors.Behaviour_DataOrb;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.nbt.NBTTagString;
-
-import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes;
-
-public class GT_MetaTileEntity_Scanner
- extends GT_MetaTileEntity_BasicMachine {
-
- public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER)});
- }
-
- public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public GT_MetaTileEntity_Scanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
- super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Scanner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName);
- }
-
- public int checkRecipe() {
- ItemStack aStack = getInputAt(0);
- if (getOutputAt(0) != null) {
- this.mOutputBlocked += 1;
- } else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) {
- if ((getFillableStack() != null) && (getFillableStack().containsFluid(Materials.Honey.getFluid(100L)))) {
- try {
- Object tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack);
- if (tIndividual != null) {
- if (((IIndividual) tIndividual).analyze()) {
- getFillableStack().amount -= 100;
- this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack});
- aStack.stackSize = 0;
- NBTTagCompound tNBT = new NBTTagCompound();
- ((IIndividual) tIndividual).writeToNBT(tNBT);
- this.mOutputItems[0].setTagCompound(tNBT);
- calculateOverclockedNess(2, 500);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- return 2;
- }
- this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack});
- aStack.stackSize = 0;
- this.mMaxProgresstime = 1;
- this.mEUt = 1;
- return 2;
- }
- } catch (Throwable e) {
- if (GT_Values.D1) {
- e.printStackTrace(GT_Log.err);
- }
- }
- }
- if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true)) {
- NBTTagCompound tNBT = aStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
- if (tNBT.getByte("scan") < 4) {
- tNBT.setByte("scan", (byte) 4);
- calculateOverclockedNess(8, 160);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- } else {
- this.mMaxProgresstime = 1;
- this.mEUt = 1;
- }
- aStack.stackSize -= 1;
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack});
- this.mOutputItems[0].setTagCompound(tNBT);
- return 2;
- }
- if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) {
- if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) {
- aStack.stackSize -= 1;
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
- calculateOverclockedNess(30, 512);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- return 2;
- }
- ItemData tData = GT_OreDictUnificator.getAssociation(aStack);
- if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) && (tData.mMaterial.mMaterial.getMass() > 0L)) {
- getSpecialSlot().stackSize -= 1;
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]);
- Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan");
- Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name());
- calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L));
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- return 2;
- }
- }
- if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) {
- if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) {
- aStack.stackSize -= 1;
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
- calculateOverclockedNess(30, 128);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- return 2;
- }
- if (aStack.getItem() == Items.written_book) {
- getSpecialSlot().stackSize -= 1;
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
- this.mOutputItems[0].setTagCompound(aStack.getTagCompound());
- calculateOverclockedNess(30, 128);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- return 2;
- }
- if (aStack.getItem() == Items.filled_map) {
- getSpecialSlot().stackSize -= 1;
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
- this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage()));
- calculateOverclockedNess(30, 128);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- return 2;
- }
-
- if ((aStack.getItem().getUnlocalizedName().contains("Schematic") || aStack.getItem().getUnlocalizedName().contains("schematic")) && !aStack.getItem().getUnlocalizedName().contains("Schematics")) {
- if (mTier < 3)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- String sTier = "";
-
- if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem())) {
- if (aStack.getItemDamage() == 0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).copy().toString()))
- sTier = "100";
- else if (aStack.getItemDamage() == 1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 1).copy().toString()))
- sTier = "2";
- } else if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem())) {
- if (aStack.getItemDamage() == 0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).copy().toString()))
- sTier = "3";
- else if (aStack.getItemDamage() == 1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 1).copy().toString()))
- sTier = "101";
- else if (aStack.getItemDamage() == 2 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 2).copy().toString()))
- sTier = "102";
- } else if (aStack.getUnlocalizedName().matches(".*\\d+.*"))
- sTier = aStack.getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1);
- else
- sTier = "1";
-
- getSpecialSlot().stackSize -= 1;
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
- this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier)));
-
- calculateOverclockedNess(480, 36000);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- return 2;
- }
-
- }
- if (getSpecialSlot() == null && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) {
- if (GT_Utility.ItemNBT.getBookTitle(aStack).equals("Raw Prospection Data")) {
- GT_Utility.ItemNBT.setBookTitle(aStack, "Analyzed Prospection Data");
- GT_Utility.ItemNBT.convertProspectionData(aStack);
- aStack.stackSize -= 1;
-
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack});
- calculateOverclockedNess(30, 1000);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- return 2;
-
- }
- }
- if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true) && aStack != null) {
- for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) {
- if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)) {
- boolean failScanner=true;
- for(GT_Recipe scannerRecipe:sScannerFakeRecipes.mRecipeList){
- if(GT_Utility.areStacksEqual(scannerRecipe.mInputs[0],aStack,true)){
- failScanner=false;
- break;
- }
- }
- if(failScanner){
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- }
-
- String s = tRecipe.mOutput.getDisplayName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName());
- if (s == null)
- s = tRecipe.mOutput.getDisplayName();
- }
- this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()});
- //remove possible old NBTTagCompound
- this.mOutputItems[0].setTagCompound(new NBTTagCompound());
- GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s + " Construction Data");
-
- NBTTagCompound tNBT = this.mOutputItems[0].getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
-
- tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound()));
- tNBT.setInteger("time", tRecipe.mDuration);
- tNBT.setInteger("eu", tRecipe.mEUt);
- for (int i = 0; i < tRecipe.mInputs.length; i++) {
- tNBT.setTag("" + i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound()));
- }
- for (int i = 0; i < tRecipe.mOreDictAlt.length; i++) {
- if (tRecipe.mOreDictAlt[i] != null && tRecipe.mOreDictAlt[i].length > 0) {
- tNBT.setInteger("a" + i, tRecipe.mOreDictAlt[i].length);
- for (int j = 0; j < tRecipe.mOreDictAlt[i].length; j++) {
- tNBT.setTag("a" + i + ":" + j, tRecipe.mOreDictAlt[i][j].writeToNBT(new NBTTagCompound()));
- }
- }
- }
- for (int i = 0; i < tRecipe.mFluidInputs.length; i++) {
- tNBT.setTag("f" + i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound()));
- }
- tNBT.setString("author", "Assembling Line Recipe Generator");
- NBTTagList tNBTList = new NBTTagList();
- s = tRecipe.mOutput.getDisplayName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName());
- if (s == null)
- s = tRecipe.mOutput.getDisplayName();
- }
- tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + " " + s + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + (tRecipe.mDuration / 20)));
- for (int i = 0; i < tRecipe.mInputs.length; i++) {
- if (tRecipe.mOreDictAlt[i] != null) {
- int count = 0;
- StringBuilder tBuilder = new StringBuilder("Input Bus " + (i + 1) + ": ");
- for (ItemStack tStack : tRecipe.mOreDictAlt[i]) {
- if (tStack != null) {
- s = tStack.getDisplayName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tStack.getDisplayName());
- if (s == null)
- s = tStack.getDisplayName();
- }
-
-
- tBuilder.append((count == 0 ? "" : "\nOr ") + tStack.stackSize + " " + s);
- count++;
- }
- }
- if (count > 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString()));
- } else if (tRecipe.mInputs[i] != null) {
- s = tRecipe.mInputs[i].getDisplayName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mInputs[i].getDisplayName());
- if (s == null)
- s = tRecipe.mInputs[i].getDisplayName();
- }
- tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + " " + s));
- }
- }
- for (int i = 0; i < tRecipe.mFluidInputs.length; i++) {
- if (tRecipe.mFluidInputs[i] != null) {
- s = tRecipe.mFluidInputs[i].getLocalizedName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mFluidInputs[i].getLocalizedName());
- if (s == null)
- s = tRecipe.mFluidInputs[i].getLocalizedName();
- }
- tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + s));
- }
- }
- tNBT.setTag("pages", tNBTList);
-
- this.mOutputItems[0].setTagCompound(tNBT);
-
- aStack.stackSize -= 1;
- calculateOverclockedNess(30, tRecipe.mResearchTime);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- getSpecialSlot().stackSize -= 1;
- return 2;
- }
- }
- }
-
- }
- return 0;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (mProgresstime >= (mMaxProgresstime - 1)) {
- if ((this.mOutputItems[0] != null) && (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707"))) {
- GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning");
- }
- }
- super.onPostTick(aBaseMetaTileEntity, aTick);
- }
-
-
- public GT_Recipe.GT_Recipe_Map getRecipeList() {
- return sScannerFakeRecipes;
- }
-
- public int getCapacity() {
- return 1000;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess() {
- sendLoopStart((byte) 1);
- }
-}
+package gregtech.common.tileentities.machines.basic; + +import cpw.mods.fml.common.FMLCommonHandler; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IIndividual; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_Assemblyline_Server; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; + +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; + +public class GT_MetaTileEntity_Scanner + extends GT_MetaTileEntity_BasicMachine { + + public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, "Scans Crops and other things.", 1, 1, "Scanner.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_SCANNER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_SCANNER)}); + } + + public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + public GT_MetaTileEntity_Scanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Scanner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + } + + public int checkRecipe() { + ItemStack aStack = getInputAt(0); + if (getOutputAt(0) != null) { + this.mOutputBlocked += 1; + } else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) { + if ((getFillableStack() != null) && (getFillableStack().containsFluid(Materials.Honey.getFluid(100L)))) { + try { + Object tIndividual = AlleleManager.alleleRegistry.getIndividual(aStack); + if (tIndividual != null) { + if (((IIndividual) tIndividual).analyze()) { + getFillableStack().amount -= 100; + this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack}); + aStack.stackSize = 0; + NBTTagCompound tNBT = new NBTTagCompound(); + ((IIndividual) tIndividual).writeToNBT(tNBT); + this.mOutputItems[0].setTagCompound(tNBT); + calculateOverclockedNess(2, 500); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + this.mOutputItems[0] = GT_Utility.copy(new Object[]{aStack}); + aStack.stackSize = 0; + this.mMaxProgresstime = 1; + this.mEUt = 1; + return 2; + } + } catch (Throwable e) { + if (GT_Values.D1) { + e.printStackTrace(GT_Log.err); + } + } + } + if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true)) { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + tNBT = new NBTTagCompound(); + } + if (tNBT.getByte("scan") < 4) { + tNBT.setByte("scan", (byte) 4); + calculateOverclockedNess(8, 160); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } else { + this.mMaxProgresstime = 1; + this.mEUt = 1; + } + aStack.stackSize -= 1; + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack}); + this.mOutputItems[0].setTagCompound(tNBT); + return 2; + } + if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) { + if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) { + aStack.stackSize -= 1; + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + calculateOverclockedNess(30, 512); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + ItemData tData = GT_OreDictUnificator.getAssociation(aStack); + if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) && (tData.mMaterial.mMaterial.getMass() > 0L)) { + getSpecialSlot().stackSize -= 1; + aStack.stackSize -= 1; + + this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L, new Object[0]); + Behaviour_DataOrb.setDataTitle(this.mOutputItems[0], "Elemental-Scan"); + Behaviour_DataOrb.setDataName(this.mOutputItems[0], tData.mMaterial.mMaterial.mElement.name()); + calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L)); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + } + if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) { + if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { + aStack.stackSize -= 1; + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + calculateOverclockedNess(30, 128); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + if (aStack.getItem() == Items.written_book) { + getSpecialSlot().stackSize -= 1; + aStack.stackSize -= 1; + + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0].setTagCompound(aStack.getTagCompound()); + calculateOverclockedNess(30, 128); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + if (aStack.getItem() == Items.filled_map) { + getSpecialSlot().stackSize -= 1; + aStack.stackSize -= 1; + + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); + calculateOverclockedNess(30, 128); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + + if ((aStack.getItem().getUnlocalizedName().contains("Schematic") || aStack.getItem().getUnlocalizedName().contains("schematic")) && !aStack.getItem().getUnlocalizedName().contains("Schematics")) { + if (mTier < 3) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + String sTier = ""; + + if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).getItem())) { + if (aStack.getItemDamage() == 0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 0).copy().toString())) + sTier = "100"; + else if (aStack.getItemDamage() == 1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftCore", "item.schematic", 1L, 1).copy().toString())) + sTier = "2"; + } else if (aStack.getItem().getIdFromItem(aStack.getItem()) == GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem().getIdFromItem(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).getItem())) { + if (aStack.getItemDamage() == 0 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 0).copy().toString())) + sTier = "3"; + else if (aStack.getItemDamage() == 1 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 1).copy().toString())) + sTier = "101"; + else if (aStack.getItemDamage() == 2 && aStack.toString().equals(GT_ModHandler.getModItem("GalacticraftMars", "item.schematic", 1L, 2).copy().toString())) + sTier = "102"; + } else if (aStack.getUnlocalizedName().matches(".*\\d+.*")) + sTier = aStack.getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1); + else + sTier = "1"; + + getSpecialSlot().stackSize -= 1; + aStack.stackSize -= 1; + + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + this.mOutputItems[0].setTagCompound(GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier))); + + calculateOverclockedNess(480, 36000); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + } + + } + if (getSpecialSlot() == null && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { + if (GT_Utility.ItemNBT.getBookTitle(aStack).equals("Raw Prospection Data")) { + GT_Utility.ItemNBT.setBookTitle(aStack, "Analyzed Prospection Data"); + GT_Utility.ItemNBT.convertProspectionData(aStack); + aStack.stackSize -= 1; + + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{aStack}); + calculateOverclockedNess(30, 1000); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + return 2; + + } + } + if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true) && aStack != null) { + for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { + if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)) { + boolean failScanner=true; + for(GT_Recipe scannerRecipe:sScannerFakeRecipes.mRecipeList){ + if(GT_Utility.areStacksEqual(scannerRecipe.mInputs[0],aStack,true)){ + failScanner=false; + break; + } + } + if(failScanner){ + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + + String s = tRecipe.mOutput.getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); + if (s == null) + s = tRecipe.mOutput.getDisplayName(); + } + this.mOutputItems[0] = GT_Utility.copyAmount(1L, new Object[]{getSpecialSlot()}); + //remove possible old NBTTagCompound + this.mOutputItems[0].setTagCompound(new NBTTagCompound()); + GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s + " Construction Data"); + + NBTTagCompound tNBT = this.mOutputItems[0].getTagCompound(); + if (tNBT == null) { + tNBT = new NBTTagCompound(); + } + + tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound())); + tNBT.setInteger("time", tRecipe.mDuration); + tNBT.setInteger("eu", tRecipe.mEUt); + for (int i = 0; i < tRecipe.mInputs.length; i++) { + tNBT.setTag("" + i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound())); + } + for (int i = 0; i < tRecipe.mOreDictAlt.length; i++) { + if (tRecipe.mOreDictAlt[i] != null && tRecipe.mOreDictAlt[i].length > 0) { + tNBT.setInteger("a" + i, tRecipe.mOreDictAlt[i].length); + for (int j = 0; j < tRecipe.mOreDictAlt[i].length; j++) { + tNBT.setTag("a" + i + ":" + j, tRecipe.mOreDictAlt[i][j].writeToNBT(new NBTTagCompound())); + } + } + } + for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { + tNBT.setTag("f" + i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound())); + } + tNBT.setString("author", "Assembling Line Recipe Generator"); + NBTTagList tNBTList = new NBTTagList(); + s = tRecipe.mOutput.getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); + if (s == null) + s = tRecipe.mOutput.getDisplayName(); + } + tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + " " + s + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + (tRecipe.mDuration / 20))); + for (int i = 0; i < tRecipe.mInputs.length; i++) { + if (tRecipe.mOreDictAlt[i] != null) { + int count = 0; + StringBuilder tBuilder = new StringBuilder("Input Bus " + (i + 1) + ": "); + for (ItemStack tStack : tRecipe.mOreDictAlt[i]) { + if (tStack != null) { + s = tStack.getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tStack.getDisplayName()); + if (s == null) + s = tStack.getDisplayName(); + } + + + tBuilder.append((count == 0 ? "" : "\nOr ") + tStack.stackSize + " " + s); + count++; + } + } + if (count > 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString())); + } else if (tRecipe.mInputs[i] != null) { + s = tRecipe.mInputs[i].getDisplayName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mInputs[i].getDisplayName()); + if (s == null) + s = tRecipe.mInputs[i].getDisplayName(); + } + tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + " " + s)); + } + } + for (int i = 0; i < tRecipe.mFluidInputs.length; i++) { + if (tRecipe.mFluidInputs[i] != null) { + s = tRecipe.mFluidInputs[i].getLocalizedName(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mFluidInputs[i].getLocalizedName()); + if (s == null) + s = tRecipe.mFluidInputs[i].getLocalizedName(); + } + tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + s)); + } + } + tNBT.setTag("pages", tNBTList); + + this.mOutputItems[0].setTagCompound(tNBT); + + aStack.stackSize -= 1; + calculateOverclockedNess(30, tRecipe.mResearchTime); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + getSpecialSlot().stackSize -= 1; + return 2; + } + } + } + + } + return 0; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (mProgresstime >= (mMaxProgresstime - 1)) { + if ((this.mOutputItems[0] != null) && (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { + GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); + } + } + super.onPostTick(aBaseMetaTileEntity, aTick); + } + + + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return sScannerFakeRecipes; + } + + public int getCapacity() { + return 1000; + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); + } + } + + public void startProcess() { + sendLoopStart((byte) 1); + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index 243066b811..0ca5b79d68 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -1,61 +1,61 @@ -package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.objects.GT_RenderedTexture;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_BronzeBlastFurnace
- extends GT_MetaTileEntity_PrimitiveBlastFurnace {
- private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS)};
- private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE)};
- private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE)};
-
- public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_BronzeBlastFurnace(String aName) {
- super(aName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName);
- }
-
- public String[] getDescription() {
- return new String[]{
- "Controller Block for the Bronze Blast Furnace",
- "Useable for Steel and general Pyrometallurgy",
- "Size(WxHxD): 3x4x3 (Hollow, with opening on top)",
- "Built from 32 Bronze Plated Bricks",
- "Causes 200 Pollution per second"};
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing) {
- return aActive ? FACING_ACTIVE : FACING_FRONT;
- }
- return FACING_SIDE;
- }
-
- @Override
- protected boolean isCorrectCasingBlock(Block block) {
- return block == GregTech_API.sBlockCasings1;
- }
-
- @Override
- protected boolean isCorrectCasingMetaID(int metaID) {
- return metaID == 10;
- }
-
- @Override
- public String getName() {
- return "Bronze Blast Furnace";
- }
-
-
+package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; + +public class GT_MetaTileEntity_BronzeBlastFurnace + extends GT_MetaTileEntity_PrimitiveBlastFurnace { + private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS)}; + private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE)}; + private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE)}; + + public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_BronzeBlastFurnace(String aName) { + super(aName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Bronze Blast Furnace", + "Useable for Steel and general Pyrometallurgy", + "Size(WxHxD): 3x4x3 (Hollow, with opening on top)", + "Built from 32 Bronze Plated Bricks", + "Causes 200 Pollution per second"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return aActive ? FACING_ACTIVE : FACING_FRONT; + } + return FACING_SIDE; + } + + @Override + protected boolean isCorrectCasingBlock(Block block) { + return block == GregTech_API.sBlockCasings1; + } + + @Override + protected boolean isCorrectCasingMetaID(int metaID) { + return metaID == 10; + } + + @Override + public String getName() { + return "Bronze Blast Furnace"; + } + + }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java index 45d3d2efa6..d0b366b995 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java @@ -1,51 +1,51 @@ -package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
-public class GT_MetaTileEntity_OilDrill2 extends GT_MetaTileEntity_OilDrillBase {
- public GT_MetaTileEntity_OilDrill2(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_OilDrill2(String aName) {
- super(aName);
- }
-
- @Override
- public String[] getDescription() {
- return getDescriptionInternal("II");
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_OilDrill2(mName);
- }
-
- @Override
- protected ItemList getCasingBlockItem() {
- return ItemList.Casing_StableTitanium;
- }
-
- @Override
- protected Materials getFrameMaterial() {
- return Materials.Titanium;
- }
-
- @Override
- protected int getCasingTextureIndex() {
- return 50;
- }
-
- @Override
- protected int getRangeInChunks() {
- return 4;
- }
-
- @Override
- protected int getMinTier() {
- return 3;
- }
+package gregtech.common.tileentities.machines.multi; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public class GT_MetaTileEntity_OilDrill2 extends GT_MetaTileEntity_OilDrillBase { + public GT_MetaTileEntity_OilDrill2(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_OilDrill2(String aName) { + super(aName); + } + + @Override + public String[] getDescription() { + return getDescriptionInternal("II"); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_OilDrill2(mName); + } + + @Override + protected ItemList getCasingBlockItem() { + return ItemList.Casing_StableTitanium; + } + + @Override + protected Materials getFrameMaterial() { + return Materials.Titanium; + } + + @Override + protected int getCasingTextureIndex() { + return 50; + } + + @Override + protected int getRangeInChunks() { + return 4; + } + + @Override + protected int getMinTier() { + return 3; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java index 102811bc5a..3ebb67f5b7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java @@ -1,51 +1,51 @@ -package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
-public class GT_MetaTileEntity_OilDrill3 extends GT_MetaTileEntity_OilDrillBase {
- public GT_MetaTileEntity_OilDrill3(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_OilDrill3(String aName) {
- super(aName);
- }
-
- @Override
- public String[] getDescription() {
- return getDescriptionInternal("III");
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_OilDrill3(mName);
- }
-
- @Override
- protected ItemList getCasingBlockItem() {
- return ItemList.Casing_RobustTungstenSteel;
- }
-
- @Override
- protected Materials getFrameMaterial() {
- return Materials.TungstenSteel;
- }
-
- @Override
- protected int getCasingTextureIndex() {
- return 48;
- }
-
- @Override
- protected int getRangeInChunks() {
- return 8;
- }
-
- @Override
- protected int getMinTier() {
- return 4;
- }
+package gregtech.common.tileentities.machines.multi; + +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public class GT_MetaTileEntity_OilDrill3 extends GT_MetaTileEntity_OilDrillBase { + public GT_MetaTileEntity_OilDrill3(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_OilDrill3(String aName) { + super(aName); + } + + @Override + public String[] getDescription() { + return getDescriptionInternal("III"); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_OilDrill3(mName); + } + + @Override + protected ItemList getCasingBlockItem() { + return ItemList.Casing_RobustTungstenSteel; + } + + @Override + protected Materials getFrameMaterial() { + return Materials.TungstenSteel; + } + + @Override + protected int getCasingTextureIndex() { + return 48; + } + + @Override + protected int getRangeInChunks() { + return 8; + } + + @Override + protected int getMinTier() { + return 4; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java index f0d57ab0bb..5013893cbe 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java @@ -1,89 +1,89 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.InventoryPlayer;
-
-public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze {
- public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Compressor_Bronze(String aName, String aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public GT_MetaTileEntity_Compressor_Bronze(String aName, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeCompressor.png", GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Compressor_Bronze(this.mName, this.mDescriptionArray, this.mTextures);
- }
-
- public int checkRecipe() {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCompressorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
- this.mOutputItems[0] = tRecipe.getOutput(0);
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = (tRecipe.mDuration * 2);
- return 2;
- }
- return 0;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess() {
- sendLoopStart((byte) 1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE)};
- }
-
- public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR)};
- }
-
- public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE)};
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR)};
- }
-
- public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE)};
- }
-
- public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR)};
- }
-
- public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE)};
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { + public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false); + } + + public GT_MetaTileEntity_Compressor_Bronze(String aName, String aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public GT_MetaTileEntity_Compressor_Bronze(String aName, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeCompressor.png", GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Compressor_Bronze(this.mName, this.mDescriptionArray, this.mTextures); + } + + public int checkRecipe() { + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCompressorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); + if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { + this.mOutputItems[0] = tRecipe.getOutput(0); + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = (tRecipe.mDuration * 2); + return 2; + } + return 0; + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ); + } + } + + public void startProcess() { + sendLoopStart((byte) 1); + } + + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE)}; + } + + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR)}; + } + + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE)}; + } + + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR)}; + } + + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE)}; + } + + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR)}; + } + + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE)}; + } + + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR)}; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java index 433b334f88..4a3a1e73ee 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java @@ -1,89 +1,89 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.InventoryPlayer;
-
-public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
- public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Compressor_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public GT_MetaTileEntity_Compressor_Steel(String aName, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelCompressor.png", GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Compressor_Steel(this.mName, this.mDescriptionArray, this.mTextures);
- }
-
- public int checkRecipe() {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCompressorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
- this.mOutputItems[0] = tRecipe.getOutput(0);
- this.mEUt = (tRecipe.mEUt * 2);
- this.mMaxProgresstime = tRecipe.mDuration;
- return 2;
- }
- return 0;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess() {
- sendLoopStart((byte) 1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE)};
- }
-
- public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR)};
- }
-
- public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE)};
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR)};
- }
-
- public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE)};
- }
-
- public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR)};
- }
-
- public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE)};
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicMachine_Steel { + public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false); + } + + public GT_MetaTileEntity_Compressor_Steel(String aName, String aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public GT_MetaTileEntity_Compressor_Steel(String aName, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelCompressor.png", GT_Recipe.GT_Recipe_Map.sCompressorRecipes.mUnlocalizedName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Compressor_Steel(this.mName, this.mDescriptionArray, this.mTextures); + } + + public int checkRecipe() { + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCompressorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); + if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { + this.mOutputItems[0] = tRecipe.getOutput(0); + this.mEUt = (tRecipe.mEUt * 2); + this.mMaxProgresstime = tRecipe.mDuration; + return 2; + } + return 0; + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(203)), 10, 1.0F, aX, aY, aZ); + } + } + + public void startProcess() { + sendLoopStart((byte) 1); + } + + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE)}; + } + + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_COMPRESSOR)}; + } + + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE)}; + } + + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_COMPRESSOR)}; + } + + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE)}; + } + + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_COMPRESSOR)}; + } + + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE)}; + } + + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_COMPRESSOR)}; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java index fcfbb5737d..2d36cf0e98 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java @@ -1,89 +1,89 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.InventoryPlayer;
-
-public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze {
- public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Extractor_Bronze(String aName, String aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public GT_MetaTileEntity_Extractor_Bronze(String aName, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeExtractor.png", GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Extractor_Bronze(this.mName, this.mDescriptionArray, this.mTextures);
- }
-
- public int checkRecipe() {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sExtractorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
- this.mOutputItems[0] = tRecipe.getOutput(0);
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = (tRecipe.mDuration * 2);
- return 2;
- }
- return 0;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess() {
- sendLoopStart((byte) 1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE)};
- }
-
- public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR)};
- }
-
- public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE)};
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR)};
- }
-
- public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE)};
- }
-
- public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR)};
- }
-
- public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE)};
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Bronze; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze { + public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false); + } + + public GT_MetaTileEntity_Extractor_Bronze(String aName, String aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public GT_MetaTileEntity_Extractor_Bronze(String aName, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "BronzeExtractor.png", GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Extractor_Bronze(this.mName, this.mDescriptionArray, this.mTextures); + } + + public int checkRecipe() { + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sExtractorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[1], null, getAllInputs()); + if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { + this.mOutputItems[0] = tRecipe.getOutput(0); + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = (tRecipe.mDuration * 2); + return 2; + } + return 0; + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ); + } + } + + public void startProcess() { + sendLoopStart((byte) 1); + } + + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE)}; + } + + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR)}; + } + + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE)}; + } + + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR)}; + } + + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE)}; + } + + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR)}; + } + + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE)}; + } + + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR)}; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java index f53f080862..e2d762f566 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java @@ -1,89 +1,89 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.InventoryPlayer;
-
-public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
- public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Extractor_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public GT_MetaTileEntity_Extractor_Steel(String aName, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelExtractor.png", GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Extractor_Steel(this.mName, this.mDescriptionArray, this.mTextures);
- }
-
- public int checkRecipe() {
- GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sExtractorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs());
- if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) {
- this.mOutputItems[0] = tRecipe.getOutput(0);
- this.mEUt = (tRecipe.mEUt * 2);
- this.mMaxProgresstime = tRecipe.mDuration;
- return 2;
- }
- return 0;
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess() {
- sendLoopStart((byte) 1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE)};
- }
-
- public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR)};
- }
-
- public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE)};
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR)};
- }
-
- public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE)};
- }
-
- public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR)};
- }
-
- public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE)};
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMachine_Steel { + public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false); + } + + public GT_MetaTileEntity_Extractor_Steel(String aName, String aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public GT_MetaTileEntity_Extractor_Steel(String aName, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelExtractor.png", GT_Recipe.GT_Recipe_Map.sExtractorRecipes.mUnlocalizedName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Extractor_Steel(this.mName, this.mDescriptionArray, this.mTextures); + } + + public int checkRecipe() { + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sExtractorRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[2], null, getAllInputs()); + if ((tRecipe != null) && (canOutput(tRecipe.mOutputs)) && (tRecipe.isRecipeInputEqual(true, null, getAllInputs()))) { + this.mOutputItems[0] = tRecipe.getOutput(0); + this.mEUt = (tRecipe.mEUt * 2); + this.mMaxProgresstime = tRecipe.mDuration; + return 2; + } + return 0; + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(200)), 10, 1.0F, aX, aY, aZ); + } + } + + public void startProcess() { + sendLoopStart((byte) 1); + } + + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE)}; + } + + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_EXTRACTOR)}; + } + + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE)}; + } + + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_EXTRACTOR)}; + } + + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE)}; + } + + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_EXTRACTOR)}; + } + + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE)}; + } + + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_EXTRACTOR)}; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java index 4e98d1ce79..5085f2d66b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java @@ -1,121 +1,121 @@ -package gregtech.common.tileentities.machines.steam;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-
-import java.util.Random;
-
-import static gregtech.api.enums.GT_Values.V;
-
-public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
- public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Macerator_Steel(String aName, String aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public GT_MetaTileEntity_Macerator_Steel(String aName, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aDescription, aTextures, 1, 1, false);
- }
-
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelMacerator.png", GT_Recipe_Map.sMaceratorRecipes.mUnlocalizedName);
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_Macerator_Steel(this.mName, this.mDescriptionArray, this.mTextures);
- }
-
- public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPreTick(aBaseMetaTileEntity, aTick);
- if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
- Random tRandom = aBaseMetaTileEntity.getWorld().rand;
- aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
- }
- }
-
- public int checkRecipe() {
- GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes;
- if (tMap == null) return DID_NOT_FIND_RECIPE;
- GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs());
- if (tRecipe == null) return DID_NOT_FIND_RECIPE;
- if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
- if (!canOutput(tRecipe)) {
- mOutputBlocked++;
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- }
-
-// if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs()))
-// return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs()))
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0);
- this.mEUt = (2 * tRecipe.mEUt);
- this.mMaxProgresstime = tRecipe.mDuration;
- return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) {
- return false;
- }
- return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, new Object[]{aStack}));
- }
-
- public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
- super.startSoundLoop(aIndex, aX, aY, aZ);
- if (aIndex == 1) {
- GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ);
- }
- }
-
- public void startProcess() {
- sendLoopStart((byte) 1);
- }
-
- public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE)};
- }
-
- public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR)};
- }
-
- public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE)};
- }
-
- public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR)};
- }
-
- public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE)};
- }
-
- public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR)};
- }
-
- public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE)};
- }
-
- public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR)};
- }
-}
+package gregtech.common.tileentities.machines.steam; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_BasicMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_Steel; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Random; + +import static gregtech.api.enums.GT_Values.V; + +public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMachine_Steel { + public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false); + } + + public GT_MetaTileEntity_Macerator_Steel(String aName, String aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public GT_MetaTileEntity_Macerator_Steel(String aName, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aDescription, aTextures, 1, 1, false); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "SteelMacerator.png", GT_Recipe_Map.sMaceratorRecipes.mUnlocalizedName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Macerator_Steel(this.mName, this.mDescriptionArray, this.mTextures); + } + + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) { + Random tRandom = aBaseMetaTileEntity.getWorld().rand; + aBaseMetaTileEntity.getWorld().spawnParticle("smoke", aBaseMetaTileEntity.getXCoord() + 0.8F - tRandom.nextFloat() * 0.6F, aBaseMetaTileEntity.getYCoord() + 0.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D); + } + } + + public int checkRecipe() { + GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; + if (tMap == null) return DID_NOT_FIND_RECIPE; + GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, getAllInputs()); + if (tRecipe == null) return DID_NOT_FIND_RECIPE; + if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; + if (!canOutput(tRecipe)) { + mOutputBlocked++; + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + +// if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) +// return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs())) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0); + this.mEUt = (2 * tRecipe.mEUt); + this.mMaxProgresstime = tRecipe.mDuration; + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { + return false; + } + return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, new Object[]{aStack})); + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 1) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(201)), 10, 1.0F, aX, aY, aZ); + } + } + + public void startProcess() { + sendLoopStart((byte) 1); + } + + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[]{super.getSideFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE)}; + } + + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[]{super.getSideFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_STEAM_MACERATOR)}; + } + + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[]{super.getFrontFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE)}; + } + + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[]{super.getFrontFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR)}; + } + + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[]{super.getTopFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE)}; + } + + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[]{super.getTopFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR)}; + } + + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[]{super.getBottomFacingActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE)}; + } + + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[]{super.getBottomFacingInactive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_STEAM_MACERATOR)}; + } +} diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java index 4327a2e957..65af5d5c92 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java @@ -1,108 +1,108 @@ -package gregtech.common.tools;
-
-import cpw.mods.fml.common.Loader;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.common.items.behaviors.Behaviour_None;
-import gregtech.common.items.behaviors.Behaviour_Scoop;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.IChatComponent;
-
-public class GT_Tool_Scoop
- extends GT_Tool {
- public static Material sBeeHiveMaterial;
-
- public int getToolDamagePerBlockBreak() {
- return 200;
- }
-
- public int getToolDamagePerDropConversion() {
- return 100;
- }
-
- public int getToolDamagePerContainerCraft() {
- return 200;
- }
-
- public int getToolDamagePerEntityAttack() {
- return 200;
- }
-
- public int getBaseQuality() {
- return 0;
- }
-
- public float getBaseDamage() {
- return 1.0F;
- }
-
- public float getSpeedMultiplier() {
- return 1.0F;
- }
-
- public float getMaxDurabilityMultiplier() {
- return 1.0F;
- }
-
- public String getCraftingSound() {
- return null;
- }
-
- public String getEntityHitSound() {
- return null;
- }
-
- public String getBreakingSound() {
- return (String) GregTech_API.sSoundList.get(Integer.valueOf(0));
- }
-
- public String getMiningSound() {
- return null;
- }
-
- public boolean canBlock() {
- return false;
- }
-
- public boolean isCrowbar() {
- return false;
- }
-
- public boolean isMinableBlock(Block aBlock, byte aMetaData) {
- String tTool = aBlock.getHarvestTool(aMetaData);
- return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("scoop"))) || (aBlock.getMaterial() == sBeeHiveMaterial);
- }
-
- public ItemStack getBrokenItem(ItemStack aStack) {
- return null;
- }
-
- public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
- return aIsToolHead ? Textures.ItemIcons.SCOOP : null;
- }
-
- public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
- return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa;
- }
-
- public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {
- if(Loader.isModLoaded(GT_Values.MOD_ID_FR)){
- aItem.addItemBehavior(aID, new Behaviour_Scoop(200));
- }else{
- aItem.addItemBehavior(aID, new Behaviour_None());
- }
-
- }
-
- public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
- return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got scooped up by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE);
- }
-}
+package gregtech.common.tools; + +import cpw.mods.fml.common.Loader; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.common.items.behaviors.Behaviour_None; +import gregtech.common.items.behaviors.Behaviour_Scoop; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class GT_Tool_Scoop + extends GT_Tool { + public static Material sBeeHiveMaterial; + + public int getToolDamagePerBlockBreak() { + return 200; + } + + public int getToolDamagePerDropConversion() { + return 100; + } + + public int getToolDamagePerContainerCraft() { + return 200; + } + + public int getToolDamagePerEntityAttack() { + return 200; + } + + public int getBaseQuality() { + return 0; + } + + public float getBaseDamage() { + return 1.0F; + } + + public float getSpeedMultiplier() { + return 1.0F; + } + + public float getMaxDurabilityMultiplier() { + return 1.0F; + } + + public String getCraftingSound() { + return null; + } + + public String getEntityHitSound() { + return null; + } + + public String getBreakingSound() { + return (String) GregTech_API.sSoundList.get(Integer.valueOf(0)); + } + + public String getMiningSound() { + return null; + } + + public boolean canBlock() { + return false; + } + + public boolean isCrowbar() { + return false; + } + + public boolean isMinableBlock(Block aBlock, byte aMetaData) { + String tTool = aBlock.getHarvestTool(aMetaData); + return aBlock.getHarvestLevel(aMetaData) != -1 && (tTool == null || tTool.isEmpty() || (tTool.equals("scoop"))) || (aBlock.getMaterial() == sBeeHiveMaterial); + } + + public ItemStack getBrokenItem(ItemStack aStack) { + return null; + } + + public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { + return aIsToolHead ? Textures.ItemIcons.SCOOP : null; + } + + public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; + } + + public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) { + if(Loader.isModLoaded(GT_Values.MOD_ID_FR)){ + aItem.addItemBehavior(aID, new Behaviour_Scoop(200)); + }else{ + aItem.addItemBehavior(aID, new Behaviour_None()); + } + + } + + public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { + return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got scooped up by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + } +} |