Updateee???

This commit is contained in:
alisolarflare 2016-10-17 15:08:53 -04:00
parent 03e431e085
commit f08413f642
4 changed files with 20 additions and 14 deletions

Binary file not shown.

View file

@ -9,7 +9,7 @@ commands:
description: Presses an Ali Link pressalilink frequency description: Presses an Ali Link pressalilink frequency
setalilink: setalilink:
description: Creates an Ali Link setalilink frequency description: Creates an Ali Link setalilink frequency
setFlairDoorColour: setflairdoorcolour:
description: Sets the flair door colour mode, when lighting portals description: Sets the flair door colour mode, when lighting portals
flairme: flairme:
description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description description: Activates the Flair Me Command. Ask Ali, she was fucking tired when writing this description

View file

@ -34,13 +34,13 @@ public class AliPresents extends JavaPlugin{
} }
public void registerSubPlugins(){ public void registerSubPlugins(){
AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this); //AliLinkSubPlug alilinksubplugin = new AliLinkSubPlug(this);
alilinksubplugin.register(); //alilinksubplugin.register();
} }
public void registerCommands(){ public void registerCommands(){
getCommand("FlairMe").setExecutor(new FlairMe()); getCommand("flairme").setExecutor(new FlairMe());
getCommand("alishulker").setExecutor(new AliShulker()); getCommand("alishulker").setExecutor(new AliShulker());
getCommand("SetFlairDoorColour").setExecutor(new SetFlairDoorColour()); getCommand("setflairdoorcolour").setExecutor(new SetFlairDoorColour());
} }
} }

View file

@ -12,7 +12,8 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPortalEvent; import org.bukkit.event.player.PlayerPortalEvent;
import org.bukkit.material.MaterialData;
import org.bukkit.material.Wool; import org.bukkit.material.Wool;
import alisolarflare.AliPresents; import alisolarflare.AliPresents;
@ -29,22 +30,23 @@ public class PortalListener implements Listener{
this.plugin = plugin; this.plugin = plugin;
} }
@EventHandler @EventHandler
public void onPortalEnter(EntityPortalEvent event){ public void onPortalEnter(PlayerPortalEvent event){
//SANITATION - Player //SANITATION - Player
if(!(event.getEntity() instanceof Player)){ if(!(event.getPlayer() instanceof Player)){
return; return;
} }
//INIT - Player //INIT - Player
Player player = (Player) event.getEntity(); Player player = event.getPlayer();
player.sendMessage("MAY THE FLAIRING COMMENCE");
//SANITATION - PlayersToBeFlaired //SANITATION - PlayersToBeFlaired
if(!(playersToBeFlaired.contains(player.getName()))){ if(!(playersToBeFlaired.contains(player.getName()))){
return; return;
} }
player.sendMessage("MAY THE FLAIRING COMMENCE"); player.sendMessage("-MAY THE FLAIRING COMMENCE-");
player.sendMessage("Deactivating regular portal behaviour..."); player.sendMessage("Deactivating regular portal behaviour...");
event.setCancelled(true); event.setTo(player.getLocation());
//INIT - x,y,z //INIT - x,y,z
int x = player.getLocation().getBlockX(); int x = player.getLocation().getBlockX();
@ -69,20 +71,24 @@ public class PortalListener implements Listener{
//TOP BLOCK IS WOOL? //TOP BLOCK IS WOOL?
}else if(blockTopper.getType() == Material.WOOL){ }else if(blockTopper.getType() == Material.WOOL){
player.sendMessage("WOOL DETECTED T"); player.sendMessage("WOOL DETECTED T");
Wool wool = (Wool) blockTopper; Wool wool = (Wool) blockTopper.getState().getData();
recolourPlayer(player, wool.getColor()); recolourPlayer(player, wool.getColor());
//MIDDLE BLOCK IS WOOL? //MIDDLE BLOCK IS WOOL?
}else if(blockMiddle.getType() == Material.WOOL){ }else if(blockMiddle.getType() == Material.WOOL){
player.sendMessage("WOOL DETECTED M"); player.sendMessage("WOOL DETECTED M");
Wool wool = (Wool) blockMiddle; MaterialData mData = blockMiddle.getState().getData();
player.sendMessage("MATERIAL DATA COLLECTED: "+ mData.toString());
Wool wool = (Wool) mData;
player.sendMessage("WOOL DATA CONVERTED: "+ wool.toString());
recolourPlayer(player, wool.getColor()); recolourPlayer(player, wool.getColor());
//BOTTOM BLOCK IS WOOL? //BOTTOM BLOCK IS WOOL?
}else if (blockBottom.getType() == Material.WOOL){ }else if (blockBottom.getType() == Material.WOOL){
player.sendMessage("WOOL DETECTED B"); player.sendMessage("WOOL DETECTED B");
Wool wool = (Wool) blockBottom; Wool wool = (Wool) blockBottom.getState().getData();
recolourPlayer(player, wool.getColor()); recolourPlayer(player, wool.getColor());
} }