Wired up modules to AliPresents, SHIT's DOOONE
This commit is contained in:
parent
4c8ffa5a9e
commit
86bc063718
8 changed files with 40 additions and 53 deletions
|
@ -6,7 +6,11 @@ import org.bukkit.plugin.PluginDescriptionFile;
|
|||
//import alisolarflare.links.AliLinkSubPlug;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import alisolarflare.modules.components.flairdoor.listeners.PortalListener;
|
||||
import alisolarflare.modules.components.flairdoor.FlairDoorModule;
|
||||
import alisolarflare.modules.components.gpowers.GPowerModule;
|
||||
import alisolarflare.modules.components.links.AliLinkModule;
|
||||
import alisolarflare.modules.components.shulker.AliShulkerModule;
|
||||
import alisolarflare.modules.events.uhc.UHCModule;
|
||||
import alisolarflare.modules.magictrick.aliarrow.AliArrowModule;
|
||||
|
||||
public class AliPresents extends JavaPlugin{
|
||||
|
@ -18,15 +22,17 @@ public class AliPresents extends JavaPlugin{
|
|||
logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ").");
|
||||
|
||||
registerModules();
|
||||
registerEvents();
|
||||
|
||||
logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ").");
|
||||
|
||||
|
||||
}
|
||||
private void registerEvents() {
|
||||
}
|
||||
public void registerModules(){
|
||||
new AliArrowModule(this).register();
|
||||
new FlairDoorModule().register(this);
|
||||
new GPowerModule().register(this);
|
||||
new AliLinkModule().register(this);
|
||||
new AliShulkerModule().register(this);
|
||||
new UHCModule().register(this);
|
||||
new AliArrowModule().register(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,6 @@ import alisolarflare.modules.components.flairdoor.commands.SetFlairDoorColour;
|
|||
import alisolarflare.modules.components.flairdoor.listeners.PortalListener;
|
||||
|
||||
public class FlairDoorModule extends Module{
|
||||
@SuppressWarnings("unused")
|
||||
private JavaPlugin plugin;
|
||||
public FlairDoorModule(JavaPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
@Override
|
||||
public void register(JavaPlugin plugin) {
|
||||
plugin.getCommand("flairme").setExecutor(new FlairMe());
|
||||
|
|
|
@ -9,26 +9,21 @@ import alisolarflare.modules.components.links.commands.SetAliLink;
|
|||
import alisolarflare.modules.components.links.entities.Link;
|
||||
|
||||
public class AliLinkModule extends Module{
|
||||
public JavaPlugin plugin;
|
||||
private SetAliLink setAliLink;
|
||||
|
||||
public AliLinkModule(JavaPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void register(JavaPlugin plugin){
|
||||
setAliLink = new SetAliLink(plugin);
|
||||
plugin.getCommand("setalilink").setExecutor(setAliLink);
|
||||
plugin.getCommand("pressalilink").setExecutor(new PressAliLink(this, setAliLink));
|
||||
plugin.getCommand("pressalilink").setExecutor(new PressAliLink(plugin, setAliLink));
|
||||
|
||||
}
|
||||
public void saveLinkList(){
|
||||
public void saveLinkList(JavaPlugin plugin){
|
||||
plugin.getConfig().set("aliLinkList", setAliLink.linkList);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Link> loadLinkList(){
|
||||
public List<Link> loadLinkList(JavaPlugin plugin){
|
||||
return (List<Link>) plugin.getConfig().getList("aliLinkList");
|
||||
}
|
||||
|
||||
|
|
|
@ -3,21 +3,21 @@ package alisolarflare.modules.components.links.commands;
|
|||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import alisolarflare.modules.components.links.AliLinkModule;
|
||||
import alisolarflare.modules.components.links.entities.Link;
|
||||
|
||||
public class PressAliLink implements CommandExecutor{
|
||||
private AliLinkModule module;
|
||||
private JavaPlugin plugin;
|
||||
private SetAliLink setAliLink;
|
||||
public PressAliLink(AliLinkModule subplugin, SetAliLink setAliLink){
|
||||
this.module = subplugin;
|
||||
public PressAliLink(JavaPlugin plugin, SetAliLink setAliLink){
|
||||
this.plugin = plugin;
|
||||
this.setAliLink = setAliLink;
|
||||
}
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
module.plugin.getServer().broadcastMessage(setAliLink.linkList.toString() + "over.");
|
||||
sender.getServer().broadcastMessage(setAliLink.linkList.toString() + "over.");
|
||||
|
||||
if (args.length < 1){
|
||||
sender.sendMessage("You must specify a link frequency");
|
||||
|
@ -26,7 +26,7 @@ public class PressAliLink implements CommandExecutor{
|
|||
for (Link link: setAliLink.linkList){
|
||||
for (String inputlink: args){
|
||||
if(inputlink.equals(link.frequency)){
|
||||
link.press(module);
|
||||
link.press(plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@ import java.io.Serializable;
|
|||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import alisolarflare.modules.components.links.AliLinkModule;
|
||||
import alisolarflare.modules.components.links.tasks.UnpressTask;
|
||||
|
||||
public class Link implements Serializable{
|
||||
|
@ -28,10 +28,14 @@ public class Link implements Serializable{
|
|||
this.z = "" + location.getBlockZ();
|
||||
//plugin.plugin.getConfig().set("frequency", 10);
|
||||
}
|
||||
public void press(AliLinkModule plugin) {
|
||||
Location location = new Location(plugin.plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z));
|
||||
/**
|
||||
* Activates the Ali-Link
|
||||
* @param plugin
|
||||
*/
|
||||
public void press(JavaPlugin plugin) {
|
||||
Location location = new Location(plugin.getServer().getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z));
|
||||
location.getBlock().setType(Material.REDSTONE_BLOCK);
|
||||
UnpressTask unPressTask = new UnpressTask(location);
|
||||
unPressTask.runTaskTimer(plugin.plugin, 2, 1);
|
||||
unPressTask.runTaskTimer(plugin, 2, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,13 +6,12 @@ import org.bukkit.entity.Projectile;
|
|||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
|
||||
import alisolarflare.AliPresents;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class AliArrowListener implements Listener {
|
||||
private final AliPresents plugin;
|
||||
private final JavaPlugin plugin;
|
||||
|
||||
public AliArrowListener(AliPresents plugin){
|
||||
public AliArrowListener(JavaPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,27 +1,16 @@
|
|||
package alisolarflare.modules.magictrick.aliarrow;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import alisolarflare.AliPresents;
|
||||
|
||||
public class AliArrowModule {
|
||||
private AliPresents plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import alisolarflare.modules.Module;
|
||||
|
||||
public AliArrowModule(AliPresents plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
public class AliArrowModule extends Module{
|
||||
/**
|
||||
* Registers the plugin, activating listeners, commands, and events
|
||||
*/
|
||||
public void register(){
|
||||
registerEvents();
|
||||
registerCommands();
|
||||
plugin.getLogger().log(Level.INFO, "Discord Sub Plugin Registered!");
|
||||
}
|
||||
private void registerEvents(){
|
||||
@Override
|
||||
public void register(JavaPlugin plugin) {
|
||||
plugin.getServer().getPluginManager().registerEvents(new AliArrowListener(plugin), plugin);
|
||||
|
||||
}
|
||||
private void registerCommands(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,17 @@ package alisolarflare.modules.magictrick.aliarrow;
|
|||
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import alisolarflare.AliPresents;
|
||||
|
||||
public class AliArrowTask extends BukkitRunnable{
|
||||
AliPresents plugin;
|
||||
JavaPlugin plugin;
|
||||
String name;
|
||||
Arrow arrow;
|
||||
|
||||
|
||||
|
||||
public AliArrowTask(AliPresents plugin, Arrow arrow, String name){
|
||||
public AliArrowTask(JavaPlugin plugin, Arrow arrow, String name){
|
||||
this.name = name;
|
||||
this.plugin = plugin;
|
||||
this.arrow = arrow;
|
||||
|
|
Loading…
Reference in a new issue