From 869cad0bbafb3e3817e491ba2aaa332649587816 Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Wed, 19 Apr 2017 23:36:50 +0200 Subject: Added a lot of (petro)chemistry stuff, expanded the API Created an adapter class for creating materials. Materials now have bit flags for automatic gas/fluid creation. Added a new convenience method for adding distillery recipes. Recipes now show the exact recipe duration instead of the duration rounded down to the nearest int. Added new Materials with relevant recipes: Acetic Acid, Acetone, Calcium Acetate, Charcoal Byproducts, Carbon Monoxide, Ethanol, Ethylene, Methanol, Methyl Acetate, Polyvinyl Acetate, Propene, Sulfuric Ethylene, Vinyl Acetate Made vinegar visible. --- src/main/java/gregtech/common/GT_Proxy.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 91033a1f34..406dcc0a59 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1538,6 +1538,16 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return rFuelValue; } + public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){ + return addFluid(aMaterial.mDefaultLocalName.replace(" ", "_").toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, + aMaterial.mRGBa, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + } + + public Fluid addAutoGeneratedCorrespondingGas(Materials aMaterial) { + return addFluid(aMaterial.mDefaultLocalName.replace(" ", "_").toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, + aMaterial.mRGBa, 2, 295, GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + } + public Fluid addAutogeneratedMoltenFluid(Materials aMaterial) { return addFluid("molten." + aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", "Molten " + aMaterial.mDefaultLocalName, aMaterial, aMaterial.mMoltenRGBa, 4, aMaterial.mMeltingPoint <= 0 ? 1000 : aMaterial.mMeltingPoint, null, null, 0); @@ -1756,4 +1766,6 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { this.mModID = ((aModID == null) || (aModID.equals("UNKNOWN")) ? null : aModID); } } + + } \ No newline at end of file -- cgit From bf414f1c9974be6909fa03910c2bd4fbbaee7a21 Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Fri, 28 Apr 2017 23:34:39 +0200 Subject: Implemented Nitric Acid, Rocket Fuel --- src/main/java/gregtech/common/GT_Proxy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 406dcc0a59..8dbc4178dc 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1539,12 +1539,12 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){ - return addFluid(aMaterial.mDefaultLocalName.replace(" ", "_").toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, + return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, aMaterial.mRGBa, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); } public Fluid addAutoGeneratedCorrespondingGas(Materials aMaterial) { - return addFluid(aMaterial.mDefaultLocalName.replace(" ", "_").toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, + return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, aMaterial.mRGBa, 2, 295, GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); } -- cgit From 1f83a98876405445341cff705f7a9b70c203b96c Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Sun, 30 Apr 2017 18:04:25 +0200 Subject: New recipes, convenience methods, recipe rebalancings Implemented new recipes for Gunpowder, Saltpeter, Sulfuric Acid Gave Sulfur dust a burn value (1600, the same as coal) Made all chemical recipes stoichiometrically correct whenever possible (2 H + 1 O -> 1 H2O instead of 2 H + 1 O -> 3 H2O) Added a convenience method to Materials that lets you get dust succinctly Put all simplified recipe additions in a separate method, the config is still missing --- src/main/java/gregtech/common/GT_Proxy.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 8dbc4178dc..7376ef4a74 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1449,6 +1449,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { rFuelValue = Math.max(rFuelValue, 100); } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinySodium")) { rFuelValue = Math.max(rFuelValue, 44); + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSulfur")) { + rFuelValue = Math.max(rFuelValue, 1600); } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemLithium")) { rFuelValue = Math.max(rFuelValue, 6000); } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedLithium")) { -- cgit From 09c76543b215d4ba35475976bad92bda9600e287 Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Mon, 1 May 2017 00:47:19 +0200 Subject: methods for pipe creation, new plastic pipes, implemented PVC Added a new plastic: Polyvinyl Chloride, currently only used for item pipes Added Polytetrafluoroethylene Fluid Pipes Fixed the number of fluid cells for polymerization, Fixed the default alpha value for the MaterialBuilder class --- src/main/java/gregtech/common/GT_Proxy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 7376ef4a74..96b53f5b8c 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1542,12 +1542,12 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public Fluid addAutoGeneratedCorrespondingFluid(Materials aMaterial){ return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, - aMaterial.mRGBa, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + aMaterial.mRGBa, 1, aMaterial.getLiquidTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); } public Fluid addAutoGeneratedCorrespondingGas(Materials aMaterial) { return addFluid(aMaterial.mName.toLowerCase(Locale.ENGLISH), "molten.autogenerated", aMaterial.mDefaultLocalName, aMaterial, - aMaterial.mRGBa, 2, 295, GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); + aMaterial.mRGBa, 2, aMaterial.getGasTemperature(), GT_OreDictUnificator.get(OrePrefixes.cell, aMaterial, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); } public Fluid addAutogeneratedMoltenFluid(Materials aMaterial) { -- cgit From a0bf545451a4d3f7a6b5b9e1dc2603638473da05 Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Mon, 1 May 2017 14:36:50 +0200 Subject: Added config for simple chemical recipes and stone dust centifugation --- src/main/java/gregtech/common/GT_Proxy.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 96b53f5b8c..2eda73297f 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -196,6 +196,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mLowGravProcessing = false; public boolean mAprilFool = false; public boolean mCropNeedBlock = true; + public boolean mReenableSimplifiedChemicalRecipes = false; public GT_Proxy() { GameRegistry.registerFuelHandler(this); -- cgit From 978c4877b6e00ce6510be5efe2cd099e5314aeeb Mon Sep 17 00:00:00 2001 From: Johannes Gäßler Date: Mon, 1 May 2017 22:02:36 +0200 Subject: Added molecular formulas for the new materials, added alternative charcoal recipes. Charcoal can now be made by treating Wood Pulp or Sugar with Sulfuric Acid (takes very long, doesn't scale well) --- src/main/java/gregtech/common/GT_Proxy.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 2eda73297f..703be0d9ad 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1500,6 +1500,12 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { rFuelValue = Math.max(rFuelValue, 400); } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCoal")) { rFuelValue = Math.max(rFuelValue, 177); + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustCarbon")) { + rFuelValue = Math.max(rFuelValue, 1600); + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustSmallCarbon")) { + rFuelValue = Math.max(rFuelValue, 400); + } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "dustTinyCarbon")) { + rFuelValue = Math.max(rFuelValue, 177); } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "gemCharcoal")) { rFuelValue = Math.max(rFuelValue, 1600); } else if (GT_OreDictUnificator.isItemStackInstanceOf(aFuel, "crushedCharcoal")) { -- cgit From bc7eaaa76280cb5bef0ed420e3a3f20ebc345ee8 Mon Sep 17 00:00:00 2001 From: Yuriy Shnitkovskiy Date: Tue, 16 May 2017 19:49:46 +0300 Subject: Added config for automation --- src/main/java/gregtech/common/GT_Proxy.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 91033a1f34..e7fcd1e01d 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -196,6 +196,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mLowGravProcessing = false; public boolean mAprilFool = false; public boolean mCropNeedBlock = true; + public boolean mAMHInteraction = true; public GT_Proxy() { GameRegistry.registerFuelHandler(this); -- cgit From 82458fed2e4c065091f38340ceb05e98f28fc459 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 1 May 2017 08:18:30 +0200 Subject: Cherry-Pick c12e474 https://github.com/GTNewHorizons/GT5-Unofficial/commit/c12e474c23ca02fb3479312850f6ae07e623d8b9 --- src/main/java/gregtech/common/GT_Proxy.java | 123 ++++++++++++++++++++-------- 1 file changed, 87 insertions(+), 36 deletions(-) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index e7fcd1e01d..b79e6691d3 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -6,6 +6,8 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.ProgressManager; import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.eventhandler.EventBus; +import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.FMLNetworkEvent; @@ -55,10 +57,12 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.DamageSource; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; import net.minecraft.world.WorldSettings.GameType; import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.EntityJoinWorldEvent; @@ -69,6 +73,7 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.ChunkDataEvent; +import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; @@ -581,6 +586,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } } catch (Throwable e) {e.printStackTrace(GT_Log.err);} + + dimensionWiseChunkData.clear();//!!! IMPORTANT for map switching... + dimensionWisePollution.clear();//!!! IMPORTANT for map switching... } public void onServerStarted() { @@ -1246,8 +1254,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } } - if(aEvent.world.provider.dimensionId==0) - GT_Pollution.onWorldTick(aEvent.world, (int) (aEvent.world.getTotalWorldTime() % 1200)); + + GT_Pollution.onWorldTick(aEvent); } } @@ -1700,48 +1708,91 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { ProgressManager.pop(progressBar); } - public static final HashMap chunkData = new HashMap(5000); + public static final HashMap> dimensionWiseChunkData = new HashMap<>(16);//stores chunk data that is loaded/saved + public static final HashMap dimensionWisePollution = new HashMap<>(16);//stores GT_Polluttors objects + public static final byte GTOIL=3,GTOILFLUID=2,GTPOLLUTION=1,GTMETADATA=0,NOT_LOADED=0,LOADED=1;//consts + //@Deprecated + //public static final HashMap chunkData = new HashMap<>(0); + + private static final byte oilVer=(byte)20;//non zero plz + + //TO get default's fast + public static int[] getDefaultChunkDataOnCreation(){ + return new int[]{NOT_LOADED,0,-1,-1}; + } + public static int[] getDefaultChunkDataOnLoad(){ + return new int[]{LOADED,0,-1,-1}; + } @SubscribeEvent - public void handleChunkSaveEvent(ChunkDataEvent.Save event) - { - ChunkPosition tPos = new ChunkPosition(event.getChunk().xPosition,event.getChunk().worldObj.provider.dimensionId,event.getChunk().zPosition); - if(chunkData.containsKey(tPos)){ - int[] tInts = chunkData.get(tPos); - if(tInts.length>0){event.getData().setInteger("GTOIL", tInts[0]);} - if(tInts.length>1){event.getData().setInteger("GTPOLLUTION", tInts[1]);} - if(tInts.length>2){event.getData().setInteger("GTOILFLUID", tInts[2]);} - } + public void handleChunkSaveEvent(ChunkDataEvent.Save event) {//ALWAYS SAVE FROM THE HASH MAP DATA + HashMap chunkData=dimensionWiseChunkData.get(event.world.provider.dimensionId); + if(chunkData==null) return;//no dim info stored + + int[] tInts = chunkData.get(event.getChunk().getChunkCoordIntPair()); + if(tInts==null) return;//no chunk data stored + //assuming len of this array 4 + if(tInts[3]>=0)event.getData().setInteger("GTOIL", tInts[GTOIL]); + else event.getData().removeTag("GTOIL"); + if(tInts[2]>=0)event.getData().setInteger("GTOILFLUID", tInts[GTOILFLUID]); + else event.getData().removeTag("GTOILFLUID"); + if(tInts[1]>0)event.getData().setInteger("GTPOLLUTION", tInts[GTPOLLUTION]); + else event.getData().removeTag("GTPOLLUTION"); + event.getData().setByte("GTOILVER", oilVer);//version mark } @SubscribeEvent - public void handleChunkLoadEvent(ChunkDataEvent.Load event) - { - int tOil = 0; - int tOilFluid = 0; - int tPollution = 0; - - ChunkPosition tPos = new ChunkPosition(event.getChunk().xPosition,event.getChunk().worldObj.provider.dimensionId,event.getChunk().zPosition); - int[] tData = new int[0]; - if(chunkData.containsKey(tPos)){ - tData = chunkData.get(tPos); - chunkData.remove(tPos); - if(tData.length>0) - tOil = tData[0]; - if(tData.length>1) - tPollution = tData[1]; - if(tData.length>2) - tOilFluid = tData[2]; + public void handleChunkLoadEvent(ChunkDataEvent.Load event) { + final int worldID=event.world.provider.dimensionId; + HashMap chunkData = dimensionWiseChunkData.get(worldID); + if (chunkData == null){ + chunkData=new HashMap<>(1024); + dimensionWiseChunkData.put(worldID, chunkData); } + if (dimensionWisePollution.get(worldID) == null) + dimensionWisePollution.put(worldID, new GT_Pollution(event.world)); + + int[] tInts = chunkData.get(event.getChunk().getChunkCoordIntPair()); + if (tInts == null) { + //NOT LOADED and NOT PROCESSED by pollution algorithms + //regular load + tInts = getDefaultChunkDataOnLoad(); + + if (event.getData().getByte("GTOILVER") == oilVer) { + if (event.getData().hasKey("GTOIL")) + tInts[GTOIL] = event.getData().getInteger("GTOIL"); + if (event.getData().hasKey("GTOILFLUID")) + tInts[GTOILFLUID] = event.getData().getInteger("GTOILFLUID"); + } + + tInts[GTPOLLUTION] = event.getData().getInteger("GTPOLLUTION");//Defaults to 0 + + //store in HASH MAP if has useful data + if (tInts[GTPOLLUTION] > 0 || tInts[GTOIL] >= 0 || tInts[GTOILFLUID] >= 0) + chunkData.put(event.getChunk().getChunkCoordIntPair(), tInts); + } else if (tInts[GTMETADATA] == NOT_LOADED) {//was NOT loaded from chunk save game data + //NOT LOADED but generated + //append load + if (event.getData().getByte("GTOILVER") == oilVer) { + if (tInts[GTOIL] < 0 && event.getData().hasKey("GTOIL"))//if was not yet initialized + tInts[GTOIL] = event.getData().getInteger("GTOIL"); + + if (tInts[GTOILFLUID] < 0 && event.getData().hasKey("GTOILFLUID"))//if was not yet initialized + tInts[GTOILFLUID] = event.getData().getInteger("GTOILFLUID"); + } else { + tInts[GTOIL] = -1; + tInts[GTOILFLUID] = -1; + } - if(tOil==0&&event.getData().hasKey("GTOIL")) - tOil = event.getData().getInteger("GTOIL"); - if(tPollution==0&&event.getData().hasKey("GTPOLLUTION")) - tPollution = event.getData().getInteger("GTPOLLUTION"); - if(tOilFluid==0&&event.getData().hasKey("GTOILFLUID")) - tOilFluid = event.getData().getInteger("GTOILFLUID"); + tInts[GTPOLLUTION] += event.getData().getInteger("GTPOLLUTION");//Defaults to 0, add stored pollution to data + tInts[GTMETADATA] = LOADED;//mark as = loaded + //store in HASHMAP - chunkData.put(tPos, new int[]{tOil,tPollution,tOilFluid}); + chunkData.put(event.getChunk().getChunkCoordIntPair(), tInts); + }//else if(tInts[0]==1){ + ////Already loaded chunk data + ////DO NOTHING - this chunk data was already loaded and stored in hash map + //} } public static class OreDictEventContainer { -- cgit From c1f85264a09c174b964d16d145e24b16f26dfcbc Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 5 Jun 2017 20:45:15 +0200 Subject: Add missing translation lines. #772 --- src/main/java/gregtech/common/GT_Proxy.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index b79e6691d3..d9f94d0b12 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -502,6 +502,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { break; } } + GT_LanguageManager.writePlaceholderStrings(); } public static long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE; @@ -1267,7 +1268,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aEvent.player.setGameType(GameType.ADVENTURE); aEvent.player.capabilities.allowEdit = false; if (this.mAxeWhenAdventure) { - GT_Utility.sendChatToPlayer(aEvent.player, "It's dangerous to go alone! Take this."); + GT_Utility.sendChatToPlayer(aEvent.player, GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_097", "It's dangerous to go alone! Take this.", false)); aEvent.player.worldObj.spawnEntityInWorld(new EntityItem(aEvent.player.worldObj, aEvent.player.posX, aEvent.player.posY, aEvent.player.posZ, GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.AXE, 1, Materials.Flint, Materials.Wood, null))); } -- cgit From ead3fa6ad717c175b161f2b6b08a42d61abcd265 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 13 Jun 2017 18:57:05 +0200 Subject: meh... --- src/main/java/gregtech/common/GT_Proxy.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index d9f94d0b12..3f8a24ada7 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -202,6 +202,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mAprilFool = false; public boolean mCropNeedBlock = true; public boolean mAMHInteraction = true; + public boolean mForceFreeFace = false; public GT_Proxy() { GameRegistry.registerFuelHandler(this); -- cgit From 9209d0843f61e7e062c50cc66e3f2263635655d5 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 13 Jun 2017 18:58:18 +0200 Subject: Port GT6 timber changes --- src/main/java/gregtech/common/GT_Proxy.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 3f8a24ada7..304978c403 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -38,6 +38,7 @@ import gregtech.common.items.armor.gui.ContainerElectricArmor1; import gregtech.common.items.armor.gui.GuiElectricArmor1; import gregtech.common.items.armor.gui.GuiModularArmor; import gregtech.common.items.armor.gui.InventoryArmor; +import gregtech.common.tools.GT_Tool; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; @@ -69,6 +70,7 @@ import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.world.BlockEvent; @@ -1796,6 +1798,21 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { ////DO NOTHING - this chunk data was already loaded and stored in hash map //} } + + @SubscribeEvent + public void onBlockBreakSpeedEvent(PlayerEvent.BreakSpeed aEvent) + { + if (aEvent.newSpeed > 0.0F) + { + if (aEvent.entityPlayer != null) + { + ItemStack aStack = aEvent.entityPlayer.getCurrentEquippedItem(); + if ((aStack != null) && ((aStack.getItem() instanceof GT_MetaGenerated_Tool))) { + aEvent.newSpeed = ((GT_MetaGenerated_Tool)aStack.getItem()).onBlockBreakSpeedEvent(aEvent.newSpeed, aStack, aEvent.entityPlayer, aEvent.block, aEvent.x, aEvent.y, aEvent.z, (byte)aEvent.metadata, aEvent); + } + } + } + } public static class OreDictEventContainer { public final OreDictionary.OreRegisterEvent mEvent; -- cgit From d1eea59fe744c1b5b2c5dae324b6887f985a6569 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 14 Jun 2017 18:55:26 +1000 Subject: Made the Cleanroom optional. This disables the Low Grav option if the Cleanroom is disabled. --- src/main/java/gregtech/common/GT_Proxy.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 304978c403..a7da28c78e 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -200,6 +200,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mEnableAllMaterials = false; public boolean mEnableAllComponents = false; public boolean mAddGTRecipesToIC2Machines = true; + public boolean mEnableCleanroom = true; public boolean mLowGravProcessing = false; public boolean mAprilFool = false; public boolean mCropNeedBlock = true; -- cgit From 911a80752930d6207fc0b850f3ccf8b3da05b0a5 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 14 Jun 2017 23:51:39 +0200 Subject: pollution smog --- src/main/java/gregtech/common/GT_Proxy.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java/gregtech/common/GT_Proxy.java') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index a7da28c78e..96b957e01c 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -24,6 +24,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Item; import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.net.GT_Packet_Pollution; import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_FluidStack; import gregtech.api.objects.GT_UO_DimensionList; @@ -47,6 +48,7 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -1325,6 +1327,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { aEvent.player.addExhaustion(Math.max(1.0F, tCount / 666.6F)); } } + if (aEvent.player.ticksExisted % 10 == 0) { + int tPollution = 0; + tPollution = GT_Pollution.getPollution(new ChunkCoordIntPair(aEvent.player.chunkCoordX,aEvent.player.chunkCoordZ), aEvent.player.dimension); + if(aEvent.player instanceof EntityPlayerMP)GT_Values.NW.sendToPlayer(new GT_Packet_Pollution(tPollution), (EntityPlayerMP) aEvent.player); + } } } -- cgit