diff options
Diffstat (limited to 'src/main/java/gregtech/common')
3 files changed, 31 insertions, 1 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 33222c03bb..7463893366 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -7,6 +7,7 @@ package gregtech.common; import codechicken.lib.vec.Rotation; import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import gregtech.GT_Mod; @@ -20,16 +21,21 @@ import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.objects.GT_FluidStack; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_PlayedSound; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.entities.GT_Entity_Arrow_Potion; import gregtech.common.render.*; +import gregtech.loaders.misc.GT_Achievements; +import gregtech.nei.NEI_GT_Config; import ic2.api.tile.IWrenchable; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.StatFileWriter; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; @@ -73,6 +79,8 @@ public class GT_Client extends GT_Proxy private final List mMoltenNegB; private final List mMoltenNegA = Arrays.asList(new Object[0]); private long mAnimationTick; + /**This is the place to def the value used below**/ + private long afterSomeTime; private boolean mAnimationDirection; private boolean isFirstClientPlayerTick; private String mMessage; @@ -282,6 +290,18 @@ public class GT_Client extends GT_Proxy @SubscribeEvent public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) { if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) { + /**Something on the lines of this works for recipe visibility toggling**/ + /**yes just change the mHidden thing, rest is done by custom NEI configurer GT_NEI_AssLineHandler**/ + afterSomeTime++; + if(afterSomeTime>=100L){ + afterSomeTime=0; + StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter(); + try { + for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.mRecipeList){ + recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName())); + } + }catch (Exception e){} + } ArrayList<GT_PlayedSound> tList = new ArrayList(); for (Map.Entry<GT_PlayedSound, Integer> tEntry : GT_Utility.sPlayedSoundMap.entrySet()) { if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index d87f6bcc72..e8dfc4615a 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -836,7 +836,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if(tItem==null)System.out.println("addAssemblylineRecipe"+aResearchItem.getDisplayName()); } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{aResearchItem}, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, null, null, aResearchTime, 30, 0); - + GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.addFakeRecipe(false, aInputs, new ItemStack[]{aOutput}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Research result", new Object[0])}, aFluidInputs, null, aDuration, aEUt, 0,true); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt)); return true; } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 7d48752076..af6487a08f 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.generators; +import com.dreammaster.main.MainRegistry; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -63,6 +64,15 @@ public class GT_MetaTileEntity_DieselGenerator return rValue; } + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if(aTick%100==0 && mFluid!=null && mFluid.amount>this.getCapacity()){ + MainRegistry.Logger.error("Dupe Abuse: "+aBaseMetaTileEntity.getOwnerName()+" Coords: "+aBaseMetaTileEntity.getXCoord()+" "+aBaseMetaTileEntity.getYCoord()+" "+aBaseMetaTileEntity.getZCoord(),aBaseMetaTileEntity); + aBaseMetaTileEntity.setToFire(); + } + super.onPostTick(aBaseMetaTileEntity, aTick); + } + public ITexture[] getFront(byte aColor) { return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; } |