mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-24 01:19:28 +00:00
KingdomsX 兼容
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