From 38007dae2d51f02b5d123d93ec77fab3650405ba Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Sep 2016 16:51:06 -0400 Subject: [PATCH] Added pom.xml --- .classpath | 20 ++++++- .gitignore | 1 + .project | 6 ++ .settings/org.eclipse.jdt.core.prefs | 5 ++ .settings/org.eclipse.m2e.core.prefs | 4 ++ pom.xml | 21 +++++++ .../flairdoors/PortalListener.java | 58 ++++++++++++++----- .../links/commands/SetAliLink.java | 5 +- src/alisolarflare/links/entities/Link.java | 8 +-- 9 files changed, 102 insertions(+), 26 deletions(-) create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 pom.xml diff --git a/.classpath b/.classpath index a8e4705..4ddb94c 100644 --- a/.classpath +++ b/.classpath @@ -1,9 +1,23 @@ - - + + + + + + + + + + + - + + + + + + diff --git a/.gitignore b/.gitignore index 84c1d8d..f8a6805 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* /bin/ +/target/ diff --git a/.project b/.project index 6fcc3e1..10a212f 100644 --- a/.project +++ b/.project @@ -10,8 +10,14 @@ + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature org.eclipse.jdt.core.javanature diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..abec6ca --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..946cc7f --- /dev/null +++ b/pom.xml @@ -0,0 +1,21 @@ + + 4.0.0 + com.github.tbmcplugins + AliPresents + 0.0.1-SNAPSHOT + AliPresents + A bucket of aaall the stuff Ali makes. It's a bit smelly. + + src + + + maven-compiler-plugin + 3.5.1 + + + + + + + + \ No newline at end of file diff --git a/src/alisolarflare/flairdoors/PortalListener.java b/src/alisolarflare/flairdoors/PortalListener.java index a4bdea4..97a3faa 100644 --- a/src/alisolarflare/flairdoors/PortalListener.java +++ b/src/alisolarflare/flairdoors/PortalListener.java @@ -1,20 +1,23 @@ package alisolarflare.flairdoors; import java.util.AbstractMap; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.world.PortalCreateEvent; +import org.bukkit.event.entity.EntityPortalEvent; import alisolarflare.AliPresents; public class PortalListener implements Listener{ AbstractMap portalMap = new HashMap(); + public List playersToBeFlaired = new ArrayList(); private AliPresents plugin; //TODO: CREATE - LIST OF PORTALS (only x-z values) @@ -23,7 +26,38 @@ public class PortalListener implements Listener{ public PortalListener(AliPresents plugin) { this.plugin = plugin; } - + @EventHandler + public void onPortalEnter(EntityPortalEvent event){ + if(!(event.getEntity() instanceof Player)){ + return; + } + Player player = (Player) event.getEntity(); + if(!(playersToBeFlaired.contains(player.getName()))){ + return; + } + + int x = player.getLocation().getBlockX(); + int y = player.getLocation().getBlockY(); + int z = player.getLocation().getBlockZ(); + + Material blockTopper = player.getWorld().getBlockAt(x,y-1,z).getType(); + Material blockMiddle = player.getWorld().getBlockAt(x,y-2,z).getType(); + Material blockBottom = player.getWorld().getBlockAt(x,y-3,z).getType(); + + if(blockTopper == Material.STONE){ + + }else if(blockTopper == Material.WOOL){ + + } + //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 + + } + /* @EventHandler public void onAliRightClick(PlayerInteractEvent event){ if (event.getPlayer().getName() != "alisolarflare"){ @@ -48,7 +82,8 @@ public class PortalListener implements Listener{ /* * 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"); @@ -79,16 +114,7 @@ public class PortalListener implements Listener{ 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/links/commands/SetAliLink.java b/src/alisolarflare/links/commands/SetAliLink.java index f44e364..e36201f 100644 --- a/src/alisolarflare/links/commands/SetAliLink.java +++ b/src/alisolarflare/links/commands/SetAliLink.java @@ -1,6 +1,5 @@ package alisolarflare.links.commands; -import java.io.IOException; import org.apache.commons.lang3.StringUtils; import org.bukkit.Location; @@ -55,9 +54,9 @@ public class SetAliLink implements CommandExecutor{ subplugin.plugin.getConfig().set("aliLinkList", subplugin.linkList); try { player.sendMessage("SAVIN"); - subplugin.plugin.getConfig().save("aliLinkList"); + subplugin.plugin.saveConfig(); player.sendMessage("GOOD SAVE"); - } catch (IOException e) { + } catch (Exception e) { player.sendMessage("YOU FUCKED STUFF UP"); // TODO Auto-generated catch block e.printStackTrace(); diff --git a/src/alisolarflare/links/entities/Link.java b/src/alisolarflare/links/entities/Link.java index f8c2e1d..a0a7449 100644 --- a/src/alisolarflare/links/entities/Link.java +++ b/src/alisolarflare/links/entities/Link.java @@ -14,10 +14,10 @@ public class Link implements Serializable{ */ private static final long serialVersionUID = 1L; public String frequency; - String world; - String x; - String y; - String z; + public String world; + public String x; + public String y; + public String z; public Link(String frequency, Location location){