Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 1.9.0 update #107

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<dependency>
<groupId>com.github.Weesli</groupId>
<artifactId>RClaim</artifactId>
<version>1.2.0</version>
<version>1.9.0</version>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package xyz.geik.farmer.integrations.rclaim;

import net.weesli.rClaim.api.RClaimAPI;
import net.weesli.rClaim.utils.Claim;
import net.weesli.rClaim.modal.Claim;
import org.bukkit.Location;
import xyz.geik.farmer.integrations.Integrations;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.weesli.rClaim.api.events.ClaimDeleteEvent;
import net.weesli.rClaim.api.events.TrustedPlayerEvent;
import net.weesli.rClaim.api.events.UnTrustedPlayerEvent;
import net.weesli.rClaim.utils.Claim;
import net.weesli.rClaim.modal.Claim;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand All @@ -20,6 +20,7 @@

import java.util.Optional;
import java.util.UUID;
import java.util.stream.Collectors;

/**
* RClaim Integration Listener class
Expand Down Expand Up @@ -49,7 +50,7 @@ public void createClaim(ClaimCreateEvent e){
*/
@EventHandler
public void trustPlayer(TrustedPlayerEvent e){
Claim claim = RClaimAPI.getInstance().getClaims().stream().filter(c -> c.isOwner(e.getTruster().getUniqueId())).toList().get(0);
Claim claim = RClaimAPI.getInstance().getClaims().stream().filter(c -> c.isOwner(e.getTruster().getUniqueId())).collect(Collectors.toList()).get(0);
if (!FarmerManager.getFarmers().containsKey(claim.getID())) return;
UUID target = e.getTrusted().getUniqueId();
Farmer farmer = FarmerManager.getFarmers().get(claim.getID());
Expand All @@ -62,7 +63,7 @@ public void trustPlayer(TrustedPlayerEvent e){
*/
@EventHandler
public void unTrustPlayer(UnTrustedPlayerEvent e){
Claim claim = RClaimAPI.getInstance().getClaims().stream().filter(c -> c.isOwner(e.getTruster().getUniqueId())).toList().get(0);
Claim claim = RClaimAPI.getInstance().getClaims().stream().filter(c -> c.isOwner(e.getTruster().getUniqueId())).collect(Collectors.toList()).get(0);
if (!FarmerManager.getFarmers().containsKey(claim.getID())) return;
Farmer farmer = FarmerManager.getFarmers().get(claim.getID());
Optional<User> user = farmer.getUsersWithoutOwner().stream().filter(u -> u.getUuid().equals(e.getTrusted().getUniqueId())).findFirst();
Expand Down
Loading