Implemented party locking disabling modifying a party in the party GUI and its packets on the server side.

This commit is contained in:
luisc committed 2024-02-13 18:02:50 -06:00
1 parent 943f80c7ac
commit 8c7f31f1e2
3 files changed
+48 -35

No files matched your search

@@ -50,7 +50,7 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
public UUID partyUUID = null;
private final HashSet<UUID> partyInvites = new HashSet<>();
public EntityPlayer player;
public String playername = "";
@@ -134,7 +134,7 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
compound.setString("UUID", uuid);
compound.setInteger("PlayerCompanionId", companionID);
compound.setBoolean("isGUIOpen",isGUIOpen);
if(hasCompanion()){
NBTTagCompound nbt = new NBTTagCompound();
if(activeCompanion.writeToNBTOptional(nbt))
@@ -216,8 +216,10 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
if (uuid != null) {
this.partyInvites.remove(uuid);
Party party = PartyController.Instance().getParty(uuid);
party.addPlayer(player);
PacketHandlerServer.sendPartyData((EntityPlayerMP) player);
if (!party.getIsLocked()) {
party.addPlayer(player);
PacketHandlerServer.sendPartyData((EntityPlayerMP) player);
}
}
}