3
0
Mirror von https://github.com/St3venAU/ArmorStandTools.git synchronisiert 2024-12-28 20:40:12 +01:00
Dieser Commit ist enthalten in:
Steven 2018-11-17 00:31:50 +08:00
Ursprung 076fdfd829
Commit 2bad136ebe
9 geänderte Dateien mit 35 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -9,8 +9,8 @@ I wanted to create an armor stand for each kit in my mini-game, and I quickly be
Compatibility Compatibility
------------- -------------
- Armor Stand Tools v3.0.2 - Spigot/CraftBukkit 1.13 only - Armor Stand Tools v3.2.0 - Spigot/CraftBukkit 1.13 only
- Armor Stand Tools v2.4.3 - Spigot/CraftBukkit 1.8, 1.9, 1.10, 1.11, 1.12 - Armor Stand Tools v2.4.3 - Spigot/CraftBukkit 1.8, 1.9, 1.10, 1.11, 1.12 (https://www.spigotmc.org/resources/armor-stand-tools.2237/download?version=175162)
Features Features
-------- --------
@ -35,7 +35,6 @@ Assigning Commands
- When a player with the astools.ascmd.execute permission right clicks on an armor stand, it's command is run. - When a player with the astools.ascmd.execute permission right clicks on an armor stand, it's command is run.
- If a player is crouching when they right click the armor stand, the command will not be run. - If a player is crouching when they right click the armor stand, the command will not be run.
- Warning: Make sure you are careful when assigning console commands. Any player with the astools.ascmd.execute permission will be able to execute the command. - Warning: Make sure you are careful when assigning console commands. Any player with the astools.ascmd.execute permission will be able to execute the command.
- Note: Commands may include a %player% placeholder, which will get replaced by the executing player's name at time of execution.
Commands Commands
-------- --------

Datei anzeigen

@ -2,6 +2,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.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;
@ -160,8 +161,12 @@ class ArmorStandGUI implements Listener {
Utils.actionBarMsg(p, Config.carrying); Utils.actionBarMsg(p, Config.carrying);
break; break;
case SAVE: case SAVE:
if(Config.requireCreative && p.getGameMode() != GameMode.CREATIVE) {
p.sendMessage(ChatColor.RED + Config.creativeRequired);
} else {
Main.nms.generateCmdBlock(p.getLocation(), as); Main.nms.generateCmdBlock(p.getLocation(), as);
Utils.actionBarMsg(p, Config.cbCreated); Utils.actionBarMsg(p, Config.cbCreated);
}
break; break;
case SIZE: case SIZE:
as.setSmall(!as.isSmall()); as.setSmall(!as.isSmall());

Datei anzeigen

@ -33,6 +33,7 @@ class Config {
public static boolean allowMoveWorld = false; public static boolean allowMoveWorld = false;
public static boolean deactivateOnWorldChange = true; public static boolean deactivateOnWorldChange = true;
public static boolean debug = false; public static boolean debug = false;
public static boolean requireCreative = false;
public static String public static String
invReturned, asDropped, asVisible, isTrue, isFalse, invReturned, asDropped, asVisible, isTrue, isFalse,
@ -42,7 +43,7 @@ class Config {
noRelPerm, noAirError, pleaseWait, appliedHead, noRelPerm, noAirError, pleaseWait, appliedHead,
invalidName, wgNoPerm, currently, headFailed, invalidName, wgNoPerm, currently, headFailed,
noCommandPerm, generalNoPerm, armorStand, none, noCommandPerm, generalNoPerm, armorStand, none,
guiInUse, noASNearBy, closestAS, guiInUse, noASNearBy, closestAS, creativeRequired,
hasNoCmd, hasCmd, type, command, unassignedCmd, hasNoCmd, hasCmd, type, command, unassignedCmd,
assignedCmdToAS, assignCmdError, ascmdHelp, viewCmd, assignedCmdToAS, assignCmdError, ascmdHelp, viewCmd,
removeCmd, assignConsole, assignPlayer, executeCmdError; removeCmd, assignConsole, assignPlayer, executeCmdError;
@ -108,6 +109,7 @@ class Config {
assignConsole = languageConfig.getString("assignConsole"); assignConsole = languageConfig.getString("assignConsole");
assignPlayer = languageConfig.getString("assignPlayer"); assignPlayer = languageConfig.getString("assignPlayer");
executeCmdError = languageConfig.getString("executeCmdError"); executeCmdError = languageConfig.getString("executeCmdError");
creativeRequired = languageConfig.getString("creativeRequired");
} }
private static void reloadMainConfig() { private static void reloadMainConfig() {
@ -130,6 +132,7 @@ class Config {
equipmentLock = config.getBoolean("equipmentLock"); equipmentLock = config.getBoolean("equipmentLock");
allowMoveWorld = config.getBoolean("allowMovingStandsBetweenWorlds"); allowMoveWorld = config.getBoolean("allowMovingStandsBetweenWorlds");
deactivateOnWorldChange = config.getBoolean("deactivateToolsOnWorldChange"); deactivateOnWorldChange = config.getBoolean("deactivateToolsOnWorldChange");
requireCreative = config.getBoolean("requireCreativeForSaveAsCmdBlock");
debug = config.getBoolean("debug", false); debug = config.getBoolean("debug", false);
plugin.carryingArmorStand.clear(); plugin.carryingArmorStand.clear();

Datei anzeigen

@ -20,7 +20,7 @@ import java.util.logging.Level;
public class Main extends JavaPlugin { public class Main extends JavaPlugin {
private static final String LATEST_VERSION = "v1_13_R1"; private static final String LATEST_VERSION = "v1_13_R2";
static NMS nms; static NMS nms;

Datei anzeigen

@ -54,7 +54,7 @@ public class MainListener implements Listener {
@EventHandler @EventHandler
public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent event) { public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent event) {
if (event.getRightClicked() instanceof ArmorStand) { if(!event.isCancelled() && event.getRightClicked() instanceof ArmorStand) {
Player p = event.getPlayer(); Player p = event.getPlayer();
ArmorStand as = (ArmorStand) event.getRightClicked(); ArmorStand as = (ArmorStand) event.getRightClicked();
if(ArmorStandGUI.isInUse(as)) { if(ArmorStandGUI.isInUse(as)) {

Datei anzeigen

@ -0,0 +1,14 @@
package com.gmail.St3venAU.plugins.ArmorStandTools;
@SuppressWarnings("unused")
class NMS_v1_13_R2 extends NMS {
public NMS_v1_13_R2(Main plugin, String nmsVersion) {
super(
plugin,
nmsVersion,
"bH"
);
}
}

Datei anzeigen

@ -4,7 +4,7 @@
# #
# Main Config # Main Config
# #
# File generated by: v3.0.2 # File generated by: v3.2.0
# (If this is not the version you are running, consider deleting this # (If this is not the version you are running, consider deleting this
# config to allow it to be re-created. There may be new config options) # config to allow it to be re-created. There may be new config options)
# #
@ -52,6 +52,7 @@
integrateWithWorldGuard: true integrateWithWorldGuard: true
allowMovingStandsBetweenWorlds: false allowMovingStandsBetweenWorlds: false
deactivateToolsOnWorldChange: true deactivateToolsOnWorldChange: true
requireCreativeForSaveAsCmdBlock: false
helmet: AIR 0 helmet: AIR 0
chest: AIR 0 chest: AIR 0
pants: AIR 0 pants: AIR 0

Datei anzeigen

@ -4,7 +4,7 @@
# #
# Language Config # Language Config
# #
# File generated by: v3.0.2 # File generated by: v3.2.0
# (If this is not the version you are running, consider deleting this # (If this is not the version you are running, consider deleting this
# config to allow it to be re-created. There may be new config options) # config to allow it to be re-created. There may be new config options)
# #
@ -79,6 +79,8 @@ removeCmd: 'Remove assigned command'
assignConsole: 'Assign a command to be executed by the console' assignConsole: 'Assign a command to be executed by the console'
assignPlayer: 'Assign a command to be executed by the player' assignPlayer: 'Assign a command to be executed by the player'
executeCmdError: 'An error occured executing the command assigned to this armor stand' executeCmdError: 'An error occured executing the command assigned to this armor stand'
# New since v3.2.0
creativeRequired: 'Creative mode is required to save an armor stand as a command block'
# #
############################# #############################
# Tool names & descriptions # # Tool names & descriptions #

Datei anzeigen

@ -1,6 +1,6 @@
main: com.gmail.St3venAU.plugins.ArmorStandTools.Main main: com.gmail.St3venAU.plugins.ArmorStandTools.Main
name: ArmorStandTools name: ArmorStandTools
version: 3.0.2 version: 3.2.0
api-version: 1.13 api-version: 1.13
author: St3venAU author: St3venAU
description: Armor stand manipulation tools description: Armor stand manipulation tools