Fix Job Spawner not Removing Spawns

This commit is contained in:
Kam committed 2023-07-30 17:29:06 -04:00
1 parent 8e41a0973e
commit 339874da52
2 files changed
+6 -1

No files matched your search

@@ -879,6 +879,9 @@ public class PacketHandlerServer{
else if(type == EnumPacketServer.JobSpawnerRemove){
if(npc.advanced.job != EnumJobType.Spawner)
return;
JobSpawner job = (JobSpawner) npc.jobInterface;
job.setJobCompound(buffer.readInt(), null);
Server.sendData(player, EnumPacketClient.GUI_DATA, job.getTitles());
}
else if(type == EnumPacketServer.RoleSave){
npc.roleInterface.readFromNBT(Server.readNBT(buffer));
@@ -102,7 +102,8 @@ public class GuiNpcSpawner extends GuiNPCInterface2 implements ITextfieldListene
setSubGui(new GuiNpcMobSpawnerSelector());
}
if(button.id >= 20 && button.id < 26){
job.setJobCompound(button.id - 19, null);
int removeID = button.id - 19;
job.setJobCompound(removeID, null);
Client.sendData(EnumPacketServer.JobSpawnerRemove, button.id - 19);
}
if(button.id == 26){
@@ -152,6 +153,7 @@ public class GuiNpcSpawner extends GuiNPCInterface2 implements ITextfieldListene
if(textfield.id == 9){
job.zOffset = textfield.getInteger();
}
save();
}
@Override