Skip to content

Commit

Permalink
Fix for registering magnet slot on client, crashes server. So dedicat…
Browse files Browse the repository at this point in the history
…ed servers should work now
  • Loading branch information
0xC4DE committed Dec 14, 2024
1 parent 9772dc9 commit f6d928a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/main/java/com/_0xc4de/ae2exttable/items/ItemRegistry.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com._0xc4de.ae2exttable.items;

import appeng.api.config.Upgrades;
import appeng.util.Platform;
import com.blakebr0.cucumber.registry.ModRegistry;
import com._0xc4de.ae2exttable.AE2ExtendedCraftingTable;
import com._0xc4de.ae2exttable.client.gui.AE2ExtendedGUIs;
Expand Down Expand Up @@ -50,26 +51,29 @@ public static void init() {
registry.register(WIRELESS_BASIC_TERMINAL, "wireless_basic_crafting_terminal");
FORWARD_LOOKUP.put(WIRELESS_BASIC_TERMINAL, AE2ExtendedGUIs.WIRELESS_BASIC_CRAFTING_TERMINAL);
REVERSE_LOOKUP.put(AE2ExtendedGUIs.WIRELESS_BASIC_CRAFTING_TERMINAL, WIRELESS_BASIC_TERMINAL);
Upgrades.MAGNET.registerItem(
WIRELESS_BASIC_TERMINAL.getDefaultInstance(), 1);

registry.register(WIRELESS_ADVANCED_TERMINAL, "wireless_advanced_crafting_terminal");
FORWARD_LOOKUP.put(WIRELESS_ADVANCED_TERMINAL, AE2ExtendedGUIs.WIRELESS_ADVANCED_CRAFTING_TERMINAL);
REVERSE_LOOKUP.put(AE2ExtendedGUIs.WIRELESS_ADVANCED_CRAFTING_TERMINAL, WIRELESS_ADVANCED_TERMINAL);
Upgrades.MAGNET.registerItem(
WIRELESS_ADVANCED_TERMINAL.getDefaultInstance(), 1);

registry.register(WIRELESS_ELITE_TERMINAL, "wireless_elite_crafting_terminal");
FORWARD_LOOKUP.put(WIRELESS_ELITE_TERMINAL, AE2ExtendedGUIs.WIRELESS_ELITE_CRAFTING_TERMINAL);
REVERSE_LOOKUP.put(AE2ExtendedGUIs.WIRELESS_ELITE_CRAFTING_TERMINAL, WIRELESS_ELITE_TERMINAL);
Upgrades.MAGNET.registerItem(
WIRELESS_ELITE_TERMINAL.getDefaultInstance(), 1);

registry.register(WIRELESS_ULTIMATE_TERMINAL, "wireless_ultimate_crafting_terminal");
FORWARD_LOOKUP.put(WIRELESS_ULTIMATE_TERMINAL, AE2ExtendedGUIs.WIRELESS_ULTIMATE_CRAFTING_TERMINAL);
REVERSE_LOOKUP.put(AE2ExtendedGUIs.WIRELESS_ULTIMATE_CRAFTING_TERMINAL, WIRELESS_ULTIMATE_TERMINAL);
Upgrades.MAGNET.registerItem(
WIRELESS_ULTIMATE_TERMINAL.getDefaultInstance(), 1);

if (Platform.isClient()) {
Upgrades.MAGNET.registerItem(
WIRELESS_BASIC_TERMINAL.getDefaultInstance(), 1);
Upgrades.MAGNET.registerItem(
WIRELESS_ADVANCED_TERMINAL.getDefaultInstance(), 1);
Upgrades.MAGNET.registerItem(
WIRELESS_ELITE_TERMINAL.getDefaultInstance(), 1);
Upgrades.MAGNET.registerItem(
WIRELESS_ULTIMATE_TERMINAL.getDefaultInstance(), 1);
}

initModels();
}
Expand Down

0 comments on commit f6d928a

Please sign in to comment.