diff options
| author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-09-12 17:01:27 +1000 |
|---|---|---|
| committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-09-12 17:01:27 +1000 |
| commit | ed64f971b4298b186f2486dc553c9fab955d36b4 (patch) | |
| tree | bc90f24f53bd842b90ae836c044029da0bb5fb30 /src/Java/gtPlusPlus/xmod | |
| parent | 9f538f72e0274a47da852e8bd67faf2dd4cfdba2 (diff) | |
| download | GT5-Unofficial-ed64f971b4298b186f2486dc553c9fab955d36b4.tar.gz GT5-Unofficial-ed64f971b4298b186f2486dc553c9fab955d36b4.tar.bz2 GT5-Unofficial-ed64f971b4298b186f2486dc553c9fab955d36b4.zip | |
+ Added total luminosity to all Tinkers Construct fluids via ASM.
$ Recipe fix for Handpump.
% Re-enabled The Pocket Fusion & Generator Arrays.
% Updated .gitignore.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
| -rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 2 | ||||
| -rw-r--r-- | src/Java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java | 63 |
2 files changed, 62 insertions, 3 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index d64fecb032..182d30e5c5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -121,7 +121,7 @@ public class HANDLER_GT { long rotorDurabilityMax = GT_MetaGenerated_Tool.getToolMaxDamage(aI); //Logger.INFO("Found "+aType+"Turbine made out of "+getMaterialName(aMainMaterial)+", using "+getMaterialName(aSecondaryMaterial)); if (rotorDurabilityMax < aCutoff) { - Logger.INFO("[Turbine Cleanup] "+getMaterialName(aMainMaterial)+" "+aType+"Turbines have "+rotorDurabilityMax+", which is below the cutoff durability of "+aCutoff+", disabling."); + Logger.WARNING("[Turbine Cleanup] "+getMaterialName(aMainMaterial)+" "+aType+"Turbines have "+rotorDurabilityMax+", which is below the cutoff durability of "+aCutoff+", disabling."); aG.mEnabled = false; aG.mHidden = true; aG.mCanBeBuffered = false; diff --git a/src/Java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java b/src/Java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java index 3ece2cc61d..501fe6579a 100644 --- a/src/Java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java +++ b/src/Java/gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java @@ -1,7 +1,13 @@ package gtPlusPlus.xmod.tinkers; +import java.lang.reflect.Field; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.tinkers.util.TinkersUtils; +import net.minecraft.block.Block; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -27,8 +33,61 @@ public class HANDLER_Tinkers { public static final void postInit() { if (LoadedMods.TiCon) { - - } + Class aTinkersSmeltery = ReflectionUtils.getClassByName("tconstruct.smeltery.TinkerSmeltery"); + AutoMap<Fluid> aTweakedFluids = new AutoMap<Fluid>(); + if (aTinkersSmeltery != null) { + try { + Logger.INFO("Manipulating the light levels of fluids in TiCon. Molten 'metals' in world are now very luminescent!"); + Field aFluidArrayField = ReflectionUtils.getField(aTinkersSmeltery, "fluids"); + Field aBlockArrayField = ReflectionUtils.getField(aTinkersSmeltery, "fluidBlocks"); + Fluid[] aTiconFluids = (Fluid[]) aFluidArrayField.get(null); + Block[] aTiconFluidBlocks = (Block[]) aBlockArrayField.get(null); + if (aTiconFluids != null && aTiconFluidBlocks != null) { + for (Fluid a : aTiconFluids) { + if (a == null) { + continue; + } else { + if (a.getLuminosity() <= 15) { + //if (a.getTemperature() >= 500) { + a.setLuminosity(16); + aTweakedFluids.put(a); + //} + } else { + aTweakedFluids.put(a); + continue; + } + } + } + for (Block a : aTiconFluidBlocks) { + if (a == null) { + continue; + } else { + Fluid f = FluidRegistry.lookupFluidForBlock(a); + boolean isHot = false; + if (f != null && f.getTemperature() >= 500) { + if (f.getLuminosity() <= 16 && !aTweakedFluids.containsValue(f)) { + f.setLuminosity(16); + } + isHot = true; + } + if (a.getLightValue() <= 16f) { + if (isHot) { + a.setLightLevel(16f); + } else { + if (a.getLightValue() <= 16f) { + a.setLightLevel(16f); + } + } + } else { + continue; + } + } + } + } + } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) { + } + } + } } } |
