Merge pull request #31 from c0508383/master

Increased NPC Inventory & Other Additions.
This commit is contained in:
Kamron Vaswani authored and GitHub committed 2022-01-31 16:27:15 -05:00
commit bc54e8cd7b
63 files changed
+2815 -216

No files matched your search

@@ -3,10 +3,7 @@ package noppes.npcs.controllers;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import noppes.npcs.CustomNpcs;
import noppes.npcs.Server;
import noppes.npcs.constants.EnumGuiType;
@@ -18,6 +15,7 @@ import noppes.npcs.scripted.entity.ScriptPlayer;
import noppes.npcs.scripted.event.CustomGuiEvent;
import noppes.npcs.scripted.gui.ScriptGui;
import noppes.npcs.scripted.interfaces.IItemStack;
import noppes.npcs.scripted.overlay.ScriptOverlay;
import noppes.npcs.scripted.wrapper.WrapperNpcAPI;
import java.io.IOException;
@@ -42,6 +40,15 @@ public class CustomGuiController {
}
}
public static void openOverlay(ScriptPlayer player, ScriptOverlay gui) {
Server.sendData((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.OVERLAY_DATA, new Object[]{gui.toNBT()});
}
public static boolean updateOverlay(ScriptPlayer player, ScriptOverlay gui) {
Server.sendData((EntityPlayerMP)player.getMCEntity(), EnumPacketClient.OVERLAY_DATA, new Object[]{gui.toNBT()});
return true;
}
static boolean checkGui(CustomGuiEvent event) {
EntityPlayer player = (EntityPlayer) event.player.getMCEntity();
if (!(player.openContainer instanceof ContainerCustomGui)) {
@@ -239,4 +239,39 @@ public class Dialog implements ICompatibilty, IDialog {
public void setCommand(String command) {
this.command = command;
}
public void setDarkenScreen(boolean darkenScreen) {
this.darkenScreen = darkenScreen;
}
public boolean getDarkenScreen() {
return this.darkenScreen;
}
public void setDisableEsc(boolean disableEsc) {
this.disableEsc = disableEsc;
}
public boolean getDisableEsc() {
return this.disableEsc;
}
public void setShowWheel(boolean showWheel) {
this.showWheel = showWheel;
}
public boolean getShowWheel() {
return this.showWheel;
}
public void setHideNPC(boolean hideNPC) {
this.hideNPC = hideNPC;
}
public boolean getHideNPC() {
return this.hideNPC;
}
public void setSound(String sound) {
this.sound = sound;
}
public String getSound() {
return this.sound;
}
}
@@ -20,6 +20,7 @@ import noppes.npcs.scripted.CustomNPCsException;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.handler.data.IQuest;
import noppes.npcs.scripted.handler.data.IQuestCategory;
import noppes.npcs.scripted.handler.data.IQuestInterface;
import noppes.npcs.scripted.handler.data.IQuestObjective;
import noppes.npcs.scripted.interfaces.IContainer;
import noppes.npcs.scripted.interfaces.IPlayer;
@@ -242,4 +243,8 @@ public class Quest implements ICompatibilty, IQuest {
public IContainer getRewards() {
return NpcAPI.Instance().getIContainer(this.rewardItems);
}
public IQuestInterface getQuestInterface(){
return this.questInterface;
}
}