9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-27 02:49:11 +00:00

lands + code clean

This commit is contained in:
Xiao-MoMi
2022-07-06 16:43:15 +08:00
parent d0d75ba809
commit a12120d053
10 changed files with 47 additions and 17 deletions

View File

@@ -0,0 +1,31 @@
package net.momirealms.customcrops.integrations;
import me.angeschossen.lands.api.flags.Flags;
import me.angeschossen.lands.api.integration.LandsIntegration;
import me.angeschossen.lands.api.land.Area;
import net.momirealms.customcrops.CustomCrops;
import org.bukkit.Location;
import org.bukkit.entity.Player;
public class Lands implements Integration{
@Override
public boolean canBreak(Location location, Player player) {
Area area = new LandsIntegration(CustomCrops.instance).getAreaByLoc(location);
if (area != null){
return area.hasFlag(player, Flags.BLOCK_BREAK, false);
}else {
return true;
}
}
@Override
public boolean canPlace(Location location, Player player) {
Area area = new LandsIntegration(CustomCrops.instance).getAreaByLoc(location);
if (area != null){
return area.hasFlag(player, Flags.BLOCK_PLACE, false);
}else {
return true;
}
}
}