mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 13:45:36 +01:00
Fix for PreciousStones
This commit is contained in:
parent
ef06ca3b19
commit
bdff04cff4
@ -2,6 +2,8 @@ package com.boydti.fawe.bukkit.regions;
|
|||||||
|
|
||||||
import com.boydti.fawe.bukkit.FaweBukkit;
|
import com.boydti.fawe.bukkit.FaweBukkit;
|
||||||
import com.boydti.fawe.object.FawePlayer;
|
import com.boydti.fawe.object.FawePlayer;
|
||||||
|
import com.boydti.fawe.regions.FaweMask;
|
||||||
|
import com.sk89q.worldedit.BlockVector;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones;
|
import net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones;
|
||||||
import net.sacredlabyrinth.Phaed.PreciousStones.field.Field;
|
import net.sacredlabyrinth.Phaed.PreciousStones.field.Field;
|
||||||
@ -23,20 +25,20 @@ public class PreciousStonesFeature extends BukkitMaskManager implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BukkitMask getMask(final FawePlayer<Player> fp) {
|
public FaweMask getMask(final FawePlayer<Player> fp) {
|
||||||
final Player player = fp.parent;
|
final Player player = fp.parent;
|
||||||
final Location location = player.getLocation();
|
final Location location = player.getLocation();
|
||||||
final List<Field> fields = PreciousStones.API().getFieldsProtectingArea(FieldFlag.PLOT, location);
|
final List<Field> fields = PreciousStones.API().getFieldsProtectingArea(FieldFlag.PLOT, location);
|
||||||
for (final Field myfield : fields) {
|
if (fields.isEmpty()) {
|
||||||
if (myfield.getOwner().equalsIgnoreCase(player.getName()) || (myfield.getAllowed().contains(player.getName()))) {
|
return null;
|
||||||
final Location pos1 = new Location(location.getWorld(), myfield.getCorners().get(0).getBlockX(), myfield.getCorners().get(0).getBlockY(), myfield.getCorners().get(0).getBlockZ());
|
|
||||||
final Location pos2 = new Location(location.getWorld(), myfield.getCorners().get(1).getBlockX(), myfield.getCorners().get(1).getBlockY(), myfield.getCorners().get(1).getBlockZ());
|
|
||||||
return new BukkitMask(pos1, pos2) {
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return "FIELD:" + myfield.toString();
|
|
||||||
}
|
}
|
||||||
};
|
String name = player.getName();
|
||||||
|
boolean member = fp.hasPermission("fawe.preciousstones.member");
|
||||||
|
for (final Field myField : fields) {
|
||||||
|
if (myField.isOwner(name) || (member && myField.getAllowed().contains(player.getName()))) {
|
||||||
|
BlockVector pos1 = new BlockVector(myField.getMinx(), myField.getMiny(), myField.getMinz());
|
||||||
|
BlockVector pos2 = new BlockVector(myField.getMaxx(), myField.getMaxy(), myField.getMaxz());
|
||||||
|
return new FaweMask(pos1, pos2, "FIELD: " + myField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user