So many improvements
This commit is contained in:
commit
40d6054275
@ -2,6 +2,7 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.listeners.FactionsPlayerListener;
|
||||
import com.massivecraft.factions.shop.ShopConfig;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@ -28,6 +29,11 @@ public class CmdReload extends FCommand {
|
||||
if (FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
|
||||
FactionsPlugin.getInstance().factionsFlight = true;
|
||||
}
|
||||
|
||||
if (!FactionsPlugin.getInstance().mc17) {
|
||||
FactionsPlayerListener.loadCorners();
|
||||
}
|
||||
|
||||
long timeReload = (System.currentTimeMillis() - timeInitStart);
|
||||
|
||||
context.msg(TL.COMMAND_RELOAD_TIME, timeReload);
|
||||
|
@ -47,7 +47,7 @@ import java.util.logging.Level;
|
||||
public class FactionsPlayerListener implements Listener {
|
||||
|
||||
HashMap<Player, Boolean> fallMap = new HashMap<>();
|
||||
private Set<FLocation> corners;
|
||||
public static Set<FLocation> corners;
|
||||
// Holds the next time a player can have a map shown.
|
||||
private HashMap<UUID, Long> showTimes = new HashMap<>();
|
||||
// for handling people who repeatedly spam attempts to open a door (or similar) in another faction's territory
|
||||
@ -58,16 +58,20 @@ public class FactionsPlayerListener implements Listener {
|
||||
initPlayer(player);
|
||||
}
|
||||
if (!FactionsPlugin.getInstance().mc17) {
|
||||
this.corners = new HashSet<>();
|
||||
loadCorners();
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadCorners() {
|
||||
FactionsPlayerListener.corners = new HashSet<>();
|
||||
for (World world : FactionsPlugin.getInstance().getServer().getWorlds()) {
|
||||
WorldBorder border = world.getWorldBorder();
|
||||
if (border != null) {
|
||||
int cornerCoord = (int) ((border.getSize() - 1.0) / 2.0);
|
||||
this.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(cornerCoord), FLocation.blockToChunk(cornerCoord)));
|
||||
this.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(cornerCoord), FLocation.blockToChunk(-cornerCoord)));
|
||||
this.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(-cornerCoord), FLocation.blockToChunk(cornerCoord)));
|
||||
this.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(-cornerCoord), FLocation.blockToChunk(-cornerCoord)));
|
||||
}
|
||||
FactionsPlayerListener.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(cornerCoord), FLocation.blockToChunk(cornerCoord)));
|
||||
FactionsPlayerListener.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(cornerCoord), FLocation.blockToChunk(-cornerCoord)));
|
||||
FactionsPlayerListener.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(-cornerCoord), FLocation.blockToChunk(cornerCoord)));
|
||||
FactionsPlayerListener.corners.add(new FLocation(world.getName(), FLocation.blockToChunk(-cornerCoord), FLocation.blockToChunk(-cornerCoord)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,9 @@ public class CornerTask extends BukkitRunnable {
|
||||
FLocation fLocation = surrounding.remove(0);
|
||||
if (fPlayer.attemptClaim(fPlayer.getFaction(), fLocation, true)) {
|
||||
++amount;
|
||||
} else {
|
||||
fPlayer.sendMessage(TL.COMMAND_CORNER_FAIL_WITH_FEEDBACK.toString().replace("&", "§") + amount);
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ public enum TL {
|
||||
COMMAND_CORNER_CANT_CLAIM("&c&l[!] &cYou may not claim this corner!"),
|
||||
COMMAND_CORNER_CLAIMED("\n&2&l[!] &aYou have claimed the corner successfully, totalling in &b%1$d &achunks!\n"),
|
||||
COMMAND_CORNER_ATTEMPTING_CLAIM("&c&l[!] &7Attempting to claim corner..."),
|
||||
COMMAND_CORNER_FAIL_WITH_FEEDBACK("&c&l[!] &cOne or more claims in this corner could not be claimed! Total chunks claimed:&b "),
|
||||
COMMAND_CORNER_NOT_CORNER("&c&l[!] &7You must be in a corner to use this command!"),
|
||||
COMMAND_CORNER_DESCRIPTION("claim a corner at world border"),
|
||||
COMMAND_CORNERLIST_DESCRIPTION("list of all corners"),
|
||||
@ -967,7 +968,7 @@ public enum TL {
|
||||
CLAIM_MEMBERS("Factions must have at least %s members to claim land."),
|
||||
CLAIM_SAFEZONE("You can not claim a Safe Zone."),
|
||||
CLAIM_WARZONE("You can not claim a War Zone."),
|
||||
CLAIM_POWER("You can't claim more land!You need more power!"),
|
||||
CLAIM_POWER("You can't claim more land! You need more power!"),
|
||||
CLAIM_LIMIT("Limit reached. You can't claim more land!"),
|
||||
CLAIM_ALLY("You can't claim the land of your allies."),
|
||||
CLAIM_CONTIGIOUS("You can only claim additional land which is connected to your first claim or controlled by another faction!"),
|
||||
|
Loading…
Reference in New Issue
Block a user