mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-11-27 21:15:28 +01:00
placing farms and tilling farms will now respect region permissions.
This commit is contained in:
parent
bd977b6f60
commit
4d28df97b0
@ -246,6 +246,7 @@ public class EFarm implements Farm {
|
||||
private static final Random random = new Random();
|
||||
|
||||
public boolean tillLand(Location location) {
|
||||
Player player = Bukkit.getPlayer(placedBy);
|
||||
EpicFarmingPlugin instance = EpicFarmingPlugin.getInstance();
|
||||
if (instance.getConfig().getBoolean("Main.Disable Auto Til Land")) return true;
|
||||
Block block = location.getBlock();
|
||||
@ -256,6 +257,7 @@ public class EFarm implements Farm {
|
||||
for (int fx = -radius; fx <= radius; fx++) {
|
||||
for (int fy = -2; fy <= 1; fy++) {
|
||||
for (int fz = -radius; fz <= radius; fz++) {
|
||||
if (!instance.canBuild(player, location)) continue;
|
||||
Block b2 = block.getWorld().getBlockAt(bx + fx, by + fy, bz + fz);
|
||||
|
||||
// ToDo: enum for all flowers.
|
||||
|
@ -77,6 +77,8 @@ public class BlockListeners implements Listener {
|
||||
|
||||
if (e.getBlockAgainst().getType() == farmBlock) e.setCancelled(true);
|
||||
|
||||
if (!instance.canBuild(e.getPlayer(), e.getBlock().getLocation())) return;
|
||||
|
||||
int amt = 0;
|
||||
for (Farm farmm : instance.getFarmManager().getFarms().values()) {
|
||||
if (!farmm.getPlacedBy().equals(e.getPlayer().getUniqueId())) continue;
|
||||
|
Loading…
Reference in New Issue
Block a user