-
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
Showing
13 changed files
with
123 additions
and
13 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/main/java/com/tttsaurus/ingameinfo/common/api/event/IgiGuiInitEvent.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,8 @@ | ||
package com.tttsaurus.ingameinfo.common.api.event; | ||
|
||
import net.minecraftforge.fml.common.eventhandler.Event; | ||
|
||
public class IgiGuiInitEvent extends Event | ||
{ | ||
|
||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/event/IIgiGuiInitEvent.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,12 @@ | ||
package com.tttsaurus.ingameinfo.plugin.crt.api.event; | ||
|
||
import crafttweaker.annotations.ZenRegister; | ||
import crafttweaker.api.event.IEventCancelable; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
|
||
@ZenRegister | ||
@ZenClass("mods.ingameinfo.event.IgiGuiInitEvent") | ||
public interface IIgiGuiInitEvent extends IEventCancelable | ||
{ | ||
|
||
} |
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
38 changes: 38 additions & 0 deletions
38
src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/CrtEventManager.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,38 @@ | ||
package com.tttsaurus.ingameinfo.plugin.crt.impl; | ||
|
||
import com.tttsaurus.ingameinfo.common.api.event.IgiGuiInitEvent; | ||
import com.tttsaurus.ingameinfo.plugin.crt.api.event.IIgiGuiInitEvent; | ||
import com.tttsaurus.ingameinfo.plugin.crt.impl.event.McIgiGuiInitEvent; | ||
import crafttweaker.annotations.ZenRegister; | ||
import crafttweaker.api.event.IEventHandle; | ||
import crafttweaker.api.event.IEventManager; | ||
import crafttweaker.util.EventList; | ||
import crafttweaker.util.IEventHandler; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
import stanhebben.zenscript.annotations.ZenExpansion; | ||
import stanhebben.zenscript.annotations.ZenMethod; | ||
|
||
@ZenRegister | ||
@ZenClass("mods.ingameinfo.IEventManager") | ||
@ZenExpansion("crafttweaker.events.IEventManager") | ||
public class CrtEventManager | ||
{ | ||
private static final EventList<IIgiGuiInitEvent> igiGuiInitEventList = new EventList<>(); | ||
|
||
@ZenMethod | ||
public static IEventHandle onIgiGuiInit(IEventManager manager, IEventHandler<IIgiGuiInitEvent> event) | ||
{ | ||
return igiGuiInitEventList.add(event); | ||
} | ||
|
||
public static final class Handler | ||
{ | ||
@SubscribeEvent | ||
public static void onIgiGuiInit(IgiGuiInitEvent event) | ||
{ | ||
if (igiGuiInitEventList.hasHandlers()) | ||
igiGuiInitEventList.publish(new McIgiGuiInitEvent(event)); | ||
} | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/IgiGuiManagerWrapper.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,22 @@ | ||
package com.tttsaurus.ingameinfo.plugin.crt.impl; | ||
|
||
import com.tttsaurus.ingameinfo.common.api.gui.IgiGuiManager; | ||
import crafttweaker.annotations.ZenRegister; | ||
import stanhebben.zenscript.annotations.ZenClass; | ||
import stanhebben.zenscript.annotations.ZenMethod; | ||
|
||
@ZenRegister | ||
@ZenClass("mods.ingameinfo.gui.IgiGuiManager") | ||
public final class IgiGuiManagerWrapper | ||
{ | ||
@ZenMethod | ||
public static String openGui(String mvvmRegistryName) | ||
{ | ||
return IgiGuiManager.openGui(mvvmRegistryName); | ||
} | ||
@ZenMethod | ||
public static void closeGui(String uuid) | ||
{ | ||
IgiGuiManager.closeGui(uuid); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/event/McIgiGuiInitEvent.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,26 @@ | ||
package com.tttsaurus.ingameinfo.plugin.crt.impl.event; | ||
|
||
import com.tttsaurus.ingameinfo.common.api.event.IgiGuiInitEvent; | ||
import com.tttsaurus.ingameinfo.plugin.crt.api.event.IIgiGuiInitEvent; | ||
|
||
public class McIgiGuiInitEvent implements IIgiGuiInitEvent | ||
{ | ||
private final IgiGuiInitEvent event; | ||
|
||
public McIgiGuiInitEvent(IgiGuiInitEvent event) | ||
{ | ||
this.event = event; | ||
} | ||
|
||
@Override | ||
public boolean isCanceled() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public void setCanceled(boolean canceled) | ||
{ | ||
|
||
} | ||
} |
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