ICustomGui:

-Added IDs to custom GUI slots.
This commit is contained in:
Luis C.M committed 2023-03-18 03:04:46 -05:00
1 parent 2c012f2693
commit 586c451f06
7 files changed
+52 -19

No files matched your search

@@ -1,10 +1,13 @@
package noppes.npcs.scripted.event;
import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraft.entity.player.EntityPlayerMP;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.event.ICustomGuiEvent;
import noppes.npcs.api.gui.ICustomGui;
import noppes.npcs.api.gui.IItemSlot;
import noppes.npcs.api.item.IItemStack;
import noppes.npcs.client.gui.custom.components.CustomGuiSlot;
import noppes.npcs.constants.EnumScriptType;
public class CustomGuiEvent extends CustomNPCsEvent implements ICustomGuiEvent {
@@ -114,11 +117,13 @@ public class CustomGuiEvent extends CustomNPCsEvent implements ICustomGuiEvent {
public static class SlotEvent extends CustomGuiEvent implements ICustomGuiEvent.SlotEvent {
public final int slotId;
public final IItemStack stack;
public final IItemSlot slot;
public SlotEvent(IPlayer player, ICustomGui gui, int slotId, IItemStack stack) {
super(player, gui);
this.slotId = slotId;
this.stack = stack;
this.slot = (IItemSlot) gui.getComponent(((CustomGuiSlot)(((EntityPlayerMP)player.getMCEntity()).openContainer.getSlot(slotId))).guiSlotId);
}
public String getHookName() {
@@ -139,17 +144,19 @@ public class CustomGuiEvent extends CustomNPCsEvent implements ICustomGuiEvent {
public final int slotId;
public final IItemStack stack;
public final int dragType;
public final IItemSlot slot;
/**
*
*/
public final int clickType;
public SlotClickEvent(IPlayer player, ICustomGui gui, int slotId, IItemStack stack, int dragType, int clickType) {
public SlotClickEvent(IPlayer player, ICustomGui gui, int slotId, int guiSlotId, IItemStack stack, int dragType, int clickType) {
super(player,gui);
this.slotId = slotId;
this.stack = stack;
this.dragType = dragType;
this.clickType = clickType;
this.slot = (IItemSlot) gui.getComponent(guiSlotId);
}
public String getHookName() {