mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 23:09:05 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c13c719ef2
6 files changed
+24
-6
No files matched your search
@@ -250,16 +250,19 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
else if (gui == EnumGuiType.ManageAnimations) {
|
||||
EntityCustomNpc animNpc;
|
||||
boolean save;
|
||||
if (npc != null) {
|
||||
animNpc = new EntityCustomNpc(npc.worldObj);
|
||||
animNpc.copyDataFrom(npc, true);
|
||||
animNpc.display.showName = 1;
|
||||
animNpc.display.showBossBar = 0;
|
||||
save = true;
|
||||
} else {
|
||||
animNpc = new EntityCustomNpc(Minecraft.getMinecraft().theWorld);
|
||||
animNpc.display.texture = "customnpcs:textures/entity/humanmale/AnimationBody.png";
|
||||
save = false;
|
||||
}
|
||||
return new GuiNPCManageAnimations(animNpc);
|
||||
return new GuiNPCManageAnimations(animNpc, save);
|
||||
}
|
||||
else if (gui == EnumGuiType.ManageLinked)
|
||||
return new GuiNPCManageLinkedNpc(npc);
|
||||
|
||||
@@ -28,9 +28,10 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
private String selected = null;
|
||||
private String search = "";
|
||||
|
||||
public GuiNPCManageAnimations(EntityNPCInterface npc)
|
||||
public GuiNPCManageAnimations(EntityNPCInterface npc, boolean save)
|
||||
{
|
||||
super(npc);
|
||||
this.setSave(save);
|
||||
this.xOffset = -148 + 70;
|
||||
this.yOffset = -170 + 137;
|
||||
Client.sendData(EnumPacketServer.AnimationsGet);
|
||||
|
||||
@@ -158,4 +158,10 @@ public class GuiModelInterface2 extends GuiNPCInterface2{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void setSave(boolean saveNPC){
|
||||
if(this.getMenu() != null){
|
||||
this.getMenu().saveNPC = saveNPC;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,4 +61,8 @@ public abstract class GuiNPCInterface2 extends GuiNPCInterface
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 200, 220);
|
||||
drawTexturedModalRect(guiLeft + xSize-230, guiTop, 26, 0, 230, 220);
|
||||
}
|
||||
|
||||
protected GuiNpcMenu getMenu(){
|
||||
return this.menu;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ public class GuiNpcMenu implements GuiYesNoCallback{
|
||||
|
||||
private int activeMenu;
|
||||
private EntityNPCInterface npc;
|
||||
public boolean saveNPC = true;
|
||||
|
||||
public GuiNpcMenu(GuiScreen parent, int activeMenu, EntityNPCInterface npc) {
|
||||
this.parent = parent;
|
||||
@@ -109,7 +110,8 @@ public class GuiNpcMenu implements GuiYesNoCallback{
|
||||
((GuiNPCInterface2)parent).close();
|
||||
if(npc != null){
|
||||
npc.reset();
|
||||
Client.sendData(EnumPacketServer.NpcMenuClose);
|
||||
if(saveNPC)
|
||||
Client.sendData(EnumPacketServer.NpcMenuClose);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user