Skip to content

Commit

Permalink
Repealed and replaced auto-pluginyml-registering
Browse files Browse the repository at this point in the history
- Now just uses a method MiscUtils#registerCommand to register the command like it is inside the plugin.yml. ONLY USE METHOD WITHIN THE ONLOAD() METHOD IN JAVAPLUGIN.
  • Loading branch information
funkemunky committed Jan 4, 2019
1 parent ef8fc97 commit dce7c25
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
46 changes: 22 additions & 24 deletions API/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified API/out/artifacts/Atlas_jar/Atlas.jar
Binary file not shown.
Binary file not shown.
Binary file modified API/out/production/Atlas/cc/funkemunky/api/utils/MiscUtils.class
Binary file not shown.
4 changes: 0 additions & 4 deletions API/src/cc/funkemunky/api/commands/FunkeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public FunkeCommand(JavaPlugin plugin, String name, String display, String descr
plugin.getCommand(name).setExecutor(this);
plugin.getCommand(name).setTabCompleter(this);

plugin.getDescription().getCommands().put(name, new HashMap<>());

this.addArguments();
}

Expand All @@ -62,8 +60,6 @@ public FunkeCommand(JavaPlugin plugin, String name, String display, String permi
instance = this;
plugin.getCommand(name).setExecutor(this);
plugin.getCommand(name).setTabCompleter(this);
plugin.getDescription().getCommands().put(name, new HashMap<>());


this.addArguments();
}
Expand Down
6 changes: 6 additions & 0 deletions API/src/cc/funkemunky/api/utils/MiscUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

import java.util.ArrayList;
Expand Down Expand Up @@ -107,6 +108,11 @@ public static BoundingBox getEntityBoundingBox(LivingEntity entity) {
return ReflectionsUtil.toBoundingBox(ReflectionsUtil.getBoundingBox(entity));
}

/* MAKE SURE TO ONLY RUN THIS METHOD IN onLoad() AND NO WHERE ELSE */
public static void registerCommand(String name, JavaPlugin plugin) {
plugin.getDescription().getCommands().put(name, new HashMap<>());
}

public static ItemStack createItem(Material material, int amount, String name, String... lore) {
ItemStack thing = new ItemStack(material, amount);
ItemMeta thingm = thing.getItemMeta();
Expand Down

0 comments on commit dce7c25

Please sign in to comment.