Re-add keybinding to open Portable Grid
This commit is contained in:
@@ -177,6 +177,7 @@ public class ClientSetup {
|
|||||||
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_WIRELESS_FLUID_GRID);
|
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_WIRELESS_FLUID_GRID);
|
||||||
ClientRegistry.registerKeyBinding(RSKeyBindings.FOCUS_SEARCH_BAR);
|
ClientRegistry.registerKeyBinding(RSKeyBindings.FOCUS_SEARCH_BAR);
|
||||||
ClientRegistry.registerKeyBinding(RSKeyBindings.CLEAR_GRID_CRAFTING_MATRIX);
|
ClientRegistry.registerKeyBinding(RSKeyBindings.CLEAR_GRID_CRAFTING_MATRIX);
|
||||||
|
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_PORTABLE_GRID);
|
||||||
|
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(StorageMonitorTile.class, new StorageMonitorTileRenderer());
|
ClientRegistry.bindTileEntitySpecialRenderer(StorageMonitorTile.class, new StorageMonitorTileRenderer());
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ import net.minecraftforge.client.settings.KeyModifier;
|
|||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
public final class RSKeyBindings {
|
public final class RSKeyBindings {
|
||||||
/*
|
/* TODO
|
||||||
public static final KeyBinding OPEN_PORTABLE_GRID = new KeyBinding("key.refinedstorage.openPortableGrid", KeyConflictContext.IN_GAME, 0, "Refined Storage");
|
|
||||||
public static final KeyBinding OPEN_WIRELESS_CRAFTING_MONITOR = new KeyBinding("key.refinedstorage.openWirelessCraftingMonitor", KeyConflictContext.IN_GAME, 0, "Refined Storage");
|
public static final KeyBinding OPEN_WIRELESS_CRAFTING_MONITOR = new KeyBinding("key.refinedstorage.openWirelessCraftingMonitor", KeyConflictContext.IN_GAME, 0, "Refined Storage");
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
@@ -16,6 +15,13 @@ public final class RSKeyBindings {
|
|||||||
ClientRegistry.registerKeyBinding(OPEN_WIRELESS_CRAFTING_MONITOR);
|
ClientRegistry.registerKeyBinding(OPEN_WIRELESS_CRAFTING_MONITOR);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
public static final KeyBinding OPEN_PORTABLE_GRID = new KeyBinding(
|
||||||
|
"key.refinedstorage.openPortableGrid",
|
||||||
|
KeyConflictContext.IN_GAME,
|
||||||
|
InputMappings.INPUT_INVALID,
|
||||||
|
"Refined Storage"
|
||||||
|
);
|
||||||
|
|
||||||
public static final KeyBinding OPEN_WIRELESS_GRID = new KeyBinding(
|
public static final KeyBinding OPEN_WIRELESS_GRID = new KeyBinding(
|
||||||
"key.refinedstorage.openWirelessGrid",
|
"key.refinedstorage.openWirelessGrid",
|
||||||
KeyConflictContext.IN_GAME,
|
KeyConflictContext.IN_GAME,
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.raoulvdberge.refinedstorage.network;
|
package com.raoulvdberge.refinedstorage.network;
|
||||||
|
|
||||||
|
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||||
|
import com.raoulvdberge.refinedstorage.apiimpl.network.grid.factory.PortableGridGridFactory;
|
||||||
import com.raoulvdberge.refinedstorage.item.NetworkItem;
|
import com.raoulvdberge.refinedstorage.item.NetworkItem;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import com.raoulvdberge.refinedstorage.item.blockitem.PortableGridBlockItem;
|
||||||
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraftforge.fml.network.NetworkEvent;
|
import net.minecraftforge.fml.network.NetworkEvent;
|
||||||
@@ -24,7 +27,7 @@ public class OpenNetworkItemMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void handle(OpenNetworkItemMessage message, Supplier<NetworkEvent.Context> ctx) {
|
public static void handle(OpenNetworkItemMessage message, Supplier<NetworkEvent.Context> ctx) {
|
||||||
PlayerEntity player = ctx.get().getSender();
|
ServerPlayerEntity player = ctx.get().getSender();
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
ctx.get().enqueueWork(() -> {
|
ctx.get().enqueueWork(() -> {
|
||||||
@@ -32,9 +35,9 @@ public class OpenNetworkItemMessage {
|
|||||||
|
|
||||||
if (stack.getItem() instanceof NetworkItem) {
|
if (stack.getItem() instanceof NetworkItem) {
|
||||||
((NetworkItem) stack.getItem()).applyNetwork(player.getServer(), stack, n -> n.getNetworkItemManager().open(player, stack), player::sendMessage);
|
((NetworkItem) stack.getItem()).applyNetwork(player.getServer(), stack, n -> n.getNetworkItemManager().open(player, stack), player::sendMessage);
|
||||||
}/* TODO else if (stack.getItem() == Item.getItemFromBlock(RSBlocks.PORTABLE_GRID)) { // @Hack
|
} else if (stack.getItem() instanceof PortableGridBlockItem) {
|
||||||
API.instance().getGridManager().openGrid(PortableGrid.ID, player, stack);
|
API.instance().getGridManager().openGrid(PortableGridGridFactory.ID, player, stack);
|
||||||
}*/
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ public class KeyInputListener {
|
|||||||
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error), RSItems.WIRELESS_GRID, RSItems.CREATIVE_WIRELESS_GRID);
|
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error), RSItems.WIRELESS_GRID, RSItems.CREATIVE_WIRELESS_GRID);
|
||||||
} else if (RSKeyBindings.OPEN_WIRELESS_FLUID_GRID.isKeyDown()) {
|
} else if (RSKeyBindings.OPEN_WIRELESS_FLUID_GRID.isKeyDown()) {
|
||||||
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error), RSItems.WIRELESS_FLUID_GRID, RSItems.CREATIVE_WIRELESS_FLUID_GRID);
|
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error), RSItems.WIRELESS_FLUID_GRID, RSItems.CREATIVE_WIRELESS_FLUID_GRID);
|
||||||
}/* TODO else if (RSKeyBindings.OPEN_PORTABLE_GRID.isKeyDown()) {
|
} else if (RSKeyBindings.OPEN_PORTABLE_GRID.isKeyDown()) {
|
||||||
findAndOpen(inv, Item.getItemFromBlock(RSBlocks.PORTABLE_GRID));
|
findAndOpen(inv, (error) -> Minecraft.getInstance().player.sendMessage(error), RSItems.PORTABLE_GRID, RSItems.CREATIVE_PORTABLE_GRID);
|
||||||
} else if (RSKeyBindings.OPEN_WIRELESS_CRAFTING_MONITOR.isKeyDown()) {
|
}/* TODO else if (RSKeyBindings.OPEN_WIRELESS_CRAFTING_MONITOR.isKeyDown()) {
|
||||||
findAndOpen(inv, RSItems.WIRELESS_CRAFTING_MONITOR);
|
findAndOpen(inv, RSItems.WIRELESS_CRAFTING_MONITOR);
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user