mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-28 19:39:20 +00:00
1.3.1 remake
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package net.momirealms.customcrops.integrations;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.kingdoms.constants.group.Kingdom;
|
||||
import org.kingdoms.constants.land.Land;
|
||||
import org.kingdoms.constants.player.KingdomPlayer;
|
||||
|
||||
public class KingdomsXIntegrations {
|
||||
public static boolean checkKDBuild(Location location, Player player){
|
||||
KingdomPlayer kp = KingdomPlayer.getKingdomPlayer(player);
|
||||
Land land = Land.getLand(location);
|
||||
if (land == null) return false;
|
||||
if (land.isClaimed()) {
|
||||
Kingdom cropKingdom = land.getKingdom();
|
||||
if (kp.getKingdom() != null) {
|
||||
Kingdom kingdom = kp.getKingdom();
|
||||
return kingdom != cropKingdom;
|
||||
}else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user