From cc5342a2fe4627032a4459a6372846312d42d0d0 Mon Sep 17 00:00:00 2001 From: Gegy Date: Fri, 16 Jul 2021 15:36:10 +0200 Subject: [PATCH] fix errors from wrong mapping usage --- .../nucleoid/leukocyte/command/ProtectCommand.java | 12 ++++++------ .../xyz/nucleoid/leukocyte/command/ShapeCommand.java | 4 ++-- .../command/argument/AuthorityArgument.java | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/xyz/nucleoid/leukocyte/command/ProtectCommand.java b/src/main/java/xyz/nucleoid/leukocyte/command/ProtectCommand.java index 23aa52d..cb1ce6c 100644 --- a/src/main/java/xyz/nucleoid/leukocyte/command/ProtectCommand.java +++ b/src/main/java/xyz/nucleoid/leukocyte/command/ProtectCommand.java @@ -145,7 +145,7 @@ private static int addAuthority(CommandContext context, Una var key = StringArgumentType.getString(context, "authority"); var source = context.getSource(); - var leukocyte = Leukocyte.get(source.getMinecraftServer()); + var leukocyte = Leukocyte.get(source.getServer()); var authority = operator.apply(Authority.create(key)); if (leukocyte.addAuthority(authority)) { @@ -174,7 +174,7 @@ private static int addAuthority(CommandContext context, Una private static int remove(CommandContext context) throws CommandSyntaxException { var authority = AuthorityArgument.get(context, "authority"); - var leukocyte = Leukocyte.get(context.getSource().getMinecraftServer()); + var leukocyte = Leukocyte.get(context.getSource().getServer()); leukocyte.removeAuthority(authority.getKey()); context.getSource().sendFeedback(new LiteralText("Removed authority " + authority.getKey()), true); @@ -183,7 +183,7 @@ private static int remove(CommandContext context) throws Co } private static int setRule(CommandContext context) throws CommandSyntaxException { - var leukocyte = Leukocyte.get(context.getSource().getMinecraftServer()); + var leukocyte = Leukocyte.get(context.getSource().getServer()); var authority = AuthorityArgument.get(context, "authority"); var rule = ProtectionRuleArgument.get(context, "rule"); @@ -201,7 +201,7 @@ private static int setLevel(CommandContext context) throws var authority = AuthorityArgument.get(context, "authority"); int level = IntegerArgumentType.getInteger(context, "level"); - var leukocyte = Leukocyte.get(context.getSource().getMinecraftServer()); + var leukocyte = Leukocyte.get(context.getSource().getServer()); var newAuthority = authority.withLevel(level); leukocyte.replaceAuthority(authority, newAuthority); @@ -270,7 +270,7 @@ private static int removeRoleExclusion(CommandContext conte } private static int listAuthorities(CommandContext context) { - var leukocyte = Leukocyte.get(context.getSource().getMinecraftServer()); + var leukocyte = Leukocyte.get(context.getSource().getServer()); var authorities = leukocyte.getAuthorities(); if (authorities.isEmpty()) { @@ -294,7 +294,7 @@ private static int testRulesHere(CommandContext context) th var source = context.getSource(); var player = source.getPlayer(); - var leukocyte = Leukocyte.get(source.getMinecraftServer()); + var leukocyte = Leukocyte.get(source.getServer()); var authorities = new ArrayList(); diff --git a/src/main/java/xyz/nucleoid/leukocyte/command/ShapeCommand.java b/src/main/java/xyz/nucleoid/leukocyte/command/ShapeCommand.java index 9eefde2..8cd6945 100644 --- a/src/main/java/xyz/nucleoid/leukocyte/command/ShapeCommand.java +++ b/src/main/java/xyz/nucleoid/leukocyte/command/ShapeCommand.java @@ -154,7 +154,7 @@ private static int addShapeToAuthority(CommandContext conte if (builder != null) { var shape = builder.finish(); - var leukocyte = Leukocyte.get(source.getMinecraftServer()); + var leukocyte = Leukocyte.get(source.getServer()); leukocyte.replaceAuthority(authority, authority.addShape(name, shape)); source.sendFeedback(new LiteralText("Added shape as '" + name + "' to '" + authority.getKey() + "'!"), true); @@ -176,7 +176,7 @@ private static int removeShapeFromAuthority(CommandContext throw SHAPE_NOT_FOUND.create(); } - var leukocyte = Leukocyte.get(source.getMinecraftServer()); + var leukocyte = Leukocyte.get(source.getServer()); leukocyte.replaceAuthority(authority, newAuthority); source.sendFeedback(new LiteralText("Removed shape '" + name + "' from '" + authority.getKey() + "'!"), true); diff --git a/src/main/java/xyz/nucleoid/leukocyte/command/argument/AuthorityArgument.java b/src/main/java/xyz/nucleoid/leukocyte/command/argument/AuthorityArgument.java index a6b56dc..ce61085 100644 --- a/src/main/java/xyz/nucleoid/leukocyte/command/argument/AuthorityArgument.java +++ b/src/main/java/xyz/nucleoid/leukocyte/command/argument/AuthorityArgument.java @@ -21,7 +21,7 @@ public static RequiredArgumentBuilder argument(Stri return CommandManager.argument(name, StringArgumentType.string()) .suggests((context, builder) -> { var source = context.getSource(); - var leukocyte = Leukocyte.get(source.getMinecraftServer()); + var leukocyte = Leukocyte.get(source.getServer()); return CommandSource.suggestMatching( leukocyte.getAuthorities().stream().map(Authority::getKey), @@ -34,7 +34,7 @@ public static Authority get(CommandContext context, String var key = StringArgumentType.getString(context, name); var source = context.getSource(); - var leukocyte = Leukocyte.get(source.getMinecraftServer()); + var leukocyte = Leukocyte.get(source.getServer()); var authority = leukocyte.getAuthorityByKey(key); if (authority == null) {