Fixed bullshit.

Made an error with the type of listener
This commit is contained in:
alisolarflare 2016-08-25 03:47:18 -04:00
parent bcd18f7d39
commit 1053249962
3 changed files with 43 additions and 14 deletions

View file

@ -3,7 +3,10 @@ package alisolarflare;
import java.util.logging.Logger;
import org.bukkit.plugin.PluginDescriptionFile;
import alisolarflare.links.AliLinkSubPlug;
import alisolarflare.flairdoors.PortalListener;
import alisolarflare.flairdoors.SetFlairDoorColour;
//import alisolarflare.links.AliLinkSubPlug;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.shulker.AliShulker;
@ -15,18 +18,25 @@ public class AliPresents extends JavaPlugin{
logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ").");
registerSubPlugins();
//registerSubPlugins();
registerCommands();
registerEvents();
logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ").");
}
private void registerEvents() {
getServer().getPluginManager().registerEvents(new PortalListener(this), this);
}
public void registerSubPlugins(){
AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this);
alilinksubplugin.register();
//AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this);
//alilinksubplugin.register();
}
public void registerCommands(){
getCommand("alishulker").setExecutor(new AliShulker());
getCommand("SetFlairDoorColour").setExecutor(new SetFlairDoorColour());
}
}

View file

@ -1,23 +1,21 @@
package alisolarflare.flairdoors;
import alisolarflare.AliPresents;
//import alisolarflare.AliPresents;
public class FlairDoorsSubPlug{
private AliPresents plugin;
public FlairDoorsSubPlug(AliPresents plugin){
this.plugin = plugin;
//private AliPresents plugin;
public FlairDoorsSubPlug(/*AliPresents plugin*/){
//this.plugin = plugin;
}
public void register(){
registerCommands();
registerEvents();
}
private void registerCommands() {
plugin.getCommand("SetFlairDoorColour").setExecutor(new SetFlairDoorColour());
}
private void registerEvents() {
// TODO Auto-generated method stub
plugin.getServer().getPluginManager().registerEvents(new PortalListener(plugin), plugin);
}
}

View file

@ -4,11 +4,11 @@ import java.util.AbstractMap;
import java.util.HashMap;
import org.bukkit.Location;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityCreatePortalEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.world.PortalCreateEvent;
import alisolarflare.AliPresents;
@ -22,7 +22,28 @@ public class PortalListener implements Listener{
public PortalListener(AliPresents plugin) {
this.plugin = plugin;
}
@EventHandler
public void onAliRightClick(PlayerInteractEvent event){
if (event.getPlayer().getName() != "alisolarflare"){
return;
}
if (event.getClickedBlock().getType() != Material.OBSIDIAN){
return;
}
if(event.getItem().getType() != Material.FLINT_AND_STEEL && event.getItem().getType() != Material.FIREBALL){
return;
}
plugin.getServer().broadcastMessage("RIIIIGHTCLICK");
}
@EventHandler
public void onPortalLight(PortalCreateEvent event){
plugin.getServer().broadcastMessage("PORTAL LIIIIIT");
}
/*
* NOTE: WRONG ENTITY EVENT ALLTOGETHER.
* ENTITY CREATE PORTAL EVENT ONLY TRIGGERS WHEN AN ENDERDRAGON DIES
*
@EventHandler
public void onPortalLight(EntityCreatePortalEvent event){
plugin.getServer().broadcastMessage("PORTAL LIT WHOOP WHOOP");