Finally finished flairdoors

This commit is contained in:
alisolarflare 2016-11-05 08:37:27 -04:00
parent 0a01494c4a
commit 405fb19111
3 changed files with 97 additions and 79 deletions

155
pom.xml
View file

@ -1,73 +1,82 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.tbmcplugins</groupId>
<artifactId>AliPresents</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>AliPresents</name>
<description>A bucket of aaall the stuff Ali makes. It's a bit smelly.</description>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>.</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository> <!-- This repo fixes issues with transitive dependencies -->
<id>jcenter</id>
<url>http://jcenter.bintray.com</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.9.2-R0.1-SNAPSHOT</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>com.github.TBMCPlugins.ButtonCore</groupId>
<artifactId>ButtonCore</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.tbmcplugins</groupId>
<artifactId>AliPresents</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>AliPresents</name>
<description>A bucket of aaall the stuff Ali makes. It's a bit smelly.</description>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>.</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository> <!-- This repo fixes issues with transitive dependencies -->
<id>jcenter</id>
<url>http://jcenter.bintray.com</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>ess-repo</id>
<url>http://repo.ess3.net</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.9.2-R0.1-SNAPSHOT</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>com.github.TBMCPlugins.ButtonCore</groupId>
<artifactId>ButtonCore</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId>
<version>2.13.1</version>
</dependency>
</dependencies>
</project>

View file

@ -3,6 +3,7 @@ package alisolarflare.components.flairdoor.listeners;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -14,13 +15,18 @@ import org.bukkit.material.MaterialData;
import org.bukkit.material.Wool;
import org.bukkit.plugin.java.JavaPlugin;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
public class PortalListener implements Listener{
public static List<String> playersToBeFlaired = new ArrayList<String>();
public JavaPlugin plugin;
Essentials essentials;
public PortalListener(JavaPlugin plugin) {
this.plugin = plugin;
this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"));
}
@EventHandler
public void onPortalEnter(PlayerPortalEvent event){
@ -86,8 +92,10 @@ public class PortalListener implements Listener{
}
public void recolourPlayer(Player player, DyeColor dyecolour){
User user = essentials.getUser(player);
player.sendMessage("Recolouring Player as..." + dyecolour.toString());
String name = player.getName();
String name = user.getNickname();
player.sendMessage("name:" + name);
String tempName = "";
for(int i = 0; i < name.length(); i++){
@ -136,8 +144,8 @@ public class PortalListener implements Listener{
player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK");
break;
}
player.setCustomName(name);
player.sendMessage("Your name is now: " + player.getCustomName() +"! Removing you from playersToBeFlaired...");
user.setNickname(name);
player.sendMessage("Your name is now: " + user.getNickname() +"! Removing you from playersToBeFlaired...");
playersToBeFlaired.remove(player.getName());
}
}

View file

@ -3,8 +3,6 @@ package alisolarflare.components.gpowers.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.mysql.fabric.xmlrpc.base.Data;
import alisolarflare.components.gpowers.GPowerMemory;
import buttondevteam.lib.chat.TBMCCommandBase;
@ -19,6 +17,9 @@ public class GPower extends TBMCCommandBase {
@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {
sender.sendMessage("G power activate!");
if (!(sender instanceof Player)){
sender.sendMessage("You must be a player to use this command! Talk to a dev/ali if you think this is wrong");
}
Player player = (Player) sender;
if (args.length < 2) {
player.sendMessage("Proper Usage to test G-Powers:");