Everything posted by onContentStop
-
[1.7.10] Checking all armor a player is wearing at a given tick
Thanks for replying, but I realized I was being unnecessarily stupid. I made a general Armor class and overrode onArmorTick() there to check each individual slot. Here's the code in progress: @Override public void onArmorTick (World world, EntityPlayer player, ItemStack stack) { int aAmt = 0;//amethyst = regen int aCap = 3; int sAmt = 0;//sapphire = resist int sCap = 3; int rAmt = 0;//ruby = strength int rCap = 3; int tAmt = 0;//topaz = haste int tCap = 3; //checks for amethyst if(player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem().equals(oncontentstop.amethystBoots)) aAmt++; if (player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem().equals(oncontentstop.amethystLeggings)) aAmt++; if(player.getCurrentArmor(2) != null && player.getCurrentArmor(2).getItem().equals(oncontentstop.amethystChestplate)) aAmt++; if(player.getCurrentArmor(3) != null && player.getCurrentArmor(3).getItem().equals(oncontentstop.amethystHelmet)) aAmt++; if(aAmt > 0) player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 5, aAmt > aCap ? aAmt - 1 : aCap)); //checks for sapphire if(player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem().equals(oncontentstop.sapphireBoots)) sAmt++; if(player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem().equals(oncontentstop.sapphireLeggings)) sAmt++; if(player.getCurrentArmor(2) != null && player.getCurrentArmor(2).getItem().equals(oncontentstop.sapphireChestplate)) sAmt++; if(player.getCurrentArmor(3) != null && player.getCurrentArmor(3).getItem().equals(oncontentstop.sapphireHelmet)) sAmt++; if(sAmt > 0) player.addPotionEffect(new PotionEffect(Potion.resistance.id, 5, sAmt > sCap ? sAmt - 1 : sCap)); //checks for ruby if(player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem().equals(oncontentstop.rubyBoots)) rAmt++; if(player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem().equals(oncontentstop.rubyLeggings)) rAmt++; if(player.getCurrentArmor(2) != null && player.getCurrentArmor(2).getItem().equals(oncontentstop.rubyChestplate)) rAmt++; if(player.getCurrentArmor(3) != null && player.getCurrentArmor(3).getItem().equals(oncontentstop.rubyHelmet)) rAmt++; if(rAmt > 0) player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 5, rAmt > rCap ? rAmt - 1 : rCap)); //checks for topaz if(player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem().equals(oncontentstop.topazBoots)) tAmt++; if(player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem().equals(oncontentstop.topazLeggings)) tAmt++; if(player.getCurrentArmor(2) != null && player.getCurrentArmor(2).getItem().equals(oncontentstop.topazChestplate)) tAmt++; if(player.getCurrentArmor(3) != null && player.getCurrentArmor(3).getItem().equals(oncontentstop.topazHelmet)) tAmt++; if(tAmt > 0) player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 5, tAmt > tCap ? tAmt - 1 : tCap)); } But just to make sure, am I making any grave mistakes here? edit: added code
-
[1.7.10] Checking all armor a player is wearing at a given tick
I'm making a simple mod that adds new ores and I want to apply a custom status effect only when the player is wearing a full set of my armor. However, I've only succeeded in checking if ONE armor piece is equipped by putting the code in the custom helmet class, chestplate class, etc. How do I check the full equip list of a player in one tick and apply status effects based on that?
-
[1.7.10] Reversible recipes?
Thank you, I'll see if I can do use the reflexible recipe.
-
[1.7.10] Reversible recipes?
I mean something like how Axes and Hoes can be crafted inverted to the default recipe (facing left or right).
-
[1.7.10] Reversible recipes?
I want to create a reversible recipe (e.g axes). Is there a built-in way to do this or do I just have to create two shaped recipes?
-
Forge 1.7.2 not launching
Of course. My mods folder had a few mods from a while back, and they were the cause of the problem.
-
Forge 1.7.2 not launching
I am experiencing this exact problem, here is a log: http://pastebin.com/RWs7k69D
IPS spam blocked by CleanTalk.