use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class ItemTagsCommand method updateInv.
@Path("updateInv")
@Permission(Group.ADMIN)
@Description("Update item tags on all items in inventory")
void updateInv() {
ItemStack[] contents = inventory().getContents();
int count = 0;
for (ItemStack item : contents) {
if (isNullOrAir(item))
continue;
ItemTagsUtils.updateItem(item);
++count;
}
send(PREFIX + count + " items itemtags updated!");
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class ItemTagsCommand method setCondition.
@Path("setCondition <condition>")
@Permission(Group.ADMIN)
void setCondition(Condition condition) {
ItemStack tool = getToolRequired();
ItemTagsUtils.updateCondition(tool, condition);
Condition.setDurability(tool, condition);
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class HomesCommand method lockInWorld.
@Async
@Confirm
@Path("lockInWorld <world>")
@Permission(Group.ADMIN)
void lockInWorld(World world) {
int count = 0;
for (HomeOwner owner : service.getAll()) {
boolean updated = false;
for (Home home : homeOwner.getHomes()) {
if (world.equals(home.getLocation().getWorld()) && !home.isLocked()) {
++count;
updated = true;
home.setLocked(true);
}
}
if (updated)
service.save(owner);
}
send(PREFIX + "Locked " + count + " homes");
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class ArmorStandEditorCommand method position_arms.
@Path("position arms left")
@Permission(Group.ADMIN)
void position_arms() {
ArmorStand armorStand = (ArmorStand) getTargetEntityRequired(EntityType.ARMOR_STAND);
if (!isPerkAllowedAt(player(), armorStand.getLocation()))
error("You cannot edit armor stands here");
float yaw = LocationUtils.normalizeYaw(location());
float pitch = location().getPitch();
line();
send("yaw: " + yaw + " / pitch: " + pitch);
double x;
if (yaw > 180)
x = yaw + pitch;
else
x = yaw - pitch;
double y = yaw + 180;
if (y > 360)
y -= 360;
double z = 0;
double xr = Math.toRadians(x);
double yr = Math.toRadians(y);
double zr = Math.toRadians(z);
send(StringUtils.getDf().format(x) + " " + StringUtils.getDf().format(y) + " " + StringUtils.getDf().format(z));
send(StringUtils.getDf().format(xr) + " " + StringUtils.getDf().format(yr) + " " + StringUtils.getDf().format(zr));
EulerAngle ea = new EulerAngle(xr, yr, zr);
armorStand.setLeftArmPose(ea);
}
use of gg.projecteden.nexus.framework.commands.models.annotations.Permission in project Nexus by ProjectEdenGG.
the class Pugmas20Command method treeRegion.
@Permission(Group.ADMIN)
@Path("tree region <treeType> <id>")
void treeRegion(PugmasTreeType treeType, int id) {
ProtectedRegion region = treeType.getRegion(id);
String command = region == null ? "define" : "redefine";
runCommand("mcmd /here ;; rg " + command + " pugmas20_trees_" + treeType.name().toLowerCase() + "_" + id);
}
Aggregations