mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Merge remote-tracking branch 'refs/remotes/ProjectKorra/master'
This commit is contained in:
commit
d84b0977ff
9 changed files with 75 additions and 38 deletions
|
@ -1147,6 +1147,8 @@ public class GeneralMethods {
|
|||
for (Entity entity : entities) {
|
||||
if (entity.getWorld() != location.getWorld()) {
|
||||
list.remove(entity);
|
||||
} else if (entity instanceof Player && ((Player) entity).getGameMode().equals(GameMode.SPECTATOR)) {
|
||||
list.remove(entity);
|
||||
} else if (entity.getLocation().distance(location) > radius) {
|
||||
list.remove(entity);
|
||||
}
|
||||
|
|
|
@ -109,12 +109,12 @@ public class BendingTabComplete implements TabCompleter {
|
|||
}
|
||||
List<String> abils = new ArrayList<String>();
|
||||
for (String abil : AbilityModuleManager.abilities) {
|
||||
if (GeneralMethods.canBend(sender.getName(), abil)) {
|
||||
if (GeneralMethods.canBind(sender.getName(), abil)) {
|
||||
abils.add(abil);
|
||||
}
|
||||
}
|
||||
for (ComboAbilityModule abil : ComboModuleManager.combo) {
|
||||
if (GeneralMethods.canBend(sender.getName(), abil.getName())) {
|
||||
if (GeneralMethods.canBind(sender.getName(), abil.getName())) {
|
||||
abils.add(abil.getName());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,15 +55,15 @@ public class WhoCommand extends PKCommand {
|
|||
staff.put("dedf335b-d282-47ab-8ffc-a80121661cd1", ChatColor.DARK_PURPLE + "ProjectKorra Developer"); // grasshopperMatt
|
||||
|
||||
staff.put("623df34e-9cd4-438d-b07c-1905e1fc46b6", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Loony
|
||||
staff.put("80f9072f-e37e-4adc-8675-1ba6af87d63b", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Cross
|
||||
staff.put("57205eec-96bd-4aa3-b73f-c6627429beb2", ChatColor.GREEN + "ProjectKorra Concept Designer"); // ashe36
|
||||
staff.put("7daead36-d285-4640-848a-2f105334b792", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Fuzzy
|
||||
staff.put("f30c871e-cd60-446b-b219-e31e00e16857", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Gangksta
|
||||
staff.put("38217173-8a32-4ba7-9fe1-dd4fed031a74", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Fly
|
||||
//staff.put("80f9072f-e37e-4adc-8675-1ba6af87d63b", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Cross
|
||||
//staff.put("57205eec-96bd-4aa3-b73f-c6627429beb2", ChatColor.GREEN + "ProjectKorra Concept Designer"); // ashe36
|
||||
//staff.put("7daead36-d285-4640-848a-2f105334b792", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Fuzzy
|
||||
//staff.put("f30c871e-cd60-446b-b219-e31e00e16857", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Gangksta
|
||||
staff.put("38217173-8a32-4ba7-9fe1-dd4fed031a74", ChatColor.GREEN + "ProjectKorra Concept Designer"); // Easte
|
||||
|
||||
staff.put("3d5bc713-ab8b-4125-b5ba-a1c1c2400b2c", ChatColor.GOLD + "ProjectKorra Community Moderator"); // Gold
|
||||
|
||||
staff.put("2ab334d1-9691-4994-a624-209c7b4f220b", ChatColor.BLUE + "ProjectKorra Digital Team"); // Austygen
|
||||
//staff.put("2ab334d1-9691-4994-a624-209c7b4f220b", ChatColor.BLUE + "ProjectKorra Digital Team"); // Austygen
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -76,34 +76,51 @@ public class WhoCommand extends PKCommand {
|
|||
List<String> players = new ArrayList<String>();
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
String playerName = player.getName();
|
||||
|
||||
String result = "";
|
||||
BendingPlayer bp = GeneralMethods.getBendingPlayer(playerName);
|
||||
if (bp == null) {
|
||||
GeneralMethods.createBendingPlayer(player.getUniqueId(), player.getName());
|
||||
bp = GeneralMethods.getBendingPlayer(player.getName());
|
||||
}
|
||||
if (bp.getElements().size() > 1) {
|
||||
players.add(GeneralMethods.getAvatarColor() + playerName);
|
||||
continue;
|
||||
} else if (bp.getElements().size() == 0) {
|
||||
players.add(playerName);
|
||||
continue;
|
||||
} else if (GeneralMethods.isBender(playerName, Element.Air)) {
|
||||
players.add(AirMethods.getAirColor() + playerName);
|
||||
continue;
|
||||
} else if (GeneralMethods.isBender(playerName, Element.Water)) {
|
||||
players.add(WaterMethods.getWaterColor() + playerName);
|
||||
continue;
|
||||
} else if (GeneralMethods.isBender(playerName, Element.Earth)) {
|
||||
players.add(EarthMethods.getEarthColor() + playerName);
|
||||
continue;
|
||||
} else if (GeneralMethods.isBender(playerName, Element.Chi)) {
|
||||
players.add(ChiMethods.getChiColor() + playerName);
|
||||
continue;
|
||||
} else if (GeneralMethods.isBender(playerName, Element.Fire)) {
|
||||
players.add(FireMethods.getFireColor() + playerName);
|
||||
continue;
|
||||
if (bp.hasElement(Element.Air)) {
|
||||
result = ChatColor.WHITE + playerName + " - " + ((!bp.isElementToggled(Element.Air) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&7&mA") : AirMethods.getAirColor() + "A");
|
||||
}
|
||||
if (bp.hasElement(Element.Earth)) {
|
||||
if (result == "") {
|
||||
result = ChatColor.WHITE + playerName + " - " + ((!bp.isElementToggled(Element.Earth) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&a&mE") : EarthMethods.getEarthColor() + "E");
|
||||
} else {
|
||||
result = result + ChatColor.WHITE + " | " + ((!bp.isElementToggled(Element.Earth) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&a&mE") : EarthMethods.getEarthColor() + "E");
|
||||
}
|
||||
}
|
||||
if (bp.hasElement(Element.Fire)) {
|
||||
if (result == "") {
|
||||
result = ChatColor.WHITE + playerName + " - " + ((!bp.isElementToggled(Element.Fire) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&c&mF") : FireMethods.getFireColor() + "F");
|
||||
} else {
|
||||
result = result + ChatColor.WHITE + " | " + ((!bp.isElementToggled(Element.Fire) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&c&mF") : FireMethods.getFireColor() + "F");
|
||||
}
|
||||
}
|
||||
if (bp.hasElement(Element.Water)) {
|
||||
if (result == "") {
|
||||
result = ChatColor.WHITE + playerName + " - " + ((!bp.isElementToggled(Element.Water) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&b&mW") : WaterMethods.getWaterColor() + "W");
|
||||
} else {
|
||||
result = result + ChatColor.WHITE + " | " + ((!bp.isElementToggled(Element.Water) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&b&mW") : WaterMethods.getWaterColor() + "W");
|
||||
}
|
||||
}
|
||||
if (bp.hasElement(Element.Chi)) {
|
||||
if (result == "") {
|
||||
result = ChatColor.WHITE + playerName + " - " + ((!bp.isElementToggled(Element.Chi) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&6&mC") : ChiMethods.getChiColor() + "C");
|
||||
} else {
|
||||
result = result + ChatColor.WHITE + " | " + ((!bp.isElementToggled(Element.Chi) || !bp.isToggled()) ? ChatColor.translateAlternateColorCodes('&', "&6&mC") : ChiMethods.getChiColor() + "C");
|
||||
}
|
||||
}
|
||||
if (staff.containsKey(player.getUniqueId().toString())) {
|
||||
if (result == "") {
|
||||
result = ChatColor.WHITE + playerName + staff.get(player.getUniqueId().toString());
|
||||
} else {
|
||||
result = result + ChatColor.WHITE + " | " + staff.get(player.getUniqueId().toString());
|
||||
}
|
||||
}
|
||||
players.add(result);
|
||||
}
|
||||
if (players.isEmpty()) {
|
||||
sender.sendMessage(ChatColor.RED + "There is no one online.");
|
||||
|
|
|
@ -146,6 +146,10 @@ public class FireBurst implements ConfigLoadable {
|
|||
}
|
||||
|
||||
public boolean progress() {
|
||||
if (player.isDead() || !player.isOnline()) {
|
||||
remove();
|
||||
return false;
|
||||
}
|
||||
if (!GeneralMethods.canBend(player.getName(), "FireBurst")) {
|
||||
remove();
|
||||
return false;
|
||||
|
|
|
@ -261,6 +261,16 @@ public class Fireball implements ConfigLoadable {
|
|||
}
|
||||
|
||||
public boolean progress() {
|
||||
if (player.isDead() || !player.isOnline()) {
|
||||
remove();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!player.getWorld().equals(location.getWorld())) {
|
||||
remove();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GeneralMethods.getBoundAbility(player) == null) {
|
||||
remove();
|
||||
return false;
|
||||
|
|
|
@ -102,7 +102,11 @@ public class HorizontalVelocityTracker {
|
|||
|
||||
public static void updateAll() {
|
||||
for (Entity e : instances.keySet())
|
||||
instances.get(e).update();
|
||||
if (e != null) {
|
||||
instances.get(e).update();
|
||||
} else {
|
||||
instances.remove(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.w3c.dom.NodeList;
|
|||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.UnknownHostException;
|
||||
|
@ -57,8 +58,9 @@ public class Updater {
|
|||
url = new URL(URL);
|
||||
urlc = url.openConnection();
|
||||
urlc.setRequestProperty("User-Agent", ""); // Must be used or face 403
|
||||
urlc.setConnectTimeout(30000); // 30 second time out, throws SocketTimeoutException
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(urlc.getInputStream());
|
||||
} catch (UnknownHostException e) {
|
||||
} catch (UnknownHostException | SocketTimeoutException e) {
|
||||
plugin.getLogger().info("Could not connect to ProjectKorra.com to check for updates");
|
||||
} catch (IOException | SAXException | ParserConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -225,7 +225,7 @@ public class Bloodbending {
|
|||
targetentities.remove(entity);
|
||||
continue;
|
||||
}
|
||||
Location location = GeneralMethods.getTargetedLocation(player, 6);
|
||||
Location location = GeneralMethods.getTargetedLocation(player, 6, 0, 6, 8, 9, 10, 11, 27, 28, 30, 31, 32, 37, 38, 39, 40, 50, 51, 55, 59, 63, 64, 65, 66, 68, 69, 70, 71, 72, 75, 76, 77, 78, 83, 93, 94, 104, 105, 111, 115, 117, 132, 141, 142, 143, 147, 148, 149, 150, 157, 175, 176, 177, 183, 184, 185, 187, 193, 194, 195, 196, 197);
|
||||
double distance = location.distance(newlocation);
|
||||
double dx, dy, dz;
|
||||
dx = location.getX() - newlocation.getX();
|
||||
|
|
|
@ -21,10 +21,12 @@ permissions:
|
|||
bending.command.rechoose: true
|
||||
bending.admin.choose: true
|
||||
bending.ability.AvatarState: true
|
||||
bending.water.Bloodbending.anytime: true
|
||||
bending.water.bloodbending.anytime: true
|
||||
bending.water.bloodbending: true
|
||||
bending.ability.Flight: true
|
||||
bending.ability.MetalClips.loot: true
|
||||
bending.ability.MetalClips.4clips: true
|
||||
bending.ability.MetalClips.throw: true
|
||||
bending.command.import: true
|
||||
bending.command.toggle.all: true
|
||||
bending.admin.toggle: true
|
||||
|
@ -96,7 +98,6 @@ permissions:
|
|||
bending.ability.PlantArmor: true
|
||||
bending.water.plantbending: true
|
||||
bending.message.nightmessage: true
|
||||
bending.water.bloodbending: false
|
||||
bending.water.passive: true
|
||||
bending.water.icebending: true
|
||||
bending.water.healing: true
|
||||
|
@ -124,9 +125,6 @@ permissions:
|
|||
bending.ability.Tremorsense: true
|
||||
bending.ability.Extraction: true
|
||||
bending.ability.MetalClips: true
|
||||
bending.ability.MetalClips.loot: false
|
||||
bending.ability.MetalClips.4clips: false
|
||||
bending.ability.MetalClips.throw: false
|
||||
bending.earth.passive: true
|
||||
bending.earth.metalbending: true
|
||||
bending.earth.lavabending: true
|
||||
|
|
Loading…
Reference in a new issue