#793 Fixed crash on server startup.

This commit is contained in:
CrazyPants committed 2014-07-10 00:19:36 +08:00
1 parent 2e554f1309
commit 26b1a4ea1e
2 files changed
+14 -10

No files matched your search

@@ -145,15 +145,6 @@ public class DarkSteelController {
}
return true;
}
public boolean isSoundDetectorUpgradeEquipped(EntityClientPlayerMP player) {
ItemStack helmet = player.getEquipmentInSlot(4);
SoundDetectorUpgrade upgrade = SoundDetectorUpgrade.loadFromItem(helmet);
if(upgrade == null) {
return false;
}
return true;
}
private void updateSword(EntityPlayer player) {
if(ItemDarkSteelSword.isEquipped(player)) {
@@ -6,10 +6,14 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.network.PacketHandler;
import crazypants.util.Lang;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentTranslation;
public class KeyTracker {
@@ -40,7 +44,7 @@ public class KeyTracker {
}
private void handleSoundDetector() {
if(!DarkSteelController.instance.isSoundDetectorUpgradeEquipped(Minecraft.getMinecraft().thePlayer)) {
if(!isSoundDetectorUpgradeEquipped(Minecraft.getMinecraft().thePlayer)) {
SoundDetector.instance.enabled = false;
return;
}
@@ -79,5 +83,14 @@ public class KeyTracker {
public boolean isGlideActive() {
return isGlideActive;
}
public boolean isSoundDetectorUpgradeEquipped(EntityClientPlayerMP player) {
ItemStack helmet = player.getEquipmentInSlot(4);
SoundDetectorUpgrade upgrade = SoundDetectorUpgrade.loadFromItem(helmet);
if(upgrade == null) {
return false;
}
return true;
}
}