forked from zerofall/EZStorage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbd6a62
commit 28c34fe
Showing
8 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/com/zerofall/ezstorage/integration/IntegrationUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
package com.zerofall.ezstorage.integration; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
|
||
import com.zerofall.ezstorage.gui.GuiStorageCore; | ||
import com.zerofall.ezstorage.integration.craftingtweaks.CraftingTweaksUtils; | ||
import com.zerofall.ezstorage.integration.etfuturum.EtFuturumUtils; | ||
import com.zerofall.ezstorage.nei.NeiHandler; | ||
|
||
public class IntegrationUtils { | ||
|
||
public static void init() { | ||
if (ModIds.CRAFTINGTWEAKS.isLoaded()) { | ||
CraftingTweaksUtils.init(); | ||
} | ||
} | ||
|
||
public static void initClient() { | ||
if (ModIds.NEI.isLoaded()) { | ||
NeiHandler.init(); | ||
} | ||
} | ||
|
||
public static boolean isSpectatorMode(EntityPlayer player) { | ||
if (ModIds.ETFUTURUM.isLoaded()) { | ||
return EtFuturumUtils.isSpectatorMode(player); | ||
} | ||
return false; | ||
} | ||
|
||
public static void applyCraftingTweaks(GuiScreen gui, List<GuiButton> buttons, int startIndex) { | ||
if (ModIds.CRAFTINGTWEAKS.isLoaded() && gui instanceof GuiStorageCore guiStorageCore) { | ||
CraftingTweaksUtils.initGui(guiStorageCore, buttons, startIndex); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
public enum ModIds { | ||
|
||
CRAFTINGTWEAKS("craftingtweaks"), | ||
NEI("NotEnoughItems"), | ||
ETFUTURUM("etfuturum"); | ||
|
||
|
29 changes: 29 additions & 0 deletions
29
src/main/java/com/zerofall/ezstorage/integration/craftingtweaks/CraftingTweaksUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.zerofall.ezstorage.integration.craftingtweaks; | ||
|
||
import java.util.List; | ||
|
||
import net.blay09.mods.craftingtweaks.SimpleTweakProviderImpl; | ||
import net.blay09.mods.craftingtweaks.api.CraftingTweaksAPI; | ||
import net.blay09.mods.craftingtweaks.api.SimpleTweakProvider; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.util.EnumFacing; | ||
|
||
import com.zerofall.ezstorage.Reference; | ||
import com.zerofall.ezstorage.container.ContainerStorageCore; | ||
import com.zerofall.ezstorage.gui.GuiStorageCore; | ||
|
||
public class CraftingTweaksUtils { | ||
|
||
private static SimpleTweakProvider providerStorageCore; | ||
|
||
public static void init() { | ||
providerStorageCore = new SimpleTweakProviderImpl(Reference.MOD_ID); | ||
CraftingTweaksAPI.registerProvider(ContainerStorageCore.class, providerStorageCore); | ||
} | ||
|
||
public static void initGui(GuiStorageCore gui, List<GuiButton> buttons, int startIndex) { | ||
providerStorageCore.setGrid(startIndex, 9); | ||
providerStorageCore.setAlignToGrid(EnumFacing.WEST); | ||
providerStorageCore.initGui(gui, buttons); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters