From 97d7efcc22b3c05f8631188bad33099cd4ce8c6b Mon Sep 17 00:00:00 2001 From: Muramasa- Date: Mon, 26 Sep 2016 14:03:20 +0100 Subject: [PATCH 1/4] Possible fix for scanner TE error --- .../tileentities/machines/basic/GT_MetaTileEntity_Scanner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index 9187d1fc..88951bfa 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -207,7 +207,7 @@ public class GT_MetaTileEntity_Scanner @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime >= (mMaxProgresstime - 1)) { - if (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")) { + if ((this.mOutputItems[0] != null) && (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); } } From 16fb901529b24d4d1d4aaf64984b72de75fda0c5 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 27 Sep 2016 02:00:19 +0200 Subject: [PATCH 2/4] More Pollution & bugfixes --- .../metatileentity/BaseMetaTileEntity.java | 4 +- .../GT_MetaTileEntity_Hatch_Maintenance.java | 2 +- .../GT_MetaTileEntity_MultiBlockBase.java | 2 +- .../java/gregtech/api/util/GT_Utility.java | 8 +- .../java/gregtech/common/GT_Pollution.java | 73 +++++++++++++++++-- .../GT_MetaTileEntity_DistillationTower.java | 5 +- .../postload/GT_MachineRecipeLoader.java | 11 ++- 7 files changed, 87 insertions(+), 18 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index e2a23e4b..1b3bafca 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -411,7 +411,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE || (getCoverIDAtSide((byte) 5) == 0 && worldObj.getPrecipitationHeight(xCoord + 1, zCoord) - 1 < yCoord)) { if (GregTech_API.sMachineRainExplosions && worldObj.isRaining() && getBiome().rainfall > 0) { if (getRandomNumber(10) == 0) { - GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); + try{GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");}catch(Exception e){} doEnergyExplosion(); } else setOnFire(); } @@ -420,7 +420,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE return; } if (GregTech_API.sMachineThunderExplosions && worldObj.isThundering() && getBiome().rainfall > 0 && getRandomNumber(3) == 0) { - GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather"); + try{GT_Mod.instance.achievements.issueAchievement(this.getWorldObj().getPlayerEntityByName(mOwnerName), "badweather");}catch(Exception e){} doEnergyExplosion(); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java index 552d98f5..049f34df 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java @@ -112,7 +112,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } if (mSolderingTool && aPlayer instanceof EntityPlayerMP) { EntityPlayerMP tPlayer = (EntityPlayerMP) aPlayer; - GT_Mod.instance.achievements.issueAchievement(tPlayer, "maintainance"); + try{GT_Mod.instance.achievements.issueAchievement(tPlayer, "maintainance");}catch(Exception e){} } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 7e45afdd..14c324a8 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -238,7 +238,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) { - GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack); + try{GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack);}catch(Exception e){} addOutput(tStack); } if (mOutputFluids != null && mOutputFluids.length == 1) { diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 34ef3d09..fba405dc 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -860,10 +860,12 @@ public class GT_Utility { return false; } } + ItemStack[] tStack = GT_OreDictUnificator.getStackArray(true, aOutput); + if(tStack==null||(tStack.length>0&>_Utility.areStacksEqual(aInput, tStack[0])))return false; if (tOreName != null) { - aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, GT_OreDictUnificator.getStackArray(true, aOutput))); + aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack)); } else { - aRecipeList.put(new RecipeInputItemStack(copy(aInput), aInput.stackSize), new RecipeOutput(aNBT, GT_OreDictUnificator.getStackArray(true, aOutput))); + aRecipeList.put(new RecipeInputItemStack(copy(aInput), aInput.stackSize), new RecipeOutput(aNBT, tStack)); } return true; } @@ -1741,7 +1743,7 @@ public class GT_Utility { tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName()); } if(aPlayer.capabilities.isCreativeMode){ - ChunkPosition tPos = new ChunkPosition(aX, aY, aZ); + ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); if(GT_Proxy.chunkData.containsKey(tPos)){ int[] tPollution = GT_Proxy.chunkData.get(tPos); if(tPollution.length>1){ diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index feeeafe4..743a1c5c 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -1,28 +1,85 @@ -package gregtech.common; + package gregtech.common; +import java.util.ArrayList; +import java.util.List; + +import gregtech.api.util.GT_Utility; +import net.minecraft.client.Minecraft; import net.minecraft.world.ChunkPosition; +import net.minecraft.world.WorldManager; public class GT_Pollution { -// List list = new ArrayList(chunkData.keySet()); + static List tList = null; + static int loops = 1; public static void onWorldTick(int aTick){ - + if(aTick == 0 || (tList==null && GT_Proxy.chunkData!=null)){ + tList = new ArrayList(GT_Proxy.chunkData.keySet()); + loops = (tList.size()/1200) + 1; + } + if(tList!=null && tList.size() > 0){ + int i = 0; + for(; i < loops ; i++){ + ChunkPosition tPos = tList.get(0); + tList.remove(0); + if(tPos!=null && GT_Proxy.chunkData.containsKey(tPos)){ + int tPollution = GT_Proxy.chunkData.get(tPos)[1]; +// System.out.println("process: "+tPos.chunkPosX+" "+tPos.chunkPosZ+" "+tPollution); + //Reduce pollution in chunk + tPollution = (int)(0.99f*tPollution); + tPollution -= 2000; + if(tPollution<=0){tPollution = 0;}else{ + //Spread Pollution + if(tPollution>50000){ + List tNeighbor = new ArrayList(); + tNeighbor.add(new ChunkPosition(tPos.chunkPosX+1, 1, tPos.chunkPosZ+1)); + tNeighbor.add(new ChunkPosition(tPos.chunkPosX+1, 1, tPos.chunkPosZ-1)); + tNeighbor.add(new ChunkPosition(tPos.chunkPosX-1, 1, tPos.chunkPosZ+1)); + tNeighbor.add(new ChunkPosition(tPos.chunkPosX-1, 1, tPos.chunkPosZ-1)); + for(ChunkPosition tNPos : tNeighbor){ + if(GT_Proxy.chunkData.containsKey(tNPos)){ + int tNPol = GT_Proxy.chunkData.get(tNPos)[1]; + if(tNPol1){ tData[1] += aPollution; } - GT_Proxy.chunkData.replace(aPos, tData); }else{ tData[1] += aPollution; - GT_Proxy.chunkData.put(aPos, tData); + GT_Proxy.chunkData.put(tPos, tData); + } + }catch(Exception e){ + } - } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 493f4407..246df670 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_DistillationTower "1x Output Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any casing)", "1x Energy Hatch (Any casing)", - "Clean Stainless Steel Casings for the rest (26 at least!)"}; + "Clean Stainless Steel Casings for the rest (36 at least!)"}; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -174,7 +174,8 @@ public class GT_MetaTileEntity_DistillationTower for (int i = 0; i < tmpHatches.length; i++) { this.mOutputHatches.add(tmpHatches[i]); } - return tAmount >= 26; + if(this.mMaintenanceHatches.size()!=1)return false; + return tAmount >= 36; } public boolean ignoreController(Block tTileEntity) { diff --git a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java index f70b0b15..8dd70749 100644 --- a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java @@ -1740,7 +1740,7 @@ if(Loader.isModLoaded("Railcraft")){ addProcess(tCrop, Materials.Galena, 100); tCrop = ItemList.Crop_Drop_Aurelia.get(1, new Object[0]); addProcess(tCrop, Materials.Gold, 100); - addProcess(tCrop, Materials.Magnetite, 100); + addProcess(tCrop, Materials.Magnetite, Materials.Gold, 100); // Rare Metals Line tCrop = ItemList.Crop_Drop_Bauxite.get(1, new Object[0]); @@ -1801,6 +1801,15 @@ if(Loader.isModLoaded("Railcraft")){ GT_ModHandler.addExtractionRecipe(tCrop, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1)); } } + + public void addProcess(ItemStack tCrop, Materials aMaterial, Materials aMaterialOut, int chance){ + if(GT_Mod.gregtechproxy.mNerfedCombs){ + GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(9, tCrop), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1), Materials.Water.getFluid(1000), aMaterialOut.mOreByProducts.isEmpty() ? null : aMaterialOut.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterialOut, 4), 96, 24); + GT_Values.RA.addAutoclaveRecipe(GT_Utility.copyAmount(16, tCrop), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()+9)/10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 1), 10000, (int) (aMaterial.getMass() * 128), 384); + }else{ + GT_ModHandler.addExtractionRecipe(tCrop, GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial, 1)); +} + } private void run2(){ GT_Values.RA.addAssemblylineRecipe(ItemList.Electric_Motor_IV.get(1, new Object(){}),144000,new ItemStack[]{ From 7074a513ab63fb6137da46d1b0a57050a342bacb Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 27 Sep 2016 16:35:03 +0200 Subject: [PATCH 3/4] Pollution configs and first effects --- src/main/java/gregtech/GT_Mod.java | 5 + .../java/gregtech/api/util/GT_Utility.java | 4 +- .../java/gregtech/common/GT_Pollution.java | 98 +++++++++++++++++-- src/main/java/gregtech/common/GT_Proxy.java | 22 +++-- 4 files changed, 113 insertions(+), 16 deletions(-) diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 39822f06..a9930bff 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -235,6 +235,11 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mArcSmeltIntoAnnealed = tMainConfig.get(aTextGeneral, "ArcSmeltIntoAnnealedWrought", true).getBoolean(true); gregtechproxy.mMagneticraftRecipes = tMainConfig.get(aTextGeneral, "EnableMagneticraftSupport", true).getBoolean(true); gregtechproxy.mMagneticraftBonusOutputPercent = tMainConfig.get(aTextGeneral, "MagneticraftBonusOutputPercent", 100.0f).getDouble(); + gregtechproxy.mPollution = tMainConfig.get("Pollution", "EnablePollution", true).getBoolean(true); + gregtechproxy.mPollutionSmogLimit = tMainConfig.get("Pollution", "SmogLimit", 500000).getInt(500000); + gregtechproxy.mPollutionPoisonLimit = tMainConfig.get("Pollution", "PoisonLimit", 750000).getInt(750000); + gregtechproxy.mPollutionVegetationLimit = tMainConfig.get("Pollution", "VegetationLimit", 1000000).getInt(1000000); + gregtechproxy.mPollutionSourRainLimit = tMainConfig.get("Pollution", "SourRainLimit", 2000000).getInt(2000000); GregTech_API.mOutputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "OutputRF", true); GregTech_API.mInputRF = GregTech_API.sOPStuff.get(ConfigCategories.general, "InputRF", false); diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index fba405dc..55afca61 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -1742,7 +1742,7 @@ public class GT_Utility { FluidStack tFluid = getUndergroundOil(aWorld, aX, aZ); tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName()); } - if(aPlayer.capabilities.isCreativeMode){ +// if(aPlayer.capabilities.isCreativeMode){ ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); if(GT_Proxy.chunkData.containsKey(tPos)){ int[] tPollution = GT_Proxy.chunkData.get(tPos); @@ -1752,7 +1752,7 @@ public class GT_Utility { tList.add("No Pollution in Chunk"); } } - } +// } try { if (tBlock instanceof IDebugableBlock) { diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index 743a1c5c..19784cae 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -3,21 +3,35 @@ import java.util.ArrayList; import java.util.List; +import gregtech.GT_Mod; +import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Utility; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; import net.minecraft.world.WorldManager; +import net.minecraftforge.common.DimensionManager; public class GT_Pollution { static List tList = null; static int loops = 1; + static XSTR tRan = new XSTR(); public static void onWorldTick(int aTick){ + if(!GT_Mod.gregtechproxy.mPollution)return; if(aTick == 0 || (tList==null && GT_Proxy.chunkData!=null)){ tList = new ArrayList(GT_Proxy.chunkData.keySet()); loops = (tList.size()/1200) + 1; +// System.out.println("new Pollution loop"+aTick); } if(tList!=null && tList.size() > 0){ int i = 0; @@ -34,14 +48,14 @@ public class GT_Pollution { //Spread Pollution if(tPollution>50000){ List tNeighbor = new ArrayList(); - tNeighbor.add(new ChunkPosition(tPos.chunkPosX+1, 1, tPos.chunkPosZ+1)); - tNeighbor.add(new ChunkPosition(tPos.chunkPosX+1, 1, tPos.chunkPosZ-1)); - tNeighbor.add(new ChunkPosition(tPos.chunkPosX-1, 1, tPos.chunkPosZ+1)); - tNeighbor.add(new ChunkPosition(tPos.chunkPosX-1, 1, tPos.chunkPosZ-1)); + tNeighbor.add(new ChunkPosition(tPos.chunkPosX+1, 1, tPos.chunkPosZ)); + tNeighbor.add(new ChunkPosition(tPos.chunkPosX-1, 1, tPos.chunkPosZ)); + tNeighbor.add(new ChunkPosition(tPos.chunkPosX, 1, tPos.chunkPosZ+1)); + tNeighbor.add(new ChunkPosition(tPos.chunkPosX, 1, tPos.chunkPosZ-1)); for(ChunkPosition tNPos : tNeighbor){ if(GT_Proxy.chunkData.containsKey(tNPos)){ int tNPol = GT_Proxy.chunkData.get(tNPos)[1]; - if(tNPol GT_Mod.gregtechproxy.mPollutionSmogLimit){ + +// Poison effects + if(tPollution > GT_Mod.gregtechproxy.mPollutionPoisonLimit){ + AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX*16, 0, tPos.chunkPosZ*16, tPos.chunkPosX*16+16, 256, tPos.chunkPosZ*16+16); + List tEntitys = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB(EntityLiving.class, chunk); + for(EntityLiving tEnt : tEntitys){ + if(tRan.nextInt(tPollution/25000) > 20){ + tEnt.addPotionEffect(new PotionEffect(Potion.poison.id, tPollution/25000, 1)); + } + } +// killing plants + if(tPollution > GT_Mod.gregtechproxy.mPollutionVegetationLimit){ + int f = 20; + for(;f<(tPollution/25000);f++){ + int x =tPos.chunkPosX*16+(tRan.nextInt(16));; + int y =60 +(-f+tRan.nextInt(f*2+1)); + int z =tPos.chunkPosZ*16+(tRan.nextInt(16)); + damageBlock(x, y, z, tPollution > GT_Mod.gregtechproxy.mPollutionSourRainLimit); + }}}} } } } } } + public static void damageBlock(int x, int y, int z, boolean sourRain){ + World world = DimensionManager.getWorld(0); + if (world.isRemote) return; + Block tBlock = world.getBlock(x, y, z); + int tMeta = world.getBlockMetadata(x, y, z); + if (tBlock == Blocks.air || tBlock == Blocks.stone || tBlock == Blocks.sand|| tBlock == Blocks.deadbush)return; + + if (tBlock == Blocks.leaves || tBlock == Blocks.leaves2 || tBlock.getMaterial() == Material.leaves) + world.setBlockToAir(x, y, z); + if (tBlock == Blocks.reeds) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.tallgrass) + world.setBlock(x, y, z, Blocks.deadbush); + if (tBlock == Blocks.vine) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.waterlily || tBlock == Blocks.wheat || tBlock == Blocks.cactus || + tBlock.getMaterial() == Material.cactus || tBlock == Blocks.melon_block || tBlock == Blocks.melon_stem) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.red_flower || tBlock == Blocks.yellow_flower || tBlock == Blocks.carrots || + tBlock == Blocks.potatoes || tBlock == Blocks.pumpkin || tBlock == Blocks.pumpkin_stem) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.sapling || tBlock.getMaterial() == Material.plants) + world.setBlock(x, y, z, Blocks.deadbush); + if (tBlock == Blocks.cocoa) { + tBlock.dropBlockAsItem(world, x, y, z, tMeta, 0); + world.setBlockToAir(x, y, z); + } + if (tBlock == Blocks.mossy_cobblestone) + world.setBlock(x, y, z, Blocks.cobblestone); + if (tBlock == Blocks.grass || tBlock.getMaterial() == Material.grass ) + world.setBlock(x, y, z, Blocks.dirt); + if(tBlock == Blocks.farmland || tBlock == Blocks.dirt){ + world.setBlock(x, y, z, Blocks.sand); + } + + if(sourRain && world.isRaining() && (tBlock == Blocks.stone || tBlock == Blocks.gravel || tBlock == Blocks.cobblestone) && + world.getBlock(x, y+1, z) == Blocks.air && world.canBlockSeeTheSky(x, y, z)){ + if(tBlock == Blocks.stone){world.setBlock(x, y, z, Blocks.cobblestone); } + else if(tBlock == Blocks.cobblestone){world.setBlock(x, y, z, Blocks.gravel); } + else if(tBlock == Blocks.gravel){world.setBlock(x, y, z, Blocks.sand); } + } + } + public static void addPollution(ChunkPosition aPos, int aPollution){ + if(!GT_Mod.gregtechproxy.mPollution)return; try{ ChunkPosition tPos = new ChunkPosition(aPos.chunkPosX/16, 1, aPos.chunkPosZ/16); // System.out.println("add pollution x: "+ tPos.chunkPosX +" z: " + tPos.chunkPosZ +" poll: "+aPollution); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 7ffa49c9..41407c38 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -149,24 +149,29 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mAE2Integration = true; public boolean mArcSmeltIntoAnnealed = true; public boolean mMagneticraftRecipes = true; + private boolean isFirstServerWorldTick = true; + private boolean mOreDictActivated = false; + public boolean mChangeHarvestLevels=false; + public boolean mNerfedCombs = true; + public boolean mGTBees = true; + public boolean mHideUnusedOres = true; + public boolean mHideRecyclingRecipes = true; + public boolean mPollution = true; public int mSkeletonsShootGTArrows = 16; public int mMaxEqualEntitiesAtOneSpot = 3; public int mFlintChance = 30; public int mItemDespawnTime = 6000; public int mUpgradeCount = 4; - public boolean mGTBees = true; - private World mUniverse = null; - private boolean isFirstServerWorldTick = true; - private boolean mOreDictActivated = false; public int[] mHarvestLevel= new int[1000]; public int mGraniteHavestLevel=3; public int mMaxHarvestLevel=7; - public boolean mChangeHarvestLevels=false; - public boolean mNerfedCombs = true; public int mWireHeatingTicks = 4; - public boolean mHideUnusedOres = true; - public boolean mHideRecyclingRecipes = true; + public int mPollutionSmogLimit = 500000; + public int mPollutionPoisonLimit = 750000; + public int mPollutionVegetationLimit = 1000000; + public int mPollutionSourRainLimit = 2000000; public double mMagneticraftBonusOutputPercent = 100.0d; + private World mUniverse = null; private final String aTextThermalExpansion = "ThermalExpansion"; private final String aTextRailcraft = "Railcraft"; private final String aTextTwilightForest = "TwilightForest"; @@ -1410,6 +1415,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } } + if(aEvent.world.provider.dimensionId==0) GT_Pollution.onWorldTick((int) (aEvent.world.getTotalWorldTime() % 1200)); } } From a6216b8cf0e514c6488aa5f0aff3a6998d8879f7 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 27 Sep 2016 18:11:19 +0200 Subject: [PATCH 4/4] Count pipe transfers on input not output side --- .../metatileentity/implementations/GT_MetaPipeEntity_Item.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java index 0a3ee8d5..e08ae2fb 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java @@ -210,7 +210,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE tPipeList.add(tTileEntity); while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity)) for (IMetaTileEntityItemPipe tPipe : tPipeList) - if (!tPipe.incrementTransferCounter(1)) temp = true; + if (!tPipe.incrementTransferCounter(1)) temp = false; } } }