mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 21:35:10 +00:00
DBC Manage Custom Forms
This commit is contained in:
1 parent
4590275695
commit
ab2ac3d231
7 files changed
+39
-7
No files matched your search
@@ -24,25 +24,29 @@ public class DBCAddon {
|
||||
|
||||
public void dbcCopyData(EntityLivingBase copied, EntityLivingBase entity){}
|
||||
|
||||
// AI / STATS
|
||||
public boolean canDBCAttack(EntityNPCInterface npc, float attackStrength, Entity receiver){
|
||||
return false;
|
||||
}
|
||||
|
||||
public void doDBCDamage(EntityNPCInterface npc, float attackStrength, Entity receiver){}
|
||||
|
||||
public boolean isKO(EntityNPCInterface npc, EntityPlayer player){
|
||||
return false;
|
||||
}
|
||||
|
||||
// PlayerData NBT
|
||||
public void writeToNBT(PlayerData playerData, NBTTagCompound nbtTagCompound){}
|
||||
|
||||
public void readFromNBT(PlayerData playerData, NBTTagCompound nbtTagCompound){}
|
||||
|
||||
// Client Sync
|
||||
public void syncPlayer(EntityPlayerMP playerMP){}
|
||||
|
||||
public void clientSync(NBTTagCompound compound, boolean syncEnd){}
|
||||
|
||||
public void syncUpdate(NBTTagCompound compound, ByteBuf buffer){}
|
||||
public void syncRemove(int id){}
|
||||
|
||||
|
||||
// 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){}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package kamkeel.addon.client;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.client.gui.mainmenu.GuiNpcStats;
|
||||
import noppes.npcs.client.gui.model.GuiCreationScreen;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface2;
|
||||
@@ -30,4 +32,7 @@ public class DBCClient {
|
||||
|
||||
// Render Auras
|
||||
public void renderDBCAuras(EntityNPCInterface npcInterface){}
|
||||
|
||||
// Manage Custom Forms
|
||||
public GuiNPCInterface2 manageCustomForms(EntityNPCInterface npcInterface){ return null; }
|
||||
}
|
||||
@@ -49,8 +49,10 @@ 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_MOB = new Permission("customnpcs.spawner.mob");
|
||||
public static final Permission SPAWNER_CREATE = new Permission("customnpcs.spawner.create");
|
||||
|
||||
// Open / Use Wands
|
||||
|
||||
@@ -6,6 +6,7 @@ import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import foxz.utils.Market;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.addon.DBCAddon;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
@@ -1205,6 +1206,18 @@ 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
|
||||
blockPackets(type, buffer, player);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import kamkeel.addon.client.DBCClient;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
@@ -245,6 +246,9 @@ public class ClientProxy extends CommonProxy {
|
||||
else if (gui == EnumGuiType.ManageFactions)
|
||||
return new GuiNPCManageFactions(npc);
|
||||
|
||||
else if (gui == EnumGuiType.ManageCustomForms)
|
||||
return DBCClient.Instance.manageCustomForms(npc);
|
||||
|
||||
else if (gui == EnumGuiType.ManageTags)
|
||||
return new GuiNPCManageTags(npc);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ public enum EnumGuiType {
|
||||
MainMenuStats,
|
||||
ManageFactions,
|
||||
ManageTags,
|
||||
ManageCustomForms,
|
||||
ManageAnimations,
|
||||
MainMenuAdvanced,
|
||||
MainMenuGlobal,
|
||||
|
||||
@@ -98,7 +98,10 @@ public enum EnumPacketServer {
|
||||
AnimationsGet, AnimationGet,
|
||||
AnimationRemove(CustomNpcsPermissions.GLOBAL_ANIMATION), AnimationSave(CustomNpcsPermissions.GLOBAL_ANIMATION),
|
||||
|
||||
RecipesGet, RecipeGet, QuestOpenGui, PlayerDataGet, QuestLogToServer, PartyLogToServer, UntrackQuest,
|
||||
CustomFormsGet, CustomFormGet,
|
||||
CustomFormRemove(CustomNpcsPermissions.GLOBAL_CUSTOMFORM), CustomFormSave(CustomNpcsPermissions.GLOBAL_CUSTOMFORM),
|
||||
|
||||
RecipesGet, RecipeGet, QuestOpenGui, PlayerDataGet, QuestLogToServer, PartyLogToServer, UntrackQuest,
|
||||
|
||||
RemoteNpcsGet(CustomNpcsPermissions.NPC_GUI),
|
||||
RemoteTpToNpc(CustomNpcsPermissions.NPC_TELEPORT),
|
||||
|
||||
Reference in new issue
Block a user