From bcd18f7d39caed919c7f59248aa714257ba86a96 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 25 Aug 2016 01:21:19 -0400 Subject: [PATCH] Added a portal Listener class --- AliPresents.jar | Bin 22926 -> 16697 bytes plugin.yml | 2 +- .../flairdoors/FlairDoorsSubPlug.java | 4 +- .../flairdoors/PortalLightListener.java | 44 ------------ .../flairdoors/PortalListener.java | 68 ++++++++++++++++++ .../flairdoors/SetFlairDoorColour.java | 6 +- 6 files changed, 75 insertions(+), 49 deletions(-) delete mode 100644 src/alisolarflare/flairdoors/PortalLightListener.java create mode 100644 src/alisolarflare/flairdoors/PortalListener.java diff --git a/AliPresents.jar b/AliPresents.jar index f138d866d5979f346b01d8fc3d8fd1b3b8dd13b3..0a43358fab4dc3fe4cb564114b46bae3b3d1ade0 100644 GIT binary patch delta 4136 zcma)Z)@)|@;ud(TYPdVbgnqPj35Dm@seDlTst3D+Wd49ry|6NyQQu3UG&pXqc?Z$>jy1}qE4Mu+0pARZB7se z2p1LI&<}5ZFZK?#ITb9o`Wy`E?B-Uo*%sF6T`4tnEo&3Rc4zZ4FHGL|ivlauvR9V0 zqyfD-nOEjnc|fEG1CrG}x(Cb#008d^?X-%M{A&%lG2NoNB3D+HDf$QCBJaCp`Iy#{J^i*hC zx#<+#7Pu~a37b_Il+j%Ls2&U$hO4RN5Sa%zDHp=w4Vcfp{ryyfJ2O2ffJ3B-{Ny4> zkFvKFx$)|ncQcB%Kv>3Yl6?l??_4^4zdx|b+0>|vCFTW_>8~BmWOWdWWsQiSsh$Kp z6b_LgE>|9~?%w!7L@W3%>AK^q7@eNs{LYrVHQ~8@pH#O+piF51!0GjzXlmilcy~sA zSXknxWK6q`^xfP|YTiAvBUv_lj`FBR{l~eV)61+Ozw6e0E8pKjs4A4`?B;O*|E`;Y z@Cz@LpEJ?}66lV?!Fziv477UR3-=E|g|$f*j1+CM&6E+yASX^yQ)_#VS1Dl*2q)!` zKv#XFxTq<6d~YvsLwr^I3b-+mL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>@+3^gk6aLW?@Tj;t($(`q2FUy}d|N!w_FJ4^iYHUfX+jS&Agn2z;7t5>%n zZ_>-#mY4Z&us`1IA^(kdZE|m}@Xuru_$%AI4SVx=Zilsh-pX}~f5ZOY-1EONZ$|;_ zzb;ks&vzY~Yt{T?x16iFr|s<%uY-irZRP#@#6QoArA>xPKxl6M>9$DSi16>>K$n~+ zaToPQo-QOQ084r#BvmCDIdvVm+dp*uwbE@}y7L?0`lw0=2}xT{N>)vd)5+@gX*Z&E ro8texJ`7zXB-iVd-p-lR&&g3!1swy4@EVQa`p^BEjTm}2Kk|P7MD5)R diff --git a/plugin.yml b/plugin.yml index 6d46464..a1932dd 100644 --- a/plugin.yml +++ b/plugin.yml @@ -10,4 +10,4 @@ commands: setalilink: description: Creates an Ali Link setalilink frequency setFlairDoorColour: - description: Sets the flair door colour mode, when lighting portals \ No newline at end of file + description: Sets the flair door colour mode, when lighting portals \ No newline at end of file diff --git a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java index 70ac438..9e3bfce 100644 --- a/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java +++ b/src/alisolarflare/flairdoors/FlairDoorsSubPlug.java @@ -1,7 +1,5 @@ package alisolarflare.flairdoors; -import org.bukkit.plugin.java.JavaPlugin; - import alisolarflare.AliPresents; public class FlairDoorsSubPlug{ @@ -19,7 +17,7 @@ public class FlairDoorsSubPlug{ } private void registerEvents() { // TODO Auto-generated method stub - plugin.getServer().getPluginManager().registerEvents(new PortalLightListener(), plugin); + plugin.getServer().getPluginManager().registerEvents(new PortalListener(plugin), plugin); } } diff --git a/src/alisolarflare/flairdoors/PortalLightListener.java b/src/alisolarflare/flairdoors/PortalLightListener.java deleted file mode 100644 index abb087e..0000000 --- a/src/alisolarflare/flairdoors/PortalLightListener.java +++ /dev/null @@ -1,44 +0,0 @@ -package alisolarflare.flairdoors; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityCreatePortalEvent; -import org.bukkit.event.entity.EntityPortalEvent; - -public class PortalLightListener implements Listener{ - - //TODO: CREATE - LIST OF PORTALS (only x-z values) - - - @EventHandler - public void onPortalLight(EntityCreatePortalEvent event){ - - //SANITATION - entity > player - if(!(event.getEntity() instanceof Player)){return;} - Player player = (Player) event.getEntity(); - - //SANITIATION - player > alisolarflare - if(!(player.getName() == "alisolarflare")){return;} - - //TODO: MARK PORTAL - if (SetFlairDoorColour.FlairDoorColorMode == "null"){ - player.sendMessage("Your Colour mode is set to Null, use /SetFlairDoorColour [Color] to specify a colour for this portal"); - return; - } - //TODO: SAVE PORTAL - } - - @EventHandler - public void onPortalEnter(EntityPortalEvent event){ - event.setCancelled(false); - - //TODO: IF PLAYER LOCATION IS INSIDE A COLOUR PORTAL - //TODO: IF PLAYER NOT FLAIRED - //TODO: IF PLAYERSTATE IS TRUE - //TODO: CHANGE CUSTOM DISPLAY NAME - //TODO: TELEPORT TO SPAWN - //TODO: MARK PLAYER AS COLOURED - - } -} diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java new file mode 100644 index 0000000..1b51c9e --- /dev/null +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -0,0 +1,68 @@ +package alisolarflare.flairdoors; + +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.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityCreatePortalEvent; + +import alisolarflare.AliPresents; + +public class PortalListener implements Listener{ + AbstractMap portalMap = new HashMap(); + private AliPresents plugin; + + //TODO: CREATE - LIST OF PORTALS (only x-z values) + + + public PortalListener(AliPresents plugin) { + this.plugin = plugin; + } + + @EventHandler + public void onPortalLight(EntityCreatePortalEvent event){ + plugin.getServer().broadcastMessage("PORTAL LIT WHOOP WHOOP"); + plugin.getServer().broadcastMessage(event.getEntity().getName()); + //SANITATION - entity > player + if(!(event.getEntity() instanceof Player)){return;} + Player player = (Player) event.getEntity(); + event.getEntity().getServer().broadcastMessage(player.getName()); + + //SANITIATION - player > alisolarflare + if(!(player.getName() == "alisolarflare")){return;} + event.getEntity().getServer().broadcastMessage(SetFlairDoorColour.FlairDoorColorMode); + //SANITATION - FlairDoorColourMode + if (SetFlairDoorColour.FlairDoorColorMode == "null"){ + player.sendMessage("Your Colour mode is set to Null, use /SetFlairDoorColour [Color] to specify a colour for this portal"); + return; + } + + //INIT - colourMode, portalLocation + String colourMode = SetFlairDoorColour.FlairDoorColorMode; + Location portalLocation = event.getBlocks().get(0).getBlock().getLocation(); + event.getEntity().getServer().broadcastMessage(portalLocation.toString()); + //SAVE - Portal + if(SetFlairDoorColour.COLOURMODES.contains(colourMode)){ + for (BlockState blockstate : event.getBlocks()){ + player.sendMessage(blockstate.getBlock().getLocation().toString()); + } + portalMap.put(colourMode, portalLocation); + } + } + /* + @EventHandler + public void onPortalEnter(EntityPortalEvent event){ + //TODO: IF PLAYER LOCATION IS INSIDE A COLOUR PORTAL + //TODO: IF PLAYER NOT FLAIRED + //TODO: IF PLAYERSTATE IS TRUE + //TODO: CHANGE CUSTOM DISPLAY NAME + //TODO: TELEPORT TO SPAWN + //TODO: MARK PLAYER AS COLOURED + + } + */ +} diff --git a/src/alisolarflare/flairdoors/SetFlairDoorColour.java b/src/alisolarflare/flairdoors/SetFlairDoorColour.java index 69df081..d3d349d 100644 --- a/src/alisolarflare/flairdoors/SetFlairDoorColour.java +++ b/src/alisolarflare/flairdoors/SetFlairDoorColour.java @@ -1,11 +1,15 @@ package alisolarflare.flairdoors; +import java.util.Arrays; +import java.util.List; + import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; public class SetFlairDoorColour implements CommandExecutor { public static String FlairDoorColorMode = "null"; + public static final List COLOURMODES = Arrays.asList("red", "orange", "yellow", "green", "blue", "purple", "gray"); @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (args.length > 1){ @@ -15,7 +19,7 @@ public class SetFlairDoorColour implements CommandExecutor { String firstCommand = args[0]; firstCommand = firstCommand.toLowerCase(); if(firstCommand.startsWith("e")|| firstCommand.startsWith("gra")|| firstCommand.startsWith("grey")){ - sender.sendMessage("Flair Door Colour Mode set to grey"); + sender.sendMessage("Flair Door Colour Mode set to gray"); FlairDoorColorMode = "gray"; }else if(firstCommand.startsWith("r")){ sender.sendMessage("Flair Door Colour Mode set to Red");