diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:47:13 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:47:13 -0400 |
commit | bea4cfc54566b4f3b9971d1da93782b03410f669 (patch) | |
tree | 0c736c222d38dcc1d016fd5318790c583e1bdf98 /src/main/java/gregtech/common | |
parent | 1185424fa7c692f9932623b965a99392d969e3c5 (diff) | |
download | GT5-Unofficial-bea4cfc54566b4f3b9971d1da93782b03410f669.tar.gz GT5-Unofficial-bea4cfc54566b4f3b9971d1da93782b03410f669.tar.bz2 GT5-Unofficial-bea4cfc54566b4f3b9971d1da93782b03410f669.zip |
Bring in experimental branch
Diffstat (limited to 'src/main/java/gregtech/common')
71 files changed, 4182 insertions, 1517 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 5e6e2498c5..26f2b673ff 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -157,6 +157,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mFlintChance = 30; public int mItemDespawnTime = 6000; public int mUpgradeCount = 4; + public boolean mGTBees = true; public static class OreDictEventContainer { public final OreDictionary.OreRegisterEvent mEvent; @@ -1633,22 +1634,22 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { rFuelValue = (short) Math.max(rFuelValue, 888); } if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLignite")) { - rFuelValue = (short) Math.max(rFuelValue, 300); + rFuelValue = (short) Math.max(rFuelValue, 1200); } if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLignite")) { - rFuelValue = (short) Math.max(rFuelValue, 300); + rFuelValue = (short) Math.max(rFuelValue, 1200); } if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustImpureLignite")) { - rFuelValue = (short) Math.max(rFuelValue, 300); + rFuelValue = (short) Math.max(rFuelValue, 1200); } if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustLignite")) { - rFuelValue = (short) Math.max(rFuelValue, 300); + rFuelValue = (short) Math.max(rFuelValue, 1200); } if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallLignite")) { - rFuelValue = (short) Math.max(rFuelValue, 75); + rFuelValue = (short) Math.max(rFuelValue, 375); } if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyLignite")) { - rFuelValue = (short) Math.max(rFuelValue, 33); + rFuelValue = (short) Math.max(rFuelValue, 166); } if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCoal")) { rFuelValue = (short) Math.max(rFuelValue, 1600); diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index bb9a173288..a1ccbcc05c 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -82,6 +82,11 @@ public class GT_RecipeAdder 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, int aDuration, int aEUtick) + { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aFluidOutput == null))) { return false; } @@ -91,7 +96,10 @@ public class GT_RecipeAdder if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { return false; } - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, new ItemStack[] { aOutput }, null, null, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, 30, 0); + if(aEUtick<=0){ + return false; + } + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, new ItemStack[] { aOutput }, null, null, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUtick, 0); return true; } @@ -296,6 +304,19 @@ public class GT_RecipeAdder // return true; return false; } + + +@Override +public boolean addUniversalDistillationRecipe(FluidStack aInput, FluidStack[] aOutputs, ItemStack aOutput2, int aDuration, int aEUt) { + if(aOutputs.length>0){addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 0L, new Object[0]), aInput, aOutputs[0], aDuration*2, aEUt/4, false);} + if(aOutputs.length>1){addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 1L, new Object[0]), aInput, aOutputs[1], aDuration*2, aEUt/4, false);} + if(aOutputs.length>2){addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 2L, new Object[0]), aInput, aOutputs[2], aDuration*2, aEUt/4, false);} + if(aOutputs.length>3){addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 3L, new Object[0]), aInput, aOutputs[3], aDuration*2, aEUt/4, false);} + if(aOutputs.length>4){addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), aInput, aOutputs[4], aDuration*2, aEUt/4, false);} + if(aOutputs.length>5){addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 5L, new Object[0]), aInput, aOutputs[5], 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>5){return false;} @@ -446,12 +467,11 @@ public class GT_RecipeAdder 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); - } - + 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; } @@ -465,11 +485,11 @@ public class GT_RecipeAdder 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); - } + 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; } @@ -483,15 +503,14 @@ public class GT_RecipeAdder 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); - } + 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; } @@ -691,22 +710,22 @@ public class GT_RecipeAdder } 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; + { + 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; } - 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; } - return false; - } public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) { @@ -726,4 +745,26 @@ public class GT_RecipeAdder 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 +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; +} + } diff --git a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java index aa00217020..a0c0e2c438 100644 --- a/src/main/java/gregtech/common/GT_ThaumcraftCompat.java +++ b/src/main/java/gregtech/common/GT_ThaumcraftCompat.java @@ -200,12 +200,12 @@ public class GT_ThaumcraftCompat } public Object addInfusionRecipe(String aResearch, ItemStack aMainInput,ItemStack[] aSideInputs, ItemStack aOutput,int aInstability, List<TC_Aspects.TC_AspectStack> aAspects) - { - if ((GT_Utility.isStringInvalid(aResearch)) || (aMainInput == null)|| (aSideInputs==null) || (aOutput == null) || (aAspects == null) || (aAspects.isEmpty())) { - return null; + { + if ((GT_Utility.isStringInvalid(aResearch)) || (aMainInput == null)|| (aSideInputs==null) || (aOutput == null) || (aAspects == null) || (aAspects.isEmpty())) { + return null; + } + return ThaumcraftApi.addInfusionCraftingRecipe(aResearch, GT_Utility.copy(new Object[] { aOutput }), aInstability, getAspectList(aAspects), aMainInput, aSideInputs); } - return ThaumcraftApi.addInfusionCraftingRecipe(aResearch, GT_Utility.copy(new Object[] { aOutput }), aInstability, getAspectList(aAspects), aMainInput, aSideInputs); - } public boolean registerThaumcraftAspectsToItem(ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) { 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 f92806b3a9..d0766311a7 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 @@ -32,6 +32,7 @@ public class GT_Worldgen_GT_Ore_Layer public final boolean mOverworld;
public final boolean mNether;
public final boolean mEnd;
+ public final boolean mEndAsteroid;
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)
{
@@ -39,6 +40,7 @@ public class GT_Worldgen_GT_Ore_Layer this.mOverworld = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Overworld", aOverworld);
this.mNether = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "Nether", aNether);
this.mEnd = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "TheEnd", aEnd);
+ this.mEndAsteroid = GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "EndAsteroid", aEnd);
this.mMinY = ((short)GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MinHeight", aMinY));
this.mMaxY = ((short)Math.max(this.mMinY + 5, GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "MaxHeight", aMaxY)));
this.mWeight = ((short)GregTech_API.sWorldgenFile.get("worldgen." + this.mWorldGenName, "RandomWeight", aWeight));
diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 0d2f5fc33e..3e769cb270 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -5,9 +5,14 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API;
import gregtech.api.util.GT_Log;
import gregtech.api.world.GT_Worldgen;
+import gregtech.common.blocks.GT_TileEntity_Ores;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
+
+import net.minecraft.init.Blocks;
+import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
@@ -21,9 +26,18 @@ public class GT_Worldgenerator public static boolean sAsteroids = true;
public List<Runnable> mList = new ArrayList();
public boolean mIsGenerating = false;
+ private static int mEndAsteroidProbability = 300;
+ private static int mSize = 100;
+ private static int endMinSize = 50;
+ private static int endMaxSize = 200;
+ private static boolean endAsteroids=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);
GameRegistry.registerWorldGenerator(this, 1073741823);
}
@@ -86,12 +100,12 @@ public class GT_Worldgenerator {
temp = false;
}
+ break;
}
catch (Throwable e)
{
e.printStackTrace(GT_Log.err);
}
- break;
}
}
}
@@ -121,6 +135,104 @@ public class GT_Worldgenerator i++;
}
}
+ //Asteroid Worldgen
+ int tDimensionType = this.mWorld.provider.dimensionId;
+ Random aRandom = new Random();
+ 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 < 256) && (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) {
+ primaryMeta = tWorldGen.mPrimaryMeta;
+ secondaryMeta = tWorldGen.mSecondaryMeta;
+ betweenMeta = tWorldGen.mBetweenMeta;
+ sporadicMeta = tWorldGen.mSporadicMeta;
+ temp = false;
+ break;
+ }
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+ }
+ }
+ }
+ int tX = mX + aRandom.nextInt(16);
+ int tY = 50 + aRandom.nextInt(200 - 50);
+ int tZ = mZ + aRandom.nextInt(16);
+ if (tDimensionType == 1) {
+ mSize = aRandom.nextInt((int) (endMaxSize - endMinSize));
+ }
+ 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 + (tDimensionType == -30 ? 4000 : 2000), true);
+ } else if (ranOre < 6) {
+ GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, secondaryMeta + (tDimensionType == -30 ? 4000 : 2000), true);
+ } else if (ranOre < 8) {
+ GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, betweenMeta + (tDimensionType == -30 ? 4000 : 2000), true);
+ } else if (ranOre < 10) {
+ GT_TileEntity_Ores.setOreBlock(mWorld, eX, eY, eZ, sporadicMeta + (tDimensionType == -30 ? 4000 : 2000), true);
+ } else {
+ if (tDimensionType == -30) {
+ mWorld.setBlock(eX, eY, eZ, GregTech_API.sBlockGranites, 8, 3);
+ } else {
+ mWorld.setBlock(eX, eY, eZ, Blocks.end_stone, 0, 0);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+
+
+
Chunk tChunk = this.mWorld.getChunkFromBlockCoords(this.mX, this.mZ);
if (tChunk != null) {
tChunk.isModified = true;
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java index a24aee847f..e1f1a73945 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings1.java @@ -19,6 +19,7 @@ public class GT_Block_Casings1 for (byte i = 0; i < 16; i = (byte)(i + 1)) {
Textures.BlockIcons.CASING_BLOCKS[i] = new GT_CopiedBlockTexture(this, 6, i);
}
+ Textures.BlockIcons.CASING_BLOCKS[120] = new GT_CopiedBlockTexture(this, 6, 0);
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "ULV Machine Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "LV Machine Casing");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "MV Machine Casing");
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java index d312719bc3..a329abcdd3 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java @@ -87,8 +87,9 @@ public class GT_Block_Concretes }
else
{
+ if(aEntity.motionX<6.0&&aEntity.motionZ<6.0){
aEntity.motionX *= 1.100000023841858D;
- aEntity.motionZ *= 1.100000023841858D;
+ aEntity.motionZ *= 1.100000023841858D;}
}
}
}
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 dd791ec783..3943331295 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -296,14 +296,10 @@ public class GT_Block_Machines public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ)
{
-// System.out.println("player hardness");
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (((tTileEntity instanceof BaseMetaTileEntity)) && (((BaseMetaTileEntity)tTileEntity).privateAccess()) && (!((BaseMetaTileEntity)tTileEntity).playerOwnsThis(aPlayer, true))) {
-// System.out.println("locked");
- return -1.0F;
+ return -1.0F;
}
-// System.out.println("unlocked");
-// System.out.println("hardness: "+super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ));
return super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ);
}
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java new file mode 100644 index 0000000000..f5f0b4749f --- /dev/null +++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java @@ -0,0 +1,37 @@ +package gregtech.common.blocks; + +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.ItemBlock; +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 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; + for(int i=0;i<aMats.length;i++){ + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "."+i+".name", "Block of "+aMats[i].mDefaultLocalName); + GT_OreDictUnificator.registerOre(aPrefix, aMats[i], 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.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java index a03f70f154..3fdfe7ce5b 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java @@ -1,273 +1,262 @@ -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.Materials;
-import gregtech.api.enums.OrePrefixes;
-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 java.util.ArrayList;
-import java.util.List;
-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;
-
-public class GT_Block_Ores
- extends GT_Generic_Block
- implements ITileEntityProvider
-{
- public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal();
-
- public GT_Block_Ores()
- {
- super(GT_Item_Ores.class, "gt.blockores", Material.rock);
- this.isBlockContainer = true;
- setStepSound(soundTypeStone);
- setCreativeTab(GregTech_API.TAB_GREGTECH_ORES);
- 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)
- {
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 1000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 2000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 3000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 4000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 16000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 17000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 18000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 19000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 20000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
- if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0)
- {
- GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i));
- GT_OreDictUnificator.registerOre(OrePrefixes.oreNetherrack.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000));
- GT_OreDictUnificator.registerOre(OrePrefixes.oreEndstone.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 2000));
- GT_OreDictUnificator.registerOre(OrePrefixes.oreBlackgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 3000));
- GT_OreDictUnificator.registerOre(OrePrefixes.oreRedgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 4000));
- }
- }
- }
- }
-
- public static boolean FUCKING_LOCK = false;
-
- 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 getLocalizedName(Materials aMaterial) {
- switch (aMaterial) {
- case InfusedAir: case InfusedDull: case InfusedEarth: case InfusedEntropy: case InfusedFire: case InfusedOrder: case InfusedVis: case InfusedWater:
- return aMaterial.mDefaultLocalName + " 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 aMaterial.mDefaultLocalName;
- default:
- return aMaterial.mDefaultLocalName + OrePrefixes.ore.mLocalizedMaterialPost;
- }
-
- }
-
- 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 % 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 String getUnlocalizedName()
- {
- return "gt.blockores";
- }
-
- public String getLocalizedName()
- {
- return StatCollector.translateToLocal(getUnlocalizedName() + ".name");
- }
-
- 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 != null) && ((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 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(aFortune);
- }
- return mTemporaryTileEntity.get() == null ? new ArrayList() : ((GT_TileEntity_Ores)mTemporaryTileEntity.get()).getDrops(aFortune);
- }
-
- public TileEntity createTileEntity(World aWorld, int aMeta)
- {
- return new GT_TileEntity_Ores();
- }
-
- @SideOnly(Side.CLIENT)
- 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))
- {
- aList.add(new ItemStack(aItem, 1, i));
- aList.add(new ItemStack(aItem, 1, i + 1000));
- aList.add(new ItemStack(aItem, 1, i + 2000));
- aList.add(new ItemStack(aItem, 1, i + 3000));
- aList.add(new ItemStack(aItem, 1, i + 4000));
- aList.add(new ItemStack(aItem, 1, i + 16000));
- aList.add(new ItemStack(aItem, 1, i + 17000));
- aList.add(new ItemStack(aItem, 1, i + 18000));
- aList.add(new ItemStack(aItem, 1, i + 19000));
- aList.add(new ItemStack(aItem, 1, i + 20000));
- }
- }
- }
-}
-
-
-
-/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
-
- * Qualified Name: gregtech.common.blocks.GT_Block_Ores
-
- * JD-Core Version: 0.7.0.1
-
- */
+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.Materials; +import gregtech.api.enums.OrePrefixes; +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 java.util.ArrayList; +import java.util.List; +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; + +public class GT_Block_Ores + extends GT_Generic_Block + implements ITileEntityProvider +{ + public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal(); + + public GT_Block_Ores() + { + super(GT_Item_Ores.class, "gt.blockores", Material.rock); + this.isBlockContainer = true; + setStepSound(soundTypeStone); + setCreativeTab(GregTech_API.TAB_GREGTECH_ORES); + 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) + { + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 1000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 2000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 3000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 4000) + ".name", getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 16000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 17000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 18000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 19000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + 20000) + ".name", "Small " + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); + if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) + { + GT_OreDictUnificator.registerOre(OrePrefixes.ore.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i)); + GT_OreDictUnificator.registerOre(OrePrefixes.oreNetherrack.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000)); + GT_OreDictUnificator.registerOre(OrePrefixes.oreEndstone.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 2000)); + GT_OreDictUnificator.registerOre(OrePrefixes.oreBlackgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 3000)); + GT_OreDictUnificator.registerOre(OrePrefixes.oreRedgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 4000)); + } + } + } + } + + public static boolean FUCKING_LOCK = false; + + 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 getLocalizedName(Materials aMaterial) { + switch (aMaterial) { + case InfusedAir: case InfusedDull: case InfusedEarth: case InfusedEntropy: case InfusedFire: case InfusedOrder: case InfusedVis: case InfusedWater: + return aMaterial.mDefaultLocalName + " 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 aMaterial.mDefaultLocalName; + default: + return aMaterial.mDefaultLocalName + OrePrefixes.ore.mLocalizedMaterialPost; + } + } + + 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 % 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 String getUnlocalizedName() + { + return "gt.blockores"; + } + + public String getLocalizedName() + { + return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); + } + + 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 != null) && ((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 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(aFortune); + } + return mTemporaryTileEntity.get() == null ? new ArrayList() : ((GT_TileEntity_Ores)mTemporaryTileEntity.get()).getDrops(aFortune); + } + + public TileEntity createTileEntity(World aWorld, int aMeta) + { + return new GT_TileEntity_Ores(); + } + + @SideOnly(Side.CLIENT) + 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)) + { + aList.add(new ItemStack(aItem, 1, i)); + aList.add(new ItemStack(aItem, 1, i + 1000)); + aList.add(new ItemStack(aItem, 1, i + 2000)); + aList.add(new ItemStack(aItem, 1, i + 3000)); + aList.add(new ItemStack(aItem, 1, i + 4000)); + aList.add(new ItemStack(aItem, 1, i + 16000)); + aList.add(new ItemStack(aItem, 1, i + 17000)); + aList.add(new ItemStack(aItem, 1, i + 18000)); + aList.add(new ItemStack(aItem, 1, i + 19000)); + aList.add(new ItemStack(aItem, 1, i + 20000)); + } + } + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java new file mode 100644 index 0000000000..ebf33b172c --- /dev/null +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -0,0 +1,218 @@ +package gregtech.common.blocks; + +import java.util.List; +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +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 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.IOreRecipeRegistrator; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.common.GT_Proxy; + +public class GT_Block_Reinforced extends GT_Generic_Block{ + + public GT_Block_Reinforced(String aName) { + super(GT_Item_Storage.class, aName, Material.rock); + setStepSound(soundTypeStone); + setCreativeTab(GregTech_API.TAB_GREGTECH); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Bronzeplate Reinforced Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Iridium-Tungstensteel Reinforced Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Plascrete Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Tungstensteel Reinforced Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Brittle Charcoal"); + ItemList.Block_BronzePlate.set(new ItemStack(this.setHardness(60.0f).setResistance(150.0f), 1, 0)); + ItemList.Block_IridiumTungstensteel.set(new ItemStack(this.setHardness(200.0f).setResistance(600.0f), 1, 1)); + ItemList.Block_Plascrete.set(new ItemStack(this.setHardness(80.0f).setResistance(350.0f), 1, 2)); + ItemList.Block_TungstenSteelReinforced.set(new ItemStack(this.setHardness(100.0f).setResistance(400.0f), 1, 3)); + ItemList.Block_BrittleCharcoal.set(new ItemStack(this.setHardness(0.5f).setResistance(8.0f), 1, 4)); + GT_ModHandler.addCraftingRecipe(ItemList.Block_BronzePlate.get(1L, new Object[0]), new Object[] { "hP ","PBP"," P ", 'P', OrePrefixes.plate.get(Materials.Bronze),'B',OrePrefixes.stone.get(Materials.GraniteBlack)}); + GT_ModHandler.addCraftingRecipe(ItemList.Block_BronzePlate.get(1L, new Object[0]), new Object[] { "hP ","PBP"," P ", 'P', OrePrefixes.plate.get(Materials.Bronze),'B',OrePrefixes.stone.get(Materials.GraniteRed)}); + GT_ModHandler.addCraftingRecipe(ItemList.Block_IridiumTungstensteel.get(1L, new Object[0]), new Object[] {"hBP", 'P', OrePrefixes.plate.get(Materials.Iridium),'B',ItemList.Block_TungstenSteelReinforced.get(1L, new Object[0])}); + GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.coal,1,1), new Object[]{ItemList.Block_BrittleCharcoal.get(1, new Object[0])}); + } + + public String getHarvestTool(int aMeta) + { + if(aMeta==4)return "axe"; + return "pickaxe"; + } + + public int getHarvestLevel(int aMeta) + { + if(aMeta==4)return 1; + return 4; + } + + public IIcon getIcon(int aSide, int aMeta) + { + if ((aMeta >= 0) && (aMeta < 16)) + { + switch (aMeta) + { + case 0: + return Textures.BlockIcons.BLOCK_BRONZEPREIN.getIcon(); + case 1: + return Textures.BlockIcons.BLOCK_IRREIN.getIcon(); + case 2: + return Textures.BlockIcons.BLOCK_PLASCRETE.getIcon(); + case 3: + return Textures.BlockIcons.BLOCK_TSREIN.getIcon(); + case 4: + return Blocks.coal_block.getIcon(0, 0); + } + } + return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); + } + + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) + { + if (aWorld == null) { + return 0.0F; + } + int tMeta = aWorld.getBlockMetadata(aX, aY, aZ); + if (tMeta == 0) { + return 60.0F; + } + if (tMeta == 1) { + return 200.0F; + } + if (tMeta == 2) { + return 80.0F; + } + if (tMeta == 3) { + return 100.0F; + } + if (tMeta == 4) { + return 0.5F; + } + return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); + } + + public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + { + if (world == null) { + return 0.0F; + } + int tMeta = world.getBlockMetadata(x, y, z); + if (tMeta == 0) { + return 150.0F; + } + if (tMeta == 1) { + return 600.0F; + } + if (tMeta == 2) { + return 350.0F; + } + if (tMeta == 3) { + return 400.0F; + } + if (tMeta == 4) { + return 8.0F; + } + return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); + } + + 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 boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) + { + return true; + } + + 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); + } + + public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int par5, float chance, int par7) + { + if (par5==4) + { + Random ran = new Random(); + + this.dropBlockAsItem(aWorld, aX, aY, aZ, new ItemStack(Items.coal,ran.nextInt(2)+1,1)); + }else { + super.dropBlockAsItemWithChance(aWorld, aX, aY, aZ, par5, chance, par7); + } + } + + @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_Block_Storage.java b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java new file mode 100644 index 0000000000..3e3f245e01 --- /dev/null +++ b/src/main/java/gregtech/common/blocks/GT_Block_Storage.java @@ -0,0 +1,120 @@ +package gregtech.common.blocks; + +import java.util.List; +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IOreRecipeRegistrator; +import gregtech.api.items.GT_Generic_Block; + +public class GT_Block_Storage extends GT_Generic_Block{ + + protected GT_Block_Storage(Class<? extends ItemBlock> aItemClass, String aName, Material aMaterial) { + super(aItemClass, aName, aMaterial); + setStepSound(soundTypeMetal); + setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); + } + + public String getHarvestTool(int aMeta) + { + return "pickaxe"; + } + + public int getHarvestLevel(int aMeta) + { + return 1; + } + + 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); + } + + 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 boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) + { + return true; + } + + 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++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } +} diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java new file mode 100644 index 0000000000..4154493277 --- /dev/null +++ b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java @@ -0,0 +1,37 @@ +package gregtech.common.blocks; + +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_LanguageManager; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +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 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/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index 6edce96441..5f559b2a0e 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -1,257 +1,263 @@ -package gregtech.common.blocks;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.ITexturedTileEntity;
-import gregtech.api.net.IGT_NetworkHandler;
-import gregtech.api.objects.GT_CopiedBlockTexture;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-
-import java.util.ArrayList;
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.Packet;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class GT_TileEntity_Ores
- extends TileEntity
- implements ITexturedTileEntity
-{
- private static final ITexture[] mStoneTextures = { new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0) };
- public short mMetaData = 0;
- public boolean mNatural = false;
- public boolean mBlocked = true;
-
- public void readFromNBT(NBTTagCompound aNBT)
- {
- super.readFromNBT(aNBT);
- this.mMetaData = aNBT.getShort("m");
- this.mNatural = aNBT.getBoolean("n");
- }
-
- public void writeToNBT(NBTTagCompound aNBT)
- {
- super.writeToNBT(aNBT);
- aNBT.setShort("m", this.mMetaData);
- aNBT.setBoolean("n", this.mNatural);
- }
-
- public void onUpdated()
- {
- if ((!this.worldObj.isRemote) && (this.mBlocked))
- {
- this.mBlocked = false;
- GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short)this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord);
- }
- }
-
- public Packet getDescriptionPacket()
- {
- if (!this.worldObj.isRemote) {
- if ((this.mBlocked == (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord + 1, this.yCoord, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord - 1, this.yCoord, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord + 1)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord - 1)) ? 1 : 0) == 0) {
- GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short)this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord);
- }
- }
- return null;
- }
-
- public static byte getHarvestData(short aMetaData)
- {
- Materials aMaterial = GregTech_API.sGeneratedMaterials[(aMetaData % 1000)];
- return aMaterial == null ? 0 : (byte)Math.max((aMetaData % 16000 / 1000 == 3) || (aMetaData % 16000 / 1000 == 4) ? 3 : 0, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1)));
- }
-
- public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta)
- {
- this.mMetaData = ((short)(int)(this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L));
- if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) {
- this.mMetaData = ((short)(this.mMetaData + 1000));
- } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) {
- this.mMetaData = ((short)(this.mMetaData + 2000));
- } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) {
- if (aOverridingStoneBlock == GregTech_API.sBlockGranites)
- {
- if (aOverridingStoneMeta < 8) {
- this.mMetaData = ((short)(this.mMetaData + 3000));
- } else {
- this.mMetaData = ((short)(this.mMetaData + 4000));
- }
- }
- else {
- this.mMetaData = ((short)(this.mMetaData + 3000));
- }
- }
- this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0);
- }
-
- public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData)
- {
- aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1));
- Block tBlock = aWorld.getBlock(aX, aY, aZ);
- if ((aMetaData > 0) && (tBlock != Blocks.air))
- {
- if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) {
- aMetaData += 1000;
- } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) {
- aMetaData += 2000;
- } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites))
- {
- if (tBlock == GregTech_API.sBlockGranites)
- {
- if (aWorld.getBlockMetadata(aX, aY, aZ) < 8) {
- aMetaData += 3000;
- } else {
- aMetaData += 4000;
- }
- }
- else {
- aMetaData += 3000;
- }
- }
- else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
- return false;
- }
- aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1, getHarvestData((short)aMetaData), 0);
- TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
- if ((tTileEntity instanceof GT_TileEntity_Ores))
- {
- ((GT_TileEntity_Ores)tTileEntity).mMetaData = ((short)aMetaData);
- ((GT_TileEntity_Ores)tTileEntity).mNatural = true;
- }
- return true;
- }
- return false;
- }
-
- public short getMetaData()
- {
- return this.mMetaData;
- }
-
- public boolean canUpdate()
- {
- return false;
- }
-
- public ArrayList<ItemStack> getDrops(int aFortune)
- {
- ArrayList<ItemStack> rList = new ArrayList();
- if (this.mMetaData <= 0)
- {
- rList.add(new ItemStack(Blocks.cobblestone, 1, 0));
- return rList;
- }
- if (this.mMetaData < 16000)
- {
- rList.add(new ItemStack(GregTech_API.sBlockOres1, 1, this.mMetaData));
- return rList;
- }
- Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)];
- if (!this.mNatural) {
- aFortune = 0;
- }
- if (aMaterial != null)
- {
- Random tRandom = new Random(this.xCoord ^ this.yCoord ^ this.zCoord);
- ArrayList<ItemStack> tSelector = new ArrayList();
-
-
- ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L);
- if (tStack != null) {
- for (int i = 0; i < 1; i++) {
- tSelector.add(tStack);
- }
- }
- tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L);
- if (tStack != null) {
- for (int i = 0; i < 2; i++) {
- tSelector.add(tStack);
- }
- }
- tStack = GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L);
- if (tStack != null) {
- for (int i = 0; i < 12; i++) {
- tSelector.add(tStack);
- }
- }
- tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L);
- if (tStack != null) {
- for (int i = 0; i < 5; i++) {
- tSelector.add(tStack);
- }
- }
- tStack = GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L);
- if (tStack != null) {
- for (int i = 0; i < 10; i++) {
- tSelector.add(tStack);
- }
- }
- tStack = GT_OreDictUnificator.get(OrePrefixes.gemChipped, aMaterial, GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), 1L);
- if (tStack != null) {
- for (int i = 0; i < 5; i++) {
- tSelector.add(tStack);
- }
- }
- tStack = GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L);
- if (tStack != null) {
- for (int i = 0; i < 10; i++) {
- tSelector.add(tStack);
- }
- }
- if (tSelector.size() > 0)
- {
- int i = 0;
- for (int j = Math.max(1, aMaterial.mOreMultiplier + (aFortune > 0 ? tRandom.nextInt(1 + aFortune * aMaterial.mOreMultiplier) : 0) / 2); i < j; i++) {
- rList.add(GT_Utility.copyAmount(1L, new Object[] { tSelector.get(tRandom.nextInt(tSelector.size())) }));
- }
- }
- if (tRandom.nextInt(3 + aFortune) > 1) {
- switch (this.mMetaData / 1000 % 16)
- {
- case 0:
- rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); break;
- case 1:
- rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Netherrack, 1L)); break;
- case 2:
- rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Endstone, 1L)); break;
- case 3:
- rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.GraniteBlack, 1L)); break;
- case 4:
- rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.GraniteRed, 1L));
- }
- }
- }
- return rList;
- }
-
- public ITexture[] getTexture(byte aSide)
- {
- Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)];
- if ((aMaterial != null) && (this.mMetaData < 32000)) {
- return new ITexture[] { mStoneTextures[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData/16000 ==0 ? OrePrefixes.ore.mTextureIndex:OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa) };
- }
- return new ITexture[] { mStoneTextures[0], new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) };
- }
-}
-
-
-
-/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
-
- * Qualified Name: gregtech.common.blocks.GT_TileEntity_Ores
-
- * JD-Core Version: 0.7.0.1
-
- */
+package gregtech.common.blocks; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import gregtech.api.net.IGT_NetworkHandler; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class GT_TileEntity_Ores + extends TileEntity + implements ITexturedTileEntity +{ + private static final ITexture[] mStoneTextures = { new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0) }; + public short mMetaData = 0; + public boolean mNatural = false; + public boolean mBlocked = true; + + public void readFromNBT(NBTTagCompound aNBT) + { + super.readFromNBT(aNBT); + this.mMetaData = aNBT.getShort("m"); + this.mNatural = aNBT.getBoolean("n"); + } + + public void writeToNBT(NBTTagCompound aNBT) + { + super.writeToNBT(aNBT); + aNBT.setShort("m", this.mMetaData); + aNBT.setBoolean("n", this.mNatural); + } + + public void onUpdated() + { + if ((!this.worldObj.isRemote) && (this.mBlocked)) + { + this.mBlocked = false; + GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short)this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + } + } + + public Packet getDescriptionPacket() + { + if (!this.worldObj.isRemote) { + if ((this.mBlocked == (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord + 1, this.yCoord, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord - 1, this.yCoord, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord - 1, this.zCoord)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord + 1)) && (GT_Utility.isOpaqueBlock(this.worldObj, this.xCoord, this.yCoord, this.zCoord - 1)) ? 1 : 0) == 0) { + GT_Values.NW.sendPacketToAllPlayersInRange(this.worldObj, new GT_Packet_Ores(this.xCoord, (short)this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + } + } + return null; + } + + public static byte getHarvestData(short aMetaData) + { + Materials aMaterial = GregTech_API.sGeneratedMaterials[(aMetaData % 1000)]; + return aMaterial == null ? 0 : (byte)Math.max((aMetaData % 16000 / 1000 == 3) || (aMetaData % 16000 / 1000 == 4) ? 3 : 0, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1))); + } + + public void overrideOreBlockMaterial(Block aOverridingStoneBlock, byte aOverridingStoneMeta) + { + this.mMetaData = ((short)(int)(this.mMetaData % 1000L + this.mMetaData / 16000L * 16000L)); + if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.netherrack)) { + this.mMetaData = ((short)(this.mMetaData + 1000)); + } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Blocks.end_stone)) { + this.mMetaData = ((short)(this.mMetaData + 2000)); + } else if (aOverridingStoneBlock.isReplaceableOreGen(this.worldObj, this.xCoord, this.yCoord, this.zCoord, GregTech_API.sBlockGranites)) { + if (aOverridingStoneBlock == GregTech_API.sBlockGranites) + { + if (aOverridingStoneMeta < 8) { + this.mMetaData = ((short)(this.mMetaData + 3000)); + } else { + this.mMetaData = ((short)(this.mMetaData + 4000)); + } + } + else { + this.mMetaData = ((short)(this.mMetaData + 3000)); + } + } + this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, getHarvestData(this.mMetaData), 0); + } + + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData) + {return setOreBlock(aWorld, aX, aY, aZ, aMetaData, false); + } + + public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air) + { + if (!air) { + aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); + } + Block tBlock = aWorld.getBlock(aX, aY, aZ); + if ((aMetaData > 0) && ((tBlock != Blocks.air)|| air)) + { + if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) { + aMetaData += 1000; + } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) { + aMetaData += 2000; + } else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, GregTech_API.sBlockGranites)) + { + if (tBlock == GregTech_API.sBlockGranites) + { + if (aWorld.getBlockMetadata(aX, aY, aZ) < 8) { + aMetaData += 3000; + } else { + aMetaData += 4000; + } + } + else { + aMetaData += 3000; + } + } + else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) { + return false; + } + aWorld.setBlock(aX, aY, aZ, GregTech_API.sBlockOres1, getHarvestData((short)aMetaData), 0); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if ((tTileEntity instanceof GT_TileEntity_Ores)) + { + ((GT_TileEntity_Ores)tTileEntity).mMetaData = ((short)aMetaData); + ((GT_TileEntity_Ores)tTileEntity).mNatural = true; + } + return true; + } + return false; + } + + public short getMetaData() + { + return this.mMetaData; + } + + public boolean canUpdate() + { + return false; + } + + public ArrayList<ItemStack> getDrops(int aFortune) + { + ArrayList<ItemStack> rList = new ArrayList(); + if (this.mMetaData <= 0) + { + rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); + return rList; + } + if (this.mMetaData < 16000) + { + rList.add(new ItemStack(GregTech_API.sBlockOres1, 1, this.mMetaData)); + return rList; + } + Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)]; + if (!this.mNatural) { + aFortune = 0; + } + if (aMaterial != null) + { + Random tRandom = new Random(this.xCoord ^ this.yCoord ^ this.zCoord); + ArrayList<ItemStack> tSelector = new ArrayList(); + + + ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 1; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 2; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 12; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 5; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 10; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.gemChipped, aMaterial, GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), 1L); + if (tStack != null) { + for (int i = 0; i < 5; i++) { + tSelector.add(tStack); + } + } + tStack = GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L); + if (tStack != null) { + for (int i = 0; i < 10; i++) { + tSelector.add(tStack); + } + } + if (tSelector.size() > 0) + { + int i = 0; + for (int j = Math.max(1, aMaterial.mOreMultiplier + (aFortune > 0 ? tRandom.nextInt(1 + aFortune * aMaterial.mOreMultiplier) : 0) / 2); i < j; i++) { + rList.add(GT_Utility.copyAmount(1L, new Object[] { tSelector.get(tRandom.nextInt(tSelector.size())) })); + } + } + if (tRandom.nextInt(3 + aFortune) > 1) { + switch (this.mMetaData / 1000 % 16) + { + case 0: + rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); break; + case 1: + rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Netherrack, 1L)); break; + case 2: + rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Endstone, 1L)); break; + case 3: + rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.GraniteBlack, 1L)); break; + case 4: + rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.GraniteRed, 1L)); + } + } + } + return rList; + } + + public ITexture[] getTexture(byte aSide) + { + Materials aMaterial = GregTech_API.sGeneratedMaterials[(this.mMetaData % 1000)]; + if ((aMaterial != null) && (this.mMetaData < 32000)) { + return new ITexture[] { mStoneTextures[(this.mMetaData / 1000 % 16)], new GT_RenderedTexture(aMaterial.mIconSet.mTextures[this.mMetaData/16000 ==0 ? OrePrefixes.ore.mTextureIndex:OrePrefixes.oreSmall.mTextureIndex], aMaterial.mRGBa) }; + } + return new ITexture[] { mStoneTextures[0], new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) }; + } +} + + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + + * Qualified Name: gregtech.common.blocks.GT_TileEntity_Ores + + * JD-Core Version: 0.7.0.1 + + */ diff --git a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java index 4a91015247..e599250b72 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_LiquidMeter.java @@ -1,97 +1,97 @@ -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.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidHandler;
-
-public class GT_Cover_LiquidMeter
- extends GT_CoverBehavior
-{
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
- {
- if ((aTileEntity instanceof IFluidHandler))
- {
- FluidTankInfo[] tTanks = ((IFluidHandler)aTileEntity).getTankInfo(ForgeDirection.UNKNOWN);
- long tAll = 0L;long tFull = 0L;
- if (tTanks != null) {
- for (FluidTankInfo tTank : tTanks) {
- if (tTank != null)
- {
- tAll += tTank.capacity;
- FluidStack tLiquid = tTank.fluid;
- if (tLiquid != null) {
- tFull += tLiquid.amount;
- }
- }
- }
- }
- tAll /= 14L;
- if (tAll > 0L) {
- aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable != 0 ? (byte)(int)(15L - (tFull <= 0L ? 0L : tFull / tAll + 1L)) : tFull <= 0L ? 0 : (byte)(int)(tFull / tAll + 1L));
- } else {
- aTileEntity.setOutputRedstoneSignal(aSide, ((byte)(aCoverVariable != 0 ? 15 : 0)));
- }
- }
- else
- {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte)0);
- }
- return aCoverVariable;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ)
- {
- if (aCoverVariable == 0) {
- GT_Utility.sendChatToPlayer(aPlayer, "Inverted");
- } else {
- GT_Utility.sendChatToPlayer(aPlayer, "Normal");
- }
- return aCoverVariable == 0 ? 1 : 0;
- }
-
- 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.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class GT_Cover_LiquidMeter + extends GT_CoverBehavior +{ + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) + { + if ((aTileEntity instanceof IFluidHandler)) + { + FluidTankInfo[] tTanks = ((IFluidHandler)aTileEntity).getTankInfo(ForgeDirection.UNKNOWN); + long tAll = 0L;long tFull = 0L; + if (tTanks != null) { + for (FluidTankInfo tTank : tTanks) { + if (tTank != null) + { + tAll += tTank.capacity; + FluidStack tLiquid = tTank.fluid; + if (tLiquid != null) { + tFull += tLiquid.amount; + } + } + } + } + tAll /= 14L; + if (tAll > 0L) { + aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable != 0 ? (byte)(int)(15L - (tFull <= 0L ? 0L : tFull / tAll + 1L)) : tFull <= 0L ? 0 : (byte)(int)(tFull / tAll + 1L)); + } else { + aTileEntity.setOutputRedstoneSignal(aSide, ((byte)(aCoverVariable != 0 ? 15 : 0))); + } + } + else + { + aTileEntity.setOutputRedstoneSignal(aSide, (byte)0); + } + return aCoverVariable; + } + + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) + { + if (aCoverVariable == 0) { + GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); + } else { + GT_Utility.sendChatToPlayer(aPlayer, "Normal"); + } + return aCoverVariable == 0 ? 1 : 0; + } + + 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; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java index 39960e3940..9a800751a9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -1,9 +1,7 @@ package gregtech.common.covers; import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import gregtech.api.GregTech_API; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -40,7 +38,7 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior{ aTileEntity.setOutputRedstoneSignal(aSide, (byte)(needsRepair ? 0 : 15)); aTileEntity.setOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide), (byte)(needsRepair ? 0 : 15)); - return aCoverVariable; + return aCoverVariable; } public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java index 827fb27b71..938645a1a9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java @@ -18,15 +18,14 @@ public class GT_Cover_RedstoneTransmitterInternal 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 1;
}
+ public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
+ {
+ return true;
+ }
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java index 8ad8359708..ac004bf921 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_SolarPanel.java @@ -1,41 +1,41 @@ -package gregtech.common.covers;
-
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.util.GT_CoverBehavior;
-import net.minecraft.world.World;
-import net.minecraft.world.biome.BiomeGenBase;
-
-public class GT_Cover_SolarPanel
- extends GT_CoverBehavior
-{
- private final int mVoltage;
-
- public GT_Cover_SolarPanel(int aVoltage)
- {
- this.mVoltage = aVoltage;
- }
-
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer)
- {
- if (aTimer % 100L == 0L) {
- if ((aSide != 1) || (aTileEntity.getWorld().isThundering()))
- {
- aCoverVariable = 0;
- }
- else
- {
- boolean bRain = (aTileEntity.getWorld().isRaining()) && (aTileEntity.getBiome().rainfall > 0.0F);
- aCoverVariable = bRain && aTileEntity.getWorld().skylightSubtracted >= 4 || !aTileEntity.getSkyAtSide(aSide) ? 0 : ((int) (!bRain && aTileEntity.getWorld().isDaytime() ? 1 : 2));
- }
- }
- if ((aCoverVariable == 1) || ((aCoverVariable == 2) && (aTimer % 8L == 0L))) {
- aTileEntity.injectEnergyUnits((byte)6, this.mVoltage, 1L);
- }
- return aCoverVariable;
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
- {
- return 1;
- }
+package gregtech.common.covers; + +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.util.GT_CoverBehavior; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class GT_Cover_SolarPanel + extends GT_CoverBehavior +{ + private final int mVoltage; + + public GT_Cover_SolarPanel(int aVoltage) + { + this.mVoltage = aVoltage; + } + + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) + { + if (aTimer % 100L == 0L) { + if ((aSide != 1) || (aTileEntity.getWorld().isThundering())) + { + aCoverVariable = 0; + } + else + { + boolean bRain = (aTileEntity.getWorld().isRaining()) && (aTileEntity.getBiome().rainfall > 0.0F); + aCoverVariable = bRain && aTileEntity.getWorld().skylightSubtracted >= 4 || !aTileEntity.getSkyAtSide(aSide) ? 0 : ((int) (!bRain && aTileEntity.getWorld().isDaytime() ? 1 : 2)); + } + } + if ((aCoverVariable == 1) || ((aCoverVariable == 2) && (aTimer % 8L == 0L))) { + aTileEntity.injectEnergyUnits((byte)6, this.mVoltage, 1L); + } + return aCoverVariable; + } + + public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) + { + return 1; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java new file mode 100644 index 0000000000..1abd5dc081 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java @@ -0,0 +1,177 @@ +package gregtech.common.gui; + +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Container_BasicMachine; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_MicrowaveEnergyTransmitter; + +import java.util.Iterator; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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; + +public class GT_Container_MicrowaveEnergyTransmitter + extends GT_ContainerMetaTile_Machine +{ + public GT_Container_MicrowaveEnergyTransmitter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) + { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) + { + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 8, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 8, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 8, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 8, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 26, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 26, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 26, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 26, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 152, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 152, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 152, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 152, 59, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 134, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 134, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 134, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 2, 134, 59, false, false, 1)); + } + + @Override + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) + { + if (aSlotIndex < 0) { + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + Slot tSlot = (Slot)this.inventorySlots.get(aSlotIndex); + if ((tSlot != null) && (this.mTileEntity.getMetaTileEntity() != null)) { + switch (aSlotIndex) + { + case 0: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetX -= (aShifthold == 1 ? 512 : 64); + return null; + case 1: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetY -= (aShifthold == 1 ? 512 : 64); + return null; + case 2: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetZ -= (aShifthold == 1 ? 512 : 64); + return null; + case 3: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetD -= (aShifthold == 1 ? 16 : 8); + return null; + case 4: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetX -= (aShifthold == 1 ? 16 : 1); + return null; + case 5: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetY -= (aShifthold == 1 ? 16 : 1); + return null; + case 6: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetZ -= (aShifthold == 1 ? 16 : 1); + return null; + case 7: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetD -= (aShifthold == 1 ? 4 : 1); + return null; + case 8: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetX += (aShifthold == 1 ? 512 : 64); + return null; + case 9: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetY += (aShifthold == 1 ? 512 : 64); + return null; + case 10: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetZ += (aShifthold == 1 ? 512 : 64); + return null; + case 11: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetD += (aShifthold == 1 ? 16 : 8); + return null; + case 12: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetX += (aShifthold == 1 ? 16 : 1); + return null; + case 13: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetY += (aShifthold == 1 ? 16 : 1); + return null; + case 14: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetZ += (aShifthold == 1 ? 16 : 1); + return null; + case 15: + ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetD += (aShifthold == 1 ? 4 : 1); + return null; + } + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + public int mEgg = 0; + public int mTargetD = 0; + public int mTargetZ = 0; + public int mTargetY = 0; + public int mTargetX = 0; + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) { + return; + } + this.mTargetX = ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetX; + this.mTargetY = ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetY; + this.mTargetZ = ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetZ; + this.mTargetD = ((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).mTargetD; + this.mEgg = (((GT_MetaTileEntity_MicrowaveEnergyTransmitter)this.mTileEntity.getMetaTileEntity()).hasDimensionalTeleportCapability() ? 1 : 0); + + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) + { + ICrafting var1 = (ICrafting)var2.next(); + var1.sendProgressBarUpdate(this, 100, this.mTargetX & 0xFFFF); + var1.sendProgressBarUpdate(this, 101, this.mTargetX >>> 16); + var1.sendProgressBarUpdate(this, 102, this.mTargetY & 0xFFFF); + var1.sendProgressBarUpdate(this, 103, this.mTargetY >>> 16); + var1.sendProgressBarUpdate(this, 104, this.mTargetZ & 0xFFFF); + var1.sendProgressBarUpdate(this, 105, this.mTargetZ >>> 16); + var1.sendProgressBarUpdate(this, 106, this.mTargetD & 0xFFFF); + var1.sendProgressBarUpdate(this, 107, this.mTargetD >>> 16); + var1.sendProgressBarUpdate(this, 108, this.mEgg); + } + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) + { + super.updateProgressBar(par1, par2); + switch (par1) + { + case 100: + this.mTargetX = (this.mTargetX & 0xFFFF0000 | par2); break; + case 101: + this.mTargetX = (this.mTargetX & 0xFFFF | par2 << 16); break; + case 102: + this.mTargetY = (this.mTargetY & 0xFFFF0000 | par2); break; + case 103: + this.mTargetY = (this.mTargetY & 0xFFFF | par2 << 16); break; + case 104: + this.mTargetZ = (this.mTargetZ & 0xFFFF0000 | par2); break; + case 105: + this.mTargetZ = (this.mTargetZ & 0xFFFF | par2 << 16); break; + case 106: + this.mTargetD = (this.mTargetD & 0xFFFF0000 | par2); break; + case 107: + this.mTargetD = (this.mTargetD & 0xFFFF | par2 << 16); break; + case 108: + this.mEgg = par2; + } + } +} diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java index c6f588a34f..5546e35fda 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java @@ -10,10 +10,11 @@ import gregtech.api.util.GT_Utility; public class GT_GUIContainer_FusionReactor extends GT_GUIContainerMetaTile_Machine { String mName = ""; - - public GT_GUIContainer_FusionReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { + public String mNEI; + public GT_GUIContainer_FusionReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile, String aNEI) { super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false), RES_PATH_GUI + "multimachines/" + (aTextureFile==null?"MultiblockDisplay":aTextureFile)); mName = aName; + mNEI = aNEI; } @Override diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java new file mode 100644 index 0000000000..a9a728aeb6 --- /dev/null +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java @@ -0,0 +1,40 @@ +package gregtech.common.gui; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.gui.GT_GUIContainer_BasicTank; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_MicrowaveEnergyTransmitter + extends GT_GUIContainerMetaTile_Machine +{ + public GT_GUIContainer_MicrowaveEnergyTransmitter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) + { + super(new GT_Container_MicrowaveEnergyTransmitter(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "Teleporter.png"); + } + + protected void drawGuiContainerForegroundLayer(int par1, int par2) + { + this.fontRendererObj.drawString("Teleporter", 46, 8, 16448255); + if (this.mContainer != null) + { + this.fontRendererObj.drawString("X: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter)this.mContainer).mTargetX), 46, 16, 16448255); + this.fontRendererObj.drawString("Y: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter)this.mContainer).mTargetY), 46, 24, 16448255); + this.fontRendererObj.drawString("Z: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter)this.mContainer).mTargetZ), 46, 32, 16448255); + if (((GT_Container_MicrowaveEnergyTransmitter)this.mContainer).mEgg > 0) { + this.fontRendererObj.drawString("Dim: " + GT_Utility.parseNumberToString(((GT_Container_MicrowaveEnergyTransmitter)this.mContainer).mTargetD), 46, 40, 16448255); + } + } + } + + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (this.width - this.xSize) / 2; + int y = (this.height - this.ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); + } +} diff --git a/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java b/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java index 467a124d41..92127f9ae2 100644 --- a/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java +++ b/src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java @@ -6,6 +6,7 @@ import gregtech.api.gui.GT_GUIContainer_BasicTank; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Teleporter; +import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Teleporter; import net.minecraft.client.gui.FontRenderer; import net.minecraft.entity.player.InventoryPlayer; diff --git a/src/main/java/gregtech/common/items/CombType.java b/src/main/java/gregtech/common/items/CombType.java new file mode 100644 index 0000000000..8ea585acfc --- /dev/null +++ b/src/main/java/gregtech/common/items/CombType.java @@ -0,0 +1,116 @@ +package gregtech.common.items; + +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_LanguageManager; + +public enum CombType +{ + //Organic + LIGNIE("lignite", true, Materials.Lignite, 100), + COAL("coal", true, Materials.Coal, 100), + STICKY("stickyresin", true, Materials._NULL, 50), + OIL("oil", true, Materials._NULL, 100), + //Gem Line + STONE("stone", true, Materials._NULL, 70), + CERTUS("certus", true, Materials.CertusQuartz, 100), + REDSTONE("redstone", true, Materials.Redstone, 100), + LAPIS("lapis", true, Materials.Lapis, 100), + RUBY("ruby", true, Materials.Ruby, 100), + SAPPHIRE("sapphire", true, Materials.Sapphire, 100), + DIAMOND("diamond", true, Materials.Diamond, 100), + OLIVINE("olivine", true, Materials.Olivine, 100), + EMERALD("emerald", true, Materials.Emerald, 100), + + // Metals Line + SLAG("slag", true, Materials._NULL, 50), + COPPER("copperdust", true, Materials.Copper, 100), + TIN("tindust", true, Materials.Tin, 100), + LEAD("leaddust", true, Materials.Lead, 100), + IRON("irondust", true, Materials.Iron, 100), + STEEL("steeldust", true, Materials.Steel, 100), + NICKEL("nickeldust", true, Materials.Nickel, 100), + ZINC("zincdust", true, Materials.Zinc, 100), + SILVER("silverdust", true, Materials.Silver, 100), + GOLD("golddust", true, Materials.Gold, 100), + + // Rare Metals Line + ALUMINIUM("aluminium", true, Materials.Aluminium, 60), + MANGANESE("manganese", true, Materials.Manganese, 30), + TITANIUM("titanium", true, Materials.Ilmenite, 100), + CHROME("chrome", true, Materials.Chrome, 50), + TUNGSTEN("tungsten", true, Materials.Tungstate, 100), + PLATINUM("platinum", true, Materials.Platinum, 40), + IRIDIUM("iridium", true, Materials._NULL, 20), + + + // Radioactive Line + URANIUM("uranium", true, Materials.Uranium, 50), + PLUTONIUM("plutonium", true, Materials.Plutonium, 10), + NAQUADAH("naquada", true, Materials.Naquadah, 10), + ; + + private static int[][] colours = new int[][] { + { 0x906237 , 0x58300B }, + { 0x666666 , 0x525252 }, + { 0x2E8F5B , 0xDCC289 }, + { 0x4C4C4C , 0x333333 }, + { 0x808080 , 0x999999 }, + { 0x57CFFB , 0xBBEEFF }, + { 0x7D0F0F , 0xD11919 }, + { 0x1947D1 , 0x476CDA }, + { 0xE6005C , 0xCC0052 }, + { 0x0033CC , 0x00248F }, + { 0xCCFFFF , 0xA3CCCC }, + { 0x248F24 , 0xCCFFCC }, + { 0x248F24 , 0x2EB82E }, + { 0xD4D4D4 , 0x58300B }, + { 0xFF6600 , 0xE65C00 }, + { 0xD4D4D4 , 0xDDDDDD }, + { 0x666699 , 0xA3A3CC }, + { 0xDA9147 , 0xDE9C59 }, + { 0x808080 , 0x999999 }, + { 0x8585AD , 0x9D9DBD }, + { 0xF0DEF0 , 0xF2E1F2 }, + { 0xC2C2D6 , 0xCECEDE }, + { 0xE6B800 , 0xCFA600 }, + { 0x008AB8 , 0xD6D6FF }, + { 0xD5D5D5 , 0xAAAAAA }, + { 0xCC99FF , 0xDBB8FF }, + { 0xEBA1EB , 0xF2C3F2 }, + { 0x62626D , 0x161620 }, + { 0xE6E6E6 , 0xFFFFCC }, + { 0xDADADA , 0xD1D1E0 }, + { 0x19AF19 , 0x169E16 }, + { 0x335C33 , 0x6B8F00 }, + { 0x003300 , 0x002400 }, + }; + + private CombType(String pName, boolean show, Materials material, int chance) + { + this.name = pName; + this.material = material; + this.chance = chance; + this.showInList = show; + } + + public void setHidden() + { + this.showInList = false; + } + + private String name; + public boolean showInList; + public Materials material; + public int chance; + + public String getName() + { +// return "gt.comb."+this.name; + return GT_LanguageManager.addStringLocalization("comb." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1)+" Comb"); + } + + public int[] getColours() + { + return colours[this.ordinal()]; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 5f7ff478cd..b5c3f487fb 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -419,23 +419,23 @@ public class GT_MetaGenerated_Item_01 GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { ItemList.Schematic_3by3 });
GT_ModHandler.addShapelessCraftingRecipe(ItemList.Schematic.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { ItemList.Schematic_Dust });
- ItemList.Battery_Hull_LV.set(addItem(tLastID = 500, "Small Battery Hull", "An empty LV Battery Hull", new Object[] { new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 2L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L) }));
- ItemList.Battery_Hull_MV.set(addItem(tLastID = 501, "Medium Battery Hull", "An empty MV Battery Hull", new Object[] { new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 6L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L) }));
- ItemList.Battery_Hull_HV.set(addItem(tLastID = 502, "Large Battery Hull", "An empty HV Battery Hull", new Object[] { new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 18L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L) }));
+ ItemList.Battery_Hull_LV.set(addItem(tLastID = 500, "Small Battery Hull", "An empty LV Battery Hull", new Object[] { new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 1L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L) }));
+ ItemList.Battery_Hull_MV.set(addItem(tLastID = 501, "Medium Battery Hull", "An empty MV Battery Hull", new Object[] { new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 3L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L) }));
+ ItemList.Battery_Hull_HV.set(addItem(tLastID = 502, "Large Battery Hull", "An empty HV Battery Hull", new Object[] { new ItemData(Materials.BatteryAlloy, OrePrefixes.plate.mMaterialAmount * 9L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 1L) }));
GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { "C", "P", "P", Character.valueOf('P'), OrePrefixes.plate.get(Materials.BatteryAlloy), Character.valueOf('C'), OreDictNames.craftingWireTin });
GT_ModHandler.addCraftingRecipe(ItemList.Battery_Hull_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { "C C", "PPP", "PPP", Character.valueOf('P'), OrePrefixes.plate.get(Materials.BatteryAlloy), Character.valueOf('C'), OreDictNames.craftingWireCopper });
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 2L), ItemList.Battery_Hull_LV.get(1L, new Object[0]), 800, 1);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Copper, 2L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 6L), ItemList.Battery_Hull_MV.get(1L, new Object[0]), 1600, 2);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.AnnealedCopper, 2L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 6L), ItemList.Battery_Hull_MV.get(1L, new Object[0]), 1600, 2);
- GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Gold, 4L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 18L), ItemList.Battery_Hull_HV.get(1L, new Object[0]), 3200, 4);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 1L),Materials.Plastic.getMolten(144), ItemList.Battery_Hull_LV.get(1L, new Object[0]), 800, 1);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Copper, 2L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 3L),Materials.Plastic.getMolten(432), ItemList.Battery_Hull_MV.get(1L, new Object[0]), 1600, 2);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.AnnealedCopper, 2L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 3L),Materials.Plastic.getMolten(432), ItemList.Battery_Hull_MV.get(1L, new Object[0]), 1600, 2);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Gold, 4L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.BatteryAlloy, 9L),Materials.Plastic.getMolten(1296), ItemList.Battery_Hull_HV.get(1L, new Object[0]), 3200, 4);
ItemList.Battery_RE_ULV_Tantalum.set(addItem(tLastID = 499, "Tantalum Capacitor", "Reusable", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L) }));
setElectricStats(32000 + tLastID, 1000L, GT_Values.V[0], 0L, -3L, false);
ItemList.Battery_SU_LV_SulfuricAcid.set(addItem(tLastID = 510, "Small Acid Battery", "Single Use", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L) }));
- setElectricStats(32000 + tLastID, 12000L, GT_Values.V[1], 1L, -2L, true);
+ setElectricStats(32000 + tLastID, 18000L, GT_Values.V[1], 1L, -2L, true);
ItemList.Battery_SU_LV_Mercury.set(addItem(tLastID = 511, "Small Mercury Battery", "Single Use", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 2L) }));
setElectricStats(32000 + tLastID, 32000L, GT_Values.V[1], 1L, -2L, true);
@@ -447,7 +447,7 @@ public class GT_MetaGenerated_Item_01 setElectricStats(32000 + tLastID, 50000L, GT_Values.V[1], 1L, -3L, true);
ItemList.Battery_SU_MV_SulfuricAcid.set(addItem(tLastID = 520, "Medium Acid Battery", "Single Use", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L) }));
- setElectricStats(32000 + tLastID, 48000L, GT_Values.V[2], 2L, -2L, true);
+ setElectricStats(32000 + tLastID, 72000L, GT_Values.V[2], 2L, -2L, true);
ItemList.Battery_SU_MV_Mercury.set(addItem(tLastID = 521, "Medium Mercury Battery", "Single Use", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 4L) }));
setElectricStats(32000 + tLastID, 128000L, GT_Values.V[2], 2L, -2L, true);
@@ -459,7 +459,7 @@ public class GT_MetaGenerated_Item_01 setElectricStats(32000 + tLastID, 200000L, GT_Values.V[2], 2L, -3L, true);
ItemList.Battery_SU_HV_SulfuricAcid.set(addItem(tLastID = 530, "Large Acid Battery", "Single Use", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L) }));
- setElectricStats(32000 + tLastID, 192000L, GT_Values.V[3], 3L, -2L, true);
+ setElectricStats(32000 + tLastID, 288000L, GT_Values.V[3], 3L, -2L, true);
ItemList.Battery_SU_HV_Mercury.set(addItem(tLastID = 531, "Large Mercury Battery", "Single Use", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 8L) }));
setElectricStats(32000 + tLastID, 512000L, GT_Values.V[3], 3L, -2L, true);
@@ -539,14 +539,14 @@ public class GT_MetaGenerated_Item_01 GregTech_API.registerCover(ItemList.Electric_Pump_EV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), new GT_Cover_Pump(2048));
GregTech_API.registerCover(ItemList.Electric_Pump_IV.get(1L, new Object[0]), new GT_MultiTexture(new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), new GT_Cover_Pump(8192));
- ItemList.Rotor_LV.set(addItem(tLastID = 620, "Tin Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.Tin), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L) }));
+ /**ItemList.Rotor_LV.set(addItem(tLastID = 620, "Tin Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.Tin), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L) }));
ItemList.Rotor_MV.set(addItem(tLastID = 621, "Bronze Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.Bronze), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L) }));
ItemList.Rotor_HV.set(addItem(tLastID = 622, "Steel Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.Steel), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L) }));
ItemList.Rotor_EV.set(addItem(tLastID = 623, "Stainless Steel Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.StainlessSteel), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L) }));
ItemList.Rotor_IV.set(addItem(tLastID = 624, "Tungstensteel Rotor", "", new Object[] { OrePrefixes.rotor.get(Materials.TungstenSteel), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 16L) }));
ItemList.Rotor_LuV.set(ItemList.Rotor_IV.get(1L, new Object[0]));
ItemList.Rotor_ZPM.set(ItemList.Rotor_LuV.get(1L, new Object[0]));
- ItemList.Rotor_UV.set(ItemList.Rotor_ZPM.get(1L, new Object[0]));
+ ItemList.Rotor_UV.set(ItemList.Rotor_ZPM.get(1L, new Object[0]));**/
GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[] { "SXO", "dPw", "OMW", Character.valueOf('M'), ItemList.Electric_Motor_LV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Tin), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Tin), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.Tin), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Bronze) });
GT_ModHandler.addCraftingRecipe(ItemList.Electric_Pump_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[] { "SXO", "dPw", "OMW", Character.valueOf('M'), ItemList.Electric_Motor_MV, Character.valueOf('O'), OrePrefixes.ring.get(Materials.Rubber), Character.valueOf('X'), OrePrefixes.rotor.get(Materials.Bronze), Character.valueOf('S'), OrePrefixes.screw.get(Materials.Bronze), Character.valueOf('W'), OrePrefixes.cableGt01.get(Materials.AnyCopper), Character.valueOf('P'), OrePrefixes.pipeMedium.get(Materials.Steel) });
@@ -678,6 +678,8 @@ public class GT_MetaGenerated_Item_01 ItemList.Circuit_Parts_Wiring_Basic.set(addItem(tLastID = 716, "Etched Medium Voltage Wiring", "Part of Circuit Boards", new Object[0]));
ItemList.Circuit_Parts_Wiring_Advanced.set(addItem(tLastID = 717, "Etched High Voltage Wiring", "Part of Circuit Boards", new Object[0]));
ItemList.Circuit_Parts_Wiring_Elite.set(addItem(tLastID = 718, "Etched Extreme Voltage Wiring", "Part of Circuit Boards", new Object[0]));
+ ItemList.Empty_Board_Basic.set(addItem(tLastID = 719, "Empty Circuit Board", "A Board Part", new Object[0]));
+ ItemList.Empty_Board_Elite.set(addItem(tLastID = 720, "Empty Processor Board", "A Processor Board Part", new Object[0]));
ItemList.Component_Sawblade_Diamond.set(addItem(tLastID = 721, "Diamond Sawblade", "", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.PERDITIO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VITREUS, 4L), OreDictNames.craftingDiamondBlade }));
@@ -703,7 +705,7 @@ public class GT_MetaGenerated_Item_01 ItemList.Component_Filter.set(addItem(tLastID = 729, "Item Filter", "", new Object[] { new ItemData(Materials.Zinc, OrePrefixes.foil.mMaterialAmount * 16L, new MaterialStack[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITO, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), OreDictNames.craftingFilter }));
- GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getIC2Item("carbonMesh", 4L), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Zinc, 16L), ItemList.Component_Filter.get(1L, new Object[0]), 1600, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getIC2Item("carbonMesh", 4L), GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Zinc, 16L),Materials.Plastic.getMolten(144), ItemList.Component_Filter.get(1L, new Object[0]), 1600, 32);
ItemList.Cover_Controller.set(addItem(tLastID = 730, "Machine Controller", "Turns Machines ON/OFF", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L) }));
ItemList.Cover_ActivityDetector.set(addItem(tLastID = 731, "Activity Detector", "Gives out Activity as Redstone", new Object[] { new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L) }));
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 ce339b1773..a2f3f77045 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 @@ -248,6 +248,8 @@ public class GT_MetaGenerated_Item_02 ItemList.Crop_Drop_OilBerry.set(addItem(tLastID = 510, "Oil Berry", "Oil in Berry form", new Object[] { 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 Object[] { 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 Object[] { 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 Object[] { 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 Object[] { 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) }));
diff --git a/src/main/java/gregtech/common/items/ItemComb.java b/src/main/java/gregtech/common/items/ItemComb.java new file mode 100644 index 0000000000..a36ff7c759 --- /dev/null +++ b/src/main/java/gregtech/common/items/ItemComb.java @@ -0,0 +1,147 @@ +package gregtech.common.items; + +import java.util.List; + +import com.google.common.collect.ImmutableMap; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import forestry.api.core.ForestryAPI; +import forestry.api.core.Tabs; +import forestry.api.recipes.RecipeManagers; +import forestry.factory.gadgets.MachineCentrifuge.RecipeManager; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; +import static gregtech.api.enums.GT_Values.MOD_ID; + +public class ItemComb extends Item +{ + public ItemComb() + { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gt.comb"); + GameRegistry.registerItem(this, "gt.comb", MOD_ID); + } + + public ItemStack getStackForType(CombType type) + { + return new ItemStack(this, 1, type.ordinal()); + } + + public ItemStack getStackForType(CombType type, int count) + { + return new ItemStack(this, count, type.ordinal()); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) + { + for (CombType type : CombType.values()) + { + if (type.showInList) + { + list.add(this.getStackForType(type)); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @Override + public int getRenderPasses(int meta) + { + return 2; + } + + @SideOnly(Side.CLIENT) + private IIcon secondIcon; + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) + { + this.itemIcon = par1IconRegister.registerIcon("forestry:beeCombs.0"); + this.secondIcon = par1IconRegister.registerIcon("forestry:beeCombs.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) + { + return (pass == 0) ? itemIcon : secondIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) + { + int meta = Math.max(0, Math.min(CombType.values().length - 1, stack.getItemDamage())); + int colour = CombType.values()[meta].getColours()[0]; + + if (pass >= 1) + { + colour = CombType.values()[meta].getColours()[1]; + } + + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) + { + return CombType.values()[stack.getItemDamage()].getName(); + } + + public void initCombsRecipes(){ + for(CombType type : CombType.values()){ + ItemStack tComb = getStackForType(type); + if(type.material==Materials._NULL){ + if(type == type.STICKY){ + GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.IC2_Resin.get(1, new Object[0]), ItemList.FR_Wax.get(1, new Object[0]), ItemList.IC2_Plantball.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{5000,10000,1500}, 128, 5); + RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of( + ItemList.IC2_Resin.get(1, new Object[0]), 0.5f, + ItemList.FR_Wax.get(1, new Object[0]), 1.0f, + ItemList.IC2_Plantball.get(1, new Object[0]),0.15f)); + }else if(type == type.OIL){ + GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, ItemList.Crop_Drop_OilBerry.get(1, new Object[0]), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{10000,10000}, 128, 5); + RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of( + ItemList.Crop_Drop_OilBerry.get(1, new Object[0]), 1.0f, + ItemList.FR_Wax.get(1, new Object[0]), 1.0f)); + }else if(type == type.STONE|| type == type.SLAG){ + GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{7000,3000}, 128, 5); + RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of( + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1), 0.7f, + ItemList.FR_Wax.get(1, new Object[0]), 0.3f)); + }else if(type == type.IRIDIUM){ + GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iridium, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Osmium, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{2000,800,3000}, 128, 5); + RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of( + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iridium, 1), 0.2f, + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Osmium, 1), 0.08f, + ItemList.FR_Wax.get(1, new Object[0]), 0.3f)); + } + }else{ + GT_Values.RA.addCentrifugeRecipe(tComb, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dustTiny, type.material, 1), ItemList.FR_Wax.get(1, new Object[0]), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, new int[]{type.chance*100,3000}, 128, 5); + RecipeManagers.centrifugeManager.addRecipe(40, tComb, ImmutableMap.of( + GT_OreDictUnificator.get(OrePrefixes.dustTiny, type.material, 1), type.chance*0.01f, + ItemList.FR_Wax.get(1, new Object[0]), 0.3f)); + } + } + } + +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java index 57571cd408..7088884e7b 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java @@ -1,83 +1,77 @@ -package gregtech.common.items.behaviors;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntityItemPipe;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntityItemPipe.Util;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaBase_Item;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Utility;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.PlayerCapabilities;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class Behaviour_Plunger_Item
- extends Behaviour_None
-{
- private final int mCosts;
-
- public Behaviour_Plunger_Item(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 IGregTechTileEntity))
- {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity)aTileEntity).getMetaTileEntity();
- if ((tMetaTileEntity instanceof IMetaTileEntityItemPipe)) {
- for (Object tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes((IMetaTileEntityItemPipe)tMetaTileEntity, new HashMap(), 0L, false, true)).keySet())
-
- {
- int i = 0;
- for (int j = ((IMetaTileEntityItemPipe)tTileEntity).getSizeInventory(); i < j; i++) {
- if (((IMetaTileEntityItemPipe)tTileEntity).isValidSlot(i)) {
- if ((((IMetaTileEntityItemPipe)tTileEntity).getStackInSlot(i) != null) && (
- (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool)aItem).doDamage(aStack, this.mCosts))))
- {
- ItemStack tStack = ((IMetaTileEntityItemPipe)tTileEntity).decrStackSize(i, 64);
- if (tStack != null)
- {
- EntityItem tEntity = new EntityItem(aWorld, ((IGregTechTileEntity)aTileEntity).getOffsetX((byte)aSide, 1) + 0.5D, ((IGregTechTileEntity)aTileEntity).getOffsetY((byte)aSide, 1) + 0.5D, ((IGregTechTileEntity)aTileEntity).getOffsetZ((byte)aSide, 1) + 0.5D, tStack);
- tEntity.motionX = 0.0D;tEntity.motionY = 0.0D;tEntity.motionZ = 0.0D;
- aWorld.spawnEntityInWorld(tEntity);
- GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ);
- }
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.item", "Clears Items from Pipes");
-
- public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack)
- {
- aList.add(this.mTooltip);
- return aList;
- }
-}
-
-
-/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
- * Qualified Name: gregtech.common.items.behaviors.Behaviour_Plunger_Item
- * JD-Core Version: 0.7.0.1
- */
\ No newline at end of file +package gregtech.common.items.behaviors; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.metatileentity.IMetaTileEntityItemPipe; +import gregtech.api.interfaces.metatileentity.IMetaTileEntityItemPipe.Util; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class Behaviour_Plunger_Item + extends Behaviour_None +{ + private final int mCosts; + + public Behaviour_Plunger_Item(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 IGregTechTileEntity)) + { + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity)aTileEntity).getMetaTileEntity(); + if ((tMetaTileEntity instanceof IMetaTileEntityItemPipe)) { + for (Object tTileEntity : GT_Utility.sortMapByValuesAcending(IMetaTileEntityItemPipe.Util.scanPipes((IMetaTileEntityItemPipe)tMetaTileEntity, new HashMap(), 0L, false, true)).keySet()) + + { + int i = 0; + for (int j = ((IMetaTileEntityItemPipe)tTileEntity).getSizeInventory(); i < j; i++) { + if (((IMetaTileEntityItemPipe)tTileEntity).isValidSlot(i)) { + if ((((IMetaTileEntityItemPipe)tTileEntity).getStackInSlot(i) != null) && ( + (aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool)aItem).doDamage(aStack, this.mCosts)))) + { + ItemStack tStack = ((IMetaTileEntityItemPipe)tTileEntity).decrStackSize(i, 64); + if (tStack != null) + { + EntityItem tEntity = new EntityItem(aWorld, ((IGregTechTileEntity)aTileEntity).getOffsetX((byte)aSide, 1) + 0.5D, ((IGregTechTileEntity)aTileEntity).getOffsetY((byte)aSide, 1) + 0.5D, ((IGregTechTileEntity)aTileEntity).getOffsetZ((byte)aSide, 1) + 0.5D, tStack); + tEntity.motionX = 0.0D;tEntity.motionY = 0.0D;tEntity.motionZ = 0.0D; + aWorld.spawnEntityInWorld(tEntity); + GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(101)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + } + } + } + } + } + return false; + } + + private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.plunger.item", "Clears Items from Pipes"); + + public List<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack) + { + aList.add(this.mTooltip); + return aList; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java index e43e4ce3bf..dc1c14c4c4 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java @@ -61,8 +61,7 @@ public class Behaviour_Spray_Color Items.feather.setDamage(aStack, Items.feather.getDamage(this.mUsed));
tUses = this.mUses;
}
- if ((GT_Utility.areStacksEqual(aStack, this.mUsed, true)) &&
- (colorize(aWorld, aX, aY, aZ, aSide)))
+ if ((GT_Utility.areStacksEqual(aStack, this.mUsed, true)) && (colorize(aWorld, aX, aY, aZ, aSide)))
{
GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(102)), 1.0F, 1.0F, aX, aY, aZ);
if (!aPlayer.capabilities.isCreativeMode) {
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 90acb38dd4..822c774c10 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,6 +1,5 @@ package gregtech.common.tileentities.automation;
-import gregtech.api.enums.OreDictNames;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.Textures;
import gregtech.api.enums.Textures.BlockIcons;
@@ -10,10 +9,10 @@ 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 gregtech.api.util.GT_OreDictUnificator;
import java.util.ArrayList;
@@ -80,7 +79,6 @@ public class GT_MetaTileEntity_TypeFilter i = OrePrefixes.values().length - 1;
}
}while(OrePrefixes.values()[i].mPrefixedItems.isEmpty());
-
}
else
{
@@ -102,21 +100,21 @@ public class GT_MetaTileEntity_TypeFilter 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());
+ 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)
@@ -139,21 +137,23 @@ public class GT_MetaTileEntity_TypeFilter {
boolean tAllowPrefix = this.mPrefix.contains(aStack);
if(this.mPrefix==OrePrefixes.ore){
- OrePrefixes tFix = GT_OreDictUnificator.getItemData(aStack).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)tAllowPrefix=true;
- }
- return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && ((this.bNBTAllowed) || (!aStack.hasTagCompound())) && (tAllowPrefix != this.bInvertFilter);
- }
+ 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)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.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index 64b452e60c..340d1eb1e7 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -281,7 +281,7 @@ public abstract class GT_MetaTileEntity_Boiler } else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) { - this.mProcessingEnergy += 40; + this.mProcessingEnergy += 120; aBaseMetaTileEntity.decrStackSize(2, 1); if (aBaseMetaTileEntity.getRandomNumber(8) == 0) { aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index e683eb09aa..b8c4ed5356 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -158,7 +158,7 @@ public class GT_MetaTileEntity_Boiler_Bronze } else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) { - this.mProcessingEnergy += 40; + this.mProcessingEnergy += 120; aBaseMetaTileEntity.decrStackSize(2, 1); if (aBaseMetaTileEntity.getRandomNumber(8) == 0) { aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); 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 7b8361fa96..d848f90e4e 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 @@ -162,7 +162,7 @@ rTextures[4][(i + 1)] = tmp5; }
else if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite))))
{
- this.mProcessingEnergy += 40;
+ this.mProcessingEnergy += 120;
aBaseMetaTileEntity.decrStackSize(2, 1);
if (aBaseMetaTileEntity.getRandomNumber(8) == 0) {
aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
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 83c731a632..f01a8c6532 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 @@ -57,7 +57,7 @@ public class GT_MetaTileEntity_DieselGenerator public void onConfigLoad()
{
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier."+this.mTier, (100 - this.mTier * 10));
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier."+this.mTier, (100 - this.mTier * 5));
}
public int getEfficiency()
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index f6c39bbea5..97607c4b9e 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -51,7 +51,7 @@ onConfigLoad(); public void onConfigLoad()
{
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier."+this.mTier, (100 - this.mTier * 10));
+ this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier."+this.mTier, (100 - this.mTier * 5));
}
diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java index 06935e6137..acfd218ab4 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -51,7 +51,7 @@ onConfigLoad(); public void onConfigLoad() { - this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier."+this.mTier, 100-this.mTier*10); + this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyConverter.efficiency.tier."+this.mTier, 100-this.mTier*5); } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index 18add4535b..2374ade4a3 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -1,7 +1,5 @@ package gregtech.common.tileentities.generators; -import static gregtech.api.enums.GT_Values.V; - import java.util.ArrayList; import thaumcraft.api.aspects.Aspect; @@ -21,7 +19,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; +import static gregtech.api.enums.GT_Values.V; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.TC_Aspects; @@ -36,269 +34,252 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator -{ +public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator { + + public int mEfficiency; + public static boolean sAllowMultipleEggs = true; + public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null; + public static int sEnergyPerEnderCrystal = 32; + public static int sEnergyFromVis = 12800; + public static final ArrayList<EntityEnderCrystal> sUsedDragonCrystalList = new ArrayList(); + public EntityEnderCrystal mTargetedCrystal; + public static int sDragonEggEnergyPerTick = 128; + public static boolean isThaumcraftLoaded; + + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]); + onConfigLoad(); + } + + public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_MagicalEnergyAbsorber(this.mName, this.mTier, this.mDescription, this.mTextures); + } - public int mEfficiency; - public static boolean sAllowMultipleEggs = true; - public static GT_MetaTileEntity_MagicalEnergyAbsorber mActiveSiphon = null; - public static int sEnergyPerEnderCrystal = 32; - public static int sEnergyFromVis = 12800; - public static final ArrayList<EntityEnderCrystal> sUsedDragonCrystalList = new ArrayList(); - public EntityEnderCrystal mTargetedCrystal; - public static int sDragonEggEnergyPerTick = 128; - public static boolean isThaumcraftLoaded; - - public boolean isOutputFacing(byte aSide) - { - return aSide == getBaseMetaTileEntity().getFrontFacing(); - } - - public GT_MetaTileEntity_MagicalEnergyAbsorber(int aID, String aName, String aNameRegional, int aTier) - { - super(aID, aName, aNameRegional, aTier, "Feasts on magic close to it", new ITexture[0]); - onConfigLoad(); - } - - public GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String aDescription, ITexture[][][] aTextures) - { - super(aName, aTier, aDescription, aTextures); - onConfigLoad(); - } - - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) - { - return new GT_MetaTileEntity_MagicalEnergyAbsorber(this.mName, this.mTier, this.mDescription, this.mTextures); - } - - public GT_Recipe.GT_Recipe_Map getRecipes() - { - return GT_Recipe.GT_Recipe_Map.sMagicFuels; - } - - public int getCapacity() - { - return 16000; - } + public GT_Recipe.GT_Recipe_Map getRecipes() { + return GT_Recipe.GT_Recipe_Map.sMagicFuels; + } - public void onConfigLoad() - { - this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.efficiency.tier."+this.mTier, 100-this.mTier*10); - this.sAllowMultipleEggs = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false); - this.sEnergyPerEnderCrystal = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 32); - this.sEnergyFromVis = (GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerVisDivisor", 2500)*10); - this.sDragonEggEnergyPerTick = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick", 2048); - this.isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft"); + public int getCapacity() { + return 16000; + } + + public void onConfigLoad() { + this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.efficiency.tier." + this.mTier, + 100 - this.mTier * 10); + this.sAllowMultipleEggs = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.AllowMultipleEggs", false); + this.sEnergyPerEnderCrystal = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick.EnderCrystal", 32); + this.sEnergyFromVis = (GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerVisDivisor", 2500) * 10); + this.sDragonEggEnergyPerTick = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MagicEnergyAbsorber.EnergyPerTick", 2048); + this.isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft"); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() + && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) { + // Dragon Egg + if (hasEgg() && aTick % 10 == 0) { + getBaseMetaTileEntity().increaseStoredEnergyUnits(sDragonEggEnergyPerTick * getEfficiency() * 10, false); + if ((mActiveSiphon != this) && (!sAllowMultipleEggs)) { + if ((mActiveSiphon == null) || (mActiveSiphon.getBaseMetaTileEntity() == null) + || (mActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()) || (!mActiveSiphon.hasEgg())) { + mActiveSiphon = this; + } else { + Block tEgg = mActiveSiphon.getBaseMetaTileEntity().getBlockOffset(0, 1, 0); + if(!getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(mActiveSiphon.getBaseMetaTileEntity().getXCoord(), mActiveSiphon.getBaseMetaTileEntity().getZCoord()).isChunkLoaded&&(tEgg==Blocks.dragon_egg||tEgg.getUnlocalizedName().equals("tile.dragonEgg"))) + {getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE);}else{ + mActiveSiphon=this; + } + } + } + } + // Energyzed node + if (isThaumcraftLoaded) { + try { + World tmpWorld = this.getBaseMetaTileEntity().getWorld(); + int tmpX = this.getBaseMetaTileEntity().getXCoord(); + int tmpY = this.getBaseMetaTileEntity().getYCoord(); + int tmpZ = this.getBaseMetaTileEntity().getZCoord(); + int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000); + int earth = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.EARTH, 1000); + int air = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.AIR, 1000); + int destruction = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ENTROPY, 1000); + int order = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ORDER, 1000); + int water = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.WATER, 1000); + int visEU = (int) (Math.pow(fire, 4) + Math.pow(earth, 4) + Math.pow(air, 4) + Math.pow(destruction, 4) + Math.pow(order, 4) + Math.pow( + water, 4)); + int mult = 85; + if (fire > 4) + mult += 15; + if (earth > 4) + mult += 15; + if (air > 4) + mult += 15; + if (destruction > 4) + mult += 15; + if (order > 4) + mult += 15; + if (water > 4) + mult += 15; + visEU = (visEU * mult) / 100; + getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU * getEfficiency() / this.sEnergyFromVis), false); + } catch (Throwable e) { } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) { - //Dragon Egg - if(hasEgg()&&aTick%10==0){ - getBaseMetaTileEntity().increaseStoredEnergyUnits(sDragonEggEnergyPerTick*getEfficiency()*10, false); - if ((mActiveSiphon != this) && (!sAllowMultipleEggs)) { - if ((mActiveSiphon == null) || (mActiveSiphon.getBaseMetaTileEntity() == null) || (mActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()) || (!mActiveSiphon.hasEgg())) { - mActiveSiphon = this; - } else { - Block tEgg = mActiveSiphon.getBaseMetaTileEntity().getBlockOffset(0, 1, 0); - if(!getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(mActiveSiphon.getBaseMetaTileEntity().getXCoord(), mActiveSiphon.getBaseMetaTileEntity().getZCoord()).isChunkLoaded&&(tEgg==Blocks.dragon_egg||tEgg.getUnlocalizedName().equals("tile.dragonEgg"))) - {getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE);}else{ - mActiveSiphon=this; - } - - } - } - } - //Energyzed node - if(isThaumcraftLoaded){ - try{ - World tmpWorld = this.getBaseMetaTileEntity().getWorld(); - int tmpX = this.getBaseMetaTileEntity().getXCoord(); - int tmpY = this.getBaseMetaTileEntity().getYCoord(); - int tmpZ = this.getBaseMetaTileEntity().getZCoord(); - int fire = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.FIRE, 1000); - int earth = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.EARTH, 1000); - int air = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.AIR, 1000); - int destruction = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ENTROPY, 1000); - int order = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.ORDER, 1000); - int water = VisNetHandler.drainVis(tmpWorld, tmpX, tmpY, tmpZ, Aspect.WATER, 1000); - int visEU = (int) (Math.pow(fire, 4)+Math.pow(earth, 4)+Math.pow(air, 4)+Math.pow(destruction, 4)+Math.pow(order, 4)+Math.pow(water, 4)); - int mult = 85; - if(fire>4)mult+=15; - if(earth>4)mult+=15; - if(air>4)mult+=15; - if(destruction>4)mult+=15; - if(order>4)mult+=15; - if(water>4)mult+=15; - visEU = (visEU*mult) / 100; - getBaseMetaTileEntity().increaseStoredEnergyUnits(Math.min(maxEUOutput(), visEU*getEfficiency()/this.sEnergyFromVis), false); - }catch (Throwable e){} - } - //EnderCrystal - - if (sEnergyPerEnderCrystal > 0) { - if (this.mTargetedCrystal == null) - { - ArrayList<EntityEnderCrystal> tList = (ArrayList)getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(EntityEnderCrystal.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 64, getBaseMetaTileEntity().getYCoord() - 64, getBaseMetaTileEntity().getZCoord() - 64, getBaseMetaTileEntity().getXCoord() + 64, getBaseMetaTileEntity().getYCoord() + 64, getBaseMetaTileEntity().getZCoord() + 64)); - if ((tList != null) && (!tList.isEmpty())) - { - tList.removeAll(sUsedDragonCrystalList); - if (tList.size() > 0) - { - this.mTargetedCrystal = ((EntityEnderCrystal)tList.get(0)); - if (this.mTargetedCrystal != null) { - sUsedDragonCrystalList.add(this.mTargetedCrystal); - } - } - } - } - else if (this.mTargetedCrystal.isEntityAlive()) - { - getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerEnderCrystal * 10, false); - } - else - { - sUsedDragonCrystalList.remove(this.mTargetedCrystal); - this.mTargetedCrystal = null; - } - } - - //Absorb entchantments - try - { - if ((this.mInventory[0] != null) && (this.mInventory[1] == null)) - { - if(isThaumcraftLoaded && this.mInventory[0].getItem() instanceof IEssentiaContainerItem){ - AspectList tAspect = ((IEssentiaContainerItem)this.mInventory[0].getItem()).getAspects(this.mInventory[0]); - TC_Aspects tValue = TC_Aspects.valueOf(tAspect.getAspects()[0].getTag().toUpperCase()); - int tEU = (tValue.mValue*tAspect.getAmount((Aspect) tValue.mAspect)*100); - getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true); - ItemStack tStack = this.mInventory[0].copy(); - tStack.setTagCompound(null); - tStack.setItemDamage(0); - tStack.stackSize=1; - this.mInventory[1]=tStack; - this.mInventory[0].stackSize--; - if(this.mInventory[0].stackSize<1){this.mInventory[0]=null;} - - }else{ - if ((this.mInventory[0].isItemEnchanted()) && (this.mInventory[0].getItem().getItemEnchantability() > 0)) - { - NBTTagList tEnchantments = this.mInventory[0].getEnchantmentTagList(); - if (tEnchantments != null) - { - for (int i = 0; i < tEnchantments.tagCount(); i++) - { - short tID = ((NBTTagCompound)tEnchantments.getCompoundTagAt(i)).getShort("id"); - short tLevel = ((NBTTagCompound)tEnchantments.getCompoundTagAt(i)).getShort("lvl"); - if ((tID > -1) && (tID < Enchantment.enchantmentsList.length)) - { - Enchantment tEnchantment = Enchantment.enchantmentsList[tID]; - if (tEnchantment != null) { - getBaseMetaTileEntity().increaseStoredEnergyUnits(1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); - } - } - } - this.mInventory[0].stackTagCompound.removeTag("ench"); - } - } - else if ((this.mInventory[0].getItem() instanceof ItemEnchantedBook)) - { - NBTTagList tEnchantments = ((ItemEnchantedBook)this.mInventory[0].getItem()).func_92110_g(this.mInventory[0]); - if (tEnchantments != null) - { - for (int i = 0; i < tEnchantments.tagCount(); i++) - { - short tID = ((NBTTagCompound)tEnchantments.getCompoundTagAt(i)).getShort("id"); - short tLevel = ((NBTTagCompound)tEnchantments.getCompoundTagAt(i)).getShort("lvl"); - if ((tID > -1) && (tID < Enchantment.enchantmentsBookList.length)) - { - Enchantment tEnchantment = Enchantment.enchantmentsBookList[tID]; - if (tEnchantment != null) { - getBaseMetaTileEntity().increaseStoredEnergyUnits(1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); - } - } - } - this.mInventory[0] = new ItemStack(Items.book, 1); - } - } - this.mInventory[1] = this.mInventory[0]; - this.mInventory[0] = null; - } - }} - catch (Throwable e){} + } + // EnderCrystal + if (sEnergyPerEnderCrystal > 0) { + if (this.mTargetedCrystal == null) { + ArrayList<EntityEnderCrystal> tList = (ArrayList) getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB( + EntityEnderCrystal.class, + AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getXCoord() - 64, getBaseMetaTileEntity().getYCoord() - 64, + getBaseMetaTileEntity().getZCoord() - 64, getBaseMetaTileEntity().getXCoord() + 64, + getBaseMetaTileEntity().getYCoord() + 64, getBaseMetaTileEntity().getZCoord() + 64)); + if ((tList != null) && (!tList.isEmpty())) { + tList.removeAll(sUsedDragonCrystalList); + if (tList.size() > 0) { + this.mTargetedCrystal = ((EntityEnderCrystal) tList.get(0)); + if (this.mTargetedCrystal != null) { + sUsedDragonCrystalList.add(this.mTargetedCrystal); + } + } + } + } else if (this.mTargetedCrystal.isEntityAlive()) { + getBaseMetaTileEntity().increaseStoredEnergyUnits(sEnergyPerEnderCrystal * 10, false); + } else { + sUsedDragonCrystalList.remove(this.mTargetedCrystal); + this.mTargetedCrystal = null; + } + } + + // Absorb entchantments and TC essentia + try { + if ((this.mInventory[0] != null) && (this.mInventory[1] == null)) { + if (isThaumcraftLoaded && this.mInventory[0].getItem() instanceof IEssentiaContainerItem) { + AspectList tAspect = ((IEssentiaContainerItem) this.mInventory[0].getItem()).getAspects(this.mInventory[0]); + TC_Aspects tValue = TC_Aspects.valueOf(tAspect.getAspects()[0].getTag().toUpperCase()); + int tEU = (tValue.mValue * tAspect.getAmount((Aspect) tValue.mAspect) * 100); + getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true); + ItemStack tStack = this.mInventory[0].copy(); + tStack.setTagCompound(null); + tStack.setItemDamage(0); + tStack.stackSize = 1; + this.mInventory[1] = tStack; + this.mInventory[0].stackSize--; + if (this.mInventory[0].stackSize < 1) { + this.mInventory[0] = null; + } + + } else { + if ((this.mInventory[0].isItemEnchanted()) && (this.mInventory[0].getItem().getItemEnchantability() > 0)) { + NBTTagList tEnchantments = this.mInventory[0].getEnchantmentTagList(); + if (tEnchantments != null) { + for (int i = 0; i < tEnchantments.tagCount(); i++) { + short tID = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("id"); + short tLevel = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("lvl"); + if ((tID > -1) && (tID < Enchantment.enchantmentsList.length)) { + Enchantment tEnchantment = Enchantment.enchantmentsList[tID]; + if (tEnchantment != null) { + getBaseMetaTileEntity().increaseStoredEnergyUnits( + 1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); + } + } + } + this.mInventory[0].stackTagCompound.removeTag("ench"); + } + } else if ((this.mInventory[0].getItem() instanceof ItemEnchantedBook)) { + NBTTagList tEnchantments = ((ItemEnchantedBook) this.mInventory[0].getItem()).func_92110_g(this.mInventory[0]); + if (tEnchantments != null) { + for (int i = 0; i < tEnchantments.tagCount(); i++) { + short tID = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("id"); + short tLevel = ((NBTTagCompound) tEnchantments.getCompoundTagAt(i)).getShort("lvl"); + if ((tID > -1) && (tID < Enchantment.enchantmentsBookList.length)) { + Enchantment tEnchantment = Enchantment.enchantmentsBookList[tID]; + if (tEnchantment != null) { + getBaseMetaTileEntity().increaseStoredEnergyUnits( + 1000000 * tLevel / (tEnchantment.getMaxLevel() * tEnchantment.getWeight()), true); + } + } + } + this.mInventory[0] = new ItemStack(Items.book, 1); + } + } + this.mInventory[1] = this.mInventory[0]; + this.mInventory[0] = null; } - } - - public void inValidate() - { - if (mActiveSiphon == this) { - mActiveSiphon = null; - } - } - - public boolean hasEgg() - { - Block above = getBaseMetaTileEntity().getBlockOffset(0, 1, 0); - if(above==null||Blocks.air==above){return false;} - return Blocks.dragon_egg == above || above.getUnlocalizedName().equals("tile.dragonEgg"); - } - - @Override public long maxEUStore(){return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());} - - public int getEfficiency() - { - return this.mEfficiency; - } - - public ITexture[] getFront(byte aColor) - { - return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; - } - - public ITexture[] getBack(byte aColor) - { - return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) }; - } - - public ITexture[] getBottom(byte aColor) - { - return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; - } - - public ITexture[] getTop(byte aColor) - { - return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; - } - - public ITexture[] getSides(byte aColor) - { - return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; - } - - public ITexture[] getFrontActive(byte aColor) - { - return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_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.MACHINE_CASING_MAGIC_FRONT_ACTIVE) }; - } - - public ITexture[] getBottomActive(byte aColor) - { - return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; - } - - public ITexture[] getTopActive(byte aColor) - { - return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; - } - - public ITexture[] getSidesActive(byte aColor) - { - return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; - } + } + } catch (Throwable e) { + } + } + } + + public void inValidate() { + if (mActiveSiphon == this) { + mActiveSiphon = null; + } + } + + public boolean hasEgg() { + Block above = getBaseMetaTileEntity().getBlockOffset(0, 1, 0); + if (above == null || Blocks.air == above) { + return false; + } + return Blocks.dragon_egg == above || above.getUnlocalizedName().equals("tile.dragonEgg"); + } + + public int getEfficiency() { + return this.mEfficiency; + } + + @Override public long maxEUStore(){return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());} + + public ITexture[] getFront(byte aColor) { + return new ITexture[] { super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + } + + public ITexture[] getBack(byte aColor) { + return new ITexture[] { super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT) }; + } + + public ITexture[] getBottom(byte aColor) { + return new ITexture[] { super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; + } + + public ITexture[] getTop(byte aColor) { + return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; + } + + public ITexture[] getSides(byte aColor) { + return new ITexture[] { super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; + } + + public ITexture[] getFrontActive(byte aColor) { + return new ITexture[] { super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_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.MACHINE_CASING_MAGIC_FRONT_ACTIVE) }; + } + + public ITexture[] getBottomActive(byte aColor) { + return new ITexture[] { super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; + } + + public ITexture[] getTopActive(byte aColor) { + return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DRAGONEGG) }; + } + + public ITexture[] getSidesActive(byte aColor) { + return new ITexture[] { super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; + } }
\ No newline at end of file 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 9da9f6b27e..e44484aad3 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,129 +1,109 @@ -package gregtech.common.tileentities.generators;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-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 gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GT_MetaTileEntity_SteamTurbine
- extends GT_MetaTileEntity_BasicGenerator
-{
-
- public int mEfficiency;
- public boolean isOutputFacing(byte aSide)
- {
- return aSide == getBaseMetaTileEntity().getFrontFacing();
- }
-
- public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier)
- {
- super(aID, aName, aNameRegional, aTier, "Requires Steam to run", new ITexture[0]);
-onConfigLoad();
- }
-
- public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures)
- {
- super(aName, aTier, aDescription, aTextures);
-onConfigLoad();
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures);
- }
-
- public GT_Recipe.GT_Recipe_Map getRecipes()
- {
- return null;
- }
-
- public int getCapacity()
- {
- return 24000 * this.mTier;
- }
-
-public void onConfigLoad()
- {
- this.mEfficiency =GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier."+this.mTier, (200 / consumedFluidPerOperation(GT_ModHandler.getSteam(1L))));
-}
-
- public int getEfficiency()
- {
- return this.mEfficiency;
- }
-
- public int getFuelValue(FluidStack aLiquid)
- {
- return GT_ModHandler.isSteam(aLiquid) ? 1 : 0;
- }
-
- public int consumedFluidPerOperation(FluidStack aLiquid)
- {
- return 2 + this.mTier;
- }
-
- 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) };
- }
-}
-
-
-/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
- * Qualified Name: gregtech.common.tileentities.generators.GT_MetaTileEntity_SteamTurbine
- * JD-Core Version: 0.7.0.1
- */
\ No newline at end of file +package gregtech.common.tileentities.generators; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +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 gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGenerator { + + public int mEfficiency; + + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Requires Steam to run", new ITexture[0]); + onConfigLoad(); + } + + public GT_MetaTileEntity_SteamTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + onConfigLoad(); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public GT_Recipe.GT_Recipe_Map getRecipes() { + return null; + } + + @Override + public String[] getDescription() { + return new String[] {mDescription, "Fuel Efficiency: " + (600/getEfficiency()) + "%"}; + } + + 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) { + return GT_ModHandler.isSteam(aLiquid) ? 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) }; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index 23b9d74fb7..fad3acec3f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -14,7 +14,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.CraftingManager;
public class GT_MetaTileEntity_Boxinator
extends GT_MetaTileEntity_BasicMachine
@@ -98,11 +97,11 @@ public class GT_MetaTileEntity_Boxinator if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
{
if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) || (ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) || (ItemList.Schematic_3by3.isStackEqual(getInputAt(1)))) {
- if(GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[this.mTier], null, new ItemStack[] { GT_Utility.copyAmount(64L, new Object[] { aStack }), getInputAt(1) }) != null){return true;}
- if(ItemList.Schematic_1by1.isStackEqual(getInputAt(1))&>_ModHandler.getRecipeOutput(new ItemStack[] { aStack })!=null)return true;
- if(ItemList.Schematic_2by2.isStackEqual(getInputAt(1))&>_ModHandler.getRecipeOutput(new ItemStack[] { aStack, aStack, null, aStack, aStack })!=null){return true;}
- if(ItemList.Schematic_3by3.isStackEqual(getInputAt(1))&&(GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack,aStack,aStack,aStack,aStack,aStack,aStack,aStack,aStack })!=null)){return true;}
- }else{return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack);}
+ if(GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[this.mTier], null, new ItemStack[] { GT_Utility.copyAmount(64L, new Object[] { aStack }), getInputAt(1) }) != null){return true;}
+ if(ItemList.Schematic_1by1.isStackEqual(getInputAt(1))&>_ModHandler.getRecipeOutput(new ItemStack[] { aStack })!=null)return true;
+ if(ItemList.Schematic_2by2.isStackEqual(getInputAt(1))&>_ModHandler.getRecipeOutput(new ItemStack[] { aStack, aStack, null, aStack, aStack })!=null){return true;}
+ if(ItemList.Schematic_3by3.isStackEqual(getInputAt(1))&&(GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack,aStack,aStack,aStack,aStack,aStack,aStack,aStack,aStack })!=null)){return true;}
+ }else{return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack);}
}
return false;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java new file mode 100644 index 0000000000..8504cf3197 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java @@ -0,0 +1,79 @@ +package gregtech.common.tileentities.machines.basic; + +import static gregtech.api.enums.GT_Values.V; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBatteryBuffer; +import gregtech.api.util.GT_ModHandler; + +public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuffer { + + public GT_MetaTileEntity_Charger(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { + super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); + } + + public GT_MetaTileEntity_Charger(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { + super(aName, aTier, aDescription, aTextures, aSlotCount); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Charger(mName, mTier, mDescription, mTextures, mInventory.length); + } + + @Override + public long getMinimumStoredEU() { + return V[mTier] * 64 * mInventory.length; + } + + @Override + public long maxEUStore() { + return V[mTier] * 256 * mInventory.length; + } + + @Override + public long maxAmperesIn() { + return mChargeableCount * 8; + } + + @Override + public long maxAmperesOut() { + return mBatteryCount * 4; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (this.getBaseMetaTileEntity() instanceof BaseMetaTileEntity) { + BaseMetaTileEntity mBaseMetaTileEntity = (BaseMetaTileEntity) getBaseMetaTileEntity(); + if (mBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) { + MetaTileEntity mMetaTileEntity = (MetaTileEntity) mBaseMetaTileEntity.getMetaTileEntity(); + //for (int t = 0; t < 6; t++) { + if (mMetaTileEntity.dechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { + for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { + if (mMetaTileEntity.mInventory[i] != null && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { + mBaseMetaTileEntity.increaseStoredEnergyUnits(GT_ModHandler.dischargeElectricItem(mMetaTileEntity.mInventory[i], (int)Math.min(V[mTier]*15, mBaseMetaTileEntity.getEUCapacity() - mBaseMetaTileEntity.getStoredEU()), (int)Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), true, false, false), true); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) + mMetaTileEntity.mInventory[i] = null; + } + } + } + if (mMetaTileEntity.rechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() > 0) { + for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { + if (mBaseMetaTileEntity.getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) { + mBaseMetaTileEntity.decreaseStoredEU(GT_ModHandler.chargeElectricItem(mMetaTileEntity.mInventory[i], (int)Math.min(V[this.mTier]*15, mBaseMetaTileEntity.getStoredEU()), (int)Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), true, false), true); + if (mMetaTileEntity.mInventory[i].stackSize <= 0) + mMetaTileEntity.mInventory[i] = 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 07337cd305..f82517bedc 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,5 +1,6 @@ package gregtech.common.tileentities.machines.basic;
+import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -46,14 +47,17 @@ public class GT_MetaTileEntity_Massfabricator Materials.UUAmplifier.mChemicalFormula = ("Mass Fabricator Eff/Speed Bonus: x" + sUUASpeedBonus);
}
+@Override public long maxAmperesIn(){return 10;}
+@Override public long maxEUStore() {return V[mTier]*512;}
+
public int checkRecipe()
{
FluidStack tFluid = getDrainableStack();
if ((tFluid == null) || (tFluid.amount < getCapacity()))
{
this.mOutputFluid = Materials.UUMatter.getFluid(1L);
- this.mEUt = ((int)gregtech.api.enums.GT_Values.V[this.mTier]);
- this.mMaxProgresstime = (sDurationMultiplier / (1 << this.mTier - 1));
+ this.mEUt = ((int)gregtech.api.enums.GT_Values.V[this.mTier])*8;
+ this.mMaxProgresstime = (sDurationMultiplier / (1 << (this.mTier*2) - 2));
if (((tFluid = getFillableStack()) != null) && (tFluid.amount >= sUUAperUUM) && (tFluid.isFluidEqual(Materials.UUAmplifier.getFluid(1L))))
{
tFluid.amount -= sUUAperUUM;
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java new file mode 100644 index 0000000000..11489dfa56 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java @@ -0,0 +1,296 @@ + +package gregtech.common.tileentities.machines.basic; + +import static gregtech.api.enums.GT_Values.V; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.entity.effect.EntityWeatherEffect; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IEnergyConnected; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Config; +import gregtech.api.util.GT_Utility; +import gregtech.common.gui.GT_Container_MicrowaveEnergyTransmitter; +import gregtech.common.gui.GT_Container_Teleporter; +import gregtech.common.gui.GT_GUIContainer_FusionReactor; +import gregtech.common.gui.GT_GUIContainer_MicrowaveEnergyTransmitter; +import gregtech.common.gui.GT_GUIContainer_Teleporter; + +public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank{ + + public int mTargetX = 0; + public int mTargetY = 0; + public int mTargetZ = 0; + public int mTargetD = 0; + public boolean mDebug = false; + public boolean hasEgg = false; + public static boolean sInterDimensionalTeleportAllowed = true; + public int mMaxLoss = 50; + public int mMaxLossDistance = 10000; + public boolean mPassiveEnergyUse = true; + + public GT_MetaTileEntity_MicrowaveEnergyTransmitter(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 3, "Transmits Energy wireless"); + } + + public GT_MetaTileEntity_MicrowaveEnergyTransmitter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 3, aDescription, aTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + this.hasEgg = checkForEgg(); + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_MicrowaveEnergyTransmitter(aPlayerInventory, aBaseMetaTileEntity); + } + + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MicrowaveEnergyTransmitter(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_MicrowaveEnergyTransmitter(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + public String[] getInfoData() + { + return new String[] { "Coordinates:", "X: " + this.mTargetX, "Y: " + this.mTargetY, "Z: " + this.mTargetZ, "Dimension: " + this.mTargetD }; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide == 0) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER) }; + } + + + public void saveNBTData(NBTTagCompound aNBT) + { + if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); + aNBT.setInteger("mTargetX", this.mTargetX); + aNBT.setInteger("mTargetY", this.mTargetY); + aNBT.setInteger("mTargetZ", this.mTargetZ); + aNBT.setInteger("mTargetD", this.mTargetD); + aNBT.setBoolean("mDebug", this.mDebug); + } + + public void loadNBTData(NBTTagCompound aNBT) + { + mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); + this.mTargetX = aNBT.getInteger("mTargetX"); + this.mTargetY = aNBT.getInteger("mTargetY"); + this.mTargetZ = aNBT.getInteger("mTargetZ"); + this.mTargetD = aNBT.getInteger("mTargetD"); + this.mDebug = aNBT.getBoolean("mDebug"); + } + + public void onConfigLoad(GT_Config aConfig) + { + sInterDimensionalTeleportAllowed = aConfig.get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); + mMaxLoss = Math.max(aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLoss",50),11); + mMaxLossDistance = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLossDistance",10000); + mPassiveEnergyUse = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.PassiveEnergy",true); + } + + public void onFirstTick() + { + if (getBaseMetaTileEntity().isServerSide()) + { + if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) + { + this.mTargetX = getBaseMetaTileEntity().getXCoord(); + this.mTargetY = getBaseMetaTileEntity().getYCoord(); + this.mTargetZ = getBaseMetaTileEntity().getZCoord(); + this.mTargetD = getBaseMetaTileEntity().getWorld().provider.dimensionId; + } + this.hasEgg = checkForEgg(); + } + } + + public boolean checkForEgg() + { + for (byte i = -5; i <= 5; i = (byte)(i + 1)) { + for (byte j = -5; j <= 5; j = (byte)(j + 1)) { + for (byte k = -5; k <= 5; k = (byte)(k + 1)) { + if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == Blocks.dragon_egg) { + return true; + } + } + } + } + return false; + } + + public boolean hasDimensionalTeleportCapability() + { + return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))&&mFluid.amount>=1000); + } + + public boolean isDimensionalTeleportAvailable() + { + return (this.mDebug) || ((hasDimensionalTeleportCapability()) && (GT_Utility.isRealDimension(this.mTargetD)) && (GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId))); + } + + public int tTargetX = 0; + public int tTargetY = 0; + public int tTargetZ = 0; + public int tTargetD = 0; + public TileEntity tTile = null; + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if(mFluid==null){ + mFluid=Materials.Nitrogen.getPlasma(0); + } + super.onPostTick(aBaseMetaTileEntity, aTick); + if (getBaseMetaTileEntity().isServerSide()) + { + if (getBaseMetaTileEntity().getTimer() % 100L == 50L) { + this.hasEgg = checkForEgg(); + } + if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) + { + if(getBaseMetaTileEntity().getStoredEU()>(V[mTier]*16)){ + if(mPassiveEnergyUse){getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(2, mTier), false);} + if(hasDimensionalTeleportCapability()&&this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId&&mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))){ + mFluid.amount--; + if(mFluid.amount<1){mFluid=null;} + } + if(tTargetD!=mTargetD||tTargetX!=mTargetX||tTargetY!=mTargetY||tTargetZ!=mTargetZ){ + tTargetD=mTargetD; + tTargetX=mTargetX; + tTargetY=mTargetY; + tTargetZ=mTargetZ; + if(this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId){ + tTile = getBaseMetaTileEntity().getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);}else{ + World tWorld = DimensionManager.getWorld(this.mTargetD); + if(tWorld!=null){ + tTile = tWorld.getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ); + } + } + } + int tDistance = distanceCalculation(); + long tEnergyTrans = Math.min(V[mTier], getBaseMetaTileEntity().getStoredEU()); + if(tTile!=null&&tTile instanceof IEnergyConnected){ + if(((IEnergyConnected)tTile).injectEnergyUnits((byte) 6, V[mTier], 1)>0){ + int tLoss=1; + if(mMaxLossDistance!=0){ + tLoss = 10 + tDistance*(mMaxLoss-10)/mMaxLossDistance;} + getBaseMetaTileEntity().decreaseStoredEnergyUnits(V[mTier]+((V[mTier]*tLoss)/100), false); + } + } + } + getBaseMetaTileEntity().setActive(true); + } + else + { + getBaseMetaTileEntity().setActive(false); + } + } + } + + private int distanceCalculation() + { + return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int)Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); + } + + @Override public boolean isSimpleMachine() {return false;} + @Override public boolean isOverclockerUpgradable() {return false;} + @Override public boolean isTransformerUpgradable() {return false;} + @Override public boolean isElectric() {return true;} + @Override public boolean isFacingValid(byte aFacing) {return true;} + @Override public boolean isEnetInput() {return true;} + @Override public boolean isInputFacing(byte aSide) {return true;} + @Override public boolean isOutputFacing(byte aSide) {return false;} + @Override public boolean isTeleporterCompatible() {return false;} + @Override public long getMinimumStoredEU() {return V[mTier]*16;} + @Override public long maxEUStore() {return V[mTier]*256;} + @Override public long maxEUInput() {return V[mTier];} + @Override public long maxSteamStore() {return maxEUStore();} + @Override public long maxAmperesIn() {return 3;} + @Override public int getStackDisplaySlot() {return 2;} + @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public int getInputSlot() {return 0;} + @Override public int getOutputSlot() {return 0;} + + @Override + public int getCapacity() {return 64000;} + + @Override + public boolean doesFillContainers() { + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean canTankBeFilled() { + return true; + } + + @Override + public boolean canTankBeEmptied() { + return true; + } + + @Override + public boolean displaysItemStack() { + return false; + } + + @Override + public boolean displaysStackSize() { + return false; + } + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + return null; + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java index 40020ef435..92248da910 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java @@ -196,10 +196,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord()) != GT_Utility .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))&&this.mInventory[0] != null&&this.mInventory[0].stackSize>0&>_Utility.areStacksEqual(this.mInventory[0], GT_ModHandler.getIC2Item("miningPipe", 1L))) { - getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), - GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord(), y, getBaseMetaTileEntity().getZCoord(), + GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); getBaseMetaTileEntity().decrStackSize(0, 1); - } return y; } 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 3360369114..a08ec27c23 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 @@ -171,6 +171,20 @@ public class GT_MetaTileEntity_Scanner 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 });
+ this.mMaxProgresstime = (1000 / (1 << this.mTier - 1));
+ this.mEUt = (32 * (1 << this.mTier - 1) * (1 << this.mTier - 1));
+ return 2;
+
+ }
+ }
+
}
return 0;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java new file mode 100644 index 0000000000..09b06b033e --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -0,0 +1,109 @@ +package gregtech.common.tileentities.machines.basic; + +import ic2.core.Ic2Items; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.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_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Ores; +import gregtech.common.blocks.GT_TileEntity_Ores; + +public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_BasicMachine{ + + boolean ready = false; + + public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier) + { + super(aID, aName, aNameRegional, aTier, 1, "Place, activate with explosives, use Data Stick", 1, 1, "Default.png", "", new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) }); + } + + public GT_MetaTileEntity_SeismicProspector(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_SeismicProspector(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isServerSide()) { + ItemStack aStack = aPlayer.getCurrentEquippedItem(); + if ((aStack != null) && (aStack.getItem() == Item.getItemFromBlock(Blocks.tnt)||aStack.getItem() == Ic2Items.industrialTnt.getItem()) && aStack.stackSize > 7&&!ready) { + if ((!aPlayer.capabilities.isCreativeMode) && (aStack.stackSize != 111)) { + aStack.stackSize -= 8; + } + this.ready = true; + this.mMaxProgresstime = 200; + } else if (ready&&mMaxProgresstime==0&&aStack!=null&&aStack.stackSize==1&&aStack.getItem()==ItemList.Tool_DataStick.getItem()) { + this.ready=false; + GT_Utility.ItemNBT.setBookTitle(aPlayer.getCurrentEquippedItem(),"Raw Prospection Data"); + List<String> tStringList = new ArrayList<String>(); + for(int i = this.getBaseMetaTileEntity().getYCoord();i>0;i--){ + for(int f = -1; f<2;f++){ + for(int g = -1; g<2;g++){ + Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(f, -i, g); + if ((tBlock instanceof GT_Block_Ores)) + { + TileEntity tTileEntity = getBaseMetaTileEntity().getWorld().getTileEntity(getBaseMetaTileEntity().getXCoord()+f, getBaseMetaTileEntity().getYCoord()+(-i), getBaseMetaTileEntity().getZCoord()+g); + if ((tTileEntity instanceof GT_TileEntity_Ores)) + { + Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores)tTileEntity).mMetaData % 1000)]; + if ((tMaterial != null) && (tMaterial != Materials._NULL)) + { + if(!tStringList.contains(tMaterial.mDefaultLocalName)){ + tStringList.add(tMaterial.mDefaultLocalName); + } + } + } + } + else + { + int tMetaID = getBaseMetaTileEntity().getWorld().getBlockMetadata(getBaseMetaTileEntity().getXCoord()+f, getBaseMetaTileEntity().getYCoord()+(-i), getBaseMetaTileEntity().getZCoord()+g); + ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); + if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) + { + if(!tStringList.contains( tAssotiation.mMaterial.mMaterial.mDefaultLocalName)){ + tStringList.add( tAssotiation.mMaterial.mMaterial.mDefaultLocalName); + } + } + } + } + } + } + FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()); + String[] tStringArray = new String[tStringList.size()];{ + for(int i = 0;i<tStringArray.length;i++){ + tStringArray[i] = tStringList.get(i); + } + } + GT_Utility.ItemNBT.setProspectionData(aPlayer.getCurrentEquippedItem(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId,tFluid, tStringArray); + } + } + + return true; + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index e0c6225a61..4f6259e7e8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -23,9 +23,15 @@ import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.fluids.FluidStack; import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.interfaces.ITexture; @@ -92,9 +98,9 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1], (aSide !=this.getBaseMetaTileEntity().getFrontFacing()) ? null : aActive ? new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) : new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TELEPORTER) }; } - public void saveNBTData(NBTTagCompound aNBT) { + if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); aNBT.setInteger("mTargetX", this.mTargetX); aNBT.setInteger("mTargetY", this.mTargetY); aNBT.setInteger("mTargetZ", this.mTargetZ); @@ -104,6 +110,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{ public void loadNBTData(NBTTagCompound aNBT) { + mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); this.mTargetX = aNBT.getInteger("mTargetX"); this.mTargetY = aNBT.getInteger("mTargetY"); this.mTargetZ = aNBT.getInteger("mTargetZ"); @@ -147,7 +154,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{ public boolean hasDimensionalTeleportCapability() { - return (this.mDebug) || (this.hasEgg); + return (this.mDebug) || (this.hasEgg) || (mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))&&mFluid.amount>=1000); } public boolean isDimensionalTeleportAvailable() @@ -157,6 +164,9 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{ @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if(mFluid==null){ + mFluid=Materials.Nitrogen.getPlasma(0); + } super.onPostTick(aBaseMetaTileEntity, aTick); if (getBaseMetaTileEntity().isServerSide()) { @@ -165,14 +175,40 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{ } if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) { - if(getBaseMetaTileEntity().decreaseStoredEnergyUnits(8192, false)){ + if(getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)){ + if(hasDimensionalTeleportCapability()&&this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId&&mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))){ + mFluid.amount--; + if(mFluid.amount<1){mFluid=null;} + } int tDistance = distanceCalculation(); + if(mInventory[0]!=null){ + TileEntity tTile = null; + if(this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId){ + tTile = getBaseMetaTileEntity().getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ);}else{ + World tWorld = DimensionManager.getWorld(this.mTargetD); + if(tWorld!=null){ + tTile = tWorld.getTileEntity(this.mTargetX, this.mTargetY, this.mTargetZ); + } + } + if(tTile!=null&&tTile instanceof IInventory){ + int tStacksize = mInventory[0].stackSize; + GT_Utility.moveOneItemStack(this, tTile, (byte)0 ,(byte)0, null, false, (byte)64, (byte)1, (byte)64, (byte)1); + if(mInventory[0]==null||mInventory[0].stackSize<tStacksize){ + getBaseMetaTileEntity().decreaseStoredEnergyUnits((int)(tDistance * tDistance * (tStacksize - (mInventory[0]==null ? 0 : mInventory[0].stackSize))), false); + } + } + + } for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) { if (((tObject instanceof Entity)) && (!((Entity)tObject).isDead)) { Entity tEntity = (Entity)tObject; if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((int)(tDistance * tDistance * weightCalculation(tEntity)), false)) { + if(hasDimensionalTeleportCapability()&&this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId&&mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))){ + mFluid.amount = mFluid.amount - ((int)Math.min(1000,(tDistance * tDistance * weightCalculation(tEntity)/8192))); + if(mFluid.amount<1){mFluid=null;} + } if (tEntity.ridingEntity != null) { tEntity.mountEntity(null); } @@ -301,6 +337,11 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{ @Override public long maxAmperesIn() {return 2;} @Override public int getStackDisplaySlot() {return 2;} @Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;} + @Override public int getInputSlot() {return 0;} + @Override public int getOutputSlot() {return 0;} + + @Override + public int getCapacity() {return 64000;} @Override public boolean doesFillContainers() { @@ -319,7 +360,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank{ @Override public boolean canTankBeEmptied() { - return false; + return true; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java new file mode 100644 index 0000000000..86a7120605 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java @@ -0,0 +1,261 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +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_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +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.blocks.GT_TileEntity_Ores; + +public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBase{ + + public GT_MetaTileEntity_AdvMiner2(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_AdvMiner2(String aName) + { + super(aName); + } + + public String[] getDescription() + { + return new String[] { + "Controller Block for the Advanced Miner II", + "Size: 3x7x3", "Controller (front middle at bottom)", + "3x3 Base of Solid Steel Casings", + "Also part of Base: MV+ Energy Input Hatch", + "Fluid Input Hatch, Output Bus and Maintainance Hatch", + "3x Solid Steel Casings on top the Center of the base", + "Steel Frame Boxes on each side and 3 more on top"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16] }; + } + public ArrayList<ChunkPosition> mMineList = new ArrayList(); + private boolean completedCycle = false; + + @Override + public boolean checkRecipe(ItemStack aStack) { + if(mInventory[1]==null||(mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize<mInventory[1].getMaxStackSize())){ + ArrayList<ItemStack> tItems = getStoredInputs(); + for(ItemStack tStack : tItems){ + if(tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))){ + if(tStack.stackSize<2){ + tStack = null; + }else{tStack.stackSize--;} + + } + if(mInventory[1]==null){ + mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L); + }else{ + mInventory[1].stackSize++;} + } + } + if(mInputHatches==null||mInputHatches.get(0).mFluid==null||mInputHatches.get(0).mFluid.getFluid().getID()!=ItemList.sDrillingFluid.getID()){ + return false;} + FluidStack tFluid = mInputHatches.get(0).mFluid.copy(); + if(tFluid==null){ + return false; + } + if(tFluid.amount<20){ + return false; + } + tFluid.amount=100; + depleteInput(tFluid); + long tVoltage = getMaxInputVoltage(); + if(getBaseMetaTileEntity().getRandomNumber(20)==0){ + if(mMineList.isEmpty()){ + int yLevel = getYOfPumpHead(); + for(int i=-48;i<49;i++){ + for(int f=-48;f<49;f++){ + Block tBlock = getBaseMetaTileEntity().getBlockOffset(i, yLevel-getBaseMetaTileEntity().getYCoord(), f); + if(tBlock==GregTech_API.sBlockOres1){ + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(i, yLevel-getBaseMetaTileEntity().getYCoord(), f); + if ((tTileEntity instanceof GT_TileEntity_Ores)&&((GT_TileEntity_Ores)tTileEntity).mNatural == true&&!mMineList.contains(new ChunkPosition(i, yLevel-getBaseMetaTileEntity().getYCoord(), f))){ + mMineList.add(new ChunkPosition(i, yLevel-getBaseMetaTileEntity().getYCoord(), f)); + } + } + } + } + } + if(mMineList.isEmpty()&&getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead()-1-getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ)!=Blocks.bedrock){ + if(mEnergyHatches.size()>0&&mEnergyHatches.get(0).getEUVar()>(512+getMaxInputVoltage()*4)){moveOneDown();} + } + ArrayList<ItemStack> tDrops = new ArrayList(); + if(!mMineList.isEmpty()){ + Block tMineBlock = getBaseMetaTileEntity().getBlockOffset(mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ); + tDrops = tMineBlock.getDrops(getBaseMetaTileEntity().getWorld(), mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ, getBaseMetaTileEntity().getMetaIDOffset(mMineList.get(0).chunkPosX,mMineList.get(0).chunkPosY,mMineList.get(0).chunkPosZ), 1); + if(!tDrops.isEmpty()){ + if(GT_OreDictUnificator.getItemData(tDrops.get(0)).mPrefix != OrePrefixes.crushed){ + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, tVoltage, null , tDrops.get(0)); + if(tRecipe!=null){ + this.mOutputItems=new ItemStack[tRecipe.mOutputs.length]; + for(int g=0;g<mOutputItems.length;g++){ + mOutputItems[g] = tRecipe.mOutputs[g].copy(); + mOutputItems[g].stackSize = mOutputItems[g].stackSize*(getBaseMetaTileEntity().getRandomNumber(4)+1); + } + } + }else{ + this.mOutputItems=null; + ItemStack[] tStack = new ItemStack[tDrops.size()]; + for(int j=0;j<tDrops.size();j++){ + tStack[j]=tDrops.get(j).copy(); + tStack[j].stackSize = tStack[j].stackSize*(getBaseMetaTileEntity().getRandomNumber(4)+1); + } + mOutputItems = tStack; + } + } + getBaseMetaTileEntity().getWorld().setBlockToAir(mMineList.get(0).chunkPosX+getBaseMetaTileEntity().getXCoord(), mMineList.get(0).chunkPosY+getBaseMetaTileEntity().getYCoord(), mMineList.get(0).chunkPosZ+getBaseMetaTileEntity().getZCoord()); + mMineList.remove(0); + } + } + + byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage)); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tEU = 48; + int tDuration = 40; + if (tEU <= 16) + { + this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tDuration / (1 << tTier - 1)); + } + else + { + this.mEUt = tEU; + this.mMaxProgresstime = tDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) + { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + return true; + } + + private boolean moveOneDown() { + if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1) + || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) { + return false; + } + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int yHead = getYOfPumpHead(); + if (yHead <= 0) { + return false; + } + if(getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead-1, getBaseMetaTileEntity().getZCoord()+zDir) == Blocks.bedrock){ + return false; + } + if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead - 1, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) { + return false; + } + if (yHead != getBaseMetaTileEntity().getYCoord()) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))); + } + getBaseMetaTileEntity().decrStackSize(1, 1); + return true; + } + + private int getYOfPumpHead() { + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int y = getBaseMetaTileEntity().getYCoord() - 1; + while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) { + y--; + } + if (y == getBaseMetaTileEntity().getYCoord() - 1) { + if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) { + return y + 1; + } + } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility + .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))&&this.mInventory[1] != null&&this.mInventory[1].stackSize>0&>_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir, + GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); + getBaseMetaTileEntity().decrStackSize(0, 1); + } + return y; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((xDir + i != 0) || (zDir + j != 0)) + { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16))) + { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) { + return false; + } + } + } + } + } + for(int y=1;y<4;y++){ + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir+1, y, zDir) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir-1, y, zDir) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir+1) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir-1) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y+3, zDir) != GregTech_API.sBlockMachines) { + return false; + } + } + return true; + } + + @Override public boolean isCorrectMachinePart(ItemStack aStack) {return true; } + @Override public int getMaxEfficiency(ItemStack aStack) {return 10000;} + @Override public int getPollutionPerTick(ItemStack aStack) {return 0; } + @Override public int getDamageToComponent(ItemStack aStack) {return 0;} + @Override public int getAmountOfOutputs() {return 0;} + @Override public boolean explodesOnComponentBreak(ItemStack aStack) {return false;} + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_AdvMiner2(this.mName); + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java new file mode 100644 index 0000000000..fcfdbfc104 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -0,0 +1,214 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Block_Reinforced; + +public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_MultiBlockBase{ + + private boolean running = false; + public GT_MetaTileEntity_Charcoal_Pit(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_Charcoal_Pit(String aName) + { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_Charcoal_Pit(this.mName); + } + + public String[] getDescription() + { + return new String[] { "Charcoal pit controller", + "Place on top of a pile of wood logs", + "Maximum size of logs below 11x5x11", + "Each log only can have other logs,", + "dirt or grass on its sides or above", + "or only logs or bricks below", + "Turns logs into Brittle Charcoal blocks"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + if (aSide == 1) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[10], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[10] }; + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() + { + return null; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + + return true; + } + + public boolean isCorrectMachinePart(ItemStack aStack) + { + return true; + } + + public boolean isFacingValid(byte aFacing) + { + return aFacing > 1; + } + + public boolean checkRecipe(ItemStack aStack) + { + if(!checkRecursiveBlocks()){ + return false; + } + + if(mEfficiency==0){ + this.mEfficiency = 10000; + this.mEfficiencyIncrease = 10000; + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + return true; + }else{ + this.mEfficiency=0; + this.mEfficiencyIncrease = 0; + this.mMaxProgresstime = 0; + } + return false; + } + + private boolean checkRecursiveBlocks(){ + ArrayList<ChunkPosition> tList1 = new ArrayList(); + ArrayList<ChunkPosition> tList2 = new ArrayList(); + + Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(0, -1, 0); + if(tBlock!=Blocks.log&&tBlock!=Blocks.log2){ + return false; + }else{ + tList2.add(new ChunkPosition(0,-1,0));//this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord()-1, this.getBaseMetaTileEntity().getZCoord())); + } + while(!tList2.isEmpty()){ + ChunkPosition tPos= (ChunkPosition) tList2.get(0); + tList2.remove(0); + if(!checkAllBlockSides(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ, tList1, tList2)){ + return false; + } + } + if(running){ + for(ChunkPosition tPos : tList1){ + if(this.getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ)==Blocks.log) + this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord()+tPos.chunkPosX, this.getBaseMetaTileEntity().getYCoord()+tPos.chunkPosY, this.getBaseMetaTileEntity().getZCoord()+tPos.chunkPosZ, GregTech_API.sBlockReinforced, 4, 3); + } + running = false; + return false; + }else{ + this.mMaxProgresstime = (int) Math.sqrt(tList1.size()* 240000); + } + running = true; + return true; + } + private boolean p1,p2,p3,p4,p5,p6; + private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<ChunkPosition> aList1, ArrayList<ChunkPosition> aList2){ + p1=false;p2=false;p3=false;p4=false;p5=false;p6=false; + Block tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX +1, aY, aZ); + if(aX+1<6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX +1, aY, aZ))&&(!aList2.contains(new ChunkPosition(aX +1, aY, aZ))))p1=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX -1, aY, aZ); + if(aX-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX -1, aY, aZ))&&(!aList2.contains(new ChunkPosition(aX -1, aY, aZ))))p2=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX , aY+1, aZ); + if(aY+1<1&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX, aY+1, aZ))&&(!aList2.contains(new ChunkPosition(aX, aY+1, aZ))))p3=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass||(aX==0&&aY==-1&&aZ==0&&tBlock==GregTech_API.sBlockMachines))){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY-1, aZ); + if(aY-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX, aY-1, aZ))&&(!aList2.contains(new ChunkPosition(aX, aY-1, aZ))))p4=true; + }else if(tBlock!=Blocks.brick_block){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ+1); + if(aZ+1<6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX, aY, aZ+1))&&(!aList2.contains(new ChunkPosition(aX, aY, aZ+1))))p5=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;} + + tBlock = this.getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ-1); + if(aZ-1>-6&&(tBlock==Blocks.log||tBlock==Blocks.log2)){ + if(!aList1.contains(new ChunkPosition(aX, aY, aZ-1))&&(!aList2.contains(new ChunkPosition(aX, aY, aZ-1))))p6=true; + }else if(!(tBlock==Blocks.dirt||tBlock==Blocks.grass)){return false;} + aList1.add(new ChunkPosition(aX,aY,aZ)); + if(p1)aList2.add(new ChunkPosition(aX+1,aY,aZ)); + if(p2)aList2.add(new ChunkPosition(aX-1,aY,aZ)); + if(p3)aList2.add(new ChunkPosition(aX,aY+1,aZ)); + if(p4)aList2.add(new ChunkPosition(aX,aY-1,aZ)); + if(p5)aList2.add(new ChunkPosition(aX,aY,aZ+1)); + if(p6)aList2.add(new ChunkPosition(aX,aY,aZ-1)); + return true; + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) + { + mWrench = true; + mScrewdriver = true; + mSoftHammer = true; + mHardHammer = true; + mSolderingTool = true; + mCrowbar = true; + return true; + } + + public int getMaxEfficiency(ItemStack aStack) + { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) + { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) + { + return 0; + } + + public int getAmountOfOutputs() + { + return 1; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) + { + return false; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 632cdcbd6f..7386e74ed8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -16,7 +16,6 @@ import gregtech.api.util.GT_Utility; import java.util.ArrayList; -import scala.actors.threadpool.Arrays; import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -43,7 +42,14 @@ public class GT_MetaTileEntity_DistillationTower public String[] getDescription() { - return new String[] { "Controller Block for the Distillation Tower", "Size: 3x6x3 (Hollow)", "Controller (front bottom)", "1x Input Hatch (bottom)", "5x Output Hatch (one each height level besides botton)","1x Output Bus (Botton)", "1x Energy Hatch (anywhere)", "1x Maintenance Hatch (anywhere)", "Clean Stainless Steel Casings for the rest (26 at least!)" }; + return new String[] { + "Controller Block for the Distillation Tower", + "Size: 3x6x3 (Hollow)", "Controller (front bottom)", + "1x Input Hatch (bottom)", + "5x Output Hatch (one each height level besides botton)", + "1x Output Bus (Botton)", "1x Energy Hatch (anywhere)", + "1x Maintenance Hatch (anywhere)", + "Clean Stainless Steel Casings for the rest (26 at least!)" }; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index 9a835e625f..e25cfc08f2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -60,11 +60,11 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png"); + return new GT_GUIContainer_FusionReactor(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "FusionComputer.png", GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName); } public abstract MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity); - + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { return aSide != getBaseMetaTileEntity().getFrontFacing(); @@ -283,7 +283,6 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity return false; } if (mRunningOnLoad||tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) { - if(mRunningOnLoad)System.out.println("First Recipe!"); this.mLastRecipe = tRecipe; this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); @@ -363,7 +362,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity mMaxProgresstime = 0; mEfficiencyIncrease = 0; if (mOutputFluids != null && mOutputFluids.length > 0) { - GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]); + try{GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]);}catch(Exception e){} } this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); if (aBaseMetaTileEntity.isAllowedToWork()) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java index 3c23afcbb5..924695b54f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java @@ -44,7 +44,7 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC public Block getCasing() { return GregTech_API.sBlockCasings1; } - + @Override public IIconContainer getIconOverlay() { return Textures.BlockIcons.OVERLAY_FUSION1; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java index d101875ba2..cd0790ba91 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java @@ -44,7 +44,6 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC public Block getCasing() { return GregTech_API.sBlockCasings4; } - @Override public IIconContainer getIconOverlay() { return Textures.BlockIcons.OVERLAY_FUSION2; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java index b7334bd449..6aabc38cb8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java @@ -44,11 +44,9 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC public Block getCasing() { return GregTech_API.sBlockCasings4; } - @Override public IIconContainer getIconOverlay() { return Textures.BlockIcons.OVERLAY_FUSION3; } - } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java index 3a6a51fa46..446c52f460 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -30,6 +30,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_HeatExchanger extends GT_MetaTileEntity_MultiBlockBase{ + public GT_MetaTileEntity_HeatExchanger(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index df129f8fd7..2657bddbb4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -94,7 +94,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler tFluid.amount = 1000;
if (depleteInput(tFluid))
{
- this.mMaxProgresstime = (tRecipe.mSpecialValue / 2);
+ this.mMaxProgresstime = (runtimeBoost(tRecipe.mSpecialValue / 2));
this.mEUt = getEUt();
this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease() * 4);
return true;
@@ -109,7 +109,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler tFluid.amount = 1000;
if (depleteInput(tFluid))
{
- this.mMaxProgresstime = Math.max(1, tRecipe.mSpecialValue * 2);
+ this.mMaxProgresstime = Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2));
this.mEUt = getEUt();
this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
return true;
@@ -119,7 +119,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler ArrayList<ItemStack> tInputList = getStoredInputs();
if (!tInputList.isEmpty()) {
for (ItemStack tInput : tInputList) {
- if ((GT_Utility.getFluidForFilledItem(tInput, true) == null) && ((this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0))
+ if ((GT_Utility.getFluidForFilledItem(tInput, true) == null) && ((this.mMaxProgresstime = runtimeBoost(GT_ModHandler.getFuelValue(tInput) / 80)) > 0))
{
this.mEUt = getEUt();
this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
@@ -135,14 +135,16 @@ public abstract class GT_MetaTileEntity_LargeBoiler return false;
}
+ abstract int runtimeBoost(int mTime);
+
public boolean onRunningTick(ItemStack aStack)
{
if (this.mEUt > 0)
{
int tGeneratedEU = (int)(this.mEUt * 2L * this.mEfficiency / 10000L);
if (tGeneratedEU > 0) {
- long amount = (tGeneratedEU + 160) / 160;
- if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) {
+ long amount = (tGeneratedEU + 160) / 160;
+ if (depleteInput(Materials.Water.getFluid(amount)) || depleteInput(GT_ModHandler.getDistilledWater(amount))) {
addOutput(GT_ModHandler.getSteam(tGeneratedEU));
} else {
explodeMultiblock();
@@ -258,12 +260,8 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { }
}
-
-
-/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
-
- * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeBoiler
-
- * JD-Core Version: 0.7.0.1
-
- */
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeBoiler
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java index c0c362d2c5..8d88995a61 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java @@ -72,6 +72,11 @@ public class GT_MetaTileEntity_LargeBoiler_Bronze {
return 16;
}
+
+@Override
+int runtimeBoost(int mTime) {
+ return mTime * 2;
+}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java index c6f16a7d4f..b1cdc312f3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java @@ -72,6 +72,11 @@ public class GT_MetaTileEntity_LargeBoiler_Steel {
return 12;
}
+
+ @Override
+ int runtimeBoost(int mTime) {
+ return mTime * 150 /100;
+ }
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java index 7d11836a19..9f18d77ec7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java @@ -1,75 +1,80 @@ -package gregtech.common.tileentities.machines.multi;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
-
-public class GT_MetaTileEntity_LargeBoiler_Titanium
- extends GT_MetaTileEntity_LargeBoiler
-{
- public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional);
- }
-
- public GT_MetaTileEntity_LargeBoiler_Titanium(String aName)
- {
- super(aName);
- }
-
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName);
- }
-
- public Block getCasingBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getCasingMeta()
- {
- return 2;
- }
-
- public byte getCasingTextureIndex()
- {
- return 50;
- }
-
- public Block getPipeBlock()
- {
- return GregTech_API.sBlockCasings2;
- }
-
- public byte getPipeMeta()
- {
- return 14;
- }
-
- public Block getFireboxBlock()
- {
- return GregTech_API.sBlockCasings4;
- }
-
- public byte getFireboxMeta()
- {
- return 3;
- }
-
- public byte getFireboxTextureIndex()
- {
- return 51;
- }
-
- public int getEUt()
- {
- return 800;
- }
-
- public int getEfficiencyIncrease()
- {
- return 8;
- }
+package gregtech.common.tileentities.machines.multi; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.block.Block; + +public class GT_MetaTileEntity_LargeBoiler_Titanium + extends GT_MetaTileEntity_LargeBoiler +{ + public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_LargeBoiler_Titanium(String aName) + { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_LargeBoiler_Titanium(this.mName); + } + + public Block getCasingBlock() + { + return GregTech_API.sBlockCasings4; + } + + public byte getCasingMeta() + { + return 2; + } + + public byte getCasingTextureIndex() + { + return 50; + } + + public Block getPipeBlock() + { + return GregTech_API.sBlockCasings2; + } + + public byte getPipeMeta() + { + return 14; + } + + public Block getFireboxBlock() + { + return GregTech_API.sBlockCasings4; + } + + public byte getFireboxMeta() + { + return 3; + } + + public byte getFireboxTextureIndex() + { + return 51; + } + + public int getEUt() + { + return 800; + } + + public int getEfficiencyIncrease() + { + return 8; + } + + @Override + int runtimeBoost(int mTime) { + return mTime * 130 /100; + } }
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java index 399ba2dcf4..2e583f1cf5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java @@ -72,6 +72,12 @@ public class GT_MetaTileEntity_LargeBoiler_TungstenSteel {
return 4;
}
+
+ @Override
+ int runtimeBoost(int mTime) {
+ return mTime * 120 /100;
+ }
+
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java index d8b765c82a..9bc636a95b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java @@ -157,7 +157,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends GT_MetaTileEntity_M if (mEUt <= 0) { // this.mEfficiencyIncrease = (-10); - this.mEfficiency = 0; + this.mEfficiency = 0; //stopMachine(); return false; } else { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index d57aa52db8..bbf4df7c32 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -75,7 +75,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La if(!achievement){ try{GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam");}catch(Exception e){} achievement=true; - } + } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index 5b7ea5c362..bab1efcd54 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -6,7 +6,6 @@ import java.util.Collection; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -71,7 +70,8 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { - aOptFlow *= 20; + + aOptFlow *= 40; int tEU = 0; int actualOptimalFlow = 0; @@ -80,6 +80,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); actualOptimalFlow = (int) ((aOptFlow + fuelValue -1 )/ fuelValue); + int remainingFlow = (int) (actualOptimalFlow * 1.25f); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. int flow = 0; int totalFlow = 0; @@ -105,6 +106,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar } else { tEU = tEU * aBaseEff / 10000; } + return tEU; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 7a3f45037a..d49c5a67f8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -64,8 +64,8 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg water = water - (int)usage; return usage; } - - private boolean achievement = false; + + private boolean achievement = false; @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { @@ -77,15 +77,15 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and track totals. String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)); if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) { - flow = aFluids.get(i).amount; // Get all (steam) in hatch + flow = aFluids.get(i).amount; // Get all (steam) in hatch flow = Math.min(flow, Math.min(remainingFlow, (int) (aOptFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used if(!achievement){ try{GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam");}catch(Exception e){} - achievement=true; - } + achievement=true; + } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java new file mode 100644 index 0000000000..246ba2e716 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java @@ -0,0 +1,241 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBase { + + public GT_MetaTileEntity_OilCracker(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_OilCracker(String aName) { + super(aName); + } + + public String[] getDescription() { + return new String[] { + "Controller Block for the Oil Cracking Unit", + "Cracks heavy oil into lighter parts", + "Size: 3 high, 3 deep, 5 wide", + "Controller (front center)", + "Made from Clean Stainless Steel Casings (18 at least!)", + "On both sides of the Controller each", + "a ring of 8 Cupronickel Coils", + "2 Blocks left Input Hatch and 8 Casings", + "2 Blocks right Output Hatch and 8 Casings", + "beween coils: Controller, second input Hatch", + "Maintainance Hatch and Energy Hatch"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49], + new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[49] }; + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<FluidStack> tInputList = getStoredFluids(); + for (FluidStack tInput : tInputList) + { + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage)); + + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCrakingRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[] { tInput }, new ItemStack[]{}); + if (tRecipe != null) { + if (tRecipe.isRecipeInputEqual(true, new FluidStack[] { tInput }, new ItemStack[]{})) + { + boolean steam=false;boolean hydrogen = false; + for(FluidStack tInput2: tInputList){ + if(tInput2.getFluid()==GT_ModHandler.getSteam(1).getFluid()){steam=true;tInput2.amount -=64;} + if(tInput2.getFluid()==Materials.Hydrogen.mGas){hydrogen=true;steam=false;tInput2.amount -=64;} + + } + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + if (tRecipe.mEUt <= 16) + { + this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1)); + } + else + { + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) + { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if(steam)this.mEUt = this.mEUt*66/100; + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) }; + if(hydrogen)this.mOutputFluids[0].amount=this.mOutputFluids[0].amount*130/100; + return true; + } + } + } + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int amount = 0; + if(xDir!=0){ + for (int i = -1; i < 2; i++) {// xDirection + for (int j = -1; j < 2; j++) {// height + for (int h = -2; h < 3; h++) { + if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) { + if (h == 1 || h == -1) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir); + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings1) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 12) { + return false; + } + } + if (h == 2||h==-2) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir); + boolean tSide = ((aBaseMetaTileEntity.getBackFacing()==4&&2==h)||(aBaseMetaTileEntity.getBackFacing()==5&&-2==h)); + if ( tSide ? !addInputToMachineList(tTileEntity, 49) : !addOutputToMachineList(tTileEntity, 49)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings4) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 1) { + return false; + } + amount++; + } + } + if (h == 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, j, h + zDir); + if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) + && (!addEnergyInputToMachineList(tTileEntity, 49))) { + if (!((xDir + i) == 0 && j == 0 && (h + zDir) == 0)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, j, h + zDir) != GregTech_API.sBlockCasings4) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, j, h + zDir) != 1) { + return false; + } + amount++; + } + } + } + + } + } + } + } + }else{ + for (int i = -1; i < 2; i++) {// zDirection + for (int j = -1; j < 2; j++) {// height + for (int h = -2; h < 3; h++) { + if (!(j == 0 && i == 0 && (h == -1 || h == 0 || h == 1))) { + if (h == 1 || h == -1) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir); + if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings1) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 12) { + return false; + } + } + if (h == 2||h==-2) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir); + boolean tSide = (aBaseMetaTileEntity.getBackFacing()==h||(aBaseMetaTileEntity.getBackFacing()==3&&-2==h)); + if ( tSide ? !addOutputToMachineList(tTileEntity, 49) : !addInputToMachineList(tTileEntity, 49)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings4) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 1) { + return false; + } + amount++; + } + } + if (h == 0) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + h, j, i + zDir); + if ((!addMaintenanceToMachineList(tTileEntity, 49)) && (!addInputToMachineList(tTileEntity, 49)) + && (!addEnergyInputToMachineList(tTileEntity, 49))) { + if (!((xDir + h) == 0 && j == 0 && (i + zDir) == 0)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + h, j, i + zDir) != GregTech_API.sBlockCasings4) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + h, j, i + zDir) != 1) { + return false; + } + amount++; + } + } + } + + } + } + } + } + } + if(amount<19)return false; + return true; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public int getAmountOfOutputs() { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_OilCracker(this.mName); + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java new file mode 100644 index 0000000000..930ee98238 --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java @@ -0,0 +1,208 @@ +package gregtech.common.tileentities.machines.multi; + +import static gregtech.api.enums.GT_Values.V; + +import java.util.ArrayList; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; + +public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase{ + + public GT_MetaTileEntity_OilDrill(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_OilDrill(String aName) + { + super(aName); + } + + public String[] getDescription() + { + return new String[] { + "Controller Block for the Oil Drilling Rig", + "Size: 3x7x3", "Controller (front middle at bottom)", + "3x3 Base of Solid Steel Casings", + "Also part of Base: Energy Input Hatch", + "Fluid Output Hatch and Maintainance Hatch", + "3x Solid Steel Casings on top the Center of the base", + "Steel Frame Boxes on each side and 3 more on top"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) + { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[16] }; + } + private boolean completedCycle = false; + + @Override + public boolean checkRecipe(ItemStack aStack) { + if(mInventory[1]==null||(mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize<mInventory[1].getMaxStackSize())){ + ArrayList<ItemStack> tItems = getStoredInputs(); + for(ItemStack tStack : tItems){ + if(tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))){ + if(tStack.stackSize<2){ + tStack = null; + }else{tStack.stackSize--;} + + } + if(mInventory[1]==null){ + mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L); + }else{ + mInventory[1].stackSize++;} + } + } + FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()); + if(tFluid==null){ + return false; + } + if(getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead()-1-getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ)!=Blocks.bedrock){ + if(completedCycle){moveOneDown();} + tFluid=null; + if(mEnergyHatches.size()>0&&mEnergyHatches.get(0).getEUVar()>(512+getMaxInputVoltage()*4))completedCycle=true; + }else if(tFluid.amount<5000){ + return false; + }else{tFluid.amount = tFluid.amount/5000;} + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage)); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tEU = 24; + int tDuration = 160; + if (tEU <= 16) + { + this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tDuration / (1 << tTier - 1)); + } + else + { + this.mEUt = tEU; + this.mMaxProgresstime = tDuration; + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) + { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + this.mOutputFluids = new FluidStack[] { tFluid }; + return true; + } + + private boolean moveOneDown() { + if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1) + || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) { + return false; + } + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int yHead = getYOfPumpHead(); + if (yHead <= 0) { + return false; + } + if(getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead-1, getBaseMetaTileEntity().getZCoord()+zDir) == Blocks.bedrock){ + return false; + } + if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead - 1, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) { + return false; + } + if (yHead != getBaseMetaTileEntity().getYCoord()) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, yHead, getBaseMetaTileEntity().getZCoord()+zDir,GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))); + } + getBaseMetaTileEntity().decrStackSize(1, 1); + return true; + } + + private int getYOfPumpHead() { + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int y = getBaseMetaTileEntity().getYCoord() - 1; + while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) { + y--; + } + if (y == getBaseMetaTileEntity().getYCoord() - 1) { + if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) { + return y + 1; + } + } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir) != GT_Utility + .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))&&this.mInventory[1] != null&&this.mInventory[1].stackSize>0&>_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord()+xDir, y, getBaseMetaTileEntity().getZCoord()+zDir, + GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); + getBaseMetaTileEntity().decrStackSize(0, 1); + } + return y; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity,ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((xDir + i != 0) || (zDir + j != 0)) + { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16))) + { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) { + return false; + } + } + } + } + } + for(int y=1;y<4;y++){ + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir+1, y, zDir) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir-1, y, zDir) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir+1) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir-1) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y+3, zDir) != GregTech_API.sBlockMachines) { + return false; + } + } + return true; + } + + @Override public boolean isCorrectMachinePart(ItemStack aStack) {return true; } + @Override public int getMaxEfficiency(ItemStack aStack) {return 10000;} + @Override public int getPollutionPerTick(ItemStack aStack) {return 0; } + @Override public int getDamageToComponent(ItemStack aStack) {return 0;} + @Override public int getAmountOfOutputs() {return 0;} + @Override public boolean explodesOnComponentBreak(ItemStack aStack) {return false;} + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_OilDrill(this.mName); + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 410eea616c..4e6c1a2e24 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -115,6 +115,7 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl }else if(tmp.startsWith("arcfurnace")){ return GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes; } + return null; } @@ -181,14 +182,15 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl this.mEUt = 0; this.mOutputItems = null; this.mOutputFluids = null; - this.mMaxProgresstime = tRecipe.mDuration; int machines = Math.min(16,mInventory[1].stackSize); - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; int i = 0; for(;i<machines;i++){ - if(!tRecipe.isRecipeInputEqual(true, tFluids, tInputs))break; - } + if(!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)){if(i==0){return false;} + break;} + } + this.mMaxProgresstime = tRecipe.mDuration; + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; if (tRecipe.mEUt <= 16) { this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java new file mode 100644 index 0000000000..05c7a4a0ef --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -0,0 +1,171 @@ +package gregtech.common.tileentities.machines.multi; + +import java.util.ArrayList; + +import net.minecraft.block.BlockDynamicLiquid; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; + +public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlockBase { + + public GT_MetaTileEntity_PyrolyseOven(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_PyrolyseOven(String aName) { + super(aName); + } + + public String[] getDescription() { + return new String[] { + "Controller Block for the Pyrolyse Oven", + "Industrial Charcoal producer and Oil from Plants", + "Size: 5x4x5, Controller (bottom center)", + "Made from ULV Machine Casings (min 60)", + "Bottom 3x3 Kantal Heating Coils", + "4 high ULV Casings around the coils", + "bottom row of casings are Energy Hatch", + "Maintainance Hatch and Output Hatch/Bus", + "top 3x3 has Input Hatch/Bus and Muffler Hatch"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[0], + new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[0] }; + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<ItemStack> tInputList = getStoredInputs(); + ArrayList<FluidStack> tFluidInputs = getStoredFluids(); + for (ItemStack tInput : tInputList) + { + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte)Math.max(1, GT_Utility.getTier(tVoltage)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs.isEmpty() ? null :new FluidStack[]{tFluidInputs.get(0)}, new ItemStack[] { mInventory[1],tInput }); + if (tRecipe != null) { + if (tRecipe.isRecipeInputEqual(true, tFluidInputs.isEmpty() ? null :new FluidStack[]{tFluidInputs.get(0)}, new ItemStack[] { tInput, mInventory[1] })) + { + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + this.mEUt = tRecipe.mEUt; + this.mMaxProgresstime = tRecipe.mDuration; + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + if(tRecipe.mOutputs.length>0)this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) }; + if(tRecipe.mFluidOutputs.length>0)this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) }; + updateSlots(); + return true; + } + } + } + return false; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX*2; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ*2; + for (int i = -2; i < 3; i++) { + for (int j = -2; j < 3; j++) { + for (int h = 0; h < 4; h++) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); + if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne höhe + if (h == 0) {// innen boden (kantal coils) + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 13) { + return false; + } + } else if (h == 3) {// innen decke (ulv casings + input + muffler) + if ((!addInputToMachineList(tTileEntity, 120)) && (!addMufflerToMachineList(tTileEntity, 120))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) { + return false; + } + } + } else {// innen air + if (!aBaseMetaTileEntity.getAir(xDir + i, h, zDir + j)) { + return false; + } + } + } else {// Außerer 5x5 ohne höhe + if (h == 0) {// außen boden (controller, output, energy, maintainance, rest ulv casings) + if ((!addMaintenanceToMachineList(tTileEntity, 120)) && (!addOutputToMachineList(tTileEntity, 120)) && (!addEnergyInputToMachineList(tTileEntity, 120))) { + if ((xDir + i != 0) || (zDir + j != 0)){//no controller + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) { return false;} + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) { + return false; + }} + } + } else {// außen über boden (ulv casings) + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings1) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 0) { + return false; + } + } + } + } + } + } + return true; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 20; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public int getAmountOfOutputs() { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_PyrolyseOven(this.mName); + } + +} diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java index 6a28464ec7..fd84eab38c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java @@ -1,132 +1,132 @@ -package gregtech.common.tileentities.machines.steam;
-
-import static gregtech.api.enums.GT_Values.V;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.enums.Textures.BlockIcons;
-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_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-
-import java.util.Map;
-import java.util.Random;
-
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GT_MetaTileEntity_Macerator_Bronze
- extends GT_MetaTileEntity_BasicMachine_Bronze
-{
- public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional)
- {
- super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
- }
-
- public GT_MetaTileEntity_Macerator_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(), "BronzeMacerator.png", "ic2.macerator");
- }
-
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity)
- {
- return new GT_MetaTileEntity_Macerator_Bronze(this.mName, this.mDescription, 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.getOutput(0)!=null) mOutputItems[0] = tRecipe.getOutput(0);
- this.mEUt = 2;
- this.mMaxProgresstime = 800;
- getInputAt(0).stackSize-=tRecipe.mInputs[0].stackSize;
- 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_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null;
- }
-
- 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 static gregtech.api.enums.GT_Values.V; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +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_ModHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; + +import java.util.Map; +import java.util.Random; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_Macerator_Bronze + extends GT_MetaTileEntity_BasicMachine_Bronze +{ + public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional) + { + super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false); + } + + public GT_MetaTileEntity_Macerator_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(), "BronzeMacerator.png", "ic2.macerator"); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) + { + return new GT_MetaTileEntity_Macerator_Bronze(this.mName, this.mDescription, 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.getOutput(0)!=null) mOutputItems[0] = tRecipe.getOutput(0); + this.mEUt = 2; + this.mMaxProgresstime = 800; + getInputAt(0).stackSize-=tRecipe.mInputs[0].stackSize; + 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_ModHandler.getMaceratorOutput(GT_Utility.copyAmount(64L, new Object[] { aStack }), false, null) != null; + } + + 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/tileentities/storage/GT_MetaTileEntity_QuantumTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java index a27feb5814..2b37049dc6 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java @@ -29,7 +29,7 @@ public class GT_MetaTileEntity_QuantumTank @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide ==1 ? new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1],new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QTANK)} :new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex+1]}; - } + } @Override public void saveNBTData(NBTTagCompound aNBT) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java index 7640c4fe8a..b3371b2671 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java @@ -14,7 +14,7 @@ public abstract class GT_Tool_Turbine extends GT_Tool{ public abstract float getBaseDamage(); @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) {return false;} @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {return aIsToolHead ? getTurbineIcon(): null;} - @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : null;} + @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : null;} public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " put " + EnumChatFormatting.RED + diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Small.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Small.java index 4292ab73fb..3c85760b41 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Small.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Small.java @@ -8,5 +8,4 @@ public class GT_Tool_Turbine_Small extends GT_Tool_Turbine { @Override public float getMaxDurabilityMultiplier() {return 1.0F;} @Override public float getBaseDamage() {return 0.0F;} @Override public IIconContainer getTurbineIcon() {return Textures.ItemIcons.TURBINE_SMALL;} - } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java index 2b68b6eaa2..8a79c96750 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java @@ -141,4 +141,10 @@ public class GT_Tool_Wrench {
return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " threw a Monkey Wrench into the Plans of " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE);
}
-}
\ No newline at end of file +}
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.tools.GT_Tool_Wrench
+ * JD-Core Version: 0.7.0.1
+ */
\ No newline at end of file |