Cleaning sweep, mainly for various stray "4 spaces" indentions to tabs
This commit is contained in:
parent
554a7a42c6
commit
03fe63cda0
@ -7,8 +7,8 @@ public class CmdLock extends FCommand {
|
|||||||
// TODO: This solution needs refactoring.
|
// TODO: This solution needs refactoring.
|
||||||
/*
|
/*
|
||||||
factions.lock:
|
factions.lock:
|
||||||
description: use the /f lock [on/off] command to temporarily lock the data files from being overwritten
|
description: use the /f lock [on/off] command to temporarily lock the data files from being overwritten
|
||||||
default: op
|
default: op
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public CmdLock()
|
public CmdLock()
|
||||||
|
@ -17,47 +17,47 @@ public class FactionCreateEvent extends Event implements Cancellable
|
|||||||
private Player sender;
|
private Player sender;
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
|
|
||||||
public FactionCreateEvent(Player sender, String tag)
|
public FactionCreateEvent(Player sender, String tag)
|
||||||
{
|
{
|
||||||
this.factionTag = tag;
|
this.factionTag = tag;
|
||||||
this.sender = sender;
|
this.sender = sender;
|
||||||
this.cancelled = false;
|
this.cancelled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FPlayer getFPlayer()
|
public FPlayer getFPlayer()
|
||||||
{
|
{
|
||||||
return FPlayers.i.get(sender);
|
return FPlayers.i.get(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionId()
|
public String getFactionId()
|
||||||
{
|
{
|
||||||
return Factions.i.getNextId();
|
return Factions.i.getNextId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionTag()
|
public String getFactionTag()
|
||||||
{
|
{
|
||||||
return factionTag;
|
return factionTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HandlerList getHandlers()
|
public HandlerList getHandlers()
|
||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandlerList getHandlerList()
|
public static HandlerList getHandlerList()
|
||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled()
|
public boolean isCancelled()
|
||||||
{
|
{
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean c)
|
public void setCancelled(boolean c)
|
||||||
{
|
{
|
||||||
this.cancelled = c;
|
this.cancelled = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -12,53 +12,53 @@ import com.massivecraft.factions.Factions;
|
|||||||
|
|
||||||
public class FactionDisbandEvent extends Event implements Cancellable
|
public class FactionDisbandEvent extends Event implements Cancellable
|
||||||
{
|
{
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private String id;
|
private String id;
|
||||||
private Player sender;
|
private Player sender;
|
||||||
|
|
||||||
public FactionDisbandEvent(Player sender, String factionId)
|
public FactionDisbandEvent(Player sender, String factionId)
|
||||||
{
|
{
|
||||||
cancelled = false;
|
cancelled = false;
|
||||||
this.sender = sender;
|
this.sender = sender;
|
||||||
this.id = factionId;
|
this.id = factionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HandlerList getHandlers()
|
public HandlerList getHandlers()
|
||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandlerList getHandlerList()
|
public static HandlerList getHandlerList()
|
||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Faction getFaction()
|
public Faction getFaction()
|
||||||
{
|
{
|
||||||
return Factions.i.get(id);
|
return Factions.i.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FPlayer getFPlayer()
|
public FPlayer getFPlayer()
|
||||||
{
|
{
|
||||||
return FPlayers.i.get(sender);
|
return FPlayers.i.get(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer()
|
public Player getPlayer()
|
||||||
{
|
{
|
||||||
return sender;
|
return sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled()
|
public boolean isCancelled()
|
||||||
{
|
{
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean c)
|
public void setCancelled(boolean c)
|
||||||
{
|
{
|
||||||
cancelled = c;
|
cancelled = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,50 +7,50 @@ import com.massivecraft.factions.struct.Relation;
|
|||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
|
|
||||||
|
|
||||||
public class FactionRelationEvent extends Event {
|
public class FactionRelationEvent extends Event
|
||||||
private static final HandlerList handlers = new HandlerList();
|
{
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
private Faction fsender;
|
private Faction fsender;
|
||||||
private Faction ftarget;
|
private Faction ftarget;
|
||||||
private Relation foldrel;
|
private Relation foldrel;
|
||||||
private Relation frel;
|
private Relation frel;
|
||||||
|
|
||||||
public FactionRelationEvent(Faction sender, Faction target, Relation oldrel, Relation rel)
|
public FactionRelationEvent(Faction sender, Faction target, Relation oldrel, Relation rel)
|
||||||
{
|
{
|
||||||
fsender = sender;
|
fsender = sender;
|
||||||
ftarget = target;
|
ftarget = target;
|
||||||
foldrel = oldrel;
|
foldrel = oldrel;
|
||||||
frel = rel;
|
frel = rel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HandlerList getHandlers()
|
public HandlerList getHandlers()
|
||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandlerList getHandlerList()
|
public static HandlerList getHandlerList()
|
||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Relation getOldRelation()
|
public Relation getOldRelation()
|
||||||
{
|
{
|
||||||
return foldrel;
|
return foldrel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Relation getRelation()
|
public Relation getRelation()
|
||||||
{
|
{
|
||||||
return frel;
|
return frel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Faction getFaction()
|
public Faction getFaction()
|
||||||
{
|
{
|
||||||
return fsender;
|
return fsender;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Faction getTargetFaction()
|
|
||||||
{
|
|
||||||
return ftarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public Faction getTargetFaction()
|
||||||
|
{
|
||||||
|
return ftarget;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,66 +8,67 @@ import org.bukkit.event.HandlerList;
|
|||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
|
|
||||||
public class FactionRenameEvent extends Event implements Cancellable {
|
public class FactionRenameEvent extends Event implements Cancellable
|
||||||
private static final HandlerList handlers = new HandlerList();
|
{
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private FPlayer fplayer;
|
private FPlayer fplayer;
|
||||||
private Faction faction;
|
private Faction faction;
|
||||||
private String tag;
|
private String tag;
|
||||||
|
|
||||||
public FactionRenameEvent(FPlayer sender, String newTag)
|
public FactionRenameEvent(FPlayer sender, String newTag)
|
||||||
{
|
{
|
||||||
fplayer = sender;
|
fplayer = sender;
|
||||||
faction = sender.getFaction();
|
faction = sender.getFaction();
|
||||||
tag = newTag;
|
tag = newTag;
|
||||||
this.cancelled = false;
|
this.cancelled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Faction getFaction()
|
public Faction getFaction()
|
||||||
{
|
{
|
||||||
return(faction);
|
return(faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FPlayer getFPlayer()
|
public FPlayer getFPlayer()
|
||||||
{
|
{
|
||||||
return(fplayer);
|
return(fplayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer()
|
public Player getPlayer()
|
||||||
{
|
{
|
||||||
return(fplayer.getPlayer());
|
return(fplayer.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOldFactionTag()
|
public String getOldFactionTag()
|
||||||
{
|
{
|
||||||
return(faction.getTag());
|
return(faction.getTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionTag()
|
public String getFactionTag()
|
||||||
{
|
{
|
||||||
return(tag);
|
return(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HandlerList getHandlers()
|
public HandlerList getHandlers()
|
||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HandlerList getHandlerList()
|
public static HandlerList getHandlerList()
|
||||||
{
|
{
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled()
|
public boolean isCancelled()
|
||||||
{
|
{
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean c)
|
public void setCancelled(boolean c)
|
||||||
{
|
{
|
||||||
this.cancelled = c;
|
this.cancelled = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,23 +37,23 @@ public class LandClaimEvent extends Event implements Cancellable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FLocation getLocation()
|
public FLocation getLocation()
|
||||||
{
|
{
|
||||||
return this.location;
|
return this.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Faction getFaction()
|
public Faction getFaction()
|
||||||
{
|
{
|
||||||
return faction;
|
return faction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionId()
|
public String getFactionId()
|
||||||
{
|
{
|
||||||
return faction.getId();
|
return faction.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionTag()
|
public String getFactionTag()
|
||||||
{
|
{
|
||||||
return faction.getTag();
|
return faction.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FPlayer getFPlayer()
|
public FPlayer getFPlayer()
|
||||||
@ -63,7 +63,7 @@ public class LandClaimEvent extends Event implements Cancellable
|
|||||||
|
|
||||||
public Player getPlayer()
|
public Player getPlayer()
|
||||||
{
|
{
|
||||||
return fplayer.getPlayer();
|
return fplayer.getPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,5 +77,4 @@ public class LandClaimEvent extends Event implements Cancellable
|
|||||||
{
|
{
|
||||||
this.cancelled = c;
|
this.cancelled = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package com.massivecraft.factions.event;
|
|||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
//import com.massivecraft.factions.FLocation;
|
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -12,11 +11,8 @@ public class LandUnclaimAllEvent extends Event
|
|||||||
{
|
{
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
// Location is commented out because there is no clean way to hook currently.
|
private Faction faction;
|
||||||
// faction and fplayer should be enough to filter needed information.
|
private FPlayer fplayer;
|
||||||
// private FLocation[] location;
|
|
||||||
private Faction faction;
|
|
||||||
private FPlayer fplayer;
|
|
||||||
|
|
||||||
public LandUnclaimAllEvent(Faction f, FPlayer p)
|
public LandUnclaimAllEvent(Faction f, FPlayer p)
|
||||||
{
|
{
|
||||||
@ -34,35 +30,28 @@ public class LandUnclaimAllEvent extends Event
|
|||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public FLocation getLocation()
|
|
||||||
{
|
|
||||||
return this.location;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public Faction getFaction()
|
public Faction getFaction()
|
||||||
{
|
{
|
||||||
return faction;
|
return faction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionId()
|
public String getFactionId()
|
||||||
{
|
{
|
||||||
return faction.getId();
|
return faction.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionTag()
|
public String getFactionTag()
|
||||||
{
|
{
|
||||||
return faction.getTag();
|
return faction.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FPlayer getFPlayer()
|
public FPlayer getFPlayer()
|
||||||
{
|
{
|
||||||
return fplayer;
|
return fplayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer()
|
public Player getPlayer()
|
||||||
{
|
{
|
||||||
return fplayer.getPlayer();
|
return fplayer.getPlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,9 @@ public class LandUnclaimEvent extends Event implements Cancellable
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private FLocation location;
|
private FLocation location;
|
||||||
private Faction faction;
|
private Faction faction;
|
||||||
private FPlayer fplayer;
|
private FPlayer fplayer;
|
||||||
|
|
||||||
public LandUnclaimEvent(FLocation loc, Faction f, FPlayer p)
|
public LandUnclaimEvent(FLocation loc, Faction f, FPlayer p)
|
||||||
{
|
{
|
||||||
@ -38,7 +38,7 @@ public class LandUnclaimEvent extends Event implements Cancellable
|
|||||||
|
|
||||||
public FLocation getLocation()
|
public FLocation getLocation()
|
||||||
{
|
{
|
||||||
return this.location;
|
return this.location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Faction getFaction()
|
public Faction getFaction()
|
||||||
@ -46,25 +46,25 @@ public class LandUnclaimEvent extends Event implements Cancellable
|
|||||||
return faction;
|
return faction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionId()
|
public String getFactionId()
|
||||||
{
|
{
|
||||||
return faction.getId();
|
return faction.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionTag()
|
public String getFactionTag()
|
||||||
{
|
{
|
||||||
return faction.getTag();
|
return faction.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FPlayer getFPlayer()
|
public FPlayer getFPlayer()
|
||||||
{
|
{
|
||||||
return fplayer;
|
return fplayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer()
|
public Player getPlayer()
|
||||||
{
|
{
|
||||||
return fplayer.getPlayer();
|
return fplayer.getPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCancelled()
|
public boolean isCancelled()
|
||||||
|
@ -116,8 +116,8 @@ public class FactionsEntityListener implements Listener
|
|||||||
EntityDamageByEntityEvent sub = (EntityDamageByEntityEvent)event;
|
EntityDamageByEntityEvent sub = (EntityDamageByEntityEvent)event;
|
||||||
if ( ! this.canDamagerHurtDamagee(sub, true))
|
if ( ! this.canDamagerHurtDamagee(sub, true))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Conf.safeZonePreventAllDamageToPlayers && isPlayerInSafeZone(event.getEntity()))
|
else if (Conf.safeZonePreventAllDamageToPlayers && isPlayerInSafeZone(event.getEntity()))
|
||||||
{
|
{
|
||||||
|
@ -62,8 +62,8 @@ public class FactionsPlayerListener implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onPlayerQuit(PlayerQuitEvent event)
|
public void onPlayerQuit(PlayerQuitEvent event)
|
||||||
{
|
{
|
||||||
FPlayer me = FPlayers.i.get(event.getPlayer());
|
FPlayer me = FPlayers.i.get(event.getPlayer());
|
||||||
|
|
||||||
// Make sure player's power is up to date when they log off.
|
// Make sure player's power is up to date when they log off.
|
||||||
@ -209,8 +209,8 @@ public class FactionsPlayerListener implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onPlayerInteract(PlayerInteractEvent event)
|
public void onPlayerInteract(PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
|
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
|
@ -11,9 +11,9 @@ public enum ChatMode
|
|||||||
|
|
||||||
private ChatMode(final int value, final String nicename)
|
private ChatMode(final int value, final String nicename)
|
||||||
{
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.nicename = nicename;
|
this.nicename = nicename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAtLeast(ChatMode role)
|
public boolean isAtLeast(ChatMode role)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ public enum Permission
|
|||||||
Permission(final String node)
|
Permission(final String node)
|
||||||
{
|
{
|
||||||
this.node = "factions."+node;
|
this.node = "factions."+node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean has(CommandSender sender, boolean informSenderIfNot)
|
public boolean has(CommandSender sender, boolean informSenderIfNot)
|
||||||
{
|
{
|
||||||
|
@ -17,9 +17,9 @@ public enum Relation
|
|||||||
|
|
||||||
private Relation(final int value, final String nicename)
|
private Relation(final int value, final String nicename)
|
||||||
{
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.nicename = nicename;
|
this.nicename = nicename;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
|
@ -13,9 +13,9 @@ public enum Role
|
|||||||
|
|
||||||
private Role(final int value, final String nicename)
|
private Role(final int value, final String nicename)
|
||||||
{
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.nicename = nicename;
|
this.nicename = nicename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAtLeast(Role role)
|
public boolean isAtLeast(Role role)
|
||||||
{
|
{
|
||||||
|
@ -21,8 +21,8 @@ public class AsciiCompass
|
|||||||
|
|
||||||
private Point(final char asciiChar)
|
private Point(final char asciiChar)
|
||||||
{
|
{
|
||||||
this.asciiChar = asciiChar;
|
this.asciiChar = asciiChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
@ -62,7 +62,7 @@ public class AsciiCompass
|
|||||||
return AsciiCompass.Point.N;
|
return AsciiCompass.Point.N;
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<String> getAsciiCompass(Point point, ChatColor colorActive, String colorDefault)
|
public static ArrayList<String> getAsciiCompass(Point point, ChatColor colorActive, String colorDefault)
|
||||||
{
|
{
|
||||||
|
@ -61,8 +61,8 @@ public class DiscUtil
|
|||||||
URL url = new URL(urlstring);
|
URL url = new URL(urlstring);
|
||||||
ReadableByteChannel rbc = Channels.newChannel(url.openStream());
|
ReadableByteChannel rbc = Channels.newChannel(url.openStream());
|
||||||
FileOutputStream fos = new FileOutputStream(file);
|
FileOutputStream fos = new FileOutputStream(file);
|
||||||
fos.getChannel().transferFrom(rbc, 0, 1 << 24);
|
fos.getChannel().transferFrom(rbc, 0, 1 << 24);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -75,14 +75,14 @@ public class TextUtil
|
|||||||
public static String parseColorAmp(String string)
|
public static String parseColorAmp(String string)
|
||||||
{
|
{
|
||||||
string = string.replaceAll("(§([a-z0-9]))", "\u00A7$2");
|
string = string.replaceAll("(§([a-z0-9]))", "\u00A7$2");
|
||||||
string = string.replaceAll("(&([a-z0-9]))", "\u00A7$2");
|
string = string.replaceAll("(&([a-z0-9]))", "\u00A7$2");
|
||||||
string = string.replace("&&", "&");
|
string = string.replace("&&", "&");
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String parseColorAcc(String string)
|
public static String parseColorAcc(String string)
|
||||||
{
|
{
|
||||||
return string.replace("`e", "")
|
return string.replace("`e", "")
|
||||||
.replace("`r", ChatColor.RED.toString()) .replace("`R", ChatColor.DARK_RED.toString())
|
.replace("`r", ChatColor.RED.toString()) .replace("`R", ChatColor.DARK_RED.toString())
|
||||||
.replace("`y", ChatColor.YELLOW.toString()) .replace("`Y", ChatColor.GOLD.toString())
|
.replace("`y", ChatColor.YELLOW.toString()) .replace("`Y", ChatColor.GOLD.toString())
|
||||||
.replace("`g", ChatColor.GREEN.toString()) .replace("`G", ChatColor.DARK_GREEN.toString())
|
.replace("`g", ChatColor.GREEN.toString()) .replace("`G", ChatColor.DARK_GREEN.toString())
|
||||||
@ -91,27 +91,27 @@ public class TextUtil
|
|||||||
.replace("`p", ChatColor.LIGHT_PURPLE.toString()) .replace("`P", ChatColor.DARK_PURPLE.toString())
|
.replace("`p", ChatColor.LIGHT_PURPLE.toString()) .replace("`P", ChatColor.DARK_PURPLE.toString())
|
||||||
.replace("`k", ChatColor.BLACK.toString()) .replace("`s", ChatColor.GRAY.toString())
|
.replace("`k", ChatColor.BLACK.toString()) .replace("`s", ChatColor.GRAY.toString())
|
||||||
.replace("`S", ChatColor.DARK_GRAY.toString()) .replace("`w", ChatColor.WHITE.toString());
|
.replace("`S", ChatColor.DARK_GRAY.toString()) .replace("`w", ChatColor.WHITE.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String parseColorTags(String string)
|
public static String parseColorTags(String string)
|
||||||
{
|
{
|
||||||
return string.replace("<empty>", "")
|
return string.replace("<empty>", "")
|
||||||
.replace("<black>", "\u00A70")
|
.replace("<black>", "\u00A70")
|
||||||
.replace("<navy>", "\u00A71")
|
.replace("<navy>", "\u00A71")
|
||||||
.replace("<green>", "\u00A72")
|
.replace("<green>", "\u00A72")
|
||||||
.replace("<teal>", "\u00A73")
|
.replace("<teal>", "\u00A73")
|
||||||
.replace("<red>", "\u00A74")
|
.replace("<red>", "\u00A74")
|
||||||
.replace("<purple>", "\u00A75")
|
.replace("<purple>", "\u00A75")
|
||||||
.replace("<gold>", "\u00A76")
|
.replace("<gold>", "\u00A76")
|
||||||
.replace("<silver>", "\u00A77")
|
.replace("<silver>", "\u00A77")
|
||||||
.replace("<gray>", "\u00A78")
|
.replace("<gray>", "\u00A78")
|
||||||
.replace("<blue>", "\u00A79")
|
.replace("<blue>", "\u00A79")
|
||||||
.replace("<lime>", "\u00A7a")
|
.replace("<lime>", "\u00A7a")
|
||||||
.replace("<aqua>", "\u00A7b")
|
.replace("<aqua>", "\u00A7b")
|
||||||
.replace("<rose>", "\u00A7c")
|
.replace("<rose>", "\u00A7c")
|
||||||
.replace("<pink>", "\u00A7d")
|
.replace("<pink>", "\u00A7d")
|
||||||
.replace("<yellow>", "\u00A7e")
|
.replace("<yellow>", "\u00A7e")
|
||||||
.replace("<white>", "\u00A7f");
|
.replace("<white>", "\u00A7f");
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -125,22 +125,22 @@ public class TextUtil
|
|||||||
|
|
||||||
public static String implode(List<String> list, String glue)
|
public static String implode(List<String> list, String glue)
|
||||||
{
|
{
|
||||||
StringBuilder ret = new StringBuilder();
|
StringBuilder ret = new StringBuilder();
|
||||||
for (int i=0; i<list.size(); i++)
|
for (int i=0; i<list.size(); i++)
|
||||||
{
|
{
|
||||||
if (i!=0)
|
if (i!=0)
|
||||||
{
|
{
|
||||||
ret.append(glue);
|
ret.append(glue);
|
||||||
}
|
}
|
||||||
ret.append(list.get(i));
|
ret.append(list.get(i));
|
||||||
}
|
}
|
||||||
return ret.toString();
|
return ret.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String repeat(String s, int times)
|
public static String repeat(String s, int times)
|
||||||
{
|
{
|
||||||
if (times <= 0) return "";
|
if (times <= 0) return "";
|
||||||
else return s + repeat(s, times-1);
|
else return s + repeat(s, times-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
Loading…
Reference in New Issue
Block a user