Fixes quite a lot of warnings
This commit is contained in:
parent
f8407a3692
commit
950faa7100
1
.gitignore
vendored
1
.gitignore
vendored
@ -167,7 +167,6 @@ GitHub.sublime-settings
|
|||||||
Session.vim
|
Session.vim
|
||||||
# temporary
|
# temporary
|
||||||
.netrwhist
|
.netrwhist
|
||||||
*~
|
|
||||||
# auto-generated tag files
|
# auto-generated tag files
|
||||||
tags
|
tags
|
||||||
|
|
||||||
|
10
pom.xml
10
pom.xml
@ -57,7 +57,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.massivecraft.massivecore</groupId>
|
<groupId>com.massivecraft.massivecore</groupId>
|
||||||
<artifactId>MassiveCore</artifactId>
|
<artifactId>MassiveCore</artifactId>
|
||||||
<version>RELEASE</version>
|
<version>3.3.3</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}\lib\MassiveCore.jar</systemPath>
|
<systemPath>${project.basedir}\lib\MassiveCore.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -76,12 +76,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sk89q.worldguard</groupId>
|
<groupId>com.sk89q.worldguard</groupId>
|
||||||
<artifactId>worldguard-core</artifactId>
|
<artifactId>worldguard-core</artifactId>
|
||||||
<version>RELEASE</version>
|
<version>7.0.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sk89q.worldguard</groupId>
|
<groupId>com.sk89q.worldguard</groupId>
|
||||||
<artifactId>worldguard-bukkit</artifactId>
|
<artifactId>worldguard-bukkit</artifactId>
|
||||||
<version>RELEASE</version>
|
<version>7.0.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Vault -->
|
<!-- Vault -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.griefcraft</groupId>
|
<groupId>com.griefcraft</groupId>
|
||||||
<artifactId>lwc</artifactId>
|
<artifactId>lwc</artifactId>
|
||||||
<version>RELEASE</version>
|
<version>4.4.0</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}\lib\LWC.jar</systemPath>
|
<systemPath>${project.basedir}\lib\LWC.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -108,7 +108,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mineverse.Aust1n46.chat</groupId>
|
<groupId>mineverse.Aust1n46.chat</groupId>
|
||||||
<artifactId>VentureChat</artifactId>
|
<artifactId>VentureChat</artifactId>
|
||||||
<version>RELEASE</version>
|
<version>3.4.1_1.19_patch</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}\lib\VentureChat.jar</systemPath>
|
<systemPath>${project.basedir}\lib\VentureChat.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package net.knarcraft.factions;
|
package net.knarcraft.factions;
|
||||||
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import com.massivecraft.massivecore.util.extractor.Extractor;
|
import com.massivecraft.massivecore.util.extractor.Extractor;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
|
||||||
public class ExtractorFactionAccountId implements Extractor {
|
public class ExtractorFactionAccountId implements Extractor {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// INSTANCE & CONSTRUCT
|
// INSTANCE & CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private static ExtractorFactionAccountId i = new ExtractorFactionAccountId();
|
private static final ExtractorFactionAccountId i = new ExtractorFactionAccountId();
|
||||||
|
|
||||||
public static ExtractorFactionAccountId get() {
|
public static ExtractorFactionAccountId get() {
|
||||||
return i;
|
return i;
|
||||||
@ -22,9 +22,9 @@ public class ExtractorFactionAccountId implements Extractor {
|
|||||||
public Object extract(Object o) {
|
public Object extract(Object o) {
|
||||||
if (o instanceof Faction) {
|
if (o instanceof Faction) {
|
||||||
String factionId = ((Faction) o).getId();
|
String factionId = ((Faction) o).getId();
|
||||||
if (factionId == null) {
|
if (factionId == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return Factions.FACTION_MONEY_ACCOUNT_ID_PREFIX + factionId;
|
return Factions.FACTION_MONEY_ACCOUNT_ID_PREFIX + factionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
package net.knarcraft.factions;
|
package net.knarcraft.factions;
|
||||||
|
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.massivecraft.massivecore.MassivePlugin;
|
||||||
|
import com.massivecraft.massivecore.command.type.RegistryType;
|
||||||
|
import com.massivecraft.massivecore.store.migrator.MigratorUtil;
|
||||||
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
import net.knarcraft.factions.adapter.BoardAdapter;
|
import net.knarcraft.factions.adapter.BoardAdapter;
|
||||||
import net.knarcraft.factions.adapter.BoardMapAdapter;
|
import net.knarcraft.factions.adapter.BoardMapAdapter;
|
||||||
import net.knarcraft.factions.adapter.TerritoryAccessAdapter;
|
import net.knarcraft.factions.adapter.TerritoryAccessAdapter;
|
||||||
@ -76,10 +80,6 @@ import net.knarcraft.factions.mixin.PowerMixin;
|
|||||||
import net.knarcraft.factions.task.TaskFlagPermCreate;
|
import net.knarcraft.factions.task.TaskFlagPermCreate;
|
||||||
import net.knarcraft.factions.task.TaskPlayerPowerUpdate;
|
import net.knarcraft.factions.task.TaskPlayerPowerUpdate;
|
||||||
import net.knarcraft.factions.task.TaskTax;
|
import net.knarcraft.factions.task.TaskTax;
|
||||||
import com.massivecraft.massivecore.MassivePlugin;
|
|
||||||
import com.massivecraft.massivecore.command.type.RegistryType;
|
|
||||||
import com.massivecraft.massivecore.store.migrator.MigratorUtil;
|
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -95,7 +95,7 @@ public class Factions extends MassivePlugin {
|
|||||||
public final static String ID_SAFEZONE = "safezone";
|
public final static String ID_SAFEZONE = "safezone";
|
||||||
public final static String ID_WARZONE = "warzone";
|
public final static String ID_WARZONE = "warzone";
|
||||||
|
|
||||||
public final static String NAME_NONE_DEFAULT = ChatColor.DARK_GREEN.toString() + "Wilderness";
|
public final static String NAME_NONE_DEFAULT = ChatColor.DARK_GREEN + "Wilderness";
|
||||||
public final static String NAME_SAFEZONE_DEFAULT = "SafeZone";
|
public final static String NAME_SAFEZONE_DEFAULT = "SafeZone";
|
||||||
public final static String NAME_WARZONE_DEFAULT = "WarZone";
|
public final static String NAME_WARZONE_DEFAULT = "WarZone";
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.knarcraft.factions;
|
package net.knarcraft.factions;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.collections.MassiveSet;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.FactionColl;
|
import net.knarcraft.factions.entity.FactionColl;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.entity.MPlayerColl;
|
import net.knarcraft.factions.entity.MPlayerColl;
|
||||||
import com.massivecraft.massivecore.collections.MassiveSet;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -24,7 +24,7 @@ public class FactionsIndex {
|
|||||||
// INSTANCE
|
// INSTANCE
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private static FactionsIndex i = new FactionsIndex();
|
private static final FactionsIndex i = new FactionsIndex();
|
||||||
|
|
||||||
public static FactionsIndex get() {
|
public static FactionsIndex get() {
|
||||||
return i;
|
return i;
|
||||||
@ -35,7 +35,7 @@ public class FactionsIndex {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private final Map<MPlayer, Faction> mplayer2faction;
|
private final Map<MPlayer, Faction> mplayer2faction;
|
||||||
private final Map<Faction, Set<MPlayer>> faction2mplayers;
|
private final Map<Faction, Set<MPlayer>> faction2mPlayers;
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
@ -43,7 +43,7 @@ public class FactionsIndex {
|
|||||||
|
|
||||||
private FactionsIndex() {
|
private FactionsIndex() {
|
||||||
this.mplayer2faction = new WeakHashMap<>();
|
this.mplayer2faction = new WeakHashMap<>();
|
||||||
this.faction2mplayers = new WeakHashMapCreativeImpl();
|
this.faction2mPlayers = new WeakHashMapCreativeImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -51,12 +51,12 @@ public class FactionsIndex {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private boolean isConnected(MPlayer mplayer, Faction faction) {
|
private boolean isConnected(MPlayer mplayer, Faction faction) {
|
||||||
if (mplayer == null) {
|
if (mplayer == null) {
|
||||||
throw new NullPointerException("mplayer");
|
throw new NullPointerException("mplayer");
|
||||||
}
|
}
|
||||||
if (faction == null) {
|
if (faction == null) {
|
||||||
throw new NullPointerException("faction");
|
throw new NullPointerException("faction");
|
||||||
}
|
}
|
||||||
|
|
||||||
return mplayer.getFaction() == faction;
|
return mplayer.getFaction() == faction;
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ public class FactionsIndex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized Set<MPlayer> getMPlayers(Faction faction) {
|
public synchronized Set<MPlayer> getMPlayers(Faction faction) {
|
||||||
return new MassiveSet<>(this.faction2mplayers.get(faction));
|
return new MassiveSet<>(this.faction2mPlayers.get(faction));
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -78,20 +78,20 @@ public class FactionsIndex {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public synchronized void updateAll() {
|
public synchronized void updateAll() {
|
||||||
if (!MPlayerColl.get().isActive()) {
|
if (!MPlayerColl.get().isActive()) {
|
||||||
throw new IllegalStateException("The MPlayerColl is not yet fully activated.");
|
throw new IllegalStateException("The MPlayerColl is not yet fully activated.");
|
||||||
}
|
}
|
||||||
|
|
||||||
MPlayerColl.get().getAll().forEach(this::update);
|
MPlayerColl.get().getAll().forEach(this::update);
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void update(MPlayer mplayer) {
|
public synchronized void update(MPlayer mplayer) {
|
||||||
if (mplayer == null) {
|
if (mplayer == null) {
|
||||||
throw new NullPointerException("mplayer");
|
throw new NullPointerException("mplayer");
|
||||||
}
|
}
|
||||||
if (!FactionColl.get().isActive()) {
|
if (!FactionColl.get().isActive()) {
|
||||||
throw new IllegalStateException("The FactionColl is not yet fully activated.");
|
throw new IllegalStateException("The FactionColl is not yet fully activated.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This is not optimal but here we remove a player from the index when
|
// TODO: This is not optimal but here we remove a player from the index when
|
||||||
// the mplayer object is deattached. Optimally it should be removed
|
// the mplayer object is deattached. Optimally it should be removed
|
||||||
@ -101,7 +101,7 @@ public class FactionsIndex {
|
|||||||
if (!mplayer.attached()) {
|
if (!mplayer.attached()) {
|
||||||
Faction factionIndexed = this.mplayer2faction.remove(mplayer);
|
Faction factionIndexed = this.mplayer2faction.remove(mplayer);
|
||||||
if (factionIndexed != null) {
|
if (factionIndexed != null) {
|
||||||
faction2mplayers.get(factionIndexed).remove(mplayer);
|
faction2mPlayers.get(factionIndexed).remove(mplayer);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -110,19 +110,19 @@ public class FactionsIndex {
|
|||||||
Faction factionIndexed = this.getFaction(mplayer);
|
Faction factionIndexed = this.getFaction(mplayer);
|
||||||
|
|
||||||
Set<Faction> factions = new MassiveSet<>();
|
Set<Faction> factions = new MassiveSet<>();
|
||||||
if (factionActual != null) {
|
if (factionActual != null) {
|
||||||
factions.add(factionActual);
|
factions.add(factionActual);
|
||||||
}
|
}
|
||||||
if (factionIndexed != null) {
|
if (factionIndexed != null) {
|
||||||
factions.add(factionIndexed);
|
factions.add(factionIndexed);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Faction faction : factions) {
|
for (Faction faction : factions) {
|
||||||
boolean connected = this.isConnected(mplayer, faction);
|
boolean connected = this.isConnected(mplayer, faction);
|
||||||
if (connected) {
|
if (connected) {
|
||||||
this.faction2mplayers.get(faction).add(mplayer);
|
this.faction2mPlayers.get(faction).add(mplayer);
|
||||||
} else {
|
} else {
|
||||||
this.faction2mplayers.get(faction).remove(mplayer);
|
this.faction2mPlayers.get(faction).remove(mplayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,9 +130,9 @@ public class FactionsIndex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void update(Faction faction) {
|
public synchronized void update(Faction faction) {
|
||||||
if (faction == null) {
|
if (faction == null) {
|
||||||
throw new NullPointerException("faction");
|
throw new NullPointerException("faction");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getMPlayers(faction).forEach(this::update);
|
this.getMPlayers(faction).forEach(this::update);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.knarcraft.factions;
|
package net.knarcraft.factions;
|
||||||
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
|
||||||
import com.massivecraft.massivecore.Colorized;
|
import com.massivecraft.massivecore.Colorized;
|
||||||
import com.massivecraft.massivecore.Named;
|
import com.massivecraft.massivecore.Named;
|
||||||
import com.massivecraft.massivecore.collections.MassiveSet;
|
import com.massivecraft.massivecore.collections.MassiveSet;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.knarcraft.factions;
|
package net.knarcraft.factions;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.collections.MassiveSet;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.util.RelationUtil;
|
import net.knarcraft.factions.util.RelationUtil;
|
||||||
import com.massivecraft.massivecore.collections.MassiveSet;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -47,7 +47,7 @@ public class TerritoryAccess {
|
|||||||
// FIELDS: VERSION
|
// FIELDS: VERSION
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public int version = 1;
|
public final int version = 1;
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// FIELDS: DELTA
|
// FIELDS: DELTA
|
||||||
@ -116,12 +116,12 @@ public class TerritoryAccess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TerritoryAccess(String hostFactionId, Boolean hostFactionAllowed, Collection<String> grantedIds, String chunkName) {
|
private TerritoryAccess(String hostFactionId, Boolean hostFactionAllowed, Collection<String> grantedIds, String chunkName) {
|
||||||
if (hostFactionId == null) {
|
if (hostFactionId == null) {
|
||||||
throw new NullPointerException("hostFactionId");
|
throw new NullPointerException("hostFactionId");
|
||||||
}
|
}
|
||||||
if (grantedIds == null) {
|
if (grantedIds == null) {
|
||||||
throw new NullPointerException("grantedIds");
|
throw new NullPointerException("grantedIds");
|
||||||
}
|
}
|
||||||
this.hostFactionId = hostFactionId;
|
this.hostFactionId = hostFactionId;
|
||||||
|
|
||||||
Set<String> grantedIdsInner = new MassiveSet<>();
|
Set<String> grantedIdsInner = new MassiveSet<>();
|
||||||
@ -141,19 +141,19 @@ public class TerritoryAccess {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public static TerritoryAccess valueOf(String hostFactionId, Boolean hostFactionAllowed, Collection<String> grantedIds, String chunkName) {
|
public static TerritoryAccess valueOf(String hostFactionId, Boolean hostFactionAllowed, Collection<String> grantedIds, String chunkName) {
|
||||||
if (hostFactionId == null) {
|
if (hostFactionId == null) {
|
||||||
throw new NullPointerException("hostFactionId");
|
throw new NullPointerException("hostFactionId");
|
||||||
}
|
}
|
||||||
if (grantedIds == null) {
|
if (grantedIds == null) {
|
||||||
throw new NullPointerException("grantedIds");
|
throw new NullPointerException("grantedIds");
|
||||||
}
|
}
|
||||||
return new TerritoryAccess(hostFactionId, hostFactionAllowed, grantedIds, chunkName);
|
return new TerritoryAccess(hostFactionId, hostFactionAllowed, grantedIds, chunkName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TerritoryAccess valueOf(String hostFactionId) {
|
public static TerritoryAccess valueOf(String hostFactionId) {
|
||||||
if (hostFactionId == null) {
|
if (hostFactionId == null) {
|
||||||
throw new NullPointerException("hostFactionId");
|
throw new NullPointerException("hostFactionId");
|
||||||
}
|
}
|
||||||
return valueOf(hostFactionId, null, Collections.emptySet(), null);
|
return valueOf(hostFactionId, null, Collections.emptySet(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,9 +166,9 @@ public class TerritoryAccess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isGranted(String permableId) {
|
public boolean isGranted(String permableId) {
|
||||||
if (permableId.equals(this.hostFactionId)) {
|
if (permableId.equals(this.hostFactionId)) {
|
||||||
return this.isHostFactionAllowed();
|
return this.isHostFactionAllowed();
|
||||||
}
|
}
|
||||||
return this.getGrantedIds().contains(permableId);
|
return this.getGrantedIds().contains(permableId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,26 +183,26 @@ public class TerritoryAccess {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public AccessStatus getTerritoryAccess(MPlayer mplayer) {
|
public AccessStatus getTerritoryAccess(MPlayer mplayer) {
|
||||||
if (isGranted(mplayer.getId())) {
|
if (isGranted(mplayer.getId())) {
|
||||||
return AccessStatus.ELEVATED;
|
return AccessStatus.ELEVATED;
|
||||||
}
|
}
|
||||||
if (isGranted(mplayer.getRank().getId())) {
|
if (isGranted(mplayer.getRank().getId())) {
|
||||||
return AccessStatus.ELEVATED;
|
return AccessStatus.ELEVATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getHostFactionId().equals(mplayer.getFaction().getId())) {
|
if (this.getHostFactionId().equals(mplayer.getFaction().getId())) {
|
||||||
if (this.isHostFactionAllowed()) {
|
if (this.isHostFactionAllowed()) {
|
||||||
return AccessStatus.STANDARD;
|
return AccessStatus.STANDARD;
|
||||||
} else {
|
} else {
|
||||||
return AccessStatus.DECREASED;
|
return AccessStatus.DECREASED;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (isGranted(mplayer.getFaction().getId())) {
|
||||||
|
return AccessStatus.ELEVATED;
|
||||||
|
}
|
||||||
|
if (isGranted(RelationUtil.getRelationOfThatToMe(mplayer, this.getHostFaction()).toString())) {
|
||||||
|
return AccessStatus.ELEVATED;
|
||||||
}
|
}
|
||||||
if (isGranted(mplayer.getFaction().getId())) {
|
|
||||||
return AccessStatus.ELEVATED;
|
|
||||||
}
|
|
||||||
if (isGranted(RelationUtil.getRelationOfThatToMe(mplayer, this.getHostFaction()).toString())) {
|
|
||||||
return AccessStatus.ELEVATED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return AccessStatus.STANDARD;
|
return AccessStatus.STANDARD;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class BoardAdapter implements JsonDeserializer<Board>, JsonSerializer<Boa
|
|||||||
// INSTANCE & CONSTRUCT
|
// INSTANCE & CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private static BoardAdapter i = new BoardAdapter();
|
private static final BoardAdapter i = new BoardAdapter();
|
||||||
|
|
||||||
public static BoardAdapter get() {
|
public static BoardAdapter get() {
|
||||||
return i;
|
return i;
|
||||||
@ -25,7 +25,6 @@ public class BoardAdapter implements JsonDeserializer<Board>, JsonSerializer<Boa
|
|||||||
// OVERRIDE
|
// OVERRIDE
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public Board deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
public Board deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||||
return new Board(context.deserialize(json, Board.MAP_TYPE));
|
return new Board(context.deserialize(json, Board.MAP_TYPE));
|
||||||
|
@ -7,8 +7,8 @@ import com.google.gson.JsonObject;
|
|||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
import com.google.gson.JsonSerializationContext;
|
import com.google.gson.JsonSerializationContext;
|
||||||
import com.google.gson.JsonSerializer;
|
import com.google.gson.JsonSerializer;
|
||||||
import net.knarcraft.factions.TerritoryAccess;
|
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
import net.knarcraft.factions.TerritoryAccess;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -20,7 +20,7 @@ public class BoardMapAdapter implements JsonDeserializer<Map<PS, TerritoryAccess
|
|||||||
// INSTANCE & CONSTRUCT
|
// INSTANCE & CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private static BoardMapAdapter i = new BoardMapAdapter();
|
private static final BoardMapAdapter i = new BoardMapAdapter();
|
||||||
|
|
||||||
public static BoardMapAdapter get() {
|
public static BoardMapAdapter get() {
|
||||||
return i;
|
return i;
|
||||||
@ -37,9 +37,9 @@ public class BoardMapAdapter implements JsonDeserializer<Map<PS, TerritoryAccess
|
|||||||
JsonObject jsonObject = json.getAsJsonObject();
|
JsonObject jsonObject = json.getAsJsonObject();
|
||||||
|
|
||||||
for (Entry<String, JsonElement> entry : jsonObject.entrySet()) {
|
for (Entry<String, JsonElement> entry : jsonObject.entrySet()) {
|
||||||
String[] ChunkCoordParts = entry.getKey().split("[,\\s]+");
|
String[] chunkCoordinateParts = entry.getKey().split("[,\\s]+");
|
||||||
int chunkX = Integer.parseInt(ChunkCoordParts[0]);
|
int chunkX = Integer.parseInt(chunkCoordinateParts[0]);
|
||||||
int chunkZ = Integer.parseInt(ChunkCoordParts[1]);
|
int chunkZ = Integer.parseInt(chunkCoordinateParts[1]);
|
||||||
PS chunk = PS.valueOf(chunkX, chunkZ);
|
PS chunk = PS.valueOf(chunkX, chunkZ);
|
||||||
|
|
||||||
TerritoryAccess territoryAccess = context.deserialize(entry.getValue(), TerritoryAccess.class);
|
TerritoryAccess territoryAccess = context.deserialize(entry.getValue(), TerritoryAccess.class);
|
||||||
|
@ -10,8 +10,8 @@ import com.google.gson.JsonPrimitive;
|
|||||||
import com.google.gson.JsonSerializationContext;
|
import com.google.gson.JsonSerializationContext;
|
||||||
import com.google.gson.JsonSerializer;
|
import com.google.gson.JsonSerializer;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import net.knarcraft.factions.TerritoryAccess;
|
|
||||||
import com.massivecraft.massivecore.store.migrator.MigratorUtil;
|
import com.massivecraft.massivecore.store.migrator.MigratorUtil;
|
||||||
|
import net.knarcraft.factions.TerritoryAccess;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -34,7 +34,7 @@ public class TerritoryAccessAdapter implements JsonDeserializer<TerritoryAccess>
|
|||||||
// INSTANCE & CONSTRUCT
|
// INSTANCE & CONSTRUCT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private static TerritoryAccessAdapter i = new TerritoryAccessAdapter();
|
private static final TerritoryAccessAdapter i = new TerritoryAccessAdapter();
|
||||||
|
|
||||||
public static TerritoryAccessAdapter get() {
|
public static TerritoryAccessAdapter get() {
|
||||||
return i;
|
return i;
|
||||||
@ -68,28 +68,28 @@ public class TerritoryAccessAdapter implements JsonDeserializer<TerritoryAccess>
|
|||||||
hostFactionId = element.getAsString();
|
hostFactionId = element.getAsString();
|
||||||
|
|
||||||
element = obj.get(HOST_FACTION_ALLOWED);
|
element = obj.get(HOST_FACTION_ALLOWED);
|
||||||
if (element != null) {
|
if (element != null) {
|
||||||
hostFactionAllowed = element.getAsBoolean();
|
hostFactionAllowed = element.getAsBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
element = obj.get(GRANTED_IDS);
|
element = obj.get(GRANTED_IDS);
|
||||||
if (element != null) {
|
if (element != null) {
|
||||||
grantedIds = context.deserialize(element, SET_OF_STRING_TYPE);
|
grantedIds = context.deserialize(element, SET_OF_STRING_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
element = obj.get(CHUNK_NAME);
|
element = obj.get(CHUNK_NAME);
|
||||||
if (element != null) {
|
if (element != null) {
|
||||||
chunkName = element.getAsString();
|
chunkName = element.getAsString();
|
||||||
}
|
}
|
||||||
|
|
||||||
return TerritoryAccess.valueOf(hostFactionId, hostFactionAllowed, grantedIds, chunkName);
|
return TerritoryAccess.valueOf(hostFactionId, hostFactionAllowed, grantedIds, chunkName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonElement serialize(TerritoryAccess src, Type typeOfSrc, JsonSerializationContext context) {
|
public JsonElement serialize(TerritoryAccess src, Type typeOfSrc, JsonSerializationContext context) {
|
||||||
if (src == null) {
|
if (src == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// isDefault <=> simple hostFactionId string
|
// isDefault <=> simple hostFactionId string
|
||||||
if (src.isDefault()) {
|
if (src.isDefault()) {
|
||||||
|
@ -9,10 +9,10 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ChatFormater is a system offered by factions for tag parsing.
|
* The ChatFormatter is a system offered by factions for tag parsing.
|
||||||
* <p>
|
* <p>
|
||||||
* Note that every tag and modifier id must be lowercase.
|
* Note that every tag and modifier id must be lowercase.
|
||||||
* A tag with id "derp" is allowed but not with id "Derp". For that reason the tag {sender} will work but {Sender} wont.
|
* A tag with id "derp" is allowed but not with id "Derp". For that reason the tag {sender} will work but {Sender} won't.
|
||||||
*/
|
*/
|
||||||
public class ChatFormatter {
|
public class ChatFormatter {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -33,23 +33,23 @@ public class ChatFormatter {
|
|||||||
// FORMAT
|
// FORMAT
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public static String format(String msg, CommandSender sender, CommandSender recipient) {
|
public static String format(String message, CommandSender sender, CommandSender recipient) {
|
||||||
// We build the return value in this string buffer
|
// We build the return value in this string buffer
|
||||||
StringBuffer ret = new StringBuffer();
|
StringBuilder returnValue = new StringBuilder();
|
||||||
|
|
||||||
// A matcher to match all the tags in the msg
|
// A matcher to match all the tags in the msg
|
||||||
Matcher matcher = pattern.matcher(msg);
|
Matcher matcher = pattern.matcher(message);
|
||||||
|
|
||||||
// For each tag we find
|
// For each tag we find
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
// The fullmatch is something like "{sender|lp|rp}"
|
// The fullMatch is something like "{sender|lp|rp}"
|
||||||
String fullmatch = matcher.group(0);
|
String fullMatch = matcher.group(0);
|
||||||
|
|
||||||
// The submatch is something like "sender|lp|rp"
|
// The subMatch is something like "sender|lp|rp"
|
||||||
String submatch = matcher.group(1);
|
String subMatch = matcher.group(1);
|
||||||
|
|
||||||
// The parts are something like ["sender", "lp", "rp"]
|
// The parts are something like ["sender", "lp", "rp"]
|
||||||
String[] parts = submatch.split(ESC_SEPARATOR);
|
String[] parts = subMatch.split(ESC_SEPARATOR);
|
||||||
|
|
||||||
// The modifier ids are something like ["lp", "rp"] and tagId something like "sender"
|
// The modifier ids are something like ["lp", "rp"] and tagId something like "sender"
|
||||||
List<String> modifierIds = new ArrayList<>(Arrays.asList(parts));
|
List<String> modifierIds = new ArrayList<>(Arrays.asList(parts));
|
||||||
@ -61,23 +61,23 @@ public class ChatFormatter {
|
|||||||
String replacement;
|
String replacement;
|
||||||
if (tag == null) {
|
if (tag == null) {
|
||||||
// No change if tag wasn't found
|
// No change if tag wasn't found
|
||||||
replacement = fullmatch;
|
replacement = fullMatch;
|
||||||
} else {
|
} else {
|
||||||
replacement = compute(tag, modifierIds, sender, recipient);
|
replacement = compute(tag, modifierIds, sender, recipient);
|
||||||
if (replacement == null) {
|
if (replacement == null) {
|
||||||
// If a tag or modifier returns null it's the same as opting out.
|
// If a tag or modifier returns null it's the same as opting out.
|
||||||
replacement = fullmatch;
|
replacement = fullMatch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
matcher.appendReplacement(ret, replacement);
|
matcher.appendReplacement(returnValue, replacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append the rest
|
// Append the rest
|
||||||
matcher.appendTail(ret);
|
matcher.appendTail(returnValue);
|
||||||
|
|
||||||
// And finally we return the string value of the buffer we built
|
// And finally we return the string value of the buffer we built
|
||||||
return ret.toString();
|
return returnValue.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -12,7 +12,7 @@ public class ChatModifierLc extends ChatModifier {
|
|||||||
super("lc");
|
super("lc");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatModifierLc i = new ChatModifierLc();
|
private static final ChatModifierLc i = new ChatModifierLc();
|
||||||
|
|
||||||
public static ChatModifierLc get() {
|
public static ChatModifierLc get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -13,7 +13,7 @@ public class ChatModifierLp extends ChatModifier {
|
|||||||
super("lp");
|
super("lp");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatModifierLp i = new ChatModifierLp();
|
private static final ChatModifierLp i = new ChatModifierLp();
|
||||||
|
|
||||||
public static ChatModifierLp get() {
|
public static ChatModifierLp get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.knarcraft.factions.chat.modifier;
|
package net.knarcraft.factions.chat.modifier;
|
||||||
|
|
||||||
import net.knarcraft.factions.chat.ChatModifier;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.chat.ChatModifier;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class ChatModifierParse extends ChatModifier {
|
public class ChatModifierParse extends ChatModifier {
|
||||||
@ -13,7 +13,7 @@ public class ChatModifierParse extends ChatModifier {
|
|||||||
super("parse");
|
super("parse");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatModifierParse i = new ChatModifierParse();
|
private static final ChatModifierParse i = new ChatModifierParse();
|
||||||
|
|
||||||
public static ChatModifierParse get() {
|
public static ChatModifierParse get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -12,7 +12,7 @@ public class ChatModifierRp extends ChatModifier {
|
|||||||
super("rp");
|
super("rp");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatModifierRp i = new ChatModifierRp();
|
private static final ChatModifierRp i = new ChatModifierRp();
|
||||||
|
|
||||||
public static ChatModifierRp get() {
|
public static ChatModifierRp get() {
|
||||||
return i;
|
return i;
|
||||||
@ -24,9 +24,9 @@ public class ChatModifierRp extends ChatModifier {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getModified(String subject, CommandSender sender, CommandSender recipient) {
|
public String getModified(String subject, CommandSender sender, CommandSender recipient) {
|
||||||
if (subject.equals("")) {
|
if (subject.equals("")) {
|
||||||
return subject;
|
return subject;
|
||||||
}
|
}
|
||||||
return subject + " ";
|
return subject + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ public class ChatModifierUc extends ChatModifier {
|
|||||||
super("uc");
|
super("uc");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatModifierUc i = new ChatModifierUc();
|
private static final ChatModifierUc i = new ChatModifierUc();
|
||||||
|
|
||||||
public static ChatModifierUc get() {
|
public static ChatModifierUc get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package net.knarcraft.factions.chat.modifier;
|
package net.knarcraft.factions.chat.modifier;
|
||||||
|
|
||||||
import net.knarcraft.factions.chat.ChatModifier;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.chat.ChatModifier;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class ChatModifierUcf extends ChatModifier {
|
public class ChatModifierUcf extends ChatModifier {
|
||||||
@ -13,7 +13,7 @@ public class ChatModifierUcf extends ChatModifier {
|
|||||||
super("ucf");
|
super("ucf");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatModifierUcf i = new ChatModifierUcf();
|
private static final ChatModifierUcf i = new ChatModifierUcf();
|
||||||
|
|
||||||
public static ChatModifierUcf get() {
|
public static ChatModifierUcf get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -14,7 +14,7 @@ public class ChatTagName extends ChatTag {
|
|||||||
super("factions_name");
|
super("factions_name");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatTagName i = new ChatTagName();
|
private static final ChatTagName i = new ChatTagName();
|
||||||
|
|
||||||
public static ChatTagName get() {
|
public static ChatTagName get() {
|
||||||
return i;
|
return i;
|
||||||
@ -27,13 +27,13 @@ public class ChatTagName extends ChatTag {
|
|||||||
@Override
|
@Override
|
||||||
public String getReplacement(CommandSender sender, CommandSender recipient) {
|
public String getReplacement(CommandSender sender, CommandSender recipient) {
|
||||||
// Get entities
|
// Get entities
|
||||||
MPlayer usender = MPlayer.get(sender);
|
MPlayer uSender = MPlayer.get(sender);
|
||||||
|
|
||||||
// No "force"
|
// No "force"
|
||||||
Faction faction = usender.getFaction();
|
Faction faction = uSender.getFaction();
|
||||||
if (faction.isNone()) {
|
if (faction.isNone()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return faction.getName();
|
return faction.getName();
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public class ChatTagNameforce extends ChatTag {
|
|||||||
super("factions_nameforce");
|
super("factions_nameforce");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatTagNameforce i = new ChatTagNameforce();
|
private static final ChatTagNameforce i = new ChatTagNameforce();
|
||||||
|
|
||||||
public static ChatTagNameforce get() {
|
public static ChatTagNameforce get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -13,7 +13,7 @@ public class ChatTagRelcolor extends ChatTag {
|
|||||||
super("factions_relcolor");
|
super("factions_relcolor");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatTagRelcolor i = new ChatTagRelcolor();
|
private static final ChatTagRelcolor i = new ChatTagRelcolor();
|
||||||
|
|
||||||
public static ChatTagRelcolor get() {
|
public static ChatTagRelcolor get() {
|
||||||
return i;
|
return i;
|
||||||
@ -26,9 +26,9 @@ public class ChatTagRelcolor extends ChatTag {
|
|||||||
@Override
|
@Override
|
||||||
public String getReplacement(CommandSender sender, CommandSender recipient) {
|
public String getReplacement(CommandSender sender, CommandSender recipient) {
|
||||||
// Opt out if no recipient
|
// Opt out if no recipient
|
||||||
if (recipient == null) {
|
if (recipient == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get entities
|
// Get entities
|
||||||
MPlayer usender = MPlayer.get(sender);
|
MPlayer usender = MPlayer.get(sender);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package net.knarcraft.factions.chat.tag;
|
package net.knarcraft.factions.chat.tag;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.chat.ChatTag;
|
import net.knarcraft.factions.chat.ChatTag;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class ChatTagRole extends ChatTag {
|
public class ChatTagRole extends ChatTag {
|
||||||
@ -14,7 +14,7 @@ public class ChatTagRole extends ChatTag {
|
|||||||
super("factions_role");
|
super("factions_role");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatTagRole i = new ChatTagRole();
|
private static final ChatTagRole i = new ChatTagRole();
|
||||||
|
|
||||||
public static ChatTagRole get() {
|
public static ChatTagRole get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -14,7 +14,7 @@ public class ChatTagRoleprefix extends ChatTag {
|
|||||||
super("factions_roleprefix");
|
super("factions_roleprefix");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatTagRoleprefix i = new ChatTagRoleprefix();
|
private static final ChatTagRoleprefix i = new ChatTagRoleprefix();
|
||||||
|
|
||||||
public static ChatTagRoleprefix get() {
|
public static ChatTagRoleprefix get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -13,7 +13,7 @@ public class ChatTagRoleprefixforce extends ChatTag {
|
|||||||
super("factions_roleprefixforce");
|
super("factions_roleprefixforce");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatTagRoleprefixforce i = new ChatTagRoleprefixforce();
|
private static final ChatTagRoleprefixforce i = new ChatTagRoleprefixforce();
|
||||||
|
|
||||||
public static ChatTagRoleprefixforce get() {
|
public static ChatTagRoleprefixforce get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -13,7 +13,7 @@ public class ChatTagTitle extends ChatTag {
|
|||||||
super("factions_title");
|
super("factions_title");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ChatTagTitle i = new ChatTagTitle();
|
private static final ChatTagTitle i = new ChatTagTitle();
|
||||||
|
|
||||||
public static ChatTagTitle get() {
|
public static ChatTagTitle get() {
|
||||||
return i;
|
return i;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import com.massivecraft.massivecore.command.MassiveCommandDeprecated;
|
import com.massivecraft.massivecore.command.MassiveCommandDeprecated;
|
||||||
import com.massivecraft.massivecore.command.MassiveCommandVersion;
|
import com.massivecraft.massivecore.command.MassiveCommandVersion;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ public class CmdFactions extends FactionsCommand {
|
|||||||
// INSTANCE
|
// INSTANCE
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private static CmdFactions i = new CmdFactions();
|
private static final CmdFactions i = new CmdFactions();
|
||||||
|
|
||||||
public static CmdFactions get() {
|
public static CmdFactions get() {
|
||||||
return i;
|
return i;
|
||||||
@ -28,21 +28,21 @@ public class CmdFactions extends FactionsCommand {
|
|||||||
public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer();
|
public CmdFactionsPlayer cmdFactionsPlayer = new CmdFactionsPlayer();
|
||||||
public CmdFactionsStatus cmdFactionsStatus = new CmdFactionsStatus();
|
public CmdFactionsStatus cmdFactionsStatus = new CmdFactionsStatus();
|
||||||
public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin();
|
public CmdFactionsJoin cmdFactionsJoin = new CmdFactionsJoin();
|
||||||
public CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave();
|
public final CmdFactionsLeave cmdFactionsLeave = new CmdFactionsLeave();
|
||||||
public CmdFactionsWarp cmdFactionsWarp = new CmdFactionsWarp();
|
public final CmdFactionsWarp cmdFactionsWarp = new CmdFactionsWarp();
|
||||||
public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome();
|
public CmdFactionsHome cmdFactionsHome = new CmdFactionsHome();
|
||||||
public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome();
|
public CmdFactionsSethome cmdFactionsSethome = new CmdFactionsSethome();
|
||||||
public CmdFactionsUnsethome cmdFactionsUnsethome = new CmdFactionsUnsethome();
|
public CmdFactionsUnsethome cmdFactionsUnsethome = new CmdFactionsUnsethome();
|
||||||
public CmdFactionsVote cmdFactionsVote = new CmdFactionsVote();
|
public final CmdFactionsVote cmdFactionsVote = new CmdFactionsVote();
|
||||||
public CmdFactionsMap cmdFactionsMap = new CmdFactionsMap();
|
public CmdFactionsMap cmdFactionsMap = new CmdFactionsMap();
|
||||||
public CmdFactionsCreate cmdFactionsCreate = new CmdFactionsCreate();
|
public final CmdFactionsCreate cmdFactionsCreate = new CmdFactionsCreate();
|
||||||
public CmdFactionsName cmdFactionsName = new CmdFactionsName();
|
public final CmdFactionsName cmdFactionsName = new CmdFactionsName();
|
||||||
public CmdFactionsDescription cmdFactionsDescription = new CmdFactionsDescription();
|
public final CmdFactionsDescription cmdFactionsDescription = new CmdFactionsDescription();
|
||||||
public CmdFactionsMotd cmdFactionsMotd = new CmdFactionsMotd();
|
public CmdFactionsMotd cmdFactionsMotd = new CmdFactionsMotd();
|
||||||
public CmdFactionsInvite cmdFactionsInvite = new CmdFactionsInvite();
|
public final CmdFactionsInvite cmdFactionsInvite = new CmdFactionsInvite();
|
||||||
public CmdFactionsKick cmdFactionsKick = new CmdFactionsKick();
|
public final CmdFactionsKick cmdFactionsKick = new CmdFactionsKick();
|
||||||
public CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle();
|
public final CmdFactionsTitle cmdFactionsTitle = new CmdFactionsTitle();
|
||||||
public CmdFactionsRank cmdFactionsRank = new CmdFactionsRank();
|
public final CmdFactionsRank cmdFactionsRank = new CmdFactionsRank();
|
||||||
public CmdFactionsMoney cmdFactionsMoney = new CmdFactionsMoney();
|
public CmdFactionsMoney cmdFactionsMoney = new CmdFactionsMoney();
|
||||||
public CmdFactionsTop cmdFactionsTop = new CmdFactionsTop();
|
public CmdFactionsTop cmdFactionsTop = new CmdFactionsTop();
|
||||||
public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk();
|
public CmdFactionsSeeChunk cmdFactionsSeeChunk = new CmdFactionsSeeChunk();
|
||||||
@ -52,17 +52,17 @@ public class CmdFactions extends FactionsCommand {
|
|||||||
public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim();
|
public CmdFactionsUnclaim cmdFactionsUnclaim = new CmdFactionsUnclaim();
|
||||||
public CmdFactionsAccess cmdFactionsAccess = new CmdFactionsAccess();
|
public CmdFactionsAccess cmdFactionsAccess = new CmdFactionsAccess();
|
||||||
public CmdFactionsChunkname cmdFactionsChunkname = new CmdFactionsChunkname();
|
public CmdFactionsChunkname cmdFactionsChunkname = new CmdFactionsChunkname();
|
||||||
public CmdFactionsRelation cmdFactionsRelation = new CmdFactionsRelation();
|
public final CmdFactionsRelation cmdFactionsRelation = new CmdFactionsRelation();
|
||||||
public CmdFactionsRelationOld cmdFactionsRelationOldAlly = new CmdFactionsRelationOld("ally");
|
public CmdFactionsRelationOld cmdFactionsRelationOldAlly = new CmdFactionsRelationOld("ally");
|
||||||
public CmdFactionsRelationOld cmdFactionsRelationOldTruce = new CmdFactionsRelationOld("truce");
|
public CmdFactionsRelationOld cmdFactionsRelationOldTruce = new CmdFactionsRelationOld("truce");
|
||||||
public CmdFactionsRelationOld cmdFactionsRelationOldNeutral = new CmdFactionsRelationOld("neutral");
|
public CmdFactionsRelationOld cmdFactionsRelationOldNeutral = new CmdFactionsRelationOld("neutral");
|
||||||
public CmdFactionsRelationOld cmdFactionsRelationOldEnemy = new CmdFactionsRelationOld("enemy");
|
public CmdFactionsRelationOld cmdFactionsRelationOldEnemy = new CmdFactionsRelationOld("enemy");
|
||||||
public CmdFactionsTax cmdFactionsTax = new CmdFactionsTax();
|
public CmdFactionsTax cmdFactionsTax = new CmdFactionsTax();
|
||||||
public CmdFactionsPerm cmdFactionsPerm = new CmdFactionsPerm();
|
public final CmdFactionsPerm cmdFactionsPerm = new CmdFactionsPerm();
|
||||||
public CmdFactionsFlag cmdFactionsFlag = new CmdFactionsFlag();
|
public final CmdFactionsFlag cmdFactionsFlag = new CmdFactionsFlag();
|
||||||
public CmdFactionsFly cmdFactionsFly = new CmdFactionsFly();
|
public CmdFactionsFly cmdFactionsFly = new CmdFactionsFly();
|
||||||
public CmdFactionsUnstuck cmdFactionsUnstuck = new CmdFactionsUnstuck();
|
public CmdFactionsUnstuck cmdFactionsUnstuck = new CmdFactionsUnstuck();
|
||||||
public CmdFactionsOverride cmdFactionsOverride = new CmdFactionsOverride();
|
public final CmdFactionsOverride cmdFactionsOverride = new CmdFactionsOverride();
|
||||||
public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband();
|
public CmdFactionsDisband cmdFactionsDisband = new CmdFactionsDisband();
|
||||||
public CmdFactionsPowerboost cmdFactionsPowerBoost = new CmdFactionsPowerboost();
|
public CmdFactionsPowerboost cmdFactionsPowerBoost = new CmdFactionsPowerboost();
|
||||||
public CmdFactionsSetpower cmdFactionsSetpower = new CmdFactionsSetpower();
|
public CmdFactionsSetpower cmdFactionsSetpower = new CmdFactionsSetpower();
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.TerritoryAccess;
|
import net.knarcraft.factions.TerritoryAccess;
|
||||||
import net.knarcraft.factions.entity.BoardColl;
|
import net.knarcraft.factions.entity.BoardColl;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.util.AsciiMap;
|
import net.knarcraft.factions.util.AsciiMap;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
|
||||||
import net.knarcraft.factions.entity.Board;
|
|
||||||
import net.knarcraft.factions.entity.BoardColl;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.collections.MassiveMap;
|
import com.massivecraft.massivecore.collections.MassiveMap;
|
||||||
import com.massivecraft.massivecore.mixin.MixinWorld;
|
import com.massivecraft.massivecore.mixin.MixinWorld;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
|
import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
||||||
|
import net.knarcraft.factions.entity.Board;
|
||||||
|
import net.knarcraft.factions.entity.BoardColl;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -44,9 +44,9 @@ public class CmdFactionsAccessInspect extends FactionsCommand {
|
|||||||
|
|
||||||
// Check if they have access perms, unless they are checking for their own access
|
// Check if they have access perms, unless they are checking for their own access
|
||||||
if (mpermable != msender && mpermable != msenderFaction && mpermable != msender.getRank()) {
|
if (mpermable != msender && mpermable != msenderFaction && mpermable != msender.getRank()) {
|
||||||
if (!MPerm.getPermAccess().has(msender, faction, true)) {
|
if (!MPerm.getPermAccess().has(msender, faction, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Turn into id->chunks
|
// Turn into id->chunks
|
||||||
@ -59,9 +59,9 @@ public class CmdFactionsAccessInspect extends FactionsCommand {
|
|||||||
.filter(e -> e.getValue().isGranted(mpermable))
|
.filter(e -> e.getValue().isGranted(mpermable))
|
||||||
.map(Entry::getKey)
|
.map(Entry::getKey)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
if (!chunks.isEmpty()) {
|
if (!chunks.isEmpty()) {
|
||||||
world2Chunks.put(worldId, chunks);
|
world2Chunks.put(worldId, chunks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world2Chunks.isEmpty()) {
|
if (world2Chunks.isEmpty()) {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.ChunkUtil;
|
import com.massivecraft.massivecore.util.ChunkUtil;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import net.knarcraft.factions.entity.BoardColl;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.ChunkUtil;
|
import com.massivecraft.massivecore.util.ChunkUtil;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
import net.knarcraft.factions.entity.BoardColl;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
@ -36,7 +35,7 @@ public class CmdFactionsAccessSetFill extends CmdFactionsAccessSetXSimple {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<PS> getChunks() throws MassiveException {
|
public Set<PS> getChunks() {
|
||||||
// Common Startup
|
// Common Startup
|
||||||
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.ChunkUtil;
|
import com.massivecraft.massivecore.util.ChunkUtil;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -52,9 +52,9 @@ public abstract class CmdFactionsAccessSetX extends CmdFactionsAccessAbstract {
|
|||||||
final MPerm.MPermable mpermable = this.getMPermable(hostFaction);
|
final MPerm.MPermable mpermable = this.getMPermable(hostFaction);
|
||||||
|
|
||||||
final Set<PS> chunks = this.getChunks();
|
final Set<PS> chunks = this.getChunks();
|
||||||
if (chunks == null) {
|
if (chunks == null) {
|
||||||
throw new NullPointerException("chunks");
|
throw new NullPointerException("chunks");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply / Inform
|
// Apply / Inform
|
||||||
setAccess(chunks, mpermable, this.isGranting());
|
setAccess(chunks, mpermable, this.isGranting());
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeInteger;
|
import com.massivecraft.massivecore.command.type.primitive.TypeInteger;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
|
||||||
|
|
||||||
public abstract class CmdFactionsAccessSetXRadius extends CmdFactionsAccessSetX {
|
public abstract class CmdFactionsAccessSetXRadius extends CmdFactionsAccessSetX {
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.TerritoryAccess;
|
|
||||||
import net.knarcraft.factions.entity.BoardColl;
|
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
|
||||||
import net.knarcraft.factions.util.AsciiMap;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.command.type.TypeNullable;
|
import com.massivecraft.massivecore.command.type.TypeNullable;
|
||||||
@ -11,6 +7,10 @@ import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
|||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.TerritoryAccess;
|
||||||
|
import net.knarcraft.factions.entity.BoardColl;
|
||||||
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
|
import net.knarcraft.factions.util.AsciiMap;
|
||||||
|
|
||||||
public class CmdFactionsChunkname extends FactionsCommand {
|
public class CmdFactionsChunkname extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.collections.MassiveSet;
|
||||||
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
import com.massivecraft.massivecore.store.EntityInternalMap;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Rel;
|
import net.knarcraft.factions.Rel;
|
||||||
import net.knarcraft.factions.TerritoryAccess;
|
import net.knarcraft.factions.TerritoryAccess;
|
||||||
import net.knarcraft.factions.entity.Board;
|
import net.knarcraft.factions.entity.Board;
|
||||||
@ -10,11 +14,6 @@ import net.knarcraft.factions.entity.Invitation;
|
|||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.entity.MPlayerColl;
|
import net.knarcraft.factions.entity.MPlayerColl;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.collections.MassiveSet;
|
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
|
||||||
import com.massivecraft.massivecore.store.EntityInternalMap;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
@ -26,7 +25,7 @@ public class CmdFactionsClean extends FactionsCommand {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException {
|
public void perform() {
|
||||||
Object message;
|
Object message;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
@ -54,9 +53,9 @@ public class CmdFactionsClean extends FactionsCommand {
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
for (MPlayer mplayer : MPlayerColl.get().getAll()) {
|
for (MPlayer mplayer : MPlayerColl.get().getAll()) {
|
||||||
if (!mplayer.isFactionOrphan()) {
|
if (!mplayer.isFactionOrphan()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
mplayer.resetFactionData();
|
mplayer.resetFactionData();
|
||||||
ret += 1;
|
ret += 1;
|
||||||
@ -70,9 +69,9 @@ public class CmdFactionsClean extends FactionsCommand {
|
|||||||
|
|
||||||
for (Faction faction : FactionColl.get().getAll()) {
|
for (Faction faction : FactionColl.get().getAll()) {
|
||||||
EntityInternalMap<Invitation> invitations = faction.getInvitations();
|
EntityInternalMap<Invitation> invitations = faction.getInvitations();
|
||||||
if (invitations.isEmpty()) {
|
if (invitations.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret += invitations.size();
|
ret += invitations.size();
|
||||||
Set<String> invitationIds = new MassiveSet<>(invitations.keySet());
|
Set<String> invitationIds = new MassiveSet<>(invitations.keySet());
|
||||||
@ -93,9 +92,9 @@ public class CmdFactionsClean extends FactionsCommand {
|
|||||||
for (Iterator<Entry<String, Rel>> iterator = faction.getRelationWishes().entrySet().iterator(); iterator.hasNext(); ) {
|
for (Iterator<Entry<String, Rel>> iterator = faction.getRelationWishes().entrySet().iterator(); iterator.hasNext(); ) {
|
||||||
Entry<String, Rel> entry = iterator.next();
|
Entry<String, Rel> entry = iterator.next();
|
||||||
String factionId = entry.getKey();
|
String factionId = entry.getKey();
|
||||||
if (FactionColl.get().containsId(factionId)) {
|
if (FactionColl.get().containsId(factionId)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
ret += 1;
|
ret += 1;
|
||||||
@ -115,9 +114,9 @@ public class CmdFactionsClean extends FactionsCommand {
|
|||||||
TerritoryAccess territoryAccess = entry.getValue();
|
TerritoryAccess territoryAccess = entry.getValue();
|
||||||
String factionId = territoryAccess.getHostFactionId();
|
String factionId = territoryAccess.getHostFactionId();
|
||||||
|
|
||||||
if (FactionColl.get().containsId(factionId)) {
|
if (FactionColl.get().containsId(factionId)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
board.removeAt(ps);
|
board.removeAt(ps);
|
||||||
ret += 1;
|
ret += 1;
|
||||||
@ -137,9 +136,9 @@ public class CmdFactionsClean extends FactionsCommand {
|
|||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
|
|
||||||
for (String grantedIds : territoryAccess.getGrantedIds()) {
|
for (String grantedIds : territoryAccess.getGrantedIds()) {
|
||||||
if (MPerm.idToMPermableOptional(grantedIds).isPresent()) {
|
if (MPerm.idToMPermableOptional(grantedIds).isPresent()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
territoryAccess = territoryAccess.withGrantedId(grantedIds, false);
|
territoryAccess = territoryAccess.withGrantedId(grantedIds, false);
|
||||||
ret += 1;
|
ret += 1;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import com.massivecraft.massivecore.command.editor.CommandEditSingleton;
|
import com.massivecraft.massivecore.command.editor.CommandEditSingleton;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
|
||||||
public class CmdFactionsConfig extends CommandEditSingleton<MConf> {
|
public class CmdFactionsConfig extends CommandEditSingleton<MConf> {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
|
import com.massivecraft.massivecore.store.MStore;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.req.ReqHasntFaction;
|
import net.knarcraft.factions.cmd.req.ReqHasntFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFactionNameStrict;
|
import net.knarcraft.factions.cmd.type.TypeFactionNameStrict;
|
||||||
@ -8,9 +11,6 @@ import net.knarcraft.factions.entity.FactionColl;
|
|||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import net.knarcraft.factions.event.EventFactionsCreate;
|
import net.knarcraft.factions.event.EventFactionsCreate;
|
||||||
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
|
||||||
import com.massivecraft.massivecore.store.MStore;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsCreate extends FactionsCommand {
|
public class CmdFactionsCreate extends FactionsCommand {
|
||||||
@ -44,9 +44,9 @@ public class CmdFactionsCreate extends FactionsCommand {
|
|||||||
// Event
|
// Event
|
||||||
EventFactionsCreate createEvent = new EventFactionsCreate(sender, factionId, newName);
|
EventFactionsCreate createEvent = new EventFactionsCreate(sender, factionId, newName);
|
||||||
createEvent.run();
|
createEvent.run();
|
||||||
if (createEvent.isCancelled()) {
|
if (createEvent.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply
|
// Apply
|
||||||
Faction faction = FactionColl.get().create(factionId);
|
Faction faction = FactionColl.get().create(factionId);
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||||
|
import com.massivecraft.massivecore.mixin.MixinDisplayName;
|
||||||
import net.knarcraft.factions.cmd.req.ReqHasFaction;
|
import net.knarcraft.factions.cmd.req.ReqHasFaction;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.event.EventFactionsDescriptionChange;
|
import net.knarcraft.factions.event.EventFactionsDescriptionChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
|
||||||
import com.massivecraft.massivecore.mixin.MixinDisplayName;
|
|
||||||
|
|
||||||
public class CmdFactionsDescription extends FactionsCommand {
|
public class CmdFactionsDescription extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeStringConfirmation;
|
||||||
|
import com.massivecraft.massivecore.util.ConfirmationUtil;
|
||||||
|
import com.massivecraft.massivecore.util.IdUtil;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
@ -10,11 +15,6 @@ import net.knarcraft.factions.entity.MPerm;
|
|||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.event.EventFactionsDisband;
|
import net.knarcraft.factions.event.EventFactionsDisband;
|
||||||
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeStringConfirmation;
|
|
||||||
import com.massivecraft.massivecore.util.ConfirmationUtil;
|
|
||||||
import com.massivecraft.massivecore.util.IdUtil;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
public class CmdFactionsDisband extends FactionsCommand {
|
public class CmdFactionsDisband extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -37,14 +37,14 @@ public class CmdFactionsDisband extends FactionsCommand {
|
|||||||
Faction faction = this.readArg();
|
Faction faction = this.readArg();
|
||||||
String confirmationString = this.readArg(null);
|
String confirmationString = this.readArg(null);
|
||||||
|
|
||||||
if (MConf.get().requireConfirmationForFactionDisbanding) {
|
if (MConf.get().requireConfirmationForFactionDisbanding) {
|
||||||
ConfirmationUtil.tryConfirm(this);
|
ConfirmationUtil.tryConfirm(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MPerm
|
// MPerm
|
||||||
if (!MPerm.getPermDisband().has(msender, faction, true)) {
|
if (!MPerm.getPermDisband().has(msender, faction, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify
|
// Verify
|
||||||
if (faction.getFlag(MFlag.getFlagPermanent())) {
|
if (faction.getFlag(MFlag.getFlagPermanent())) {
|
||||||
@ -54,9 +54,9 @@ public class CmdFactionsDisband extends FactionsCommand {
|
|||||||
// Event
|
// Event
|
||||||
EventFactionsDisband event = new EventFactionsDisband(me, faction);
|
EventFactionsDisband event = new EventFactionsDisband(me, faction);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merged Apply and Inform
|
// Merged Apply and Inform
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.entity.MFlag;
|
import net.knarcraft.factions.entity.MFlag;
|
||||||
import net.knarcraft.factions.entity.MFlagColl;
|
import net.knarcraft.factions.entity.MFlagColl;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -22,7 +21,7 @@ public class CmdFactionsDocumentationFlags extends FactionsCommandDocumentation
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException {
|
public void perform() {
|
||||||
msgDoc("Flags are a way to give certain factions certain attributes " +
|
msgDoc("Flags are a way to give certain factions certain attributes " +
|
||||||
" such as disabling pvp or enabling friendly fire.");
|
" such as disabling pvp or enabling friendly fire.");
|
||||||
msgDoc("To see all the flags type:");
|
msgDoc("To see all the flags type:");
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
|
|
||||||
public class CmdFactionsDocumentationPerms extends FactionsCommandDocumentation {
|
public class CmdFactionsDocumentationPerms extends FactionsCommandDocumentation {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
@ -16,7 +14,7 @@ public class CmdFactionsDocumentationPerms extends FactionsCommandDocumentation
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException {
|
public void perform() {
|
||||||
msgDoc("Permissions decide who can do what in your faction. " +
|
msgDoc("Permissions decide who can do what in your faction. " +
|
||||||
"Permissions can be given to a rank, a player, a relation, " +
|
"Permissions can be given to a rank, a player, a relation, " +
|
||||||
"everyone in another faction or everyone with a specific rank in another faction.");
|
"everyone in another faction or everyone with a specific rank in another faction.");
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
|
|
||||||
public class CmdFactionsDocumentationPower extends FactionsCommandDocumentation {
|
public class CmdFactionsDocumentationPower extends FactionsCommandDocumentation {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -17,7 +16,7 @@ public class CmdFactionsDocumentationPower extends FactionsCommandDocumentation
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException {
|
public void perform() {
|
||||||
msgDoc("All players have an amount of power ranging from <h>%.2f <i>to <h>%.2f<i>.", MConf.get().powerMin, MConf.get().powerMax);
|
msgDoc("All players have an amount of power ranging from <h>%.2f <i>to <h>%.2f<i>.", MConf.get().powerMin, MConf.get().powerMax);
|
||||||
msgDoc("The power of a faction is equal to the combined power of all it's members.");
|
msgDoc("The power of a faction is equal to the combined power of all it's members.");
|
||||||
msgDoc("Your power is <h>%.2f<i>", msender.getPower());
|
msgDoc("Your power is <h>%.2f<i>", msender.getPower());
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.entity.Rank;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@ -24,7 +23,7 @@ public class CmdFactionsDocumentationRanks extends FactionsCommandDocumentation
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException {
|
public void perform() {
|
||||||
msgDoc("Ranks divide the faction into groups.");
|
msgDoc("Ranks divide the faction into groups.");
|
||||||
|
|
||||||
List<Rank> ranks = msenderFaction.getRanks().getAll(Comparator.comparingInt(Rank::getPriority).reversed());
|
List<Rank> ranks = msenderFaction.getRanks().getAll(Comparator.comparingInt(Rank::getPriority).reversed());
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.req.ReqTaxEnabled;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.money.Money;
|
import com.massivecraft.massivecore.money.Money;
|
||||||
import com.massivecraft.massivecore.util.TimeDiffUtil;
|
import com.massivecraft.massivecore.util.TimeDiffUtil;
|
||||||
import com.massivecraft.massivecore.util.TimeUnit;
|
import com.massivecraft.massivecore.util.TimeUnit;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.cmd.req.ReqTaxEnabled;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ public class CmdFactionsDocumentationTax extends FactionsCommandDocumentation {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException {
|
public void perform() {
|
||||||
LinkedHashMap<TimeUnit, Long> timeUnitcounts = TimeDiffUtil.limit(TimeDiffUtil.unitcounts(MConf.get().taxTaskPeriodMillis, TimeUnit.getAll()), 3);
|
LinkedHashMap<TimeUnit, Long> timeUnitcounts = TimeDiffUtil.limit(TimeDiffUtil.unitcounts(MConf.get().taxTaskPeriodMillis, TimeUnit.getAll()), 3);
|
||||||
String periodString = TimeDiffUtil.formatedVerboose(timeUnitcounts);
|
String periodString = TimeDiffUtil.formatedVerboose(timeUnitcounts);
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package net.knarcraft.factions.cmd;
|
|||||||
import net.knarcraft.factions.cmd.req.ReqFactionWarpsEnabled;
|
import net.knarcraft.factions.cmd.req.ReqFactionWarpsEnabled;
|
||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -21,7 +20,7 @@ public class CmdFactionsDocumentationWarps extends FactionsCommandDocumentation
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException {
|
public void perform() {
|
||||||
msgDoc("A faction can have warps which allows it's members to easily go to important places within the faction.");
|
msgDoc("A faction can have warps which allows it's members to easily go to important places within the faction.");
|
||||||
|
|
||||||
if (MConf.get().warpsMax < 0) {
|
if (MConf.get().warpsMax < 0) {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.event.EventFactionsFactionShowAsync;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.PriorityLines;
|
import com.massivecraft.massivecore.PriorityLines;
|
||||||
import com.massivecraft.massivecore.mixin.MixinMessage;
|
import com.massivecraft.massivecore.mixin.MixinMessage;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.event.EventFactionsFactionShowAsync;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ public class CmdFactionsFlag extends FactionsCommand {
|
|||||||
// FIELDS
|
// FIELDS
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public CmdFactionsFlagList cmdFactionsFlagList = new CmdFactionsFlagList();
|
public final CmdFactionsFlagList cmdFactionsFlagList = new CmdFactionsFlagList();
|
||||||
public CmdFactionsFlagShow cmdFactionsFlagShow = new CmdFactionsFlagShow();
|
public CmdFactionsFlagShow cmdFactionsFlagShow = new CmdFactionsFlagShow();
|
||||||
public CmdFactionsFlagSet cmdFactionsFlagSet = new CmdFactionsFlagSet();
|
public final CmdFactionsFlagSet cmdFactionsFlagSet = new CmdFactionsFlagSet();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import net.knarcraft.factions.entity.MFlag;
|
|
||||||
import net.knarcraft.factions.entity.MFlagColl;
|
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Parameter;
|
import com.massivecraft.massivecore.command.Parameter;
|
||||||
import com.massivecraft.massivecore.pager.Pager;
|
import com.massivecraft.massivecore.pager.Pager;
|
||||||
import com.massivecraft.massivecore.pager.Stringifier;
|
import com.massivecraft.massivecore.pager.Stringifier;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
import net.knarcraft.factions.entity.MFlag;
|
||||||
|
import net.knarcraft.factions.entity.MFlagColl;
|
||||||
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeBooleanYes;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMFlag;
|
import net.knarcraft.factions.cmd.type.TypeMFlag;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MFlag;
|
import net.knarcraft.factions.entity.MFlag;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.event.EventFactionsFlagChange;
|
import net.knarcraft.factions.event.EventFactionsFlagChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeBooleanYes;
|
|
||||||
|
|
||||||
public class CmdFactionsFlagSet extends FactionsCommand {
|
public class CmdFactionsFlagSet extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.MFlag;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.collections.MassiveList;
|
import com.massivecraft.massivecore.collections.MassiveList;
|
||||||
import com.massivecraft.massivecore.command.Parameter;
|
import com.massivecraft.massivecore.command.Parameter;
|
||||||
import com.massivecraft.massivecore.pager.Pager;
|
import com.massivecraft.massivecore.pager.Pager;
|
||||||
import com.massivecraft.massivecore.pager.Stringifier;
|
import com.massivecraft.massivecore.pager.Stringifier;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.MFlag;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.engine.EngineFly;
|
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.MassiveCommandToggle;
|
import com.massivecraft.massivecore.command.MassiveCommandToggle;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.engine.EngineMassiveCorePlayerUpdate;
|
import com.massivecraft.massivecore.engine.EngineMassiveCorePlayerUpdate;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
|
import net.knarcraft.factions.engine.EngineFly;
|
||||||
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class CmdFactionsFly extends MassiveCommandToggle {
|
public class CmdFactionsFly extends MassiveCommandToggle {
|
||||||
@ -14,7 +14,7 @@ public class CmdFactionsFly extends MassiveCommandToggle {
|
|||||||
// INSTANCE
|
// INSTANCE
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private static CmdFactionsFly i = new CmdFactionsFly();
|
private static final CmdFactionsFly i = new CmdFactionsFly();
|
||||||
|
|
||||||
public static CmdFactionsFly get() {
|
public static CmdFactionsFly get() {
|
||||||
return i;
|
return i;
|
||||||
@ -38,21 +38,21 @@ public class CmdFactionsFly extends MassiveCommandToggle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getValue() throws MassiveException {
|
public boolean getValue() {
|
||||||
return MPlayer.get(sender).isFlying();
|
return MPlayer.get(sender).isFlying();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValue(boolean value) throws MassiveException {
|
public void setValue(boolean value) throws MassiveException {
|
||||||
MPlayer mplayer = MPlayer.get(sender);
|
MPlayer mplayer = MPlayer.get(sender);
|
||||||
Player player = me;
|
Player player = me;
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
throw new MassiveException().addMsg("<b>Could not find player.");
|
throw new MassiveException().addMsg("<b>Could not find player.");
|
||||||
}
|
}
|
||||||
|
|
||||||
PS ps = PS.valueOf(player);
|
PS ps = PS.valueOf(player);
|
||||||
if (value) {
|
if (value) {
|
||||||
EngineFly.canFlyInTerritoryOrThrow(mplayer, ps);
|
EngineFly.canFlyInTerritoryOrThrow(mplayer, ps);
|
||||||
}
|
}
|
||||||
|
|
||||||
mplayer.setFlying(value);
|
mplayer.setFlying(value);
|
||||||
EngineMassiveCorePlayerUpdate.update(player, false);
|
EngineMassiveCorePlayerUpdate.update(player, false);
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.Visibility;
|
import com.massivecraft.massivecore.command.Visibility;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -31,7 +30,7 @@ public class CmdFactionsHome extends FactionsCommandWarp {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws MassiveException {
|
public void perform() {
|
||||||
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
|
List<String> args = MUtil.list(MConf.get().warpsHomeName, this.argAt(0));
|
||||||
CmdFactions.get().cmdFactionsWarp.cmdFactionsWarpGo.execute(me, args);
|
CmdFactions.get().cmdFactionsWarp.cmdFactionsWarpGo.execute(me, args);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ public class CmdFactionsInvite extends FactionsCommand {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public CmdFactionsInviteList cmdFactionsInviteList = new CmdFactionsInviteList();
|
public CmdFactionsInviteList cmdFactionsInviteList = new CmdFactionsInviteList();
|
||||||
public CmdFactionsInviteAdd cmdFactionsInviteAdd = new CmdFactionsInviteAdd();
|
public final CmdFactionsInviteAdd cmdFactionsInviteAdd = new CmdFactionsInviteAdd();
|
||||||
public CmdFactionsInviteRemove cmdFactionsInviteRemove = new CmdFactionsInviteRemove();
|
public final CmdFactionsInviteRemove cmdFactionsInviteRemove = new CmdFactionsInviteRemove();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
|
||||||
import net.knarcraft.factions.entity.Invitation;
|
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
|
||||||
import net.knarcraft.factions.event.EventFactionsInvitedChange;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.type.container.TypeSet;
|
import com.massivecraft.massivecore.command.type.container.TypeSet;
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
import com.massivecraft.massivecore.util.IdUtil;
|
import com.massivecraft.massivecore.util.IdUtil;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
||||||
|
import net.knarcraft.factions.entity.Invitation;
|
||||||
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
|
import net.knarcraft.factions.event.EventFactionsInvitedChange;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -37,9 +37,9 @@ public class CmdFactionsInviteAdd extends FactionsCommand {
|
|||||||
long creationMillis = System.currentTimeMillis();
|
long creationMillis = System.currentTimeMillis();
|
||||||
|
|
||||||
// MPerm
|
// MPerm
|
||||||
if (!MPerm.getPermInvite().has(msender, msenderFaction, true)) {
|
if (!MPerm.getPermInvite().has(msender, msenderFaction, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MPlayer mplayer : mplayers) {
|
for (MPlayer mplayer : mplayers) {
|
||||||
// Already member?
|
// Already member?
|
||||||
@ -55,9 +55,9 @@ public class CmdFactionsInviteAdd extends FactionsCommand {
|
|||||||
// Event
|
// Event
|
||||||
EventFactionsInvitedChange event = new EventFactionsInvitedChange(sender, mplayer, msenderFaction, isInvited);
|
EventFactionsInvitedChange event = new EventFactionsInvitedChange(sender, mplayer, msenderFaction, isInvited);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
isInvited = event.isNewInvited();
|
isInvited = event.isNewInvited();
|
||||||
|
|
||||||
// Inform
|
// Inform
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.Invitation;
|
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.collections.MassiveList;
|
import com.massivecraft.massivecore.collections.MassiveList;
|
||||||
import com.massivecraft.massivecore.command.Parameter;
|
import com.massivecraft.massivecore.command.Parameter;
|
||||||
@ -15,6 +10,11 @@ import com.massivecraft.massivecore.pager.Stringifier;
|
|||||||
import com.massivecraft.massivecore.util.TimeDiffUtil;
|
import com.massivecraft.massivecore.util.TimeDiffUtil;
|
||||||
import com.massivecraft.massivecore.util.TimeUnit;
|
import com.massivecraft.massivecore.util.TimeUnit;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.Invitation;
|
||||||
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -42,14 +42,14 @@ public class CmdFactionsInviteList extends FactionsCommand {
|
|||||||
|
|
||||||
Faction faction = this.readArg(msenderFaction);
|
Faction faction = this.readArg(msenderFaction);
|
||||||
|
|
||||||
if (faction != msenderFaction && !Perm.INVITE_LIST_OTHER.has(sender, true)) {
|
if (faction != msenderFaction && !Perm.INVITE_LIST_OTHER.has(sender, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MPerm
|
// MPerm
|
||||||
if (!MPerm.getPermInvite().has(msender, msenderFaction, true)) {
|
if (!MPerm.getPermInvite().has(msender, msenderFaction, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pager Create
|
// Pager Create
|
||||||
final List<Entry<String, Invitation>> invitations = new MassiveList<>(faction.getInvitations().entrySet());
|
final List<Entry<String, Invitation>> invitations = new MassiveList<>(faction.getInvitations().entrySet());
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
|
||||||
import net.knarcraft.factions.event.EventFactionsInvitedChange;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.type.container.TypeSet;
|
import com.massivecraft.massivecore.command.type.container.TypeSet;
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
||||||
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
|
import net.knarcraft.factions.event.EventFactionsInvitedChange;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -50,9 +50,9 @@ public class CmdFactionsInviteRemove extends FactionsCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MPerm
|
// MPerm
|
||||||
if (!MPerm.getPermInvite().has(msender, msenderFaction, true)) {
|
if (!MPerm.getPermInvite().has(msender, msenderFaction, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MPlayer mplayer : mplayers) {
|
for (MPlayer mplayer : mplayers) {
|
||||||
// Already member?
|
// Already member?
|
||||||
@ -63,7 +63,7 @@ public class CmdFactionsInviteRemove extends FactionsCommand {
|
|||||||
|
|
||||||
Mson kick = Mson.mson(
|
Mson kick = Mson.mson(
|
||||||
mson("You might want to kick him. ").color(ChatColor.YELLOW),
|
mson("You might want to kick him. ").color(ChatColor.YELLOW),
|
||||||
mson(ChatColor.RED.toString() + tooltip).tooltip(ChatColor.YELLOW.toString() + tooltip).suggest(command)
|
mson(ChatColor.RED + tooltip).tooltip(ChatColor.YELLOW + tooltip).suggest(command)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Inform
|
// Inform
|
||||||
@ -79,9 +79,9 @@ public class CmdFactionsInviteRemove extends FactionsCommand {
|
|||||||
// Event
|
// Event
|
||||||
EventFactionsInvitedChange event = new EventFactionsInvitedChange(sender, mplayer, msenderFaction, isInvited);
|
EventFactionsInvitedChange event = new EventFactionsInvitedChange(sender, mplayer, msenderFaction, isInvited);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
isInvited = event.isNewInvited();
|
isInvited = event.isNewInvited();
|
||||||
|
|
||||||
// Inform Player
|
// Inform Player
|
||||||
@ -96,9 +96,9 @@ public class CmdFactionsInviteRemove extends FactionsCommand {
|
|||||||
msenderFaction.uninvite(mplayer);
|
msenderFaction.uninvite(mplayer);
|
||||||
|
|
||||||
// If all, we do this at last. So we only do it once.
|
// If all, we do this at last. So we only do it once.
|
||||||
if (!all) {
|
if (!all) {
|
||||||
msenderFaction.changed();
|
msenderFaction.changed();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Mson
|
// Mson
|
||||||
String command = CmdFactions.get().cmdFactionsInvite.cmdFactionsInviteAdd.getCommandLine(mplayer.getName());
|
String command = CmdFactions.get().cmdFactionsInvite.cmdFactionsInviteAdd.getCommandLine(mplayer.getName());
|
||||||
@ -106,7 +106,7 @@ public class CmdFactionsInviteRemove extends FactionsCommand {
|
|||||||
|
|
||||||
Mson invite = Mson.mson(
|
Mson invite = Mson.mson(
|
||||||
mson("You might want to invite him. ").color(ChatColor.YELLOW),
|
mson("You might want to invite him. ").color(ChatColor.YELLOW),
|
||||||
mson(ChatColor.GREEN.toString() + tooltip).tooltip(ChatColor.YELLOW.toString() + tooltip).suggest(command)
|
mson(ChatColor.GREEN + tooltip).tooltip(ChatColor.YELLOW + tooltip).suggest(command)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Inform
|
// Inform
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.Perm;
|
import net.knarcraft.factions.Perm;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
@ -9,9 +12,6 @@ import net.knarcraft.factions.entity.MConf;
|
|||||||
import net.knarcraft.factions.entity.MFlag;
|
import net.knarcraft.factions.entity.MFlag;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsJoin extends FactionsCommand {
|
public class CmdFactionsJoin extends FactionsCommand {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.util.IdUtil;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
@ -8,8 +10,6 @@ import net.knarcraft.factions.entity.MConf;
|
|||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.util.IdUtil;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsKick extends FactionsCommand {
|
public class CmdFactionsKick extends FactionsCommand {
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import net.knarcraft.factions.comparator.ComparatorFactionList;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.FactionColl;
|
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Parameter;
|
import com.massivecraft.massivecore.command.Parameter;
|
||||||
import com.massivecraft.massivecore.pager.Pager;
|
import com.massivecraft.massivecore.pager.Pager;
|
||||||
import com.massivecraft.massivecore.pager.Stringifier;
|
import com.massivecraft.massivecore.pager.Stringifier;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
import net.knarcraft.factions.comparator.ComparatorFactionList;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.FactionColl;
|
||||||
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.util.AsciiMap;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeBooleanYes;
|
import com.massivecraft.massivecore.command.type.primitive.TypeBooleanYes;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.util.AsciiMap;
|
||||||
|
|
||||||
public class CmdFactionsMap extends FactionsCommand {
|
public class CmdFactionsMap extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import net.knarcraft.factions.Perm;
|
import net.knarcraft.factions.Perm;
|
||||||
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.integration.Econ;
|
import net.knarcraft.factions.integration.Econ;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
|
|
||||||
public class CmdFactionsMoneyBalance extends FactionsCommand {
|
public class CmdFactionsMoneyBalance extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -28,9 +28,9 @@ public class CmdFactionsMoneyBalance extends FactionsCommand {
|
|||||||
public void perform() throws MassiveException {
|
public void perform() throws MassiveException {
|
||||||
Faction faction = this.readArg(msenderFaction);
|
Faction faction = this.readArg(msenderFaction);
|
||||||
|
|
||||||
if (faction != msenderFaction && !Perm.MONEY_BALANCE_ANY.has(sender, true)) {
|
if (faction != msenderFaction && !Perm.MONEY_BALANCE_ANY.has(sender, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Econ.sendBalanceInfo(msender, faction);
|
Econ.sendBalanceInfo(msender, faction);
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||||
|
import com.massivecraft.massivecore.money.Money;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import net.knarcraft.factions.integration.Econ;
|
import net.knarcraft.factions.integration.Econ;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
|
||||||
import com.massivecraft.massivecore.money.Money;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsMoneyDeposit extends FactionsCommand {
|
public class CmdFactionsMoneyDeposit extends FactionsCommand {
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||||
|
import com.massivecraft.massivecore.money.Money;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import net.knarcraft.factions.integration.Econ;
|
import net.knarcraft.factions.integration.Econ;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
|
||||||
import com.massivecraft.massivecore.money.Money;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsMoneyTransferF2f extends FactionsCommand {
|
public class CmdFactionsMoneyTransferF2f extends FactionsCommand {
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||||
|
import com.massivecraft.massivecore.money.Money;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
@ -8,10 +12,6 @@ import net.knarcraft.factions.entity.Faction;
|
|||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.integration.Econ;
|
import net.knarcraft.factions.integration.Econ;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
|
||||||
import com.massivecraft.massivecore.money.Money;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsMoneyTransferF2p extends FactionsCommand {
|
public class CmdFactionsMoneyTransferF2p extends FactionsCommand {
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||||
|
import com.massivecraft.massivecore.money.Money;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
@ -8,10 +12,6 @@ import net.knarcraft.factions.entity.Faction;
|
|||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.integration.Econ;
|
import net.knarcraft.factions.integration.Econ;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
|
||||||
import com.massivecraft.massivecore.money.Money;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsMoneyTransferP2f extends FactionsCommand {
|
public class CmdFactionsMoneyTransferP2f extends FactionsCommand {
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||||
|
import com.massivecraft.massivecore.money.Money;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
import net.knarcraft.factions.cmd.req.ReqBankCommandsEnabled;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
@ -7,10 +11,6 @@ import net.knarcraft.factions.entity.Faction;
|
|||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.integration.Econ;
|
import net.knarcraft.factions.integration.Econ;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
|
||||||
import com.massivecraft.massivecore.money.Money;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsMoneyWithdraw extends FactionsCommand {
|
public class CmdFactionsMoneyWithdraw extends FactionsCommand {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.FactionColl;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Visibility;
|
import com.massivecraft.massivecore.command.Visibility;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeStringConfirmation;
|
import com.massivecraft.massivecore.command.type.primitive.TypeStringConfirmation;
|
||||||
import com.massivecraft.massivecore.money.Money;
|
import com.massivecraft.massivecore.money.Money;
|
||||||
import com.massivecraft.massivecore.util.ConfirmationUtil;
|
import com.massivecraft.massivecore.util.ConfirmationUtil;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.FactionColl;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
|
||||||
public class CmdFactionsMoneyconvert extends FactionsCommand {
|
public class CmdFactionsMoneyconvert extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
|
||||||
import net.knarcraft.factions.event.EventFactionsMotdChange;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.type.TypeNullable;
|
import com.massivecraft.massivecore.command.type.TypeNullable;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||||
import com.massivecraft.massivecore.mixin.MixinDisplayName;
|
import com.massivecraft.massivecore.mixin.MixinDisplayName;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
|
import net.knarcraft.factions.event.EventFactionsMotdChange;
|
||||||
|
|
||||||
public class CmdFactionsMotd extends FactionsCommand {
|
public class CmdFactionsMotd extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFactionNameLenient;
|
import net.knarcraft.factions.cmd.type.TypeFactionNameLenient;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.event.EventFactionsNameChange;
|
import net.knarcraft.factions.event.EventFactionsNameChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
|
|
||||||
public class CmdFactionsName extends FactionsCommand {
|
public class CmdFactionsName extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -29,16 +29,16 @@ public class CmdFactionsName extends FactionsCommand {
|
|||||||
Faction faction = this.readArg(msenderFaction);
|
Faction faction = this.readArg(msenderFaction);
|
||||||
|
|
||||||
// MPerm
|
// MPerm
|
||||||
if (!MPerm.getPermName().has(msender, faction, true)) {
|
if (!MPerm.getPermName().has(msender, faction, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event
|
// Event
|
||||||
EventFactionsNameChange event = new EventFactionsNameChange(sender, faction, newName);
|
EventFactionsNameChange event = new EventFactionsNameChange(sender, faction, newName);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
newName = event.getNewName();
|
newName = event.getNewName();
|
||||||
|
|
||||||
// Apply
|
// Apply
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeBooleanYes;
|
import com.massivecraft.massivecore.command.type.primitive.TypeBooleanYes;
|
||||||
import com.massivecraft.massivecore.util.IdUtil;
|
import com.massivecraft.massivecore.util.IdUtil;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
|
||||||
public class CmdFactionsOverride extends FactionsCommand {
|
public class CmdFactionsOverride extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -5,10 +5,10 @@ public class CmdFactionsPerm extends FactionsCommand {
|
|||||||
// FIELDS
|
// FIELDS
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
CmdFactionsPermList cmdFactionsPermList = new CmdFactionsPermList();
|
final CmdFactionsPermList cmdFactionsPermList = new CmdFactionsPermList();
|
||||||
CmdFactionsPermShow cmdFactionsPermShow = new CmdFactionsPermShow();
|
final CmdFactionsPermShow cmdFactionsPermShow = new CmdFactionsPermShow();
|
||||||
CmdFactionsPermView cmdFactionsPermView = new CmdFactionsPermView();
|
final CmdFactionsPermView cmdFactionsPermView = new CmdFactionsPermView();
|
||||||
CmdFactionsPermViewall cmdFactionsPermViewall = new CmdFactionsPermViewall();
|
final CmdFactionsPermViewall cmdFactionsPermViewall = new CmdFactionsPermViewall();
|
||||||
CmdFactionsPermSet cmdFactionsPermSet = new CmdFactionsPermSet();
|
final CmdFactionsPermSet cmdFactionsPermSet = new CmdFactionsPermSet();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
|
||||||
import net.knarcraft.factions.entity.MPermColl;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Parameter;
|
import com.massivecraft.massivecore.command.Parameter;
|
||||||
import com.massivecraft.massivecore.pager.Pager;
|
import com.massivecraft.massivecore.pager.Pager;
|
||||||
import com.massivecraft.massivecore.pager.Stringifier;
|
import com.massivecraft.massivecore.pager.Stringifier;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
|
import net.knarcraft.factions.entity.MPermColl;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeBooleanYes;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPerm;
|
import net.knarcraft.factions.cmd.type.TypeMPerm;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
||||||
@ -7,9 +10,6 @@ import net.knarcraft.factions.entity.Faction;
|
|||||||
import net.knarcraft.factions.entity.MConf;
|
import net.knarcraft.factions.entity.MConf;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.event.EventFactionsPermChange;
|
import net.knarcraft.factions.event.EventFactionsPermChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeBooleanYes;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
public class CmdFactionsPermSet extends FactionsCommand {
|
public class CmdFactionsPermSet extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -38,9 +38,9 @@ public class CmdFactionsPermSet extends FactionsCommand {
|
|||||||
MPerm.MPermable permable = TypeMPermable.get(faction).read(this.argAt(1), sender);
|
MPerm.MPermable permable = TypeMPermable.get(faction).read(this.argAt(1), sender);
|
||||||
|
|
||||||
// Do the sender have the right to change perms for this faction?
|
// Do the sender have the right to change perms for this faction?
|
||||||
if (!MPerm.getPermPerms().has(msender, faction, true)) {
|
if (!MPerm.getPermPerms().has(msender, faction, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is this perm editable?
|
// Is this perm editable?
|
||||||
if (!msender.isOverriding() && !perm.isEditable()) {
|
if (!msender.isOverriding() && !perm.isEditable()) {
|
||||||
@ -54,9 +54,9 @@ public class CmdFactionsPermSet extends FactionsCommand {
|
|||||||
// Event
|
// Event
|
||||||
EventFactionsPermChange event = new EventFactionsPermChange(sender, faction, perm, permable, value);
|
EventFactionsPermChange event = new EventFactionsPermChange(sender, faction, perm, permable, value);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
value = event.getNewValue();
|
value = event.getNewValue();
|
||||||
|
|
||||||
// Apply
|
// Apply
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.collections.MassiveList;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPerm;
|
import net.knarcraft.factions.cmd.type.TypeMPerm;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.collections.MassiveList;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.collections.MassiveList;
|
||||||
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.entity.Rank;
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.collections.MassiveList;
|
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -45,9 +45,9 @@ public class CmdFactionsPermView extends FactionsCommand {
|
|||||||
List<MPerm> perms = new MassiveList<>();
|
List<MPerm> perms = new MassiveList<>();
|
||||||
|
|
||||||
for (MPerm mperm : MPerm.getAll()) {
|
for (MPerm mperm : MPerm.getAll()) {
|
||||||
if (faction.isPermitted(permable.getId(), mperm.getId())) {
|
if (faction.isPermitted(permable.getId(), mperm.getId())) {
|
||||||
perms.add(mperm);
|
perms.add(mperm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (perms.isEmpty()) {
|
if (perms.isEmpty()) {
|
||||||
@ -60,31 +60,28 @@ public class CmdFactionsPermView extends FactionsCommand {
|
|||||||
String permissionSingularPlural = permNames.size() == 1 ? "permission" : "permissions";
|
String permissionSingularPlural = permNames.size() == 1 ? "permission" : "permissions";
|
||||||
msg("<i>In <reset>%s <reset>%s <i>specifically has the %s: <reset>%s<i>.", faction.describeTo(msender), permable.getDisplayName(sender), permissionSingularPlural, names);
|
msg("<i>In <reset>%s <reset>%s <i>specifically has the %s: <reset>%s<i>.", faction.describeTo(msender), permable.getDisplayName(sender), permissionSingularPlural, names);
|
||||||
}
|
}
|
||||||
if (permable instanceof MPlayer) {
|
if (permable instanceof MPlayer mplayer) {
|
||||||
MPlayer mplayer = (MPlayer) permable;
|
|
||||||
msg("<i>They may have other permissions through their faction membership, rank or relation to <reset>%s<i>.", faction.describeTo(msender));
|
msg("<i>They may have other permissions through their faction membership, rank or relation to <reset>%s<i>.", faction.describeTo(msender));
|
||||||
|
|
||||||
List<Mson> msons = new MassiveList<>();
|
List<Mson> msons = new MassiveList<>();
|
||||||
|
|
||||||
if (mplayer.getFaction() != faction) {
|
if (mplayer.getFaction() != faction) {
|
||||||
msons.add(Mson.parse("<command>[faction]").command(this, mplayer.getFaction().getName(), faction.getName()));
|
msons.add(Mson.parse("<command>[faction]").command(this, mplayer.getFaction().getName(), faction.getName()));
|
||||||
}
|
}
|
||||||
msons.add(Mson.parse("<command>[rank]").command(this, mplayer.getFaction().getName() + "-" + mplayer.getRank().getName(), faction.getName()));
|
msons.add(Mson.parse("<command>[rank]").command(this, mplayer.getFaction().getName() + "-" + mplayer.getRank().getName(), faction.getName()));
|
||||||
if (mplayer.getFaction() != faction) {
|
if (mplayer.getFaction() != faction) {
|
||||||
msons.add(Mson.parse("<command>[relation]").command(this, faction.getRelationTo(mplayer).toString(), faction.getName()));
|
msons.add(Mson.parse("<command>[relation]").command(this, faction.getRelationTo(mplayer).toString(), faction.getName()));
|
||||||
}
|
}
|
||||||
Mson msons2 = Mson.implode(msons, Mson.SPACE);
|
Mson msons2 = Mson.implode(msons, Mson.SPACE);
|
||||||
message(mson(mson("Commands: ").color(ChatColor.YELLOW), msons2));
|
message(mson(mson("Commands: ").color(ChatColor.YELLOW), msons2));
|
||||||
}
|
}
|
||||||
if (permable instanceof Faction) {
|
if (permable instanceof Faction faction1) {
|
||||||
Faction faction1 = (Faction) permable;
|
|
||||||
msg("<i>They may have other permissions through their relation to <reset>%s<i>.", faction.describeTo(msender));
|
msg("<i>They may have other permissions through their relation to <reset>%s<i>.", faction.describeTo(msender));
|
||||||
Mson msonRelation = Mson.parse("<command>[relation]").command(this, faction.getRelationTo(faction1).toString(), faction.getName());
|
Mson msonRelation = Mson.parse("<command>[relation]").command(this, faction.getRelationTo(faction1).toString(), faction.getName());
|
||||||
Mson msons = Mson.implode(MUtil.list(msonRelation), Mson.SPACE);
|
Mson msons = Mson.implode(MUtil.list(msonRelation), Mson.SPACE);
|
||||||
message(mson(mson("Commands: ").color(ChatColor.YELLOW), msons));
|
message(mson(mson("Commands: ").color(ChatColor.YELLOW), msons));
|
||||||
}
|
}
|
||||||
if (permable instanceof Rank && !faction.hasRank((Rank) permable)) {
|
if (permable instanceof Rank rank && !faction.hasRank((Rank) permable)) {
|
||||||
Rank rank = (Rank) permable;
|
|
||||||
msg("<i>They may have other permissions thorugh their faction membership or relation to <reset>%s<i>.", faction.describeTo(msender));
|
msg("<i>They may have other permissions thorugh their faction membership or relation to <reset>%s<i>.", faction.describeTo(msender));
|
||||||
Mson msonFaction = Mson.parse("<command>[faction]").command(this, rank.getFaction().getName(), faction.getName());
|
Mson msonFaction = Mson.parse("<command>[faction]").command(this, rank.getFaction().getName(), faction.getName());
|
||||||
Mson msonRelation = Mson.parse("<command>[relation]").command(this, faction.getRelationTo(rank.getFaction()).toString(), faction.getName());
|
Mson msonRelation = Mson.parse("<command>[relation]").command(this, faction.getRelationTo(rank.getFaction()).toString(), faction.getName());
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.collections.MassiveList;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
import net.knarcraft.factions.cmd.type.TypeMPermable;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.entity.Rank;
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.collections.MassiveList;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -44,18 +44,15 @@ public class CmdFactionsPermViewall extends FactionsCommand {
|
|||||||
List<MPerm.MPermable> permables = new MassiveList<>();
|
List<MPerm.MPermable> permables = new MassiveList<>();
|
||||||
permables.add(permable);
|
permables.add(permable);
|
||||||
|
|
||||||
if (permable instanceof MPlayer) {
|
if (permable instanceof MPlayer mplayer) {
|
||||||
MPlayer mplayer = (MPlayer) permable;
|
|
||||||
permables.add(mplayer.getFaction());
|
permables.add(mplayer.getFaction());
|
||||||
permables.add(mplayer.getRank());
|
permables.add(mplayer.getRank());
|
||||||
permables.add(faction.getRelationTo(mplayer));
|
permables.add(faction.getRelationTo(mplayer));
|
||||||
}
|
}
|
||||||
if (permable instanceof Faction) {
|
if (permable instanceof Faction faction1) {
|
||||||
Faction faction1 = (Faction) permable;
|
|
||||||
permables.add(faction.getRelationTo(faction1));
|
permables.add(faction.getRelationTo(faction1));
|
||||||
}
|
}
|
||||||
if (permable instanceof Rank && !faction.hasRank((Rank) permable)) {
|
if (permable instanceof Rank rank && !faction.hasRank((Rank) permable)) {
|
||||||
Rank rank = (Rank) permable;
|
|
||||||
Faction faction1 = rank.getFaction();
|
Faction faction1 = rank.getFaction();
|
||||||
permables.add(faction1);
|
permables.add(faction1);
|
||||||
permables.add(faction.getRelationTo(faction1));
|
permables.add(faction.getRelationTo(faction1));
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.Progressbar;
|
import com.massivecraft.massivecore.Progressbar;
|
||||||
import com.massivecraft.massivecore.event.EventMassiveCorePlayerCleanInactivityToleranceMillis;
|
import com.massivecraft.massivecore.event.EventMassiveCorePlayerCleanInactivityToleranceMillis;
|
||||||
import com.massivecraft.massivecore.util.TimeDiffUtil;
|
import com.massivecraft.massivecore.util.TimeDiffUtil;
|
||||||
import com.massivecraft.massivecore.util.TimeUnit;
|
import com.massivecraft.massivecore.util.TimeUnit;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -5,8 +5,8 @@ public class CmdFactionsPowerboost extends FactionsCommand {
|
|||||||
// FIELDS
|
// FIELDS
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public CmdFactionsPowerboostPlayer cmdFactionsPowerBoostPlayer = new CmdFactionsPowerboostPlayer();
|
public final CmdFactionsPowerboostPlayer cmdFactionsPowerBoostPlayer = new CmdFactionsPowerboostPlayer();
|
||||||
public CmdFactionsPowerboostFaction cmdFactionsPowerBoostFaction = new CmdFactionsPowerboostFaction();
|
public final CmdFactionsPowerboostFaction cmdFactionsPowerBoostFaction = new CmdFactionsPowerboostFaction();
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// CONSTRUCT
|
// CONSTRUCT
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import net.knarcraft.factions.FactionsParticipator;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.type.Type;
|
import com.massivecraft.massivecore.command.type.Type;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
import com.massivecraft.massivecore.command.type.primitive.TypeDouble;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
import net.knarcraft.factions.FactionsParticipator;
|
||||||
|
|
||||||
public abstract class CmdFactionsPowerboostAbstract extends FactionsCommand {
|
public abstract class CmdFactionsPowerboostAbstract extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -5,7 +5,7 @@ public class CmdFactionsRank extends FactionsCommand {
|
|||||||
// FIELDS
|
// FIELDS
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public CmdFactionsRankSet cmdFactionsRankSet = new CmdFactionsRankSet();
|
public final CmdFactionsRankSet cmdFactionsRankSet = new CmdFactionsRankSet();
|
||||||
public CmdFactionsRankShow cmdFactionsRankShow = new CmdFactionsRankShow();
|
public CmdFactionsRankShow cmdFactionsRankShow = new CmdFactionsRankShow();
|
||||||
public CmdFactionsRankList cmdFactionsRankList = new CmdFactionsRankList();
|
public CmdFactionsRankList cmdFactionsRankList = new CmdFactionsRankList();
|
||||||
public CmdFactionsRankEdit cmdFactionsRankEdit = new CmdFactionsRankEdit();
|
public CmdFactionsRankEdit cmdFactionsRankEdit = new CmdFactionsRankEdit();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
|
|
||||||
public class CmdFactionsRankEdit extends FactionsCommand {
|
public class CmdFactionsRankEdit extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.Rank;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeInteger;
|
import com.massivecraft.massivecore.command.type.primitive.TypeInteger;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeStringParsed;
|
import com.massivecraft.massivecore.command.type.primitive.TypeStringParsed;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.Rank;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeRank;
|
import net.knarcraft.factions.cmd.type.TypeRank;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.entity.Rank;
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -34,7 +34,7 @@ public class CmdFactionsRankEditDelete extends FactionsCommand {
|
|||||||
Faction faction = this.readArgAt(1, msenderFaction);
|
Faction faction = this.readArgAt(1, msenderFaction);
|
||||||
|
|
||||||
// Rank if any passed.
|
// Rank if any passed.
|
||||||
TypeRank typeRank = new TypeRank(faction);
|
TypeRank typeRank = TypeRank.get(faction, null);
|
||||||
Rank rank = typeRank.read(this.argAt(0), sender);
|
Rank rank = typeRank.read(this.argAt(0), sender);
|
||||||
|
|
||||||
CmdFactionsRankEdit.ensureAllowed(msender, faction, "delete");
|
CmdFactionsRankEdit.ensureAllowed(msender, faction, "delete");
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeRank;
|
import net.knarcraft.factions.cmd.type.TypeRank;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.Rank;
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class CmdFactionsRankEditName extends FactionsCommand {
|
|||||||
Faction faction = this.readArgAt(2, msenderFaction);
|
Faction faction = this.readArgAt(2, msenderFaction);
|
||||||
|
|
||||||
// Rank if any passed.
|
// Rank if any passed.
|
||||||
TypeRank typeRank = new TypeRank(faction);
|
TypeRank typeRank = TypeRank.get(faction, null);
|
||||||
Rank rank = typeRank.read(this.argAt(0), sender);
|
Rank rank = typeRank.read(this.argAt(0), sender);
|
||||||
|
|
||||||
// Args
|
// Args
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeRank;
|
import net.knarcraft.factions.cmd.type.TypeRank;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.Rank;
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeString;
|
|
||||||
|
|
||||||
public class CmdFactionsRankEditPrefix extends FactionsCommand {
|
public class CmdFactionsRankEditPrefix extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
@ -30,7 +30,7 @@ public class CmdFactionsRankEditPrefix extends FactionsCommand {
|
|||||||
Faction faction = this.readArgAt(2, msenderFaction);
|
Faction faction = this.readArgAt(2, msenderFaction);
|
||||||
|
|
||||||
// Rank if any passed.
|
// Rank if any passed.
|
||||||
TypeRank typeRank = new TypeRank(faction);
|
TypeRank typeRank = TypeRank.get(faction, null);
|
||||||
Rank rank = typeRank.read(this.argAt(0), sender);
|
Rank rank = typeRank.read(this.argAt(0), sender);
|
||||||
|
|
||||||
// Args
|
// Args
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.type.primitive.TypeInteger;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeRank;
|
import net.knarcraft.factions.cmd.type.TypeRank;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.Rank;
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.type.primitive.TypeInteger;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class CmdFactionsRankEditPriority extends FactionsCommand {
|
|||||||
Faction faction = this.readArgAt(2, msenderFaction);
|
Faction faction = this.readArgAt(2, msenderFaction);
|
||||||
|
|
||||||
// Rank if any passed.
|
// Rank if any passed.
|
||||||
TypeRank typeRank = new TypeRank(faction);
|
TypeRank typeRank = TypeRank.get(faction, null);
|
||||||
Rank rank = typeRank.read(this.argAt(0), sender);
|
Rank rank = typeRank.read(this.argAt(0), sender);
|
||||||
|
|
||||||
CmdFactionsRankEdit.ensureAllowed(msender, faction, "edit");
|
CmdFactionsRankEdit.ensureAllowed(msender, faction, "edit");
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.Rank;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Parameter;
|
import com.massivecraft.massivecore.command.Parameter;
|
||||||
import com.massivecraft.massivecore.pager.Pager;
|
import com.massivecraft.massivecore.pager.Pager;
|
||||||
import com.massivecraft.massivecore.pager.Stringifier;
|
import com.massivecraft.massivecore.pager.Stringifier;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.Rank;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
|
||||||
import com.massivecraft.massivecore.command.Visibility;
|
import com.massivecraft.massivecore.command.Visibility;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
||||||
|
|
||||||
public class CmdFactionsRankOld extends FactionsCommand {
|
public class CmdFactionsRankOld extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.collections.MassiveSet;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.Factions;
|
import net.knarcraft.factions.Factions;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
||||||
@ -13,9 +16,6 @@ import net.knarcraft.factions.entity.MPlayerColl;
|
|||||||
import net.knarcraft.factions.entity.Rank;
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
import net.knarcraft.factions.event.EventFactionsMembershipChange;
|
||||||
import net.knarcraft.factions.event.EventFactionsRankChange;
|
import net.knarcraft.factions.event.EventFactionsRankChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.collections.MassiveSet;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -75,9 +75,9 @@ public class CmdFactionsRankSet extends FactionsCommand {
|
|||||||
// Event
|
// Event
|
||||||
EventFactionsRankChange event = new EventFactionsRankChange(sender, target, rank);
|
EventFactionsRankChange event = new EventFactionsRankChange(sender, target, rank);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rank = event.getNewRank();
|
rank = event.getNewRank();
|
||||||
|
|
||||||
// Change the rank.
|
// Change the rank.
|
||||||
@ -135,9 +135,9 @@ public class CmdFactionsRankSet extends FactionsCommand {
|
|||||||
|
|
||||||
private void ensureAllowed() throws MassiveException {
|
private void ensureAllowed() throws MassiveException {
|
||||||
// People with permission don't follow the normal rules.
|
// People with permission don't follow the normal rules.
|
||||||
if (msender.isOverriding()) {
|
if (msender.isOverriding()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If somone gets the leadership of wilderness (Which has happened before).
|
// If somone gets the leadership of wilderness (Which has happened before).
|
||||||
// We can at least try to limit their powers.
|
// We can at least try to limit their powers.
|
||||||
@ -204,9 +204,9 @@ public class CmdFactionsRankSet extends FactionsCommand {
|
|||||||
// Event
|
// Event
|
||||||
EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(sender, msender, endFaction, EventFactionsMembershipChange.MembershipChangeReason.RANK);
|
EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(sender, msender, endFaction, EventFactionsMembershipChange.MembershipChangeReason.RANK);
|
||||||
membershipChangeEvent.run();
|
membershipChangeEvent.run();
|
||||||
if (membershipChangeEvent.isCancelled()) {
|
if (membershipChangeEvent.isCancelled()) {
|
||||||
throw new MassiveException();
|
throw new MassiveException();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply
|
// Apply
|
||||||
target.resetFactionData();
|
target.resetFactionData();
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
import net.knarcraft.factions.cmd.type.TypeMPlayer;
|
||||||
import net.knarcraft.factions.entity.MPlayer;
|
import net.knarcraft.factions.entity.MPlayer;
|
||||||
import net.knarcraft.factions.entity.Rank;
|
import net.knarcraft.factions.entity.Rank;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
|
||||||
|
|
||||||
public class CmdFactionsRankShow extends FactionsCommand {
|
public class CmdFactionsRankShow extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -5,7 +5,7 @@ public class CmdFactionsRelation extends FactionsCommand {
|
|||||||
// FIELDS
|
// FIELDS
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public CmdFactionsRelationSet cmdFactionsRelationSet = new CmdFactionsRelationSet();
|
public final CmdFactionsRelationSet cmdFactionsRelationSet = new CmdFactionsRelationSet();
|
||||||
public CmdFactionsRelationList cmdFactionsRelationList = new CmdFactionsRelationList();
|
public CmdFactionsRelationList cmdFactionsRelationList = new CmdFactionsRelationList();
|
||||||
public CmdFactionsRelationWishes cmdFactionsRelationWishes = new CmdFactionsRelationWishes();
|
public CmdFactionsRelationWishes cmdFactionsRelationWishes = new CmdFactionsRelationWishes();
|
||||||
|
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import net.knarcraft.factions.Rel;
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeRelation;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.FactionColl;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.collections.MassiveList;
|
import com.massivecraft.massivecore.collections.MassiveList;
|
||||||
import com.massivecraft.massivecore.collections.MassiveSet;
|
import com.massivecraft.massivecore.collections.MassiveSet;
|
||||||
@ -14,6 +8,12 @@ import com.massivecraft.massivecore.command.type.container.TypeSet;
|
|||||||
import com.massivecraft.massivecore.pager.Pager;
|
import com.massivecraft.massivecore.pager.Pager;
|
||||||
import com.massivecraft.massivecore.pager.Stringifier;
|
import com.massivecraft.massivecore.pager.Stringifier;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
import net.knarcraft.factions.Rel;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeRelation;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.FactionColl;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.Visibility;
|
import com.massivecraft.massivecore.command.Visibility;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
|
||||||
public class CmdFactionsRelationOld extends FactionsCommand {
|
public class CmdFactionsRelationOld extends FactionsCommand {
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.MassiveCommand;
|
||||||
|
import com.massivecraft.massivecore.mson.Mson;
|
||||||
import net.knarcraft.factions.Rel;
|
import net.knarcraft.factions.Rel;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.cmd.type.TypeRelation;
|
import net.knarcraft.factions.cmd.type.TypeRelation;
|
||||||
@ -7,9 +10,6 @@ import net.knarcraft.factions.entity.Faction;
|
|||||||
import net.knarcraft.factions.entity.MFlag;
|
import net.knarcraft.factions.entity.MFlag;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import net.knarcraft.factions.event.EventFactionsRelationChange;
|
import net.knarcraft.factions.event.EventFactionsRelationChange;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.MassiveCommand;
|
|
||||||
import com.massivecraft.massivecore.mson.Mson;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdFactionsRelationSet extends FactionsCommand {
|
public class CmdFactionsRelationSet extends FactionsCommand {
|
||||||
@ -34,9 +34,9 @@ public class CmdFactionsRelationSet extends FactionsCommand {
|
|||||||
Rel newRelation = this.readArg();
|
Rel newRelation = this.readArg();
|
||||||
|
|
||||||
// MPerm
|
// MPerm
|
||||||
if (!MPerm.getPermRel().has(msender, msenderFaction, true)) {
|
if (!MPerm.getPermRel().has(msender, msenderFaction, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify
|
// Verify
|
||||||
if (otherFaction == msenderFaction) {
|
if (otherFaction == msenderFaction) {
|
||||||
@ -49,9 +49,9 @@ public class CmdFactionsRelationSet extends FactionsCommand {
|
|||||||
// Event
|
// Event
|
||||||
EventFactionsRelationChange event = new EventFactionsRelationChange(sender, msenderFaction, otherFaction, newRelation);
|
EventFactionsRelationChange event = new EventFactionsRelationChange(sender, msenderFaction, otherFaction, newRelation);
|
||||||
event.run();
|
event.run();
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
newRelation = event.getNewRelation();
|
newRelation = event.getNewRelation();
|
||||||
|
|
||||||
// try to set the new relation
|
// try to set the new relation
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Factions;
|
|
||||||
import net.knarcraft.factions.Rel;
|
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.FactionColl;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.collections.MassiveMap;
|
import com.massivecraft.massivecore.collections.MassiveMap;
|
||||||
import com.massivecraft.massivecore.command.Parameter;
|
import com.massivecraft.massivecore.command.Parameter;
|
||||||
@ -12,6 +7,11 @@ import com.massivecraft.massivecore.pager.Pager;
|
|||||||
import com.massivecraft.massivecore.pager.Stringifier;
|
import com.massivecraft.massivecore.pager.Stringifier;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
|
import net.knarcraft.factions.Factions;
|
||||||
|
import net.knarcraft.factions.Rel;
|
||||||
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.FactionColl;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.util.AsciiMap;
|
|
||||||
import net.knarcraft.factions.util.VisualizeUtil;
|
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
|
import com.massivecraft.massivecore.ps.PSFormatHumanSpace;
|
||||||
|
import net.knarcraft.factions.util.AsciiMap;
|
||||||
|
import net.knarcraft.factions.util.VisualizeUtil;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -56,7 +56,7 @@ public class CmdFactionsSeeChunkOld extends FactionsCommand {
|
|||||||
showPillar(me, world, blockX, blockZ);
|
showPillar(me, world, blockX, blockZ);
|
||||||
|
|
||||||
// Inform
|
// Inform
|
||||||
boolean showCoords = AsciiMap.showChunkCoords(chunk);
|
boolean showCoords = AsciiMap.showChunkCoordinates(chunk);
|
||||||
String chunkDesc = showCoords ? chunk.toString(PSFormatHumanSpace.get()) : "chunk";
|
String chunkDesc = showCoords ? chunk.toString(PSFormatHumanSpace.get()) : "chunk";
|
||||||
msg("<i>Visualized %s", chunkDesc);
|
msg("<i>Visualized %s", chunkDesc);
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import net.knarcraft.factions.entity.Board;
|
|
||||||
import net.knarcraft.factions.entity.BoardColl;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
import com.massivecraft.massivecore.mixin.MixinWorld;
|
import com.massivecraft.massivecore.mixin.MixinWorld;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.MUtil;
|
import com.massivecraft.massivecore.util.MUtil;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
import net.knarcraft.factions.entity.Board;
|
||||||
|
import net.knarcraft.factions.entity.BoardColl;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import net.knarcraft.factions.Perm;
|
import net.knarcraft.factions.Perm;
|
||||||
import net.knarcraft.factions.cmd.type.TypeFaction;
|
import net.knarcraft.factions.cmd.type.TypeFaction;
|
||||||
import net.knarcraft.factions.entity.Faction;
|
import net.knarcraft.factions.entity.Faction;
|
||||||
import net.knarcraft.factions.entity.FactionColl;
|
import net.knarcraft.factions.entity.FactionColl;
|
||||||
import net.knarcraft.factions.entity.MPerm;
|
import net.knarcraft.factions.entity.MPerm;
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
import com.massivecraft.massivecore.MassiveException;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.ChunkUtil;
|
import com.massivecraft.massivecore.util.ChunkUtil;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
package net.knarcraft.factions.cmd;
|
package net.knarcraft.factions.cmd;
|
||||||
|
|
||||||
import net.knarcraft.factions.Perm;
|
|
||||||
import net.knarcraft.factions.entity.BoardColl;
|
|
||||||
import net.knarcraft.factions.entity.Faction;
|
|
||||||
import net.knarcraft.factions.entity.MConf;
|
|
||||||
import com.massivecraft.massivecore.MassiveException;
|
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
import com.massivecraft.massivecore.util.ChunkUtil;
|
import com.massivecraft.massivecore.util.ChunkUtil;
|
||||||
|
import net.knarcraft.factions.Perm;
|
||||||
|
import net.knarcraft.factions.entity.BoardColl;
|
||||||
|
import net.knarcraft.factions.entity.Faction;
|
||||||
|
import net.knarcraft.factions.entity.MConf;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
@ -41,7 +40,7 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<PS> getChunks() throws MassiveException {
|
public Set<PS> getChunks() {
|
||||||
// Common Startup
|
// Common Startup
|
||||||
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user