diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2018-05-14 04:34:25 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2018-05-14 04:34:25 +1000 |
commit | bde34e22232299d2dec9487757492033d804bf8b (patch) | |
tree | 5f4195304af4e887eeca30a48ba5009b8aebc8dc /src | |
parent | 033e0873de4ff7a3646c76bfcc03447047b3f05b (diff) | |
download | GT5-Unofficial-bde34e22232299d2dec9487757492033d804bf8b.tar.gz GT5-Unofficial-bde34e22232299d2dec9487757492033d804bf8b.tar.bz2 GT5-Unofficial-bde34e22232299d2dec9487757492033d804bf8b.zip |
% Once again, buffed Atmospheric Cleansers/Pollution Scrubbers.
Diffstat (limited to 'src')
4 files changed, 128 insertions, 16 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 4e26ce186e..d7e7b6b440 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -22,6 +22,7 @@ import gregtech.api.enums.Materials; import gregtech.api.util.FishPondFakeRecipe; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.common.GT_Worldgen_GT_Ore_Layer; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -237,6 +238,16 @@ public class GTplusplus implements ActionListener { } } + if (MiningUtils.findAndMapOreTypesFromGT()) { + int mapKey = 0; + for (AutoMap<GT_Worldgen_GT_Ore_Layer> g : MiningUtils.mOreMaps) { + for (GT_Worldgen_GT_Ore_Layer h : g) { + Logger.WORLD("Found Vein "+h.aTextWorldgen + " in map with key: "+mapKey); + } + mapKey++; + } + } + } protected void dumpGtRecipeMap(final GT_Recipe_Map r) { diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index a596b9bdf1..4dc7987448 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -9,7 +9,6 @@ import gtPlusPlus.core.block.base.BlockBaseModular; import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.item.base.bolts.BaseItemBolt; import gtPlusPlus.core.item.base.dusts.BaseItemDust; -import gtPlusPlus.core.item.base.dusts.BaseItemDustEx; import gtPlusPlus.core.item.base.gears.BaseItemGear; import gtPlusPlus.core.item.base.ingots.BaseItemIngot; import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot; @@ -207,11 +206,10 @@ public class MaterialGenerator { Block tempBlock; tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); - //temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", 3, sRadiation); + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", 3, sRadiation); temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", 2, sRadiation); temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", 1, sRadiation); - temp = new BaseItemDustEx(matInfo); temp = new BaseItemIngot(matInfo); temp = new BaseItemNugget(matInfo); diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java index 2a1de61b54..5fd89ff244 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/MiningUtils.java @@ -1,11 +1,17 @@ package gtPlusPlus.core.util.minecraft; +import java.util.Map; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import gregtech.common.GT_Worldgen_GT_Ore_Layer; + import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.util.reflect.ReflectionUtils; public class MiningUtils { @@ -211,5 +217,103 @@ public class MiningUtils { } } + public static int mMoonID =-99; + public static int mMarsID = -99; + public static int mCometsID = -99; + public static AutoMap<GT_Worldgen_GT_Ore_Layer> getOresForDim(int dim) { + if (dim == -1) { + return Ores_Nether; + } + else if (dim == 1) { + return Ores_End; + } + else if (dim == mMoonID) { + return Ores_Moon; + } + else if (dim == mMarsID) { + return Ores_Mars; + } + else if (dim == mCometsID) { + return Ores_Comets; + } + else { + return Ores_Overworld; + } + + } + public static AutoMap<GT_Worldgen_GT_Ore_Layer>[] mOreMaps = new AutoMap[7]; + private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Overworld = new AutoMap<GT_Worldgen_GT_Ore_Layer>(); + private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Nether = new AutoMap<GT_Worldgen_GT_Ore_Layer>(); + private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_End = new AutoMap<GT_Worldgen_GT_Ore_Layer>(); + private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Moon = new AutoMap<GT_Worldgen_GT_Ore_Layer>(); + private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Mars = new AutoMap<GT_Worldgen_GT_Ore_Layer>(); + private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Comets = new AutoMap<GT_Worldgen_GT_Ore_Layer>(); + private static AutoMap<GT_Worldgen_GT_Ore_Layer> Ores_Misc = new AutoMap<GT_Worldgen_GT_Ore_Layer>(); + + public static boolean findAndMapOreTypesFromGT() { + //Gets Moon ID + try { + if (Class.forName("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore") != null) { + mMoonID = ReflectionUtils.getField(Class.forName("micdoodle8.mods.galacticraft.core.util.ConfigManagerCore"), "idDimensionMoon").getInt(null); + } + } + catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {} + + //Gets Mars ID + try { + if (Class.forName("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars") != null) { + mMarsID = ReflectionUtils.getField(Class.forName("micdoodle8.mods.galacticraft.planets.mars.ConfigManagerMars"), "dimensionIDMars").getInt(null); + } + } + catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {} + + //Get Comets ID + try { + if (Class.forName("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids") != null) { + mCometsID = ReflectionUtils.getField(Class.forName("micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids"), "dimensionIDAsteroids").getInt(null); + } + } + catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) {} + + + for (GT_Worldgen_GT_Ore_Layer x : GT_Worldgen_GT_Ore_Layer.sList) { + if (x.mEnabled) { + if (x.mOverworld) { + Ores_Overworld.put(x); + continue; + } + if (x.mNether) { + Ores_Nether.put(x); + continue; + } + if (x.mEnd || x.mEndAsteroid) { + Ores_End.put(x); + continue; + } + if (x.mMoon) { + Ores_Moon.put(x); + continue; + } + if (x.mMars) { + Ores_Mars.put(x); + continue; + } + if (x.mAsteroid) { + Ores_Comets.put(x); + continue; + } + Ores_Misc.put(x); + continue; + } + } + mOreMaps[0] = Ores_Overworld; + mOreMaps[1] = Ores_Nether; + mOreMaps[2] = Ores_End; + mOreMaps[3] = Ores_Moon; + mOreMaps[4] = Ores_Mars; + mOreMaps[5] = Ores_Comets; + mOreMaps[6] = Ores_Misc; + return true; + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 22cffe3ebd..8d2dec0715 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -6,6 +6,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -187,7 +188,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi Logger.WARNING("mPollutionReduction[1]:"+mPollutionReduction); //I stole this code - mPollutionReduction = (MathUtils.safeInt((long)mPollutionReduction*this.mBaseEff)/100000)*mAirSides; + mPollutionReduction = (MathUtils.safeInt((long)mPollutionReduction*this.mBaseEff)/100000)*mAirSides*tTier; //Utils.LOG_WARNING("mPollutionReduction[2]:"+mPollutionReduction); //mPollutionReduction = GT_Utility.safeInt((long)mPollutionReduction*this.mOptimalAirFlow/10000); //Utils.LOG_WARNING("mPollutionReduction[3]:"+mPollutionReduction); @@ -262,18 +263,16 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if(mInventory[SLOT_ROTOR].getItem() instanceof GT_MetaGenerated_Tool_01 && ((GT_MetaGenerated_Tool) mInventory[SLOT_ROTOR].getItem()).getToolStats(mInventory[SLOT_ROTOR]).getSpeedMultiplier()>0 && GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[SLOT_ROTOR]).mToolSpeed>0 ) { - long damageValue = ((10L*(long) Math.min(-mTier / mDamageFactorLow, Math.pow(-mTier, this.mDamageFactorHigh)))/10); + + long damageValue = (long) Math.floor(Math.abs(MathUtils.randFloat(1, 2) - MathUtils.randFloat(1, 3)) * (1 + 3 - 1) + 1); + double fDam = Math.floor(Math.abs(MathUtils.randFloat(1f, 2f) - MathUtils.randFloat(1f, 2f)) * (1f + 2f - 1f) + 1f); + damageValue -= fDam; + + Logger.INFO("Trying to do "+damageValue+" damage to the rotor. ["+fDam+"]"); + /*Materials M1 = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[this.SLOT_ROTOR]); + Materials M2 = GT_MetaGenerated_Tool.getSecondaryMaterial(this.mInventory[this.SLOT_ROTOR]); - if (damageValue <= 1){ - if (this.mOptimalAirFlow > 0){ - damageValue = (this.mOptimalAirFlow/10/8); - } - else { - return false; - } - } - - Logger.WARNING("Trying to do "+damageValue+" damage to the rotor."); + Logger.INFO("Trying to do "+damageValue+" damage to the rotor. [2]");*/ //Damage Rotor //int rotorDurability = this.mInventory[this.SLOT_ROTOR].getItemDamage(); @@ -281,7 +280,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi long rotorDurabilityMax = GT_MetaGenerated_Tool.getToolMaxDamage(this.mInventory[this.SLOT_ROTOR]); long rotorDurability = (rotorDurabilityMax - rotorDamage); Logger.WARNING("Rotor Damage: "+rotorDamage + " | Max Durability: "+rotorDurabilityMax+" | "+" Remaining Durability: "+rotorDurability); - if (rotorDurability > damageValue){ + if (rotorDurability >= damageValue){ Logger.WARNING("Damaging Rotor."); GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); |