Fix NPE
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.function.Consumer;
|
|||||||
public class KeyInputListener {
|
public class KeyInputListener {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onKeyInput(InputEvent.KeyInputEvent e) {
|
public void onKeyInput(InputEvent.KeyInputEvent e) {
|
||||||
|
if (Minecraft.getInstance().player != null) {
|
||||||
PlayerInventory inv = Minecraft.getInstance().player.inventory;
|
PlayerInventory inv = Minecraft.getInstance().player.inventory;
|
||||||
|
|
||||||
if (RSKeyBindings.OPEN_WIRELESS_GRID.isKeyDown()) {
|
if (RSKeyBindings.OPEN_WIRELESS_GRID.isKeyDown()) {
|
||||||
@@ -34,6 +35,7 @@ public class KeyInputListener {
|
|||||||
findAndOpen(inv, RSItems.WIRELESS_CRAFTING_MONITOR);
|
findAndOpen(inv, RSItems.WIRELESS_CRAFTING_MONITOR);
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void findAndOpen(IInventory inv, Consumer<ITextComponent> onError, Item... items) {
|
private void findAndOpen(IInventory inv, Consumer<ITextComponent> onError, Item... items) {
|
||||||
Set<Item> validItems = new HashSet<>(Arrays.asList(items));
|
Set<Item> validItems = new HashSet<>(Arrays.asList(items));
|
||||||
|
|||||||
Reference in New Issue
Block a user