diff --git a/src/main/java/com/volmit/iris/util/decree/DecreeCommand.java b/src/main/java/com/volmit/iris/util/decree/DecreeCommand.java index 255190726..58486e367 100644 --- a/src/main/java/com/volmit/iris/util/decree/DecreeCommand.java +++ b/src/main/java/com/volmit/iris/util/decree/DecreeCommand.java @@ -18,5 +18,26 @@ package com.volmit.iris.util.decree; +import com.volmit.iris.Iris; +import com.volmit.iris.util.collection.KList; + public class DecreeCommand { + private static final KList> handlers = Iris.initialize("com.volmit.iris.util.decree.handlers", null).convert((i) -> (DecreeParameterHandler) i); + + /** + * Get the handler for the specified type + * @param type The type to handle + * @return The corresponding {@link DecreeParameterHandler}, or null + */ + public static DecreeParameterHandler getHandler(Class type) + { + for(DecreeParameterHandler i : handlers) + { + if(i.supports(type)) + { + return i; + } + } + return null; + } } diff --git a/src/main/java/com/volmit/iris/util/decree/DecreeParameter.java b/src/main/java/com/volmit/iris/util/decree/DecreeParameter.java index a124489e4..576ea8a30 100644 --- a/src/main/java/com/volmit/iris/util/decree/DecreeParameter.java +++ b/src/main/java/com/volmit/iris/util/decree/DecreeParameter.java @@ -39,7 +39,7 @@ public class DecreeParameter { } public DecreeParameterHandler getHandler() { - return DecreeSystem.getHandler(getType()); + return DecreeCommand.getHandler(getType()); } public Class getType() { diff --git a/src/main/java/com/volmit/iris/util/decree/DecreeSystem.java b/src/main/java/com/volmit/iris/util/decree/DecreeSystem.java deleted file mode 100644 index 2eb987ab5..000000000 --- a/src/main/java/com/volmit/iris/util/decree/DecreeSystem.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Iris is a World Generator for Minecraft Bukkit Servers - * Copyright (c) 2021 Arcane Arts (Volmit Software) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.volmit.iris.util.decree; - -import com.volmit.iris.Iris; -import com.volmit.iris.util.collection.KList; - -public class DecreeSystem { - private static final KList> handlers = Iris.initialize("com.volmit.iris.util.decree.handlers", null).convert((i) -> (DecreeParameterHandler) i); - - /** - * Get the handler for the specified type - * @param type The type to handle - * @return The corresponding {@link DecreeParameterHandler}, or null - */ - public static DecreeParameterHandler getHandler(Class type) - { - for(DecreeParameterHandler i : handlers) - { - if(i.supports(type)) - { - return i; - } - } - return null; - } -}