Skip to content

Commit bbcf3a8

Browse files
committed
Moved keybind to CommonProxy
1 parent f1473bb commit bbcf3a8

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/main/java/com/gtnewhorizon/structurelib/ClientProxy.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939
import org.apache.commons.lang3.tuple.Pair;
4040
import org.lwjgl.opengl.GL11;
4141

42-
import com.gtnewhorizon.gtnhlib.keybind.SyncedKeybind;
4342
import com.gtnewhorizon.structurelib.entity.fx.WeightlessParticleFX;
44-
import com.gtnewhorizon.structurelib.item.ItemConstructableTrigger;
4543
import com.gtnewhorizon.structurelib.net.RegistryOrderSyncMessage;
4644
import com.gtnewhorizon.structurelib.net.SetChannelDataMessage;
4745

@@ -67,16 +65,6 @@ public class ClientProxy extends CommonProxy {
6765
*/
6866
private static final List<HintGroup> allGroups = new ArrayList<>();
6967

70-
private static final SyncedKeybind MODE_SWAP_KEY = SyncedKeybind.createConfigurable(
71-
"item.structurelib.constructableTrigger.keys.cycleMode",
72-
"item.structurelib.constructableTrigger.keyCategory",
73-
0).registerGlobalListener((entityPlayerMP, syncedKeybind) -> {
74-
final ItemStack held = entityPlayerMP.getHeldItem();
75-
if (held != null && held.getItem() instanceof ItemConstructableTrigger) {
76-
ItemConstructableTrigger.cycleMode(held);
77-
}
78-
});
79-
8068
/**
8169
* Current batch of hints. Belongs to the same logical multiblock.
8270
*/

src/main/java/com/gtnewhorizon/structurelib/CommonProxy.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import net.minecraft.world.World;
1515
import net.minecraftforge.common.MinecraftForge;
1616

17+
import com.gtnewhorizon.gtnhlib.keybind.SyncedKeybind;
18+
import com.gtnewhorizon.structurelib.item.ItemConstructableTrigger;
1719
import com.gtnewhorizon.structurelib.net.ErrorHintParticleMessage;
1820
import com.gtnewhorizon.structurelib.net.UpdateHintParticleMessage;
1921

@@ -111,6 +113,16 @@ protected static void addThrottledChat(Object throttleKey, EntityPlayer player,
111113
}
112114
}
113115

116+
private static final SyncedKeybind MODE_SWAP_KEY = SyncedKeybind.createConfigurable(
117+
"item.structurelib.constructableTrigger.keys.cycleMode",
118+
"item.structurelib.constructableTrigger.keyCategory",
119+
0).registerGlobalListener((entityPlayerMP, syncedKeybind) -> {
120+
final ItemStack held = entityPlayerMP.getHeldItem();
121+
if (held != null && held.getItem() instanceof ItemConstructableTrigger) {
122+
ItemConstructableTrigger.cycleMode(held);
123+
}
124+
});
125+
114126
public void displayConfigGUI(String category) {}
115127

116128
public static class ForgeEventHandler {

0 commit comments

Comments
 (0)