SavageFactions 1.0.21
fixed this error (https://pastebin.com/4gtiQPYX) fixed damage bug (https://pastebin.com/56JHiPYt) fixed (https://prnt.sc/iy4l7q) (( I think I did, I could not replicate it )) Added methods to check if players can fly in claim types e.g. "if (fplayer.canflyinsafezone()){ //do stuff }" Autofly now enables if you have bypass permissions. Fixed faction members, truces, and allies being able to hit each other and disable fly Fixed Autofly's enable message spamming multiple times if fly is already on.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.darkblade12.particleeffect.ParticleEffect;
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Relation;
|
||||
@@ -9,7 +10,6 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.inventivetalent.particle.ParticleEffect;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
@@ -19,8 +19,8 @@ public class CmdFly extends FCommand {
|
||||
|
||||
|
||||
public static HashMap<String,Boolean> flyMap = new HashMap<String,Boolean>();
|
||||
public int id = -1;
|
||||
public int flyid = -1;
|
||||
public static int id = -1;
|
||||
public static int flyid = -1;
|
||||
public CmdFly() {
|
||||
super();
|
||||
this.aliases.add("fly");
|
||||
@@ -156,7 +156,7 @@ public class CmdFly extends FCommand {
|
||||
}
|
||||
|
||||
|
||||
public void startParticles(){
|
||||
public static void startParticles() {
|
||||
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -169,7 +169,8 @@ public class CmdFly extends FCommand {
|
||||
continue;
|
||||
}
|
||||
|
||||
ParticleEffect.CLOUD.send(Bukkit.getOnlinePlayers(), player.getLocation().add(0, -0.35, 0), 0, 0, 0, 0, 3, 16);
|
||||
|
||||
ParticleEffect.CLOUD.display(0, 0, 0, 0, 1, player.getLocation().add(0, -0.35, 0), 16);
|
||||
|
||||
}
|
||||
if (flyMap.keySet().size() == 0){
|
||||
@@ -180,7 +181,7 @@ public class CmdFly extends FCommand {
|
||||
}, 10L, 10L);
|
||||
}
|
||||
|
||||
public void startFlyCheck(){
|
||||
public static void startFlyCheck() {
|
||||
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(P.p, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -210,7 +211,7 @@ public class CmdFly extends FCommand {
|
||||
if (Board.getInstance().getFactionAt(myFloc) != myFaction) {
|
||||
if (!checkBypassPerms(fPlayer,player,toFac)){
|
||||
fPlayer.setFlying(false);
|
||||
flyMap.remove(name);
|
||||
itr.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -224,8 +225,7 @@ public class CmdFly extends FCommand {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private boolean checkBypassPerms(FPlayer fplayer, Player player,Faction toFac){
|
||||
private static boolean checkBypassPerms(FPlayer fplayer, Player player, Faction toFac) {
|
||||
if (player.hasPermission("factions.fly.wilderness") && toFac.isWilderness()){
|
||||
return true;
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class CmdFly extends FCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void checkTaskState(){
|
||||
public static void checkTaskState() {
|
||||
if (flyMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(flyid);
|
||||
flyid = -1;
|
||||
@@ -258,9 +258,6 @@ public class CmdFly extends FCommand {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void toggleFlight(final boolean toggle, final Player player) {
|
||||
if (!toggle) {
|
||||
fme.setFlying(false);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
|
||||
import com.darkblade12.particleeffect.ParticleEffect;
|
||||
import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
@@ -11,7 +12,6 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.inventivetalent.particle.ParticleEffect;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -29,6 +29,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
private int taskID = -1;
|
||||
|
||||
|
||||
|
||||
//I remade it cause of people getting mad that I had the same seechunk as drtshock
|
||||
|
||||
|
||||
@@ -46,7 +47,8 @@ public class CmdSeeChunk extends FCommand {
|
||||
|
||||
this.useParticles = p.getConfig().getBoolean("see-chunk.particles", true);
|
||||
interval = P.p.getConfig().getLong("see-chunk.interval", 10L);
|
||||
effect = ParticleEffect.valueOf(P.p.getConfig().getString("see-chunk.particle", "REDSTONE"));
|
||||
effect = ParticleEffect.fromName(P.p.getConfig().getString("see-chunk.particle", "REDSTONE"));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,6 +103,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
blockZ = chunkZ * 16;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
|
||||
|
||||
blockX = chunkX * 16 + 15;
|
||||
blockZ = chunkZ * 16;
|
||||
showPillar(me, world, blockX, blockZ);
|
||||
@@ -123,8 +126,10 @@ public class CmdSeeChunk extends FCommand {
|
||||
}
|
||||
|
||||
if (useParticles) {
|
||||
//api didnt seem to have anything for a single player, so I used a one player list :P
|
||||
effect.send(onePlayer, loc, 0, 0, 0, 0, 1, 50);
|
||||
|
||||
this.effect.display(0, 0, 0, 0, 3, loc, player);
|
||||
|
||||
|
||||
} else {
|
||||
int typeId = blockY % 5 == 0 ? Material.REDSTONE_LAMP_ON.getId() : Material.STAINED_GLASS.getId();
|
||||
VisualizeUtil.addLocation(player, loc, typeId);
|
||||
@@ -132,6 +137,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.GENERIC_PLACEHOLDER;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.*;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.P;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import com.massivecraft.factions.zcore.util.TagReplacer;
|
||||
import com.massivecraft.factions.zcore.util.TagUtil;
|
||||
import mkremins.fanciful.FancyMessage;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -19,7 +19,6 @@ public class CmdShow extends FCommand {
|
||||
public CmdShow() {
|
||||
this.aliases.add("show");
|
||||
this.aliases.add("who");
|
||||
this.aliases.add("f");
|
||||
|
||||
// add defaults to /f show in case config doesnt have it
|
||||
defaults.add("{header}");
|
||||
@@ -48,7 +47,6 @@ public class CmdShow extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
Faction faction = myFaction;
|
||||
|
||||
if (this.argIsSet(0)) {
|
||||
faction = this.argAsFaction(0);
|
||||
}
|
||||
@@ -56,11 +54,6 @@ public class CmdShow extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fme.hasFaction() && fme.getFaction() == faction){
|
||||
fme.msg(TL.COMMAND_SHOW_NEEDFACTION);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fme != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")
|
||||
&& P.p.getConfig().getStringList("show-exempt").contains(faction.getTag())) {
|
||||
msg(TL.COMMAND_SHOW_EXEMPT);
|
||||
@@ -76,65 +69,6 @@ public class CmdShow extends FCommand {
|
||||
if (show == null || show.isEmpty()) {
|
||||
show = defaults;
|
||||
}
|
||||
/* for (int i = 0; i <= show.size()-1; i ++){
|
||||
if (show.get(i).contains("{description}")){
|
||||
show.set(i,show.get(i).replace("{description}",faction.getDescription()));
|
||||
}
|
||||
if (show.get(i).contains("{online-list}")){
|
||||
String message = "";
|
||||
StringBuilder string = new StringBuilder(message);
|
||||
for (FPlayer fPlayer : faction.getFPlayers()){
|
||||
Bukkit.broadcastMessage(fPlayer.getTag());
|
||||
if (fPlayer.getPlayer().isOnline()){
|
||||
String prefix = "";
|
||||
if (fPlayer.getRole() == Role.ADMIN){
|
||||
prefix = Conf.prefixAdmin;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.COLEADER){
|
||||
prefix = Conf.prefixCoLeader;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.MODERATOR){
|
||||
prefix = Conf.prefixMod;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.NORMAL){
|
||||
prefix = Conf.prefixNormal;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.RECRUIT){
|
||||
prefix = Conf.prefixRecruit;
|
||||
}
|
||||
string.append(prefix + fPlayer.getName() + ",");
|
||||
}
|
||||
if (string.toString().equals("")) { continue; }
|
||||
show.set(i,show.get(i).replace("{online-list}",string.toString()));
|
||||
}
|
||||
}
|
||||
if (show.get(i).contains("{offline-list}")){
|
||||
String message = "";
|
||||
StringBuilder string = new StringBuilder(message);
|
||||
for (FPlayer fPlayer : faction.getFPlayers()){
|
||||
if (!fPlayer.getPlayer().isOnline()){
|
||||
String prefix = "";
|
||||
if (fPlayer.getRole() == Role.ADMIN){
|
||||
prefix = Conf.prefixAdmin;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.COLEADER){
|
||||
prefix = Conf.prefixCoLeader;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.MODERATOR){
|
||||
prefix = Conf.prefixMod;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.NORMAL){
|
||||
prefix = Conf.prefixNormal;
|
||||
}
|
||||
if (fPlayer.getRole() == Role.RECRUIT){
|
||||
prefix = Conf.prefixRecruit;
|
||||
}
|
||||
string.append(prefix + fPlayer.getName() + ",");
|
||||
}
|
||||
show.set(i,show.get(i).replace("{offline-list}",string.toString()));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (!faction.isNormal()) {
|
||||
String tag = faction.getTag(fme);
|
||||
@@ -154,9 +88,11 @@ public class CmdShow extends FCommand {
|
||||
continue; // Due to minimal f show.
|
||||
}
|
||||
|
||||
parsed = TagUtil.parsePlaceholders(fme.getPlayer(), parsed);
|
||||
if (fme != null) {
|
||||
parsed = TagUtil.parsePlaceholders(fme.getPlayer(), parsed);
|
||||
}
|
||||
|
||||
if (TagUtil.hasFancy(parsed)) {
|
||||
if (fme != null && TagUtil.hasFancy(parsed)) {
|
||||
List<FancyMessage> fancy = TagUtil.parseFancy(faction, fme, parsed);
|
||||
if (fancy != null) {
|
||||
sendFancyMessage(fancy);
|
||||
|
||||
Reference in New Issue
Block a user