diff --git a/lang/english.lang b/lang/english.lang index aa28a7b..0efd034 100644 --- a/lang/english.lang +++ b/lang/english.lang @@ -3,8 +3,8 @@ version: @version@ #@an makes the pattern allow for `an`. types: fadetype: fade type, fading type - soundcategory: sound category, sound categories - songplayer: song player, song players + funkysoundcategory: sound category, sound categories + funkysongplayer: song player, song players positionsongplayer: position player, position players, position song player, position song players noteblocksongplayer: note block song player, note block song players, note block player, note block players, noteblock song player, noteblock song players, noteblock player, noteblock players layer: song layer, note layer, layer diff --git a/src/main/java/me/limeglass/funky/elements/Register.java b/src/main/java/me/limeglass/funky/elements/Register.java index e0b1243..1d2733e 100644 --- a/src/main/java/me/limeglass/funky/elements/Register.java +++ b/src/main/java/me/limeglass/funky/elements/Register.java @@ -29,7 +29,7 @@ public class Register { public Set> classes = new HashSet<>(); public Set> oldclasses = new HashSet<>(); - private JarFile Stocksaddon; + private JarFile addon; @SuppressWarnings({ "unchecked", "rawtypes" }) public Register() { @@ -37,16 +37,18 @@ public Register() { Method method = JavaPlugin.class.getDeclaredMethod("getFile"); method.setAccessible(true); File file = (File) method.invoke(FunkySk.getInstance()); - Stocksaddon = new JarFile(file); - for (Enumeration jarEntry = Stocksaddon.entries(); jarEntry.hasMoreElements();) { + addon = new JarFile(file); + for (Enumeration jarEntry = addon.entries(); jarEntry.hasMoreElements();) { String name = jarEntry.nextElement().getName().replace("/", "."); + if (!name.endsWith(".class")) + continue; String className = name.substring(0, name.length() - 6); className = className.replace('/', '.'); if (name.startsWith(FunkySk.getPackageName()) && name.endsWith(".class")) { classes.add(Class.forName(className)); } } - Stocksaddon.close(); + addon.close(); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | IOException | ClassNotFoundException e1) { e1.printStackTrace(); } diff --git a/src/main/java/me/limeglass/funky/elements/expressions/ExprSongPlayerCategory.java b/src/main/java/me/limeglass/funky/elements/expressions/ExprSongPlayerCategory.java index 21f9102..adc410f 100644 --- a/src/main/java/me/limeglass/funky/elements/expressions/ExprSongPlayerCategory.java +++ b/src/main/java/me/limeglass/funky/elements/expressions/ExprSongPlayerCategory.java @@ -21,8 +21,8 @@ @Description("Returns the song currently playing in the song player(s).") @Properties({"funkysongplayers", "(song|track|music)[s]", "{1}[(all [[of] the]|the)]"}) @PropertiesAddition("song[ ]player[s]") -@RegisterEnum("soundcategory") -@User("soundcategor(y|ies)") +@RegisterEnum("funkysoundcategory") +@User("funkysoundcategor(y|ies)") @Changers(ChangeMode.SET) public class ExprSongPlayerCategory extends FunkyPropertyExpression { diff --git a/src/main/java/me/limeglass/funky/utils/TypeClassInfo.java b/src/main/java/me/limeglass/funky/utils/TypeClassInfo.java index 8e3fa07..4273f6c 100644 --- a/src/main/java/me/limeglass/funky/utils/TypeClassInfo.java +++ b/src/main/java/me/limeglass/funky/utils/TypeClassInfo.java @@ -37,8 +37,8 @@ public T parse(String s, ParseContext parseContext){ public void register(){ if (Classes.getExactClassInfo(clazz) == null) { - Classes.registerClass(classInfo.user(codeName + "s?").defaultExpression(new EventValueExpression<>(clazz)).parser(new Parser(){ - + classInfo.user(codeName + "s?").defaultExpression(new EventValueExpression<>(clazz)).parser(new Parser(){ + @Override public String getVariableNamePattern() { return codeName + ":.+"; @@ -48,6 +48,11 @@ public String getVariableNamePattern() { public T parse(String s, ParseContext parseContext) { return null; } + + @Override + public boolean canParse(ParseContext context) { + return false; + } @Override public String toString(T t, int i) { @@ -57,7 +62,10 @@ public String toString(T t, int i) { @Override public String toVariableNameString(T t) { return codeName + ':' + t.toString(); - }}).serializeAs(clazz)); + }}).serializeAs(clazz); + if (classInfo.getSerializer() == null) + classInfo.serializeAs(null); + Classes.registerClass(classInfo); FunkySk.debugMessage("&5Registered Type '" + codeName + "' with return class " + clazz.getName()); } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 80f35f6..7dea87b 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,7 @@ name: FunkySk author: LimeGlass description: A Skript addon to get funky with NoteBlockAPI. -version: 1.0.1c -main: me.limeglass.funky.Funky +version: @version@ +api-version: 1.13 +main: me.limeglass.funky.FunkySk depend: [Skript, NoteBlockAPI] \ No newline at end of file