fixed logger option bug (#1124)
* fixed logger option bug * implemented strict option for logger args * added back deprecated logger constructor Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
This commit is contained in:
1 parent
f17b63a8f7
commit
50b3aa8832
4 files changed
+46
-9
No files matched your search
@@ -18,6 +18,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static com.mojang.brigadier.arguments.StringArgumentType.getString;
|
||||
import static net.minecraft.command.CommandSource.suggestMatching;
|
||||
@@ -201,8 +202,13 @@ public class LogCommand
|
||||
Messenger.m(source, "r Unknown logger: ","rb "+logname);
|
||||
return 0;
|
||||
}
|
||||
if (!LoggerRegistry.getLogger(logname).isOptionValid(option))
|
||||
{
|
||||
Messenger.m(source, "r Invalid option: ", "rb "+option);
|
||||
return 0;
|
||||
}
|
||||
LoggerRegistry.subscribePlayer(player_name, logname, option);
|
||||
if (option!=null)
|
||||
if (option != null)
|
||||
{
|
||||
Messenger.m(source, "gi Subscribed to " + logname + "(" + option + ")");
|
||||
}
|
||||
@@ -210,6 +216,6 @@ public class LogCommand
|
||||
{
|
||||
Messenger.m(source, "gi Subscribed to " + logname);
|
||||
}
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user