1.1-RELEASECANDIDATE-1

Made the particles in /f fly more cloud like
Changed wilderness color to Darkgreen
Added a factionless check to inspect, so itll now disable the when you try to check with no faction.
Inspect will disable upon entering combat
You cannot claim outside the worldborder anymore, the chunkbuffer is taken into account.
Particles WILL NOT appear in /vanish and in spectator mode
This commit is contained in:
Naman 2018-04-13 21:05:43 -05:00
parent efee66071b
commit e36927db9f
15 changed files with 49 additions and 27 deletions

View File

@ -14,14 +14,14 @@ public class Conf {
public static boolean allowNoSlashCommand = true; public static boolean allowNoSlashCommand = true;
// Colors // Colors
public static ChatColor colorMember = ChatColor.GREEN; public static ChatColor colorMember = ChatColor.DARK_GREEN;
public static ChatColor colorAlly = ChatColor.LIGHT_PURPLE; public static ChatColor colorAlly = ChatColor.LIGHT_PURPLE;
public static ChatColor colorTruce = ChatColor.DARK_PURPLE; public static ChatColor colorTruce = ChatColor.DARK_PURPLE;
public static ChatColor colorNeutral = ChatColor.WHITE; public static ChatColor colorNeutral = ChatColor.WHITE;
public static ChatColor colorEnemy = ChatColor.RED; public static ChatColor colorEnemy = ChatColor.RED;
public static ChatColor colorPeaceful = ChatColor.GOLD; public static ChatColor colorPeaceful = ChatColor.GOLD;
public static ChatColor colorWilderness = ChatColor.GREEN; public static ChatColor colorWilderness = ChatColor.DARK_GREEN;
public static ChatColor colorSafezone = ChatColor.GOLD; public static ChatColor colorSafezone = ChatColor.GOLD;
public static ChatColor colorWar = ChatColor.DARK_RED; public static ChatColor colorWar = ChatColor.DARK_RED;

View File

@ -128,9 +128,7 @@ public class P extends MPlugin {
Board.getInstance().clean(); Board.getInstance().clean();
//inspect stuff //inspect stuff
if (!initCoreProtect()){
P.p.log("Inspect will be disabled, you need coreprotect installed for it to function!");
}
// Add Base Commands // Add Base Commands
this.cmdBase = new FCmdRoot(); this.cmdBase = new FCmdRoot();
@ -349,15 +347,7 @@ public class P extends MPlugin {
} }
//Inspect stuff
private boolean initCoreProtect()
{
if (!getServer().getPluginManager().isPluginEnabled("CoreProtect")) {
return false;
}
CoreProtectAPI coreProtectAPI = CoreProtect.getInstance().getAPI();
return true;
}

View File

@ -47,15 +47,21 @@ public class CmdFly extends FCommand {
if (!player.isFlying()) { if (!player.isFlying()) {
continue; continue;
} }
if (player.getGameMode() == GameMode.SPECTATOR){
continue;
}
if (FPlayers.getInstance().getByPlayer(player).isVanished()){
continue;
}
ParticleEffect.CLOUD.display(0, 0, 0, 0, 1, player.getLocation().add(0, -0.35, 0), 16); ParticleEffect.CLOUD.display((float) 0, (float) 0, (float) 0, (float) 0, 3, player.getLocation().add(0, -0.35, 0), 16);
} }
if (flyMap.keySet().size() == 0) { if (flyMap.keySet().size() == 0) {
Bukkit.getScheduler().cancelTask(id); Bukkit.getScheduler().cancelTask(id);
id = -1; id = -1;
} }
} }
}, 10L, 10L); }, 10L, 3L);
} }
public static void startFlyCheck() { public static void startFlyCheck() {
@ -76,7 +82,6 @@ public class CmdFly extends FCommand {
continue; continue;
} }
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player); FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
if (fPlayer == null) { if (fPlayer == null) {
continue; continue;
} }

View File

@ -52,8 +52,8 @@ public class CmdRules extends FCommand {
if (args.get(0).equalsIgnoreCase("set")) { if (args.get(0).equalsIgnoreCase("set")) {
fme.msg(TL.COMMAND_RULES_SET_INVALIDARGS); fme.msg(TL.COMMAND_RULES_SET_INVALIDARGS);
} }
if (args.get(0).equalsIgnoreCase("add")) { if (args.get(0).equalsIgnoreCase("remove")) {
fme.msg(TL.COMMAND_RULES_ADD_INVALIDARGS); fme.msg(TL.COMMAND_RULES_REMOVE_INVALIDARGS);
} }
if (args.get(0).equalsIgnoreCase("clear")) { if (args.get(0).equalsIgnoreCase("clear")) {
fme.getFaction().clearRules(); fme.getFaction().clearRules();

View File

@ -202,7 +202,7 @@ public class FCmdRoot extends FCommand {
this.addSubCommand(this.cmdTpBanner); this.addSubCommand(this.cmdTpBanner);
this.addSubCommand(this.cmdKillHolograms); this.addSubCommand(this.cmdKillHolograms);
if (CoreProtect.getInstance() != null){ if (Bukkit.getServer().getPluginManager().getPlugin("CoreProtect") != null){
P.p.log("Found CoreProtect, enabling Inspect"); P.p.log("Found CoreProtect, enabling Inspect");
this.addSubCommand(this.cmdInspect); this.addSubCommand(this.cmdInspect);
} else { } else {

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.listeners; package com.massivecraft.factions.listeners;
import com.massivecraft.factions.*; import com.massivecraft.factions.*;
import com.massivecraft.factions.event.FPlayerJoinEvent;
import com.massivecraft.factions.event.PowerLossEvent; import com.massivecraft.factions.event.PowerLossEvent;
import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.util.MiscUtil; import com.massivecraft.factions.util.MiscUtil;
@ -143,10 +144,20 @@ public class FactionsEntityListener implements Listener {
if (damagee != null && damagee instanceof Player) { if (damagee != null && damagee instanceof Player) {
cancelFStuckTeleport((Player) damagee); cancelFStuckTeleport((Player) damagee);
cancelFFly((Player) damagee); cancelFFly((Player) damagee);
FPlayer fplayer = FPlayers.getInstance().getByPlayer((Player) damagee);
if (fplayer.isInspectMode()){
fplayer.setInspectMode(false);
fplayer.msg(TL.COMMAND_INSPECT_DISABLED);
}
} }
if (damager instanceof Player) { if (damager instanceof Player) {
cancelFStuckTeleport((Player) damager); cancelFStuckTeleport((Player) damager);
cancelFFly((Player) damager); cancelFFly((Player) damager);
FPlayer fplayer = FPlayers.getInstance().getByPlayer((Player) damager);
if (fplayer.isInspectMode()){
fplayer.setInspectMode(false);
fplayer.msg(TL.COMMAND_INSPECT_DISABLED);
}
} }
} else if (Conf.safeZonePreventAllDamageToPlayers && isPlayerInSafeZone(event.getEntity())) { } else if (Conf.safeZonePreventAllDamageToPlayers && isPlayerInSafeZone(event.getEntity())) {
// Players can not take any damage in a Safe Zone // Players can not take any damage in a Safe Zone

View File

@ -267,7 +267,13 @@ public class FactionsPlayerListener implements Listener {
if (!fplayer.isInspectMode()){ if (!fplayer.isInspectMode()){
return; return;
} }
e.setCancelled(true);
if (!fplayer.isAdminBypassing()){ if (!fplayer.isAdminBypassing()){
if (!fplayer.hasFaction()){
fplayer.setInspectMode(false);
fplayer.msg(TL.COMMAND_INSPECT_DISABLED_NOFAC);
return;
}
if (fplayer.getFaction() != Board.getInstance().getFactionAt(new FLocation(e.getPlayer().getLocation()))){ if (fplayer.getFaction() != Board.getInstance().getFactionAt(new FLocation(e.getPlayer().getLocation()))){
fplayer.msg(TL.COMMAND_INSPECT_NOTINCLAIM); fplayer.msg(TL.COMMAND_INSPECT_NOTINCLAIM);
return; return;

View File

@ -162,4 +162,4 @@ public class BufferedObjective {
private String getNextTeamName() { private String getNextTeamName() {
return baseName.substring(0, 10) + "_" + ((teamPtr++) % 999999); return baseName.substring(0, 10) + "_" + ((teamPtr++) % 999999);
} }
} }

View File

@ -146,4 +146,4 @@ public class FScoreboard {
bufferedObjective.flip(); bufferedObjective.flip();
} }
} }
} }

View File

@ -204,4 +204,3 @@ public class FTeamWrapper {
teams.clear(); teams.clear();
} }
} }

View File

@ -99,6 +99,7 @@ public enum Permission {
TPBANNER("tpbanner"), TPBANNER("tpbanner"),
KILLHOLOS("killholos"), KILLHOLOS("killholos"),
INSPECT("inspect"), INSPECT("inspect"),
TNTFILL("tntfill"),
WARP("warp"); WARP("warp");
public final String node; public final String node;

View File

@ -250,6 +250,8 @@ public abstract class MemoryBoard extends Board {
ArrayList<FancyMessage> ret = new ArrayList<>(); ArrayList<FancyMessage> ret = new ArrayList<>();
Faction factionLoc = getFactionAt(flocation); Faction factionLoc = getFactionAt(flocation);
ret.add(new FancyMessage(P.p.txt.titleize("(" + flocation.getCoordString() + ") " + factionLoc.getTag(fplayer)))); ret.add(new FancyMessage(P.p.txt.titleize("(" + flocation.getCoordString() + ") " + factionLoc.getTag(fplayer))));
int buffer = P.p.getConfig().getInt("world-border.buffer", 0);
// Get the compass // Get the compass
ArrayList<String> asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.RED, P.p.txt.parse("<a>")); ArrayList<String> asciiCompass = AsciiCompass.getAsciiCompass(inDegrees, ChatColor.RED, P.p.txt.parse("<a>"));
@ -283,7 +285,9 @@ public abstract class MemoryBoard extends Board {
FLocation flocationHere = topLeft.getRelative(dx, dz); FLocation flocationHere = topLeft.getRelative(dx, dz);
Faction factionHere = getFactionAt(flocationHere); Faction factionHere = getFactionAt(flocationHere);
Relation relation = fplayer.getRelationTo(factionHere); Relation relation = fplayer.getRelationTo(factionHere);
if (factionHere.isWilderness()) { if (flocationHere.isOutsideWorldBorder(buffer)){
row.then("-").color(ChatColor.BLACK).tooltip(TL.CLAIM_MAP_OUTSIDEBORDER.toString());
} else if (factionHere.isWilderness()) {
row.then("-").color(Conf.colorWilderness); row.then("-").color(Conf.colorWilderness);
// Lol someone didnt add the x and z making it claim the wrong position Can i copyright this xD // Lol someone didnt add the x and z making it claim the wrong position Can i copyright this xD
if (fplayer.getPlayer().hasPermission(Permission.CLAIMAT.node)) { if (fplayer.getPlayer().hasPermission(Permission.CLAIMAT.node)) {

View File

@ -724,7 +724,10 @@ public abstract class MemoryFPlayer implements FPlayer {
if (Conf.worldGuardChecking && Worldguard.checkForRegionsInChunk(flocation)) { if (Conf.worldGuardChecking && Worldguard.checkForRegionsInChunk(flocation)) {
// Checks for WorldGuard regions in the chunk attempting to be claimed // Checks for WorldGuard regions in the chunk attempting to be claimed
error = P.p.txt.parse(TL.CLAIM_PROTECTED.toString()); error = P.p.txt.parse(TL.CLAIM_PROTECTED.toString());
} else if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) { } else if(flocation.isOutsideWorldBorder(P.p.getConfig().getInt("world-border.buffer", 0))){
error = P.p.txt.parse(TL.CLAIM_OUTSIDEWORLDBORDER.toString());
}
else if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) {
error = P.p.txt.parse(TL.CLAIM_DISABLED.toString()); error = P.p.txt.parse(TL.CLAIM_DISABLED.toString());
} else if (this.isAdminBypassing()) { } else if (this.isAdminBypassing()) {
return true; return true;

View File

@ -310,6 +310,7 @@ public enum TL {
COMMAND_HOME_DESCRIPTION("Teleport to the faction home"), COMMAND_HOME_DESCRIPTION("Teleport to the faction home"),
COMMAND_INSPECT_DISABLED("&c&l[!]&7 Inspect mode is now &cdisabled."), COMMAND_INSPECT_DISABLED("&c&l[!]&7 Inspect mode is now &cdisabled."),
COMMAND_INSPECT_DISABLED_NOFAC("&c&l[!]&7 Inspect mode is now &cdisabled,&7 because you &cdo not have a faction!"),
COMMAND_INSPECT_ENABLED("&c&l[!]&7 Inspect mode is now &aEnabled."), COMMAND_INSPECT_ENABLED("&c&l[!]&7 Inspect mode is now &aEnabled."),
COMMAND_INSPECT_HEADER("&c&m---&7Inspect Data&c&m---&c//&7x:{x},y:{y},z:{z}"), COMMAND_INSPECT_HEADER("&c&m---&7Inspect Data&c&m---&c//&7x:{x},y:{y},z:{z}"),
COMMAND_INSPECT_ROW("&c{time} &7// &c{action} &7// &c{player} &7// &c{block-type}"), COMMAND_INSPECT_ROW("&c{time} &7// &c{action} &7// &c{player} &7// &c{block-type}"),
@ -660,6 +661,7 @@ public enum TL {
COMMAND_TNT_POSITIVE("&cPlease use positive numbers!"), COMMAND_TNT_POSITIVE("&cPlease use positive numbers!"),
COMMAND_TNT_DESCRIPTION("add/widthraw from faction's tnt bank"), COMMAND_TNT_DESCRIPTION("add/widthraw from faction's tnt bank"),
COMMAND_UNBAN_DESCRIPTION("Unban someone from your Faction"), COMMAND_UNBAN_DESCRIPTION("Unban someone from your Faction"),
COMMAND_UNBAN_NOTBANNED("&7%s &cisn't banned. Not doing anything."), COMMAND_UNBAN_NOTBANNED("&7%s &cisn't banned. Not doing anything."),
COMMAND_UNBAN_UNBANNED("&e%1$s &cunbanned &7%2$s"), COMMAND_UNBAN_UNBANNED("&e%1$s &cunbanned &7%2$s"),
@ -748,6 +750,7 @@ public enum TL {
CLAIM_OUTSIDEWORLDBORDER("<i>Your claim is outside the border."), CLAIM_OUTSIDEWORLDBORDER("<i>Your claim is outside the border."),
CLAIM_OUTSIDEBORDERBUFFER("<i>Your claim is outside the border. %d chunks away world edge required."), CLAIM_OUTSIDEBORDERBUFFER("<i>Your claim is outside the border. %d chunks away world edge required."),
CLAIM_CLICK_TO_CLAIM("Click to try to claim &2(%1$d, %2$d)"), CLAIM_CLICK_TO_CLAIM("Click to try to claim &2(%1$d, %2$d)"),
CLAIM_MAP_OUTSIDEBORDER("&cThis claim is outside the worldborder!"),
CLAIM_YOUAREHERE("You are here"), CLAIM_YOUAREHERE("You are here"),
/** /**
@ -898,7 +901,7 @@ public enum TL {
FACTION_LEAVE("faction-leave", "<a>Leaving %1$s, <a>Entering %2$s"), FACTION_LEAVE("faction-leave", "<a>Leaving %1$s, <a>Entering %2$s"),
FACTIONS_ANNOUNCEMENT_TOP("faction-announcement-top", "&d--Unread Faction Announcements--"), FACTIONS_ANNOUNCEMENT_TOP("faction-announcement-top", "&d--Unread Faction Announcements--"),
FACTIONS_ANNOUNCEMENT_BOTTOM("faction-announcement-bottom", "&d--Unread Faction Announcements--"), FACTIONS_ANNOUNCEMENT_BOTTOM("faction-announcement-bottom", "&d--Unread Faction Announcements--"),
DEFAULT_PREFIX("default-prefix", "{relationcolor}[{faction}] &r"), DEFAULT_PREFIX("default-prefix", "{relationcolor}[{faction}] &r {player-name}"),
FACTION_LOGIN("faction-login", "&e%1$s &9logged in."), FACTION_LOGIN("faction-login", "&e%1$s &9logged in."),
FACTION_LOGOUT("faction-logout", "&e%1$s &9logged out.."), FACTION_LOGOUT("faction-logout", "&e%1$s &9logged out.."),
NOFACTION_PREFIX("nofactions-prefix", "&6[&a4-&6]&r"), NOFACTION_PREFIX("nofactions-prefix", "&6[&a4-&6]&r"),

View File

@ -1,5 +1,5 @@
name: Factions name: Factions
version: ${project.version}-SF-1.0.23-BETA version: ${project.version}-SF-1.1-STABLE
main: com.massivecraft.factions.P main: com.massivecraft.factions.P
authors: [Olof Larsson, Brett Flannigan, drtshock, ProSavage] authors: [Olof Larsson, Brett Flannigan, drtshock, ProSavage]
softdepend: [CoreProtect, PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap, FactionsTop] softdepend: [CoreProtect, PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap, FactionsTop]