mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-14 12:57:55 +00:00
Merge remote-tracking branch 'refs/remotes/ProjectKorra/master'
This commit is contained in:
commit
b790ddf98d
6 changed files with 28 additions and 6 deletions
|
@ -150,7 +150,7 @@ public class GeneralMethods {
|
|||
public static Material[] interactable = { Material.ACACIA_DOOR, Material.ACACIA_FENCE_GATE, Material.ANVIL, Material.ARMOR_STAND, Material.BEACON, Material.BED, Material.BED_BLOCK, Material.BIRCH_DOOR, Material.BIRCH_FENCE_GATE, Material.BOAT, Material.BREWING_STAND, Material.BURNING_FURNACE, Material.CAKE_BLOCK, Material.CHEST, Material.COMMAND, Material.DARK_OAK_DOOR, Material.DARK_OAK_FENCE_GATE, Material.DISPENSER, Material.DRAGON_EGG, Material.DROPPER, Material.ENCHANTMENT_TABLE, Material.ENDER_CHEST, Material.ENDER_PORTAL_FRAME, Material.FENCE_GATE, Material.FURNACE, Material.HOPPER, Material.HOPPER_MINECART, Material.COMMAND_MINECART, Material.ITEM_FRAME, Material.JUKEBOX, Material.JUNGLE_DOOR, Material.JUNGLE_FENCE_GATE, Material.LEVER, Material.MINECART, Material.NOTE_BLOCK, Material.PAINTING, Material.SPRUCE_DOOR, Material.SPRUCE_FENCE_GATE, Material.STONE_BUTTON, Material.TRAPPED_CHEST, Material.TRAP_DOOR, Material.WOOD_BUTTON, Material.WOOD_DOOR, Material.WORKBENCH };
|
||||
|
||||
// Stands for toggled = false while logging out
|
||||
public static List<UUID> toggedOut = new ArrayList<UUID>();
|
||||
public static List<UUID> toggledOut = new ArrayList<UUID>();
|
||||
|
||||
public GeneralMethods(ProjectKorra plugin) {
|
||||
GeneralMethods.plugin = plugin;
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ public class PKListener implements Listener {
|
|||
return;
|
||||
}
|
||||
|
||||
if (GeneralMethods.toggedOut.contains(player.getUniqueId())) {
|
||||
if (GeneralMethods.toggledOut.contains(player.getUniqueId())) {
|
||||
GeneralMethods.getBendingPlayer(player.getName()).toggleBending();
|
||||
player.sendMessage(ChatColor.YELLOW + "Reminder, you toggled your bending before signing off. Enable it again with /bending toggle.");
|
||||
}
|
||||
|
@ -1078,10 +1078,10 @@ public class PKListener implements Listener {
|
|||
Player player = event.getPlayer();
|
||||
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());
|
||||
if (bPlayer != null) {
|
||||
if (GeneralMethods.toggedOut.contains(player.getUniqueId()) && bPlayer.isToggled())
|
||||
GeneralMethods.toggedOut.remove(player.getUniqueId());
|
||||
if (GeneralMethods.toggledOut.contains(player.getUniqueId()) && bPlayer.isToggled())
|
||||
GeneralMethods.toggledOut.remove(player.getUniqueId());
|
||||
if (!bPlayer.isToggled())
|
||||
GeneralMethods.toggedOut.add(player.getUniqueId());
|
||||
GeneralMethods.toggledOut.add(player.getUniqueId());
|
||||
}
|
||||
|
||||
if (Commands.invincible.contains(event.getPlayer().getName())) {
|
||||
|
|
|
@ -91,6 +91,10 @@ public class ChiCombo {
|
|||
if (paralyzedEntities.get(e) <= System.currentTimeMillis()) {
|
||||
paralyzedEntities.remove(e);
|
||||
for (ChiCombo c : instances) {
|
||||
if (e == null || c.target == null) {
|
||||
instances.remove(c);
|
||||
continue;
|
||||
}
|
||||
if (c.target.equals(e))
|
||||
instances.remove(c);
|
||||
}
|
||||
|
|
|
@ -144,6 +144,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 (location != null && !player.getWorld().equals(location.getWorld())) {
|
||||
remove();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GeneralMethods.getBoundAbility(player) == null) {
|
||||
remove();
|
||||
return false;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue