Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
SpraxDev committed Feb 26, 2024
2 parents eb93635 + 9d40dc2 commit dcf5932
Show file tree
Hide file tree
Showing 21 changed files with 254 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
append_snapshot: ${{ github.ref_type == 'tag' && 'false' || 'true' }}
version: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
increment_version: ${{ github.ref_type == 'tag' && '' || 'patch' }}
increment_version: ${{ github.ref_type != 'tag' && 'patch' || '' }}
increment_version_only_if_not_snapshot_version: ${{ github.ref == 'refs/heads/development' && 'true' || 'false' }}

- name: Build with Maven
Expand Down
40 changes: 38 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.craftaro</groupId>
<artifactId>UltimateClaims</artifactId>
<version>2.0.1</version>
<version>2.2.0</version>

<name>UltimateClaims</name>
<description>Claim land with this unique grief protection tool – Fill up your power cell and keep it supplied to keep your land protected</description>
Expand Down Expand Up @@ -129,6 +129,12 @@
<id>dynmap-repo</id>
<url>https://repo.mikeprimm.com/</url>
</repository>

<repository>
<id>oraxen</id>
<name>Oraxen Repository</name>
<url>https://repo.oraxen.com/releases</url>
</repository>
</repositories>

<dependencies>
Expand Down Expand Up @@ -170,7 +176,7 @@
<dependency>
<groupId>io.github.thebusybiscuit</groupId>
<artifactId>slimefun4</artifactId>
<version>RC-35</version>
<version>RC-36</version>
<scope>provided</scope>
</dependency>

Expand All @@ -180,5 +186,35 @@
<version>3.6.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.th0rgal</groupId>
<artifactId>oraxen</artifactId>
<version>1.168.0</version>
<classifier>dev</classifier>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>gs.mclo</groupId>
<artifactId>mclogs</artifactId>
</exclusion>
<exclusion>
<groupId>com.ticxo</groupId>
<artifactId>PlayerAnimator</artifactId>
</exclusion>
<exclusion>
<groupId>me.gabytm.util</groupId>
<artifactId>actions-spigot</artifactId>
</exclusion>
<exclusion>
<groupId>net.kyori</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.jeff_media</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public class UltimateClaims extends SongodaPlugin {
private AuditManager auditManager;
private InviteTask inviteTask;
private TrackerTask trackerTask;
private PlaceholderManager placeholderManager;

/**
* @deprecated Use {@link org.bukkit.plugin.java.JavaPlugin#getPlugin(Class)} instead.
Expand Down Expand Up @@ -163,7 +164,8 @@ public void onPluginEnable() {

// Register Placeholders
if (pluginManager.isPluginEnabled("PlaceholderAPI")) {
new PlaceholderManager(this).register();
this.placeholderManager = new PlaceholderManager(this);
this.placeholderManager.register();
}

// Start our databases
Expand All @@ -176,6 +178,9 @@ public void onPluginDisable() {
this.guiManager.closeAll();
this.dataHelper.bulkUpdateClaims(this.claimManager.getRegisteredClaims());
this.dataManager.shutdown();
if (this.placeholderManager != null) {
this.placeholderManager.unregister();
}

// cleanup holograms
HologramManager.removeAllHolograms();
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/com/craftaro/ultimateclaims/claim/Claim.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,15 @@ public Set<ClaimMember> getOwnerAndMembers() {
}

public ClaimMember addMember(ClaimMember member) {
// Removing the player if they already are a member (i.e. they are a visitor) to avoid conflict
this.removeMember(member.getUniqueId());
this.members.add(member);
return member;
}

public ClaimMember addMember(OfflinePlayer player, ClaimRole role) {
ClaimMember newMember = new ClaimMember(this, player.getUniqueId(), player.getName(), role);
this.members.add(newMember);
return newMember;
return addMember(newMember);
}

public ClaimMember getMember(UUID uuid) {
Expand Down Expand Up @@ -219,8 +220,12 @@ public ClaimMember getMember(OfflinePlayer player) {
}

public void removeMember(UUID uuid) {
Optional<ClaimMember> optional = this.members.stream().filter(member -> member.getUniqueId().equals(uuid)).findFirst();
optional.ifPresent(this.members::remove);
for (ClaimMember member : this.members) {
if (member.getUniqueId().equals(uuid)) {
this.members.remove(member);
break;
}
}
}

public void removeMember(ClaimMember member) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.craftaro.ultimateclaims.settings.Settings;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected ReturnType runCommand(CommandSender sender, String... args) {

if (claim.getPowerCell().hasLocation()) {
PowerCell powerCell = claim.getPowerCell();
if (powerCell.getLocation().getChunk() == chunk) {
if (powerCell.getLocation().getChunk().equals(chunk)) {
this.plugin.getLocale().getMessage("command.unclaim.powercell").sendPrefixedMessage(sender);
return ReturnType.FAILURE;
}
Expand Down
Loading

0 comments on commit dcf5932

Please sign in to comment.