@@ -53,16 +53,26 @@ public boolean isValidArmor(ItemStack stack, EntityEquipmentSlot armorType, Enti
5353 @ SideOnly (Side .CLIENT )
5454 public ModelBiped getArmorModel (EntityLivingBase entityLiving , ItemStack itemStack , EntityEquipmentSlot armorSlot , ModelBiped _default ) {
5555 ModelMekAsuitHead armorModel = new ModelMekAsuitHead ();
56+ ModuleSolarHelmet Solar = new ModuleSolarHelmet ();
5657 Render <AbstractClientPlayer > render = Minecraft .getMinecraft ().getRenderManager ().getEntityRenderObject (entityLiving );
5758 if (render instanceof RenderPlayer ) {
5859 armorModel .setModelAttributes (_default );
5960 }
60- // if (){
61- ModuleSolarHelmet Solar = new ModuleSolarHelmet ();
61+ // if () {
62+ // if (armorModel.helmet_armor.childModels.contains(armorModel.hide)) {
6263 armorModel .helmet_armor .childModels .remove (armorModel .hide );
64+ // }
65+ // if (!armorModel.helmet_armor.childModels.contains(Solar.solar_helmet)) {
6366 armorModel .bipedHead .addChild (Solar .solar_helmet );
64- // }
65-
67+ // }
68+ /* } else {
69+ if (armorModel.helmet_armor.childModels.contains(Solar.solar_helmet)) {
70+ armorModel.helmet_armor.childModels.remove(Solar.solar_helmet);
71+ }
72+ if (!armorModel.helmet_armor.childModels.contains(armorModel.hide)) {
73+ armorModel.helmet_armor.childModels.add(armorModel.hide);
74+ }
75+ } */
6676
6777 return armorModel ;
6878 }
@@ -183,31 +193,43 @@ public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
183193 ItemStack headStack = player .getItemStackFromSlot (EntityEquipmentSlot .HEAD );
184194 PotionEffect nv = player .getActivePotionEffect (MobEffects .NIGHT_VISION );
185195 if (headStack .getItem () instanceof ItemMekAsuitHeadArmour item ) {
186- if (player .canEat (false )) {
196+
197+ //if ()
198+ if (player .canEat (false ) && item .getGas (headStack ) != null ) {
187199 int needed = Math .min (20 - player .getFoodStats ().getFoodLevel (), item .getStored (headStack ) / 50 );
188200 int toFeed = Math .min (20000 , needed );
189- if (toFeed > 0 ) {
201+ if (toFeed > 0 && item . getGas ( headStack ). amount > needed ) {
190202 item .setEnergy (headStack , item .getEnergy (headStack ) - toFeed );
191203 item .useGas (headStack );
192204 item .useGas (headStack , needed * 50 );
193205 player .getFoodStats ().addStats (needed , 0.8F );
194206 }
195207 }
196208
209+ //if()
197210 if (player .isEntityAlive () && player .isInsideOfMaterial (Material .WATER )) {
198211 if (!player .canBreatheUnderwater () && !player .capabilities .disableDamage ) {
199212 player .setAir (300 );
200213 item .setEnergy (headStack , item .getEnergy (headStack ) - MekanismConfig .current ().general .FROM_H2 .val () * 2 );
201214 }
202215 }
203216
217+ //if()
204218 List <PotionEffect > effects = Lists .newArrayList (player .getActivePotionEffects ());
219+ //if ()
205220 for (PotionEffect potion : Collections2 .filter (effects , potion -> potion .getPotion ().isBadEffect ())) {
206221 item .setEnergy (headStack , item .getEnergy (headStack ) - 40000 );
207222 player .removePotionEffect (potion .getPotion ());
208223 }
224+ /*if ()
225+ for (PotionEffect potion : Collections2.filter(effects, potion -> !potion.getPotion().isBadEffect())) {
226+ item.setEnergy(headStack, item.getEnergy(headStack) - 40000);
227+ player.removePotionEffect(potion.getPotion());
228+ }
229+ */
209230
210231
232+ //if()
211233 if (!player .getEntityWorld ().isDaytime () && !player .getEntityWorld ().provider .isNether ()) {
212234 if (nv == null ) {
213235 player .addPotionEffect (new PotionEffect (MobEffects .NIGHT_VISION , Integer .MAX_VALUE , 0 , false , false ));
@@ -218,7 +240,9 @@ public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
218240 } else if (nv != null ) {
219241 nv .duration = 0 ;
220242 }
243+ //if()
221244
245+ //if()
222246 if (player .getEntityWorld ().isDaytime () && player .getEntityWorld ().canSeeSky (player .getPosition ())) {
223247 Biome b = player .getEntityWorld ().provider .getBiomeForCoords (player .getPosition ());
224248 float tempEff = 0.3f * (0.8f - b .getTemperature (player .getPosition ()));
0 commit comments