Remove Packet Dependencies from CNPC+

This commit is contained in:
Kam committed 2024-05-31 12:13:17 -04:00
1 parent e8630eb1fc
commit 94fef1461e
11 files changed
+14 -36

No files matched your search

@@ -39,13 +39,4 @@ public class DBCAddon {
// Client Sync
public void syncPlayer(EntityPlayerMP playerMP){}
// Packet Handling
public void formPacketGet(EntityPlayer player, ByteBuf buffer){}
public void formPacketGets(EntityPlayer player, ByteBuf buffer){}
public void formPacketRemove(EntityPlayer player, ByteBuf buffer){}
public void formPacketSave(EntityPlayer player, ByteBuf buffer){}
public void formPacketSet(EntityPlayer player, ByteBuf buffer){}
public void formPacketPlayers(EntityPlayer player){}
}
@@ -37,6 +37,8 @@ public class DBCClient {
// Manage Custom Forms
public GuiNPCInterface2 manageCustomForms(EntityNPCInterface npcInterface){ return null; }
// Manage Custom Forms
public GuiNPCInterface2 manageCustomAuras(EntityNPCInterface npcInterface){ return null; }
// Inventory GUI
public GuiCNPCInventory inventoryGUI(){ return null; }
@@ -49,8 +49,6 @@ public class CustomNpcsPermissions{
public static final Permission GLOBAL_NATURALSPAWN = new Permission("customnpcs.global.naturalspawn");
public static final Permission GLOBAL_TAG = new Permission("customnpcs.global.tag");
public static final Permission GLOBAL_ANIMATION = new Permission("customnpcs.global.animation");
public static final Permission GLOBAL_CUSTOMFORM = new Permission("customnpcs.global.customform");
public static final Permission SPAWNER_MOB = new Permission("customnpcs.spawner.mob");
public static final Permission SPAWNER_CREATE = new Permission("customnpcs.spawner.create");
@@ -219,9 +219,6 @@ public class PacketHandlerPlayer{
PlayerMailData data = PlayerDataController.Instance.getPlayerData(player).mailData;
Server.sendData(player, EnumPacketClient.GUI_DATA, data.saveNBTData(new NBTTagCompound()));
}
else if(type == EnumPlayerPacket.CustomFormsGet){
DBCAddon.instance.formPacketPlayers(player);
}
else if(type == EnumPlayerPacket.MailDelete){
long time = buffer.readLong();
String username = Server.readString(buffer);
@@ -1207,21 +1207,6 @@ public class PacketHandlerServer{
NoppesUtilServer.sendAnimationDataAll(player);
Server.sendData(player, EnumPacketClient.GUI_DATA, animation.writeToNBT());
}
else if(type == EnumPacketServer.CustomFormsGet){
DBCAddon.instance.formPacketGets(player, buffer);
}
else if(type == EnumPacketServer.CustomFormGet){
DBCAddon.instance.formPacketGet(player, buffer);
}
else if(type == EnumPacketServer.CustomFormRemove){
DBCAddon.instance.formPacketRemove(player, buffer);
}
else if(type == EnumPacketServer.CustomFormSave){
DBCAddon.instance.formPacketSave(player, buffer);
}
else if(type == EnumPacketServer.CustomFormSet){
DBCAddon.instance.formPacketSet(player, buffer);
}
else
blockPackets(type, buffer, player);
@@ -249,6 +249,9 @@ public class ClientProxy extends CommonProxy {
else if (gui == EnumGuiType.ManageCustomForms)
return DBCClient.Instance.manageCustomForms(npc);
else if (gui == EnumGuiType.ManageCustomAuras)
return DBCClient.Instance.manageCustomAuras(npc);
else if (gui == EnumGuiType.ManageTags)
return new GuiNPCManageTags(npc);
@@ -33,8 +33,10 @@ public class GuiNPCGlobalMainMenu extends GuiNPCInterface2{
y = guiTop + 10;
this.addButton(new GuiNpcButton(18, guiLeft + 210, y, "menu.animations"));
this.addButton(new GuiNpcButton(17, guiLeft + 210, y += 22, "menu.tags"));
if(Loader.isModLoaded("npcdbc"))
this.addButton(new GuiNpcButton(200, guiLeft + 210, y += 22, "global.customforms"));
if(Loader.isModLoaded("npcdbc")){
this.addButton(new GuiNpcButton(200, guiLeft + 210, y + 154, 99, 20, "global.customforms"));
this.addButton(new GuiNpcButton(201, guiLeft + 210 + 99 + 3, y + 154, 99, 20, "global.customauras"));
}
}
@Override
@@ -78,6 +80,9 @@ public class GuiNPCGlobalMainMenu extends GuiNPCInterface2{
if (id == 200) {
NoppesUtil.requestOpenGUI(EnumGuiType.ManageCustomForms);
}
if (id == 201) {
NoppesUtil.requestOpenGUI(EnumGuiType.ManageCustomAuras);
}
}
@Override
public void save() {
@@ -7,6 +7,7 @@ public enum EnumGuiType {
ManageFactions,
ManageTags,
ManageCustomForms,
ManageCustomAuras,
ManageAnimations,
MainMenuAdvanced,
MainMenuGlobal,
@@ -98,9 +98,6 @@ public enum EnumPacketServer {
AnimationsGet, AnimationGet,
AnimationRemove(CustomNpcsPermissions.GLOBAL_ANIMATION), AnimationSave(CustomNpcsPermissions.GLOBAL_ANIMATION),
CustomFormsGet, CustomFormGet, CustomFormSet,
CustomFormRemove(CustomNpcsPermissions.GLOBAL_CUSTOMFORM), CustomFormSave(CustomNpcsPermissions.GLOBAL_CUSTOMFORM),
RecipesGet, RecipeGet, QuestOpenGui, PlayerDataGet, QuestLogToServer, PartyLogToServer, UntrackQuest,
RemoteNpcsGet(CustomNpcsPermissions.NPC_GUI),
@@ -3,7 +3,7 @@ package noppes.npcs.constants;
public enum EnumPlayerPacket {
FollowerHire,FollowerExtend,Trader, FollowerState, Transport, BankUnlock, BankUpgrade,
Dialog, QuestLog, TrackedQuest, CheckQuestCompletion, BankSlotOpen, FactionsGet,
MailGet, MailDelete, MailSend, MailRead, MailboxOpenMail, CustomFormsGet,
MailGet, MailDelete, MailSend, MailRead, MailboxOpenMail,
SignSave, SaveBook, CompanionOpenInv, RoleGet, KeyPressed,
MouseClicked, CompanionTalentExp, ScreenSize, MarkData
}