Fix night-vision being activateable without upgrade #1377

This commit is contained in:
Bernhard Bonigl committed 2015-02-21 20:49:19 +01:00
1 parent 69496722bb
commit ab96d8f46f
1 file changed
+6 -5
@@ -158,12 +158,13 @@ public class ArmorControls {
if (mc.currentScreen == null) {
if (key == ArmorControls.toggleGoggles) {
ItemStack goggles = mc.thePlayer.getCurrentArmor(3);
if (goggles != null && goggles
.getItem() instanceof TravelGear) //TODO: Genericize this
if (goggles != null && goggles.getItem() instanceof TravelGear) //TODO: Genericize this
{
activeGoggles = !activeGoggles;
PlayerAbilityHelper.toggleGoggles(mc.thePlayer, activeGoggles);
toggleGoggles();
if(goggles.hasTagCompound() && goggles.getTagCompound().getCompoundTag(((TravelGear) goggles.getItem()).getBaseTagName()).getBoolean("Night Vision")) {
activeGoggles = !activeGoggles;
PlayerAbilityHelper.toggleGoggles(mc.thePlayer, activeGoggles);
toggleGoggles();
}
}
}
if (key == ArmorControls.beltSwap) {