mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
Attribute Command Fix and Conditional Enabling
This commit is contained in:
1 parent
baf06e7162
commit
a328a635d7
2 files changed
+8
-6
No files matched your search
@@ -108,13 +108,13 @@ public class AttributeCommand extends CommandKamkeelBase {
|
||||
// Check if this is a magic attribute.
|
||||
if(def.getValueType() == AttributeValueType.MAGIC) {
|
||||
if(args.length < 3){
|
||||
sendError(sender, "Usage for magic attribute: apply <attribute> <magicID> <value>");
|
||||
sendError(sender, "Usage for magic attribute: apply <attribute> <value> <magicID>");
|
||||
return;
|
||||
}
|
||||
int magicId;
|
||||
double value;
|
||||
float value;
|
||||
try {
|
||||
value = Double.parseDouble(args[1]);
|
||||
value = Float.parseFloat(args[1]);
|
||||
magicId = Integer.parseInt(args[2]);
|
||||
} catch(NumberFormatException e) {
|
||||
sendError(sender, "Invalid number format for magicID or value.");
|
||||
@@ -133,9 +133,9 @@ public class AttributeCommand extends CommandKamkeelBase {
|
||||
sendError(sender, "Usage: <attribute> <value>");
|
||||
return;
|
||||
}
|
||||
double value;
|
||||
float value;
|
||||
try {
|
||||
value = Double.parseDouble(args[1]);
|
||||
value = Float.parseFloat(args[1]);
|
||||
} catch(NumberFormatException e) {
|
||||
sendError(sender, "Invalid number format for value.");
|
||||
return;
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.server.MinecraftServer;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.attribute.AttributeController;
|
||||
import noppes.npcs.attribute.AttributeDefinition;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.scripted.CustomNPCsException;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@@ -35,7 +36,8 @@ public class CommandKamkeel extends CommandBase{
|
||||
registerCommand(new OverlayCommand());
|
||||
registerCommand(new CommandCommand());
|
||||
registerCommand(new EffectCommand());
|
||||
registerCommand(new AttributeCommand());
|
||||
if(ConfigMain.AttributesEnabled)
|
||||
registerCommand(new AttributeCommand());
|
||||
}
|
||||
|
||||
public void registerCommand(CommandKamkeelBase command){
|
||||
|
||||
Reference in new issue
Block a user