Got rid of some static... that might help?
This commit is contained in:
parent
52b9880713
commit
3d88f355fb
3 changed files with 12 additions and 16 deletions
|
@ -3,15 +3,11 @@ package alisolarflare.components.flaircolouring;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import com.earth2me.essentials.Essentials;
|
|
||||||
|
|
||||||
import alisolarflare.architecture.Component;
|
import alisolarflare.architecture.Component;
|
||||||
import alisolarflare.components.flaircolouring.letterdyes.GetLetterDye;
|
import alisolarflare.components.flaircolouring.letterdyes.GetLetterDye;
|
||||||
import alisolarflare.components.flaircolouring.letterdyes.LetterDyeListener;
|
|
||||||
import alisolarflare.components.flaircolouring.portals.FlairMe;
|
import alisolarflare.components.flaircolouring.portals.FlairMe;
|
||||||
import alisolarflare.components.flaircolouring.portals.PlayerProximityLoop;
|
import alisolarflare.components.flaircolouring.portals.PlayerProximityLoop;
|
||||||
import alisolarflare.components.flaircolouring.portals.PortalListener;
|
import alisolarflare.components.flaircolouring.portals.PortalListener;
|
||||||
|
|
|
@ -6,9 +6,6 @@ import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
public class LetterDye {
|
public class LetterDye {
|
||||||
public static boolean isLetterDye(ItemStack item){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public static ItemStack getLetterDye(){
|
public static ItemStack getLetterDye(){
|
||||||
ItemStack item = new ItemStack(Material.INK_SACK);
|
ItemStack item = new ItemStack(Material.INK_SACK);
|
||||||
item.addUnsafeEnchantment(Enchantment.LUCK, 10);
|
item.addUnsafeEnchantment(Enchantment.LUCK, 10);
|
||||||
|
|
|
@ -21,16 +21,19 @@ public class LetterDyeListener implements Listener{
|
||||||
}
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onLetterDye(PlayerInteractEvent event){
|
public void onLetterDye(PlayerInteractEvent event){
|
||||||
if((event.getAction() == Action.PHYSICAL)) return;
|
try{
|
||||||
if (LetterDye.isLetterDye(event.getItem())) return;
|
if((event.getAction() != Action.RIGHT_CLICK_AIR)) return;
|
||||||
ItemStack item = event.getItem();
|
ItemStack item = event.getItem();
|
||||||
if(item.getType() != Material.INK_SACK) return;
|
if(item.getType() != Material.INK_SACK) return;
|
||||||
if(item.getItemMeta().hasEnchant(Enchantment.LUCK) && (item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10)) return;
|
if(item.getItemMeta().hasEnchant(Enchantment.LUCK) && (item.getItemMeta().getEnchantLevel(Enchantment.LUCK) == 10)) return;
|
||||||
if(item.getItemMeta().getDisplayName() == "LetterDye") return;
|
if(item.getItemMeta().getDisplayName() == "LetterDye") return;
|
||||||
|
|
||||||
Dye dye = (Dye) event.getItem().getData();
|
Dye dye = (Dye) event.getItem().getData();
|
||||||
User user = essentials.getUser(event.getPlayer());
|
User user = essentials.getUser(event.getPlayer());
|
||||||
user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor()));
|
user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor()));
|
||||||
|
}catch(Exception e){
|
||||||
|
event.getPlayer().sendMessage(e.getStackTrace().toString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue