From bea4cfc54566b4f3b9971d1da93782b03410f669 Mon Sep 17 00:00:00 2001 From: Shawn Buckley Date: Wed, 21 Oct 2015 20:47:13 -0400 Subject: Bring in experimental branch --- src/main/java/gregtech/common/GT_Proxy.java | 13 +- src/main/java/gregtech/common/GT_RecipeAdder.java | 103 ++-- .../java/gregtech/common/GT_ThaumcraftCompat.java | 10 +- .../gregtech/common/GT_Worldgen_GT_Ore_Layer.java | 2 + .../java/gregtech/common/GT_Worldgenerator.java | 116 ++++- .../gregtech/common/blocks/GT_Block_Casings1.java | 1 + .../gregtech/common/blocks/GT_Block_Concretes.java | 3 +- .../gregtech/common/blocks/GT_Block_Machines.java | 6 +- .../gregtech/common/blocks/GT_Block_Metal.java | 37 ++ .../java/gregtech/common/blocks/GT_Block_Ores.java | 535 ++++++++++----------- .../common/blocks/GT_Block_Reinforced.java | 218 +++++++++ .../gregtech/common/blocks/GT_Block_Storage.java | 120 +++++ .../gregtech/common/blocks/GT_Item_Storage.java | 37 ++ .../gregtech/common/blocks/GT_TileEntity_Ores.java | 520 ++++++++++---------- .../common/covers/GT_Cover_LiquidMeter.java | 192 ++++---- .../common/covers/GT_Cover_NeedMaintainance.java | 4 +- .../GT_Cover_RedstoneTransmitterInternal.java | 9 +- .../common/covers/GT_Cover_SolarPanel.java | 80 +-- .../GT_Container_MicrowaveEnergyTransmitter.java | 177 +++++++ .../common/gui/GT_GUIContainer_FusionReactor.java | 5 +- ...GT_GUIContainer_MicrowaveEnergyTransmitter.java | 40 ++ .../common/gui/GT_GUIContainer_Teleporter.java | 1 + src/main/java/gregtech/common/items/CombType.java | 116 +++++ .../common/items/GT_MetaGenerated_Item_01.java | 28 +- .../common/items/GT_MetaGenerated_Item_02.java | 2 + src/main/java/gregtech/common/items/ItemComb.java | 147 ++++++ .../items/behaviors/Behaviour_Plunger_Item.java | 160 +++--- .../items/behaviors/Behaviour_Spray_Color.java | 3 +- .../automation/GT_MetaTileEntity_TypeFilter.java | 62 +-- .../boilers/GT_MetaTileEntity_Boiler.java | 2 +- .../boilers/GT_MetaTileEntity_Boiler_Bronze.java | 2 +- .../boilers/GT_MetaTileEntity_Boiler_Steel.java | 2 +- .../GT_MetaTileEntity_DieselGenerator.java | 2 +- .../generators/GT_MetaTileEntity_GasTurbine.java | 2 +- .../GT_MetaTileEntity_MagicEnergyConverter.java | 2 +- .../GT_MetaTileEntity_MagicalEnergyAbsorber.java | 509 ++++++++++---------- .../generators/GT_MetaTileEntity_SteamTurbine.java | 238 +++++---- .../basic/GT_MetaTileEntity_Boxinator.java | 11 +- .../machines/basic/GT_MetaTileEntity_Charger.java | 79 +++ .../basic/GT_MetaTileEntity_Massfabricator.java | 8 +- ..._MetaTileEntity_MicrowaveEnergyTransmitter.java | 296 ++++++++++++ .../machines/basic/GT_MetaTileEntity_Pump.java | 5 +- .../machines/basic/GT_MetaTileEntity_Scanner.java | 14 + .../basic/GT_MetaTileEntity_SeismicProspector.java | 109 +++++ .../basic/GT_MetaTileEntity_Teleporter.java | 49 +- .../multi/GT_MetaTileEntity_AdvMiner2.java | 261 ++++++++++ .../multi/GT_MetaTileEntity_Charcoal_Pit.java | 214 +++++++++ .../multi/GT_MetaTileEntity_DistillationTower.java | 10 +- .../multi/GT_MetaTileEntity_FusionComputer.java | 7 +- .../multi/GT_MetaTileEntity_FusionComputer1.java | 2 +- .../multi/GT_MetaTileEntity_FusionComputer2.java | 1 - .../multi/GT_MetaTileEntity_FusionComputer3.java | 2 - .../multi/GT_MetaTileEntity_HeatExchanger.java | 1 + .../multi/GT_MetaTileEntity_LargeBoiler.java | 26 +- .../GT_MetaTileEntity_LargeBoiler_Bronze.java | 5 + .../multi/GT_MetaTileEntity_LargeBoiler_Steel.java | 5 + .../GT_MetaTileEntity_LargeBoiler_Titanium.java | 153 +++--- ...T_MetaTileEntity_LargeBoiler_TungstenSteel.java | 6 + .../multi/GT_MetaTileEntity_LargeTurbine.java | 2 +- .../GT_MetaTileEntity_LargeTurbine_HPSteam.java | 2 +- .../GT_MetaTileEntity_LargeTurbine_Plasma.java | 6 +- .../GT_MetaTileEntity_LargeTurbine_Steam.java | 10 +- .../multi/GT_MetaTileEntity_OilCracker.java | 241 ++++++++++ .../machines/multi/GT_MetaTileEntity_OilDrill.java | 208 ++++++++ .../multi/GT_MetaTileEntity_ProcessingArray.java | 12 +- .../multi/GT_MetaTileEntity_PyrolyseOven.java | 171 +++++++ .../steam/GT_MetaTileEntity_Macerator_Bronze.java | 264 +++++----- .../storage/GT_MetaTileEntity_QuantumTank.java | 2 +- .../gregtech/common/tools/GT_Tool_Turbine.java | 2 +- .../common/tools/GT_Tool_Turbine_Small.java | 1 - .../java/gregtech/common/tools/GT_Tool_Wrench.java | 8 +- 71 files changed, 4182 insertions(+), 1517 deletions(-) create mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Metal.java create mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java create mode 100644 src/main/java/gregtech/common/blocks/GT_Block_Storage.java create mode 100644 src/main/java/gregtech/common/blocks/GT_Item_Storage.java create mode 100644 src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java create mode 100644 src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java create mode 100644 src/main/java/gregtech/common/items/CombType.java create mode 100644 src/main/java/gregtech/common/items/ItemComb.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AdvMiner2.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java (limited to 'src/main/java/gregtech/common') 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 @@ -81,6 +81,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 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 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 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= 0) && (aMeta < 16)&&aMeta 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 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 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 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 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); +