From 101e5170d7d305bbd88274998f8fcfceadfaf697 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 14:23:41 +0200 Subject: Readd pollution done --- .../implementations/GT_MetaTileEntity_BasicGenerator.java | 11 +++++++++++ .../implementations/GT_MetaTileEntity_Hatch_Muffler.java | 3 +++ 2 files changed, 14 insertions(+) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index bbb16a8adb..e8c8ce5d98 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -5,10 +5,12 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.common.GT_Pollution; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.world.ChunkPosition; import net.minecraftforge.fluids.FluidStack; import java.util.Collection; @@ -177,6 +179,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10 == 0) { + long tProducedEU = 0; if (mFluid == null) { if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) { mInventory[getStackDisplaySlot()] = null; @@ -190,6 +193,7 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) { long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) + tProducedEU = tFluidAmountToUse * tFuelValue; mFluid.amount -= tFluidAmountToUse * tConsumed; } } @@ -200,14 +204,21 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); + tProducedEU = tFuelValue; } } } + if(tProducedEU>0&&getPollution()>0){ + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), + (int) ((tProducedEU * getPollution()/500)+1)); + } } if (aBaseMetaTileEntity.isServerSide()) aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); } + + public abstract int getPollution(); public abstract GT_Recipe_Map getRecipes(); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index 8d6a3c0e81..b092df1e0c 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -5,8 +5,10 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.world.ChunkPosition; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { @@ -58,6 +60,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { } public boolean polluteEnvironment() { + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 1000 - (95*mTier)); return (mTier > 1 && getBaseMetaTileEntity().getRandomNumber(mTier) != 0) || getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing()); } -- cgit From 994896d763b5dd69a913fb7a30b538e8fefdd2ca Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 15:06:42 +0200 Subject: Scanner cleanup --- .../implementations/GT_MetaTileEntity_BasicMachine.java | 4 ++-- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index f042a69f71..417b9cc81b 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -690,8 +690,8 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B return new String[]{ EnumChatFormatting.BLUE + mNEIName + EnumChatFormatting.RESET, "Progress:", - EnumChatFormatting.GREEN + Integer.toString(mProgresstime) + EnumChatFormatting.RESET +" ticks / "+ - EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime) + EnumChatFormatting.RESET +" ticks", + EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", "Stored Energy:", EnumChatFormatting.GREEN + Long.toString(getBaseMetaTileEntity().getStoredEU()) + EnumChatFormatting.RESET +" EU / "+ EnumChatFormatting.YELLOW + Long.toString(getBaseMetaTileEntity().getEUCapacity()) + EnumChatFormatting.RESET +" EU", 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 31306647f5..313e6c5234 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 @@ -840,8 +840,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { public String[] getInfoData() { return new String[]{ "Progress:", - EnumChatFormatting.GREEN + Integer.toString(mProgresstime) + EnumChatFormatting.RESET +" ticks / "+ - EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime) + EnumChatFormatting.RESET +" ticks", + EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", "Stored Energy:", EnumChatFormatting.GREEN + Long.toString(getBaseMetaTileEntity().getStoredEU()) + EnumChatFormatting.RESET +" EU / "+ EnumChatFormatting.YELLOW + Long.toString(getBaseMetaTileEntity().getEUCapacity()) + EnumChatFormatting.RESET +" EU", -- cgit From 7718e97e09f898054f0cdab6ee44983da78203c0 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 27 Sep 2016 02:00:19 +0200 Subject: Pollution bloodasp1 --- .../implementations/GT_MetaTileEntity_Hatch_Maintenance.java | 5 +---- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 ee45c536b5..049f34dfba 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,10 +112,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } if (mSolderingTool && aPlayer instanceof EntityPlayerMP) { EntityPlayerMP tPlayer = (EntityPlayerMP) aPlayer; - try { - GT_Mod.instance.achievements.issueAchievement(tPlayer, "maintainance"); - } catch (Exception e) { - } + 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 313e6c5234..89349d7c0e 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 @@ -241,10 +241,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) { - try { - GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack); - } catch (Exception e) { - } + try{GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack);}catch(Exception e){} addOutput(tStack); } if (mOutputFluids != null && mOutputFluids.length == 1) { @@ -417,7 +414,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { if (mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { NBTTagCompound tNBT = mInventory[1].getTagCompound(); if (tNBT != null) { - NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents"); + NBTTagCompound tNBT2 = tNBT.getCompoundTag("GT.CraftingComponents");//tNBT2 dont use out if if (!tNBT.getBoolean("mDis")) { tNBT2 = new NBTTagCompound(); Materials tMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[1]); -- cgit From 52e01b866691ab635f6c9ad102455bbcdcfb01ce Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 16:08:31 +0200 Subject: Nerf Muffler --- .../metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index b092df1e0c..b2402bb699 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -60,7 +60,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { } public boolean polluteEnvironment() { - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 1000 - (95*mTier)); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 1000 - (60*mTier)); return (mTier > 1 && getBaseMetaTileEntity().getRandomNumber(mTier) != 0) || getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing()); } -- cgit From 59631856e95b981dbf9ec39a88244c9abb0b1313 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 16:48:08 +0200 Subject: Pollution buff, and another scanner change --- .../metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index b2402bb699..cf7378e845 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -12,7 +12,7 @@ import net.minecraft.world.ChunkPosition; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Pollution might come later)"); + super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Might cause acidic rains and poisoning.)"); } public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { -- cgit From 97cafed13b0e1223fdecc3bd29df43ed1beafb2b Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 20:14:14 +0200 Subject: Numbers Crunched For Simulated Pollution --- .../metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index cf7378e845..b8ec41ec6a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -60,7 +60,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { } public boolean polluteEnvironment() { - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 1000 - (60*mTier)); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 10000 - (600*mTier)); return (mTier > 1 && getBaseMetaTileEntity().getRandomNumber(mTier) != 0) || getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing()); } -- cgit From 3198eec49813f2f662d62c888c9752c8900de32f Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 20:27:56 +0200 Subject: Pollution info on muffler --- .../implementations/GT_MetaTileEntity_Hatch_Muffler.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index b8ec41ec6a..35d63853ed 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -8,6 +8,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.ChunkPosition; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { @@ -60,7 +61,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { } public boolean polluteEnvironment() { - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 10000 - (600*mTier)); + GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 10000 - (600*(mTier-1))); return (mTier > 1 && getBaseMetaTileEntity().getRandomNumber(mTier) != 0) || getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing()); } @@ -73,4 +74,11 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } + + @Override + public String[] getInfoData() { + return new String[]{ + "Reduces pollution by: "+ EnumChatFormatting.RED + (6*(mTier-1))+ EnumChatFormatting.RESET+" %" + }; + } } -- cgit From dab144779897224754a9938073a5bf005ae5f8a4 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 20:28:34 +0200 Subject: Derp, changed color --- .../metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index 35d63853ed..46de5430e2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -78,7 +78,7 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { return new String[]{ - "Reduces pollution by: "+ EnumChatFormatting.RED + (6*(mTier-1))+ EnumChatFormatting.RESET+" %" + "Reduces pollution by: "+ EnumChatFormatting.GREEN + (6*(mTier-1))+ EnumChatFormatting.RESET+" %" }; } } -- cgit From 1c4d6851c22eed24e23cecf611649281f3906770 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 20:42:52 +0200 Subject: Better balance of pollution, adjusted timer --- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 89349d7c0e..38133b7b9d 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 @@ -343,7 +343,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { public abstract int getMaxEfficiency(ItemStack aStack); /** - * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pullution Block) + * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pollution Block) */ public abstract int getPollutionPerTick(ItemStack aStack); -- cgit From 53e33d976a44d9a02e4913492eca7461cc85ffb1 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 21:49:01 +0200 Subject: Added pollution info --- .../implementations/GT_MetaTileEntity_Hatch_Muffler.java | 5 +++++ .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index 46de5430e2..ce507ff871 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -81,4 +81,9 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { "Reduces pollution by: "+ EnumChatFormatting.GREEN + (6*(mTier-1))+ EnumChatFormatting.RESET+" %" }; } + + public int getPollutionReduction() { + return 6*(mTier-1); + } + } 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 38133b7b9d..fb16e1be47 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 @@ -835,6 +835,15 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @Override public String[] getInfoData() { + String mMufflerInfo=""; + int mPollutionReduction=0; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + mPollutionReduction+=tHatch.getPollutionReduction(); + } + } + if(mPollutionReduction>0)mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"; + return new String[]{ "Progress:", EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ @@ -849,7 +858,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { "Problems: "+ EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ " Efficiency: "+ - EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %"}; + EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", + mMufflerInfo + }; } @Override -- cgit From 2d2fecf6a720dc2829b36d1e46e66a2107e8d22c Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 22:00:32 +0200 Subject: This way is better --- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 fb16e1be47..6be792c899 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 @@ -842,7 +842,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { mPollutionReduction+=tHatch.getPollutionReduction(); } } - if(mPollutionReduction>0)mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"; + mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"; return new String[]{ "Progress:", -- cgit From 0effc7b7706637cc3d7aa8eea8f658a86ecf2280 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 2 Oct 2016 22:08:15 +0200 Subject: Optimized scanner a bit --- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 6be792c899..5303d0d244 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 @@ -835,14 +835,12 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @Override public String[] getInfoData() { - String mMufflerInfo=""; int mPollutionReduction=0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { if (isValidMetaTileEntity(tHatch)) { mPollutionReduction+=tHatch.getPollutionReduction(); } } - mMufflerInfo="Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"; return new String[]{ "Progress:", @@ -859,7 +857,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ " Efficiency: "+ EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", - mMufflerInfo + "Pollution reduced by: "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" }; } -- cgit From f87d0167677c43ea2fa8124d9c82839b0c98c624 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 3 Oct 2016 12:09:42 +0200 Subject: Pollution changes --- .../implementations/GT_MetaTileEntity_Hatch_Muffler.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index ce507ff871..1bb1e6fa48 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -13,7 +13,7 @@ import net.minecraft.world.ChunkPosition; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Might cause acidic rains and poisoning.)"); + super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Might cause acidic rains and poisoning)"); } public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -75,12 +75,12 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { return false; } - @Override - public String[] getInfoData() { - return new String[]{ - "Reduces pollution by: "+ EnumChatFormatting.GREEN + (6*(mTier-1))+ EnumChatFormatting.RESET+" %" - }; - } + //@Override + //public String[] getInfoData() { + // return new String[]{ + // "Reduces pollution by: "+ EnumChatFormatting.GREEN + (6*(mTier-1))+ EnumChatFormatting.RESET+" %" + // }; + //} public int getPollutionReduction() { return 6*(mTier-1); -- cgit From 0eca98c112ff6e0f174f8702ebc69b09e2470099 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 3 Oct 2016 12:13:20 +0200 Subject: Not working particle spawning need to move it --- .../GT_MetaTileEntity_MultiBlockBase.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 5303d0d244..f6c1027a72 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 @@ -10,12 +10,15 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.XSTR; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; import gregtech.common.items.GT_MetaGenerated_Tool_01; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -191,6 +194,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + //if (this.mMachine && aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { + // pollutionParticles(aBaseMetaTileEntity); + //} if (aBaseMetaTileEntity.isServerSide()) { if (mEfficiency < 0) mEfficiency = 0; if (--mUpdate == 0 || --mStartUpCheck == 0) { @@ -305,6 +311,24 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { return mPollution < 10000; } + //MAKE THE POLLUTION ROLL!!! + public void pollutionParticles(IGregTechTileEntity aBaseMetaTileEntity){ + for (MetaTileEntity tTileEntity : mMufflerHatches) { + IGregTechTileEntity muffler = tTileEntity.getBaseMetaTileEntity(); + byte mufflerFront = muffler.getFrontFacing(); + aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", muffler.getOffsetX(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetY(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetZ(mufflerFront, 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); + } + if(!GT_Mod.gregtechproxy.mPollution)return; + if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>GT_Mod.gregtechproxy.mPollutionSmogLimit){ + for (MetaTileEntity tTileEntity : mMufflerHatches) { + IGregTechTileEntity muffler = tTileEntity.getBaseMetaTileEntity(); + byte mufflerFront = muffler.getFrontFacing(); + aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", muffler.getOffsetX(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetY(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetZ(mufflerFront, 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", muffler.getOffsetX(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetY(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetZ(mufflerFront, 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); + } + } + } + /** * Called every tick the Machine runs */ -- cgit From e611809fdd404d9f8afd5db68bd1e637778434d6 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 3 Oct 2016 12:18:27 +0200 Subject: added todos --- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 f6c1027a72..959c96a254 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 @@ -194,6 +194,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + //TODO //if (this.mMachine && aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { // pollutionParticles(aBaseMetaTileEntity); //} @@ -311,7 +312,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { return mPollution < 10000; } - //MAKE THE POLLUTION ROLL!!! + //MAKE THE POLLUTION ROLL!!! TODO public void pollutionParticles(IGregTechTileEntity aBaseMetaTileEntity){ for (MetaTileEntity tTileEntity : mMufflerHatches) { IGregTechTileEntity muffler = tTileEntity.getBaseMetaTileEntity(); -- cgit From 5e20833305cd7ca8acf7a319ed179c4e70939cf9 Mon Sep 17 00:00:00 2001 From: Technus Date: Wed, 5 Oct 2016 14:35:55 +0200 Subject: Might be better attempt to make it work... --- .../GT_MetaTileEntity_MultiBlockBase.java | 37 ++++++++++++++-------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 959c96a254..8a53a0510a 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 @@ -10,7 +10,6 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.XSTR; @@ -25,12 +24,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; -import org.apache.commons.lang3.ArrayUtils; - import static gregtech.api.enums.GT_Values.V; public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @@ -194,8 +193,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - //TODO - //if (this.mMachine && aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { + //TODO FIX + // (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { // pollutionParticles(aBaseMetaTileEntity); //} if (aBaseMetaTileEntity.isServerSide()) { @@ -312,20 +311,32 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { return mPollution < 10000; } - //MAKE THE POLLUTION ROLL!!! TODO + //MAKE THE POLLUTION ROLL!!! TODO Fix? public void pollutionParticles(IGregTechTileEntity aBaseMetaTileEntity){ + int xPos; + int yPos; + int zPos; + IGregTechTileEntity muffler; + World aWorld =aBaseMetaTileEntity.getWorld(); for (MetaTileEntity tTileEntity : mMufflerHatches) { - IGregTechTileEntity muffler = tTileEntity.getBaseMetaTileEntity(); - byte mufflerFront = muffler.getFrontFacing(); - aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", muffler.getOffsetX(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetY(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetZ(mufflerFront, 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); + muffler = tTileEntity.getBaseMetaTileEntity(); + xPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetX+muffler.getXCoord(); + yPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetY+muffler.getYCoord(); + zPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetZ+muffler.getZCoord(); + System.out.print("x:"+xPos); + System.out.print("y:"+yPos); + System.out.print("z:"+zPos); + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); } if(!GT_Mod.gregtechproxy.mPollution)return; if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>GT_Mod.gregtechproxy.mPollutionSmogLimit){ for (MetaTileEntity tTileEntity : mMufflerHatches) { - IGregTechTileEntity muffler = tTileEntity.getBaseMetaTileEntity(); - byte mufflerFront = muffler.getFrontFacing(); - aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", muffler.getOffsetX(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetY(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetZ(mufflerFront, 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); - aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", muffler.getOffsetX(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetY(mufflerFront, 1) + (new XSTR()).nextFloat(), muffler.getOffsetZ(mufflerFront, 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); + muffler = tTileEntity.getBaseMetaTileEntity(); + xPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetX+muffler.getXCoord(); + yPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetY+muffler.getYCoord(); + zPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetZ+muffler.getZCoord(); + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); } } } -- cgit From 8b9fdcf4f61582c444e801c107adacc59a64dd0f Mon Sep 17 00:00:00 2001 From: Technus Date: Fri, 7 Oct 2016 18:08:46 +0200 Subject: Machine code changes from bloodasp code --- .../metatileentity/implementations/GT_MetaPipeEntity_Cable.java | 5 ++--- .../implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java | 7 ++++--- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java index f5993c9dc8..9837d3c43f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Cable.java @@ -77,8 +77,7 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { if (!mInsulated) - return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )}; - + return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, mMaterial.mRGBa) )}; if (aConnected) { float tThickNess = getThickNess(); if (tThickNess < 0.37F) @@ -289,4 +288,4 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile public void loadNBTData(NBTTagCompound aNBT) { // } -} \ No newline at end of file +} diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java index 1362d9581a..1533c56320 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java @@ -1,7 +1,5 @@ package gregtech.api.metatileentity.implementations; -import java.util.Random; - import gregtech.api.enums.*; import gregtech.api.gui.GT_Container_BasicMachine; import gregtech.api.gui.GT_GUIContainer_BasicMachine; @@ -19,6 +17,9 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.util.Locale; +import java.util.Random; + import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.W; @@ -35,7 +36,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ private final boolean mSharedTank, mRequiresFluidForFiltering; private final byte mGUIParameterA, mGUIParameterB; public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { - super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM"))}); + super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM"))}); mSharedTank = aSharedTank; mTankCapacity = aTankCapacity; mSpecialEffect = aSpecialEffect; 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 8a53a0510a..3c486a50da 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 @@ -379,7 +379,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { public abstract int getMaxEfficiency(ItemStack aStack); /** - * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pollution Block) + * Gets the pollution this Device outputs to a Muffler per tick (10000 = one Pullution Block) */ public abstract int getPollutionPerTick(ItemStack aStack); -- cgit From be22a87f84e020f0f396edfd148ef9070c4631c0 Mon Sep 17 00:00:00 2001 From: Technus Date: Sat, 8 Oct 2016 09:58:24 +0200 Subject: Optimize imports (Intelli J) --- .../implementations/GT_MetaTileEntity_BasicGenerator.java | 2 +- .../metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java | 1 - .../implementations/GT_MetaTileEntity_TieredMachineBlock.java | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index e8c8ce5d98..c583187c6f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -5,8 +5,8 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.common.GT_Pollution; import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index 1bb1e6fa48..6ea0304509 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -8,7 +8,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.ChunkPosition; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java index 54cede85c3..5355892d44 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java @@ -1,6 +1,5 @@ package gregtech.api.metatileentity.implementations; -import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; import gregtech.api.metatileentity.MetaTileEntity; -- cgit From 36752e13336a4759b5f208a3da5fcfd1b1034f17 Mon Sep 17 00:00:00 2001 From: Technus Date: Sat, 8 Oct 2016 14:29:42 +0200 Subject: Some another attempt --- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 3c486a50da..d206e1a125 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 @@ -25,6 +25,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -194,7 +195,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { //TODO FIX - // (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { + //if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { // pollutionParticles(aBaseMetaTileEntity); //} if (aBaseMetaTileEntity.isServerSide()) { @@ -313,14 +314,16 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { //MAKE THE POLLUTION ROLL!!! TODO Fix? public void pollutionParticles(IGregTechTileEntity aBaseMetaTileEntity){ + World aWorld =DimensionManager.getWorld(aBaseMetaTileEntity.getWorld().provider.dimensionId); + //World aWorld=aBaseMetaTileEntity.getWorld(); + if(!aWorld.isRemote)return; int xPos; int yPos; int zPos; IGregTechTileEntity muffler; - World aWorld =aBaseMetaTileEntity.getWorld(); for (MetaTileEntity tTileEntity : mMufflerHatches) { muffler = tTileEntity.getBaseMetaTileEntity(); - xPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetX+muffler.getXCoord(); + xPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetX+muffler.getXCoord();//TODO optimize? yPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetY+muffler.getYCoord(); zPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetZ+muffler.getZCoord(); System.out.print("x:"+xPos); -- cgit From b44172b92f2de3cb2b5fcdc205755ae14ff063d5 Mon Sep 17 00:00:00 2001 From: Technus Date: Thu, 13 Oct 2016 13:13:34 +0200 Subject: another fail --- .../GT_MetaTileEntity_Hatch_Muffler.java | 21 +++++++++++++- .../GT_MetaTileEntity_MultiBlockBase.java | 32 ++++------------------ 2 files changed, 25 insertions(+), 28 deletions(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index 6ea0304509..9a0adf26c5 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -1,18 +1,22 @@ package gregtech.api.metatileentity.implementations; +import gregtech.GT_Mod; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.objects.XSTR; import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Might cause acidic rains and poisoning)"); + super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Might cause ... things)"); } public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -85,4 +89,19 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { return 6*(mTier-1); } + public void pollutionParticles(){ + IGregTechTileEntity aMuffler=this.getBaseMetaTileEntity(); + World aWorld=aMuffler.getWorld(); + ForgeDirection aDir=ForgeDirection.getOrientation(aMuffler.getFrontFacing()); + int xPos=aDir.offsetX+aMuffler.getXCoord(); + int yPos=aDir.offsetX+aMuffler.getYCoord(); + int zPos=aDir.offsetX+aMuffler.getZCoord(); + + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); + if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>= GT_Mod.gregtechproxy.mPollutionSmogLimit) { + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); + } + } + } 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 d206e1a125..64364b1f3a 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 @@ -196,7 +196,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { //TODO FIX //if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { - // pollutionParticles(aBaseMetaTileEntity); + pollutionParticles(aBaseMetaTileEntity); //} if (aBaseMetaTileEntity.isServerSide()) { if (mEfficiency < 0) mEfficiency = 0; @@ -314,33 +314,11 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { //MAKE THE POLLUTION ROLL!!! TODO Fix? public void pollutionParticles(IGregTechTileEntity aBaseMetaTileEntity){ - World aWorld =DimensionManager.getWorld(aBaseMetaTileEntity.getWorld().provider.dimensionId); - //World aWorld=aBaseMetaTileEntity.getWorld(); + //World aWorld =DimensionManager.getWorld(aBaseMetaTileEntity.getWorld().provider.dimensionId); + World aWorld=aBaseMetaTileEntity.getWorld(); if(!aWorld.isRemote)return; - int xPos; - int yPos; - int zPos; - IGregTechTileEntity muffler; - for (MetaTileEntity tTileEntity : mMufflerHatches) { - muffler = tTileEntity.getBaseMetaTileEntity(); - xPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetX+muffler.getXCoord();//TODO optimize? - yPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetY+muffler.getYCoord(); - zPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetZ+muffler.getZCoord(); - System.out.print("x:"+xPos); - System.out.print("y:"+yPos); - System.out.print("z:"+zPos); - aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); - } - if(!GT_Mod.gregtechproxy.mPollution)return; - if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>GT_Mod.gregtechproxy.mPollutionSmogLimit){ - for (MetaTileEntity tTileEntity : mMufflerHatches) { - muffler = tTileEntity.getBaseMetaTileEntity(); - xPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetX+muffler.getXCoord(); - yPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetY+muffler.getYCoord(); - zPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetZ+muffler.getZCoord(); - aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); - aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D); - } + for (GT_MetaTileEntity_Hatch_Muffler tTileEntity : mMufflerHatches) { + tTileEntity.pollutionParticles(); } } -- cgit From b9b08ce9c4c5f9d7b5b1b47e703805f9355af7a9 Mon Sep 17 00:00:00 2001 From: Technus Date: Fri, 14 Oct 2016 11:08:41 +0200 Subject: disable fail particles --- .../implementations/GT_MetaTileEntity_MultiBlockBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') 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 64364b1f3a..9b75551f1e 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 @@ -196,7 +196,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { //TODO FIX //if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { - pollutionParticles(aBaseMetaTileEntity); + // pollutionParticles(aBaseMetaTileEntity); //} if (aBaseMetaTileEntity.isServerSide()) { if (mEfficiency < 0) mEfficiency = 0; -- cgit From e13dd8a2574048e6f6f49af45a0eb4e32fe6c614 Mon Sep 17 00:00:00 2001 From: Technus Date: Sat, 15 Oct 2016 19:50:19 +0200 Subject: Neat features added to batt buffers and chargers --- .../implementations/GT_MetaTileEntity_BasicBatteryBuffer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java index 5596c5f429..275baeca81 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java @@ -48,7 +48,7 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier ITexture[][][] rTextures = new ITexture[2][17][]; for (byte i = -1; i < 16; i++) { rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1]}; - rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; + rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], mInventory.length==16 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier] : mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] : Textures.Bl