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:
Naman
2018-03-30 21:22:06 -05:00
parent cdf870b782
commit e14af238bf
14 changed files with 691 additions and 123 deletions

View File

@@ -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);