2024-01-18 07:58:21 +00:00
|
|
|
package com.alttd.cometskyblock.island;
|
|
|
|
|
|
2024-01-25 14:49:04 +00:00
|
|
|
import lombok.Getter;
|
|
|
|
|
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
|
|
|
|
|
2024-01-18 07:58:21 +00:00
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
2024-01-25 14:49:04 +00:00
|
|
|
@Getter
|
|
|
|
|
@ConfigSerializable
|
2024-01-18 07:58:21 +00:00
|
|
|
public class Island {
|
|
|
|
|
|
|
|
|
|
private String worldName;
|
|
|
|
|
private String islandName;
|
|
|
|
|
private int level;
|
|
|
|
|
private UUID owner;
|
2024-01-25 14:49:04 +00:00
|
|
|
private final List<UUID> members = new ArrayList<>();
|
2024-01-18 07:58:21 +00:00
|
|
|
|
|
|
|
|
public boolean canBuild(UUID uuid) {
|
|
|
|
|
return owner.equals(uuid) || members.contains(uuid);
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-25 14:49:04 +00:00
|
|
|
public boolean addMember(UUID uuid) {
|
|
|
|
|
return this.members.add(uuid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean removeMember(UUID uuid) {
|
|
|
|
|
return this.members.remove(uuid);
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-18 07:58:21 +00:00
|
|
|
}
|