Mirror von
https://github.com/St3venAU/ArmorStandTools.git
synchronisiert 2024-12-26 03:20:07 +01:00
v4.0.2
Dieser Commit ist enthalten in:
Ursprung
1e7a868862
Commit
0023ddedd1
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2019 St3venAU
|
Copyright (c) 2021 St3venAU
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -57,7 +57,8 @@ WorldGuard Integration
|
|||||||
|
|
||||||
Permissions
|
Permissions
|
||||||
-----------
|
-----------
|
||||||
- astools.use : Permission for using any of the tools, except for those that have a custom permission below
|
- astools.use: Permission for using any of the tools, except for those that have a custom permission below
|
||||||
|
- astools.new: Permission to use "/astools new" command to summon a new armor stand
|
||||||
- astools.clone: Permission to use the clone tool
|
- astools.clone: Permission to use the clone tool
|
||||||
- astools.head: Permission to use the player head tool (Ability to specify a player head for an armor stand)
|
- astools.head: Permission to use the player head tool (Ability to specify a player head for an armor stand)
|
||||||
- astools.summon: Permission to use the summon tool (Summons an armor stand without requiring the materials)
|
- astools.summon: Permission to use the summon tool (Summons an armor stand without requiring the materials)
|
||||||
@ -66,6 +67,7 @@ Permissions
|
|||||||
- astools.ascmd.assign.player: Permission to assign a player command to an armor stand
|
- astools.ascmd.assign.player: Permission to assign a player command to an armor stand
|
||||||
- astools.ascmd.remove: Permission to remove a command from an armor stand
|
- astools.ascmd.remove: Permission to remove a command from an armor stand
|
||||||
- astools.ascmd.view: Permission to view the command assigned to an armor stand
|
- astools.ascmd.view: Permission to view the command assigned to an armor stand
|
||||||
|
- astools.ascmd.cooldown: Permission to add a cooldown to commands assigned to an armor stand
|
||||||
- astools.ascmd.execute: Permission to execute a command assigned to an armor stand by (on right click)
|
- astools.ascmd.execute: Permission to execute a command assigned to an armor stand by (on right click)
|
||||||
- astools.bypass-wg-flag: Permission to bypass the WorldGuard ast flag, allowing the player to use AST even in regions that ast flag is set to deny.
|
- astools.bypass-wg-flag: Permission to bypass the WorldGuard ast flag, allowing the player to use AST even in regions that ast flag is set to deny.
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.gmail.St3venAU.plugins</groupId>
|
<groupId>com.gmail.St3venAU.plugins</groupId>
|
||||||
<artifactId>ArmorStandTools</artifactId>
|
<artifactId>ArmorStandTools</artifactId>
|
||||||
<version>4.0.1</version>
|
<version>4.0.2</version>
|
||||||
<name>ArmorStandTools</name>
|
<name>ArmorStandTools</name>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
@ -172,9 +172,7 @@ public class AST extends JavaPlugin {
|
|||||||
static boolean checkBlockPermission(Player p, Block b) {
|
static boolean checkBlockPermission(Player p, Block b) {
|
||||||
if(b == null) return true;
|
if(b == null) return true;
|
||||||
if (PlotSquaredHook.api != null) {
|
if (PlotSquaredHook.api != null) {
|
||||||
debug("PlotSquaredHook.api: " + PlotSquaredHook.api);
|
|
||||||
Location l = b.getLocation();
|
Location l = b.getLocation();
|
||||||
debug("PlotSquaredHook.isPlotWorld(l): " + PlotSquaredHook.isPlotWorld(l));
|
|
||||||
if(PlotSquaredHook.isPlotWorld(l)) {
|
if(PlotSquaredHook.isPlotWorld(l)) {
|
||||||
Boolean hasPermission = PlotSquaredHook.checkPermission(p, l);
|
Boolean hasPermission = PlotSquaredHook.checkPermission(p, l);
|
||||||
if(hasPermission != null) {
|
if(hasPermission != null) {
|
||||||
@ -205,17 +203,18 @@ public class AST extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static boolean playerHasPermission(Player p, Block b, ArmorStandTool tool) {
|
static boolean playerHasPermission(Player p, Block b, ArmorStandTool tool) {
|
||||||
debug("tool: " + tool);
|
String permNode = tool == null ? "astools.use" : tool.getPermission();
|
||||||
if(tool != null) {
|
boolean enabled = tool == null || tool.isEnabled();
|
||||||
debug("en: " + tool.isEnabled());
|
boolean hasNode = Utils.hasPermissionNode(p, permNode);
|
||||||
debug("perm: " + Utils.hasPermissionNode(p, tool.getPermission()));
|
boolean blockPerm = checkBlockPermission(p, b);
|
||||||
|
if(Config.debug) {
|
||||||
|
AST.debug("Plr: " + p.getName() + ", Tool: " + tool + ", Tool En: " + enabled + ", Perm: " + permNode + ", Has Perm: " + hasNode + ", Location Perm: " + blockPerm);
|
||||||
}
|
}
|
||||||
String permission = tool == null ? "astools.use" : tool.getPermission();
|
return enabled && hasNode && blockPerm;
|
||||||
return (tool == null || tool.isEnabled()) && Utils.hasPermissionNode(p, permission) && checkBlockPermission(p, b);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void debug(String msg) {
|
static void debug(String msg) {
|
||||||
if(!Config.debug) return;
|
if(!Config.debug) return;
|
||||||
Bukkit.getLogger().log(Level.INFO, "[DEBUG] " + msg);
|
Bukkit.getLogger().log(Level.INFO, "[AST DEBUG] " + msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ package com.gmail.st3venau.plugins.armorstandtools;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -24,12 +25,12 @@ import java.util.UUID;
|
|||||||
|
|
||||||
class ArmorStandGUI implements Listener {
|
class ArmorStandGUI implements Listener {
|
||||||
|
|
||||||
private static final int INV_SLOT_HELMET = 2;
|
private static final int INV_SLOT_HELMET = 1;
|
||||||
private static final int INV_SLOT_CHEST = 11;
|
private static final int INV_SLOT_CHEST = 10;
|
||||||
private static final int INV_SLOT_PANTS = 20;
|
private static final int INV_SLOT_PANTS = 19;
|
||||||
private static final int INV_SLOT_BOOTS = 29;
|
private static final int INV_SLOT_BOOTS = 28;
|
||||||
private static final int INV_SLOT_R_HAND = 10;
|
private static final int INV_SLOT_R_HAND = 9;
|
||||||
private static final int INV_SLOT_L_HAND = 12;
|
private static final int INV_SLOT_L_HAND = 11;
|
||||||
|
|
||||||
private static final HashSet<Integer> inUse = new HashSet<>();
|
private static final HashSet<Integer> inUse = new HashSet<>();
|
||||||
private static final HashSet<Integer> invSlots = new HashSet<>();
|
private static final HashSet<Integer> invSlots = new HashSet<>();
|
||||||
@ -106,10 +107,12 @@ class ArmorStandGUI implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
boolean rightClick = event.getClick() == ClickType.RIGHT;
|
||||||
int slot = event.getRawSlot();
|
int slot = event.getRawSlot();
|
||||||
if(slot > i.getSize()) return;
|
if(slot > i.getSize()) return;
|
||||||
|
Location l = as.getLocation();
|
||||||
if(invSlots.contains(slot)) {
|
if(invSlots.contains(slot)) {
|
||||||
if(AST.checkBlockPermission(p, as.getLocation().getBlock())) {
|
if(AST.checkBlockPermission(p, l.getBlock())) {
|
||||||
updateArmorStandInventory();
|
updateArmorStandInventory();
|
||||||
} else {
|
} else {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -121,7 +124,7 @@ class ArmorStandGUI implements Listener {
|
|||||||
if(!(event.getWhoClicked() instanceof Player)) return;
|
if(!(event.getWhoClicked() instanceof Player)) return;
|
||||||
ArmorStandTool t = ArmorStandTool.get(event.getCurrentItem());
|
ArmorStandTool t = ArmorStandTool.get(event.getCurrentItem());
|
||||||
if(t == null) return;
|
if(t == null) return;
|
||||||
if (!AST.playerHasPermission(p, as.getLocation().getBlock(), t)) {
|
if (!AST.playerHasPermission(p, l.getBlock(), t)) {
|
||||||
p.sendMessage(ChatColor.RED + Config.generalNoPerm);
|
p.sendMessage(ChatColor.RED + Config.generalNoPerm);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -193,6 +196,23 @@ class ArmorStandGUI implements Listener {
|
|||||||
AST.pickUpArmorStand(as, p);
|
AST.pickUpArmorStand(as, p);
|
||||||
Utils.title(p, Config.carrying);
|
Utils.title(p, Config.carrying);
|
||||||
break;
|
break;
|
||||||
|
case UP:
|
||||||
|
case DOWN:
|
||||||
|
double dist = (t == ArmorStandTool.UP ? 1 : -1) * (rightClick ? 1 : 0.1);
|
||||||
|
l.add(0, dist,0);
|
||||||
|
if (!AST.playerHasPermission(p, l.getBlock(), null)) {
|
||||||
|
p.closeInventory();
|
||||||
|
p.sendMessage(ChatColor.RED + Config.wgNoPerm);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
as.setGravity(false);
|
||||||
|
as.teleport(l);
|
||||||
|
break;
|
||||||
|
case ROTATE:
|
||||||
|
float yaw = l.getYaw() + (rightClick ? -5 : 5);
|
||||||
|
l.setYaw(yaw);
|
||||||
|
as.teleport(l);
|
||||||
|
break;
|
||||||
case GLOW:
|
case GLOW:
|
||||||
boolean glowing = !as.isGlowing();
|
boolean glowing = !as.isGlowing();
|
||||||
as.setGlowing(glowing);
|
as.setGlowing(glowing);
|
||||||
|
@ -16,25 +16,30 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public enum ArmorStandTool {
|
public enum ArmorStandTool {
|
||||||
|
|
||||||
HEAD ("gui_head", Material.PLAYER_HEAD, 6, "astools.use", false),
|
HEAD ("gui_head", Material.PLAYER_HEAD, 7, "astools.use", false),
|
||||||
BODY ("gui_body", Material.NETHER_BRICKS, 15, "astools.use", false),
|
BODY ("gui_body", Material.NETHER_BRICKS, 16, "astools.use", false),
|
||||||
RARM ("gui_rarm", Material.REDSTONE_TORCH, 14, "astools.use", true),
|
RARM ("gui_rarm", Material.REDSTONE_TORCH, 15, "astools.use", true),
|
||||||
LARM ("gui_larm", Material.TORCH, 16, "astools.use", true),
|
LARM ("gui_larm", Material.TORCH, 17, "astools.use", true),
|
||||||
RLEG ("gui_rleg", Material.BLAZE_ROD, 23, "astools.use", true),
|
RLEG ("gui_rleg", Material.BLAZE_ROD, 24, "astools.use", true),
|
||||||
LLEG ("gui_lleg", Material.BONE, 25, "astools.use", true),
|
LLEG ("gui_lleg", Material.BONE, 26, "astools.use", true),
|
||||||
MOVE ("gui_move", Material.FEATHER, 24, "astools.use", false),
|
MOVE ("gui_move", Material.FEATHER, 25, "astools.use", false),
|
||||||
CLONE ("gui_clone", Material.GLOWSTONE_DUST, 33, "astools.clone", false),
|
CLONE ("gui_clone", Material.GLOWSTONE_DUST, 34, "astools.clone", false),
|
||||||
SAVE ("gui_save", Material.DIAMOND, 43, "astools.cmdblock",false),
|
|
||||||
SLOTS ("gui_slots", Material.IRON_HOE, 44, "astools.use", false),
|
UP ("gui_moveup", Material.LIGHTNING_ROD, 4, "astools.use", false),
|
||||||
|
DOWN ("gui_movedown",Material.LEVER, 13, "astools.use", false),
|
||||||
|
ROTATE ("gui_rotate", Material.ENDER_PEARL, 22, "astools.use", false),
|
||||||
|
|
||||||
|
PHEAD ("gui_pHead", Material.PLAYER_HEAD, 36, "astools.head", false),
|
||||||
NAME ("gui_name", Material.NAME_TAG, 45, "astools.use", false),
|
NAME ("gui_name", Material.NAME_TAG, 45, "astools.use", false),
|
||||||
PHEAD ("gui_pHead", Material.PLAYER_HEAD, 46, "astools.head", false),
|
INVIS ("gui_invis", Material.GOLD_NUGGET, 46, "astools.use", false),
|
||||||
INVIS ("gui_invis", Material.GOLD_NUGGET, 47, "astools.use", false),
|
ARMS ("gui_arms", Material.ARROW, 47, "astools.use", false),
|
||||||
ARMS ("gui_arms", Material.ARROW, 48, "astools.use", false),
|
BASE ("gui_base", Material.STONE_SLAB, 48, "astools.use", false),
|
||||||
BASE ("gui_base", Material.STONE_SLAB, 49, "astools.use", false),
|
SIZE ("gui_size", Material.EMERALD, 49, "astools.use", false),
|
||||||
SIZE ("gui_size", Material.EMERALD, 50, "astools.use", false),
|
GRAV ("gui_grav", Material.GHAST_TEAR, 50, "astools.use", false),
|
||||||
GRAV ("gui_grav", Material.GHAST_TEAR, 51, "astools.use", false),
|
INVUL ("gui_invul", Material.GLISTERING_MELON_SLICE, 51, "astools.use", false),
|
||||||
INVUL ("gui_invul", Material.GLISTERING_MELON_SLICE, 52, "astools.use", false),
|
SLOTS ("gui_slots", Material.IRON_HOE, 52, "astools.use", false),
|
||||||
GLOW ("gui_glow", Material.GLOWSTONE, 53, "astools.glow", false);
|
GLOW ("gui_glow", Material.GLOWSTONE, 53, "astools.glow", false),
|
||||||
|
SAVE ("gui_save", Material.DIAMOND, 44, "astools.cmdblock",false);
|
||||||
|
|
||||||
private final ItemStack item;
|
private final ItemStack item;
|
||||||
private final String config_id;
|
private final String config_id;
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
package com.gmail.st3venau.plugins.armorstandtools;
|
package com.gmail.st3venau.plugins.armorstandtools;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.TabCompleter;
|
import org.bukkit.command.TabCompleter;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@ -29,7 +31,22 @@ class Commands implements CommandExecutor, TabCompleter {
|
|||||||
p.sendMessage(ChatColor.RED + Config.noCommandPerm);
|
p.sendMessage(ChatColor.RED + Config.noCommandPerm);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
p.sendMessage(ChatColor.AQUA + Config.instructions);
|
if(args.length > 0 && args[0].equalsIgnoreCase("new")) {
|
||||||
|
// astools new
|
||||||
|
if (!Utils.hasPermissionNode(p, "astools.new")) {
|
||||||
|
p.sendMessage(ChatColor.RED + Config.noCommandPerm);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Location l = Utils.getLocationFacing(p.getLocation());
|
||||||
|
if(l.getWorld() == null) {
|
||||||
|
p.sendMessage(ChatColor.RED + Config.error);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
ArmorStand as = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
|
||||||
|
AST.pickUpArmorStand(as, p);
|
||||||
|
Utils.title(p, Config.carrying);
|
||||||
|
}
|
||||||
|
p.sendMessage(ChatColor.AQUA + Config.instructions1 + ChatColor.GREEN + " /ast new " + ChatColor.AQUA + Config.instructions2);
|
||||||
return true;
|
return true;
|
||||||
} else if(cmd.equals("ascmd")) {
|
} else if(cmd.equals("ascmd")) {
|
||||||
ArmorStand as = getNearbyArmorStand(p);
|
ArmorStand as = getNearbyArmorStand(p);
|
||||||
@ -111,6 +128,10 @@ class Commands implements CommandExecutor, TabCompleter {
|
|||||||
p.sendMessage("\n" + Config.assignCmdError + name);
|
p.sendMessage("\n" + Config.assignCmdError + name);
|
||||||
}
|
}
|
||||||
} else if(args.length >= 2 && args[0].equalsIgnoreCase("cooldown")) { //ascmd cooldown <ticks>/remove
|
} else if(args.length >= 2 && args[0].equalsIgnoreCase("cooldown")) { //ascmd cooldown <ticks>/remove
|
||||||
|
if (!Utils.hasPermissionNode(p, "astools.ascmd.cooldown")) {
|
||||||
|
p.sendMessage(ChatColor.RED + Config.noCommandPerm);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
ArmorStandCmd asCmd = new ArmorStandCmd(as);
|
ArmorStandCmd asCmd = new ArmorStandCmd(as);
|
||||||
if(asCmd.getCommand() == null) {
|
if(asCmd.getCommand() == null) {
|
||||||
p.sendMessage(Config.closestAS + name + Config.hasNoCmd);
|
p.sendMessage(Config.closestAS + name + Config.hasNoCmd);
|
||||||
|
@ -37,9 +37,9 @@ class Config {
|
|||||||
ascmdHelp, viewCmd, removeCmd, assignConsole,
|
ascmdHelp, viewCmd, removeCmd, assignConsole,
|
||||||
assignPlayer, executeCmdError, cmdOnCooldown,
|
assignPlayer, executeCmdError, cmdOnCooldown,
|
||||||
cooldownRemovedFrom, isAnInvalidCooldown,
|
cooldownRemovedFrom, isAnInvalidCooldown,
|
||||||
cooldownSetTo, ticksFor, setCooldown,
|
cooldownSetTo, ticksFor, setCooldown, glow,
|
||||||
removeCooldown, glow, instructions, crouch, click,
|
removeCooldown, instructions1, instructions2,
|
||||||
finish;
|
crouch, click, finish, error;
|
||||||
|
|
||||||
static void reload(AST main) {
|
static void reload(AST main) {
|
||||||
plugin = main;
|
plugin = main;
|
||||||
@ -57,7 +57,7 @@ class Config {
|
|||||||
requireCreative = config.getBoolean("requireCreativeForSaveAsCmdBlock");
|
requireCreative = config.getBoolean("requireCreativeForSaveAsCmdBlock");
|
||||||
defaultASCmdCooldownTicks = config.getInt("defaultASCmdCooldownTicks");
|
defaultASCmdCooldownTicks = config.getInt("defaultASCmdCooldownTicks");
|
||||||
ignoreWGForASCmdExecution = config.getBoolean("bypassWorldguardForASCmdExecution");
|
ignoreWGForASCmdExecution = config.getBoolean("bypassWorldguardForASCmdExecution");
|
||||||
debug = config.getBoolean("debug", false);
|
debug = config.getBoolean("showDebugMessages", false);
|
||||||
|
|
||||||
AST.activeTool.clear();
|
AST.activeTool.clear();
|
||||||
AST.selectedArmorStand.clear();
|
AST.selectedArmorStand.clear();
|
||||||
@ -159,10 +159,12 @@ class Config {
|
|||||||
removeCooldown = languageConfig.getString("removeCooldown");
|
removeCooldown = languageConfig.getString("removeCooldown");
|
||||||
ticksFor = languageConfig.getString("ticksFor");
|
ticksFor = languageConfig.getString("ticksFor");
|
||||||
glow = languageConfig.getString("glow");
|
glow = languageConfig.getString("glow");
|
||||||
instructions = languageConfig.getString("instructions");
|
instructions1 = languageConfig.getString("instructions1");
|
||||||
|
instructions2 = languageConfig.getString("instructions2");
|
||||||
crouch = languageConfig.getString("crouch");
|
crouch = languageConfig.getString("crouch");
|
||||||
click = languageConfig.getString("click");
|
click = languageConfig.getString("click");
|
||||||
finish = languageConfig.getString("finish");
|
finish = languageConfig.getString("finish");
|
||||||
|
error = languageConfig.getString("error");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import org.bukkit.metadata.MetadataValue;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
@SuppressWarnings("CommentedOutCode")
|
||||||
public class MainListener implements Listener {
|
public class MainListener implements Listener {
|
||||||
|
|
||||||
private static final Pattern MC_USERNAME_PATTERN = Pattern.compile("^[a-zA-Z0-9_]{3,16}$");
|
private static final Pattern MC_USERNAME_PATTERN = Pattern.compile("^[a-zA-Z0-9_]{3,16}$");
|
||||||
@ -34,9 +35,14 @@ public class MainListener implements Listener {
|
|||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
if(stopEditing(p, false)) {
|
if(stopEditing(p, false)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
AST.debug("Interaction cancelled as player is already editing");
|
||||||
}
|
}
|
||||||
if(!(event.getRightClicked() instanceof ArmorStand)) return;
|
if(!(event.getRightClicked() instanceof ArmorStand)) return;
|
||||||
ArmorStand as = (ArmorStand) event.getRightClicked();
|
ArmorStand as = (ArmorStand) event.getRightClicked();
|
||||||
|
AST.debug(p.getName() + " right-clicked " + as.getName() + ", Crouching: " + p.isSneaking());
|
||||||
|
if(event.isCancelled()) {
|
||||||
|
AST.debug("Interaction with Armor Stand was cancelled by a plugin");
|
||||||
|
}
|
||||||
if(!event.isCancelled() && ArmorStandGUI.isInUse(as)) {
|
if(!event.isCancelled() && ArmorStandGUI.isInUse(as)) {
|
||||||
Utils.title(p, Config.guiInUse);
|
Utils.title(p, Config.guiInUse);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -66,9 +72,7 @@ public class MainListener implements Listener {
|
|||||||
|
|
||||||
ArmorStand getCarryingArmorStand(Player p) {
|
ArmorStand getCarryingArmorStand(Player p) {
|
||||||
UUID uuid = p.getUniqueId();
|
UUID uuid = p.getUniqueId();
|
||||||
return ArmorStandTool.MOVE == AST.activeTool.get(uuid)
|
return ArmorStandTool.MOVE == AST.activeTool.get(uuid) ? AST.selectedArmorStand.get(uuid) : null;
|
||||||
? AST.selectedArmorStand.get(uuid)
|
|
||||||
: null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
@ -247,7 +251,9 @@ public class MainListener implements Listener {
|
|||||||
attachment.setPermission("astools.ascmd.remove", true);
|
attachment.setPermission("astools.ascmd.remove", true);
|
||||||
attachment.setPermission("astools.ascmd.assign.player", true);
|
attachment.setPermission("astools.ascmd.assign.player", true);
|
||||||
attachment.setPermission("astools.ascmd.assign.console", true);
|
attachment.setPermission("astools.ascmd.assign.console", true);
|
||||||
|
attachment.setPermission("astools.ascmd.cooldown", true);
|
||||||
attachment.setPermission("astools.ascmd.execute", true);
|
attachment.setPermission("astools.ascmd.execute", true);
|
||||||
|
attachment.setPermission("astools.new", true);
|
||||||
//attachment.setPermission("astools.bypass-wg-flag", true);
|
//attachment.setPermission("astools.bypass-wg-flag", true);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
@ -25,24 +25,18 @@ class PlotSquaredHook {
|
|||||||
|
|
||||||
public static Boolean checkPermission(Player p, Location l) {
|
public static Boolean checkPermission(Player p, Location l) {
|
||||||
if(l.getWorld() == null) return null;
|
if(l.getWorld() == null) return null;
|
||||||
com.plotsquared.core.location.Location plotLocation
|
com.plotsquared.core.location.Location plotLocation = com.plotsquared.core.location.Location.at(l.getWorld().getName(), BlockVector3.at(l.getBlockX(), l.getBlockY(), l.getBlockZ()));
|
||||||
= com.plotsquared.core.location.Location.at(l.getWorld().getName(), BlockVector3.at(l.getBlockX(), l.getBlockY(), l.getBlockZ()));
|
|
||||||
PlotArea plotArea = plotLocation.getPlotArea();
|
PlotArea plotArea = plotLocation.getPlotArea();
|
||||||
if(plotArea == null) {
|
if(plotArea == null) {
|
||||||
AST.debug("plots.admin.build.road: " + p.hasPermission("plots.admin.build.road"));
|
|
||||||
return p.hasPermission("plots.admin.build.road");
|
return p.hasPermission("plots.admin.build.road");
|
||||||
}
|
}
|
||||||
Plot plot = plotArea.getPlot(plotLocation);
|
Plot plot = plotArea.getPlot(plotLocation);
|
||||||
PlotPlayer<?> pp = api.wrapPlayer(p.getUniqueId());
|
PlotPlayer<?> pp = api.wrapPlayer(p.getUniqueId());
|
||||||
if(pp == null) return null;
|
if(pp == null) return null;
|
||||||
AST.debug("Plot: " + plot);
|
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
AST.debug("plots.admin.build.road: " + pp.hasPermission("plots.admin.build.road"));
|
|
||||||
return pp.hasPermission("plots.admin.build.road");
|
return pp.hasPermission("plots.admin.build.road");
|
||||||
}
|
}
|
||||||
UUID uuid = pp.getUUID();
|
UUID uuid = pp.getUUID();
|
||||||
AST.debug("plot.isAdded: " + plot.isAdded(uuid));
|
|
||||||
AST.debug("plots.admin.build.other: " + pp.hasPermission("plots.admin.build.other"));
|
|
||||||
return plot.isAdded(uuid) || pp.hasPermission("plots.admin.build.other");
|
return plot.isAdded(uuid) || pp.hasPermission("plots.admin.build.other");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,6 +232,7 @@ class Utils {
|
|||||||
sb.append(",Count:").append(is.getAmount());
|
sb.append(",Count:").append(is.getAmount());
|
||||||
}
|
}
|
||||||
String itemStackTags = getItemStackTags(is);
|
String itemStackTags = getItemStackTags(is);
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
short durability = is.getDurability();
|
short durability = is.getDurability();
|
||||||
String skullOwner = skullOwner(is);
|
String skullOwner = skullOwner(is);
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#
|
#
|
||||||
# Permissions:
|
# Permissions:
|
||||||
# astools.use Permission to using any of the tools, except the ones below that have their own separate permissions (see below)
|
# astools.use Permission to using any of the tools, except the ones below that have their own separate permissions (see below)
|
||||||
|
# astools.new Permission to use "/astools new" command to summon a new armor stand
|
||||||
# astools.clone Permission to use the clone tool (Clones an armor stand without requiring the materials)
|
# astools.clone Permission to use the clone tool (Clones an armor stand without requiring the materials)
|
||||||
# astools.summon Permission to use the summon tool (Summons an armor stand without requiring the materials)
|
# astools.summon Permission to use the summon tool (Summons an armor stand without requiring the materials)
|
||||||
# astools.head Permission to use the player head tool (Ability to specify a player head for an armor stand)
|
# astools.head Permission to use the player head tool (Ability to specify a player head for an armor stand)
|
||||||
@ -40,6 +41,7 @@
|
|||||||
# astools.ascmd.remove Permission to remove a command from an armor stand
|
# astools.ascmd.remove Permission to remove a command from an armor stand
|
||||||
# astools.ascmd.view Permission to view the command assigned to an armor stand
|
# astools.ascmd.view Permission to view the command assigned to an armor stand
|
||||||
# astools.ascmd.execute Permission to execute a command assigned to an armor stand by (on right click)
|
# astools.ascmd.execute Permission to execute a command assigned to an armor stand by (on right click)
|
||||||
|
# astools.ascmd.cooldown Permission to add a cooldown to commands assigned to an armor stand
|
||||||
# astools.bypass-wg-flag Permission to bypass AST's custom worldguard flag (see below for more details)
|
# astools.bypass-wg-flag Permission to bypass AST's custom worldguard flag (see below for more details)
|
||||||
#
|
#
|
||||||
# WorldGuard Integration:
|
# WorldGuard Integration:
|
||||||
@ -50,6 +52,7 @@
|
|||||||
# this permission can use AST in worldguard regions even if the ast flag for that region is set to Deny.
|
# this permission can use AST in worldguard regions even if the ast flag for that region is set to Deny.
|
||||||
# - The ast worldguard flag is also ignored for players that have op.
|
# - The ast worldguard flag is also ignored for players that have op.
|
||||||
#
|
#
|
||||||
|
showDebugMessages: false
|
||||||
integrateWithWorldGuard: true
|
integrateWithWorldGuard: true
|
||||||
allowMovingStandsBetweenWorlds: false
|
allowMovingStandsBetweenWorlds: false
|
||||||
requireCreativeForSaveAsCmdBlock: false
|
requireCreativeForSaveAsCmdBlock: false
|
||||||
@ -68,6 +71,9 @@ enableTool:
|
|||||||
gui_pHead: true
|
gui_pHead: true
|
||||||
gui_invul: true
|
gui_invul: true
|
||||||
gui_move: true
|
gui_move: true
|
||||||
|
gui_moveup: true
|
||||||
|
gui_movedown: true
|
||||||
|
gui_rotate: true
|
||||||
gui_glow: true
|
gui_glow: true
|
||||||
gui_head: true
|
gui_head: true
|
||||||
gui_body: true
|
gui_body: true
|
||||||
|
@ -84,19 +84,39 @@ removeCooldown: 'Remove the cooldown for the command'
|
|||||||
# New since v3.4.1
|
# New since v3.4.1
|
||||||
glow: 'Glow'
|
glow: 'Glow'
|
||||||
#New since v4.0.0
|
#New since v4.0.0
|
||||||
instructions: 'Crouch + right-click an armor stand to use Armor Stand Tools'
|
|
||||||
crouch: 'Crouch'
|
crouch: 'Crouch'
|
||||||
click: 'Click'
|
click: 'Click'
|
||||||
finish: 'Finish'
|
finish: 'Finish'
|
||||||
|
#New since v4.0.2
|
||||||
|
instructions1: 'Crouch + right-click an armor stand to edit, or use command'
|
||||||
|
instructions2: 'to summon a new armor stand'
|
||||||
|
error: 'An error occured. Try again.'
|
||||||
#
|
#
|
||||||
#############################
|
#############################
|
||||||
# Tool names & descriptions #
|
# Tool names & descriptions #
|
||||||
#############################
|
#############################
|
||||||
tool:
|
tool:
|
||||||
gui_move:
|
gui_move:
|
||||||
name: 'Pick Up (Move/Rotate)'
|
name: 'Pick Up (Move)'
|
||||||
lore:
|
lore:
|
||||||
- 'Pick up this armor stand to move or rotate it'
|
- 'Pick up this armor stand to move it'
|
||||||
|
gui_moveup:
|
||||||
|
name: 'Move Up'
|
||||||
|
lore:
|
||||||
|
- 'Left click: Move up 0.1 block'
|
||||||
|
- 'Right click: Move up 1 block'
|
||||||
|
- '(Automatically disables gravity)'
|
||||||
|
gui_movedown:
|
||||||
|
name: 'Move Down'
|
||||||
|
lore:
|
||||||
|
- 'Left click: Move down 0.1 block'
|
||||||
|
- 'Right click: Move down 1 block'
|
||||||
|
- '(Automatically disables gravity)'
|
||||||
|
gui_rotate:
|
||||||
|
name: 'Rotate'
|
||||||
|
lore:
|
||||||
|
- 'Left click: Rotate clockwise 5°'
|
||||||
|
- 'Right click: Rotate anti-clockwise 5°'
|
||||||
gui_clone:
|
gui_clone:
|
||||||
name: 'Clone'
|
name: 'Clone'
|
||||||
lore:
|
lore:
|
||||||
|
@ -9,7 +9,7 @@ commands:
|
|||||||
astools:
|
astools:
|
||||||
description: Provides player instructions on how to use AST
|
description: Provides player instructions on how to use AST
|
||||||
aliases: ast
|
aliases: ast
|
||||||
usage: Usage /astools or /ast
|
usage: Usage /astools or /ast, /ast new
|
||||||
ascmd:
|
ascmd:
|
||||||
description: View/Remove/Assign the command assigned to the nearest armor stand
|
description: View/Remove/Assign the command assigned to the nearest armor stand
|
||||||
usage: Usage /ascmd view, /ascmd remove, /ascmd assign <player/console> <command>
|
usage: Usage /ascmd view, /ascmd remove, /ascmd assign <player/console> <command>
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren