mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 04:05:12 +00:00
Added functionality to the disband party button
This commit is contained in:
1 parent
ae43f0548d
commit
cdd3f22826
5 files changed
+35
-3
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package noppes.npcs.controllers;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.controllers.data.Party;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
@@ -30,7 +33,15 @@ public class PartyController {
|
||||
return this.parties.get(partyUUID);
|
||||
}
|
||||
|
||||
public void deleteParty(UUID partyUUID) {
|
||||
this.parties.remove(partyUUID);
|
||||
public void disbandParty(UUID partyUUID) {
|
||||
Party party = this.parties.get(partyUUID);
|
||||
if (party != null) {
|
||||
for (UUID uuid: party.getPlayerUUIDs()) {
|
||||
EntityPlayer player = NoppesUtilServer.getPlayer(uuid);
|
||||
PlayerData playerData = PlayerDataController.Instance.getPlayerData(player);
|
||||
playerData.partyUUID = null;
|
||||
}
|
||||
this.parties.remove(partyUUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user