mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 12:49:32 +00:00
Change bloodbending method, Add zach to staff list, misc
- Changed bloodbending method isBloodbended to isBloodbent - Added zach to the staff list - Changed ClickType: (UNTESTED) - Added JUMP, MOVE_FORWARD, MOVE_BACKWARDS, MOVE_LEFT, MOVE_RIGHT, CUSTOM, RIGHT_CLICK_BLOCK, RIGHT_CLICK_ENTITY - Removed SHIFT and CLICK - Removed unnecessary methods in BendingManager - Removed unnecessary defaults from ConfigManager
This commit is contained in:
parent
b439c84056
commit
793ef9b3d6
|
@ -113,14 +113,6 @@ public class BendingManager implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
public static String getSozinsCometMessage() {
|
||||
return getConfig().getString("Properties.Fire.CometMessage");
|
||||
}
|
||||
|
||||
public static String getSolarEclipseMessage() {
|
||||
return getConfig().getString("Properties.Fire.SolarEclipseMessage");
|
||||
}
|
||||
|
||||
public static String getSunriseMessage() {
|
||||
return getConfig().getString("Properties.Fire.DayMessage");
|
||||
}
|
||||
|
@ -133,14 +125,6 @@ public class BendingManager implements Runnable {
|
|||
return getConfig().getString("Properties.Water.NightMessage");
|
||||
}
|
||||
|
||||
public static String getFullMoonriseMessage() {
|
||||
return getConfig().getString("Properties.Water.FullMoonMessage");
|
||||
}
|
||||
|
||||
public static String getLunarEclipseMessage() {
|
||||
return getConfig().getString("Properties.Water.LunarEclipseMessage");
|
||||
}
|
||||
|
||||
public static String getMoonsetMessage() {
|
||||
return getConfig().getString("Properties.Water.DayMessage");
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ public class BendingPlayer {
|
|||
cooldowns.remove(name);
|
||||
}
|
||||
|
||||
if (isChiBlocked() || isParalyzed() || isBloodbended() || isControlledByMetalClips()) {
|
||||
if (isChiBlocked() || isParalyzed() || isBloodbent() || isControlledByMetalClips()) {
|
||||
return false;
|
||||
} else if (GeneralMethods.isRegionProtectedFromBuild(player, ability.getName(), playerLoc)) {
|
||||
return false;
|
||||
|
@ -212,7 +212,7 @@ public class BendingPlayer {
|
|||
return false;
|
||||
} else if (!isToggled() || !hasElement(element) || !isElementToggled(element)) {
|
||||
return false;
|
||||
} else if (isChiBlocked() || isParalyzed() || isBloodbended()) {
|
||||
} else if (isChiBlocked() || isParalyzed() || isBloodbent()) {
|
||||
return false;
|
||||
} else if (GeneralMethods.isRegionProtectedFromBuild(player, player.getLocation())) {
|
||||
return false;
|
||||
|
@ -464,8 +464,8 @@ public class BendingPlayer {
|
|||
return CoreAbility.hasAbility(player, AvatarState.class);
|
||||
}
|
||||
|
||||
public boolean isBloodbended() {
|
||||
return Bloodbending.isBloodbended(player);
|
||||
public boolean isBloodbent() {
|
||||
return Bloodbending.isBloodbent(player);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -137,6 +137,7 @@ import org.bukkit.event.inventory.InventoryType.SlotType;
|
|||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.event.player.PlayerGameModeChangeEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerKickEvent;
|
||||
|
@ -369,7 +370,7 @@ public class PKListener implements Listener {
|
|||
return;
|
||||
}
|
||||
Player player = event.getPlayer();
|
||||
if (Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player) || Bloodbending.isBloodbended(player) || Suffocate.isBreathbent(player)) {
|
||||
if (Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player) || Bloodbending.isBloodbent(player) || Suffocate.isBreathbent(player)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -411,7 +412,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity) || Suffocate.isBreathbent(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity) || Suffocate.isBreathbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
@ -550,7 +551,7 @@ public class PKListener implements Listener {
|
|||
|
||||
Entity entity = event.getEntity();
|
||||
if (entity != null) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity) || Suffocate.isBreathbent(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity) || Suffocate.isBreathbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -563,7 +564,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity) || Suffocate.isBreathbent(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity) || Suffocate.isBreathbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -575,7 +576,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity) || Suffocate.isBreathbent(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity) || Suffocate.isBreathbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -587,7 +588,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity) || Suffocate.isBreathbent(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity) || Suffocate.isBreathbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -599,7 +600,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity) || Suffocate.isBreathbent(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity) || Suffocate.isBreathbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -624,7 +625,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -636,7 +637,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -648,7 +649,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbended(entity) || Suffocate.isBreathbent(entity)) {
|
||||
if (Paralyze.isParalyzed(entity) || ChiCombo.isParalyzed(entity) || Bloodbending.isBloodbent(entity) || Suffocate.isBreathbent(entity)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -1038,12 +1039,32 @@ public class PKListener implements Listener {
|
|||
}
|
||||
}.runTaskLater(plugin, 5);
|
||||
|
||||
ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK);
|
||||
if (event.getClickedBlock() != null) {
|
||||
ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK_BLOCK);
|
||||
} else {
|
||||
ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK);
|
||||
}
|
||||
|
||||
if (bPlayer.getBoundAbilityName().equalsIgnoreCase("EarthSmash")) {
|
||||
new EarthSmash(player, ClickType.RIGHT_CLICK);
|
||||
}
|
||||
}
|
||||
if (Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player) || Bloodbending.isBloodbended(player) || Suffocate.isBreathbent(player)) {
|
||||
if (Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player) || Bloodbending.isBloodbent(player) || Suffocate.isBreathbent(player)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK_ENTITY);
|
||||
|
||||
if (Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player) || Bloodbending.isBloodbent(player) || Suffocate.isBreathbent(player)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -1074,12 +1095,12 @@ public class PKListener implements Listener {
|
|||
return;
|
||||
}
|
||||
|
||||
if (ChiCombo.isParalyzed(player)) {
|
||||
else if (ChiCombo.isParalyzed(player)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (CoreAbility.hasAbility(player, WaterSpout.class)
|
||||
else if (CoreAbility.hasAbility(player, WaterSpout.class)
|
||||
|| CoreAbility.hasAbility(player, AirSpout.class)
|
||||
|| CoreAbility.hasAbility(player, SandSpout.class)) {
|
||||
Vector vel = new Vector();
|
||||
|
@ -1098,7 +1119,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
}
|
||||
|
||||
if (Bloodbending.isBloodbended(player)) {
|
||||
else if (Bloodbending.isBloodbent(player)) {
|
||||
double distance1, distance2;
|
||||
Location loc = Bloodbending.getBloodbendingLocation(player);
|
||||
distance1 = event.getFrom().distance(loc);
|
||||
|
@ -1108,7 +1129,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
}
|
||||
|
||||
if (AirFlight.isFlying(event.getPlayer())) {
|
||||
else if (AirFlight.isFlying(event.getPlayer())) {
|
||||
if (AirFlight.isHovering(event.getPlayer())) {
|
||||
Location loc = event.getFrom();
|
||||
Location toLoc = player.getLocation();
|
||||
|
@ -1119,6 +1140,39 @@ public class PKListener implements Listener {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
Location from = event.getFrom();
|
||||
Location to = event.getTo();
|
||||
|
||||
if (from.getBlock() == to.getBlock() && (from.getBlock() != null && to.getBlock() != null)) return;
|
||||
|
||||
if (from.getBlockY() < to.getBlockY()) {// Jump
|
||||
ComboManager.addComboAbility(player, ClickType.JUMP);
|
||||
return;
|
||||
}
|
||||
|
||||
Vector toRight = GeneralMethods.getDirection(player.getLocation(), GeneralMethods.getRightSide(player.getLocation(), 1));
|
||||
Vector toLeft = GeneralMethods.getDirection(player.getLocation(), GeneralMethods.getLeftSide(player.getLocation(), 1));
|
||||
Location loc = player.getLocation();
|
||||
loc.setYaw(0);
|
||||
loc.setPitch(0);
|
||||
Vector forwards = loc.getDirection().normalize();
|
||||
Vector backwards = forwards.multiply(-1);
|
||||
Vector current = player.getLocation().toVector().normalize();
|
||||
|
||||
if (current.distance(forwards) < 0.5 && current.distance(forwards) > -0.5) {
|
||||
ComboManager.addComboAbility(player, ClickType.MOVE_FORWARDS);
|
||||
} else if (current.distance(backwards) < 0.5 && current.distance(backwards) > -0.5) {
|
||||
ComboManager.addComboAbility(player, ClickType.MOVE_BACKWARDS);
|
||||
} else if (current.distance(toLeft) < 0.5 && current.distance(toLeft) > -0.5) {
|
||||
ComboManager.addComboAbility(player, ClickType.MOVE_LEFT);
|
||||
} else if (current.distance(toRight) < 0.5 && current.distance(toRight) > -0.5) {
|
||||
ComboManager.addComboAbility(player, ClickType.MOVE_RIGHT);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -1199,7 +1253,7 @@ public class PKListener implements Listener {
|
|||
}
|
||||
}
|
||||
|
||||
if (Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player) || Bloodbending.isBloodbended(player)) {
|
||||
if (Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player) || Bloodbending.isBloodbent(player)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -1395,7 +1449,7 @@ public class PKListener implements Listener {
|
|||
if (Suffocate.isBreathbent(player)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
} else if (Bloodbending.isBloodbended(player) || Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player)) {
|
||||
} else if (Bloodbending.isBloodbent(player) || Paralyze.isParalyzed(player) || ChiCombo.isParalyzed(player)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
} else if (bPlayer.isChiBlocked()) {
|
||||
|
@ -1628,7 +1682,7 @@ public class PKListener implements Listener {
|
|||
|
||||
Player player = event.getPlayer();
|
||||
if (CoreAbility.hasAbility(player, Tornado.class)
|
||||
|| Bloodbending.isBloodbended(player)
|
||||
|| Bloodbending.isBloodbent(player)
|
||||
|| Suffocate.isBreathbent(player)
|
||||
|| CoreAbility.hasAbility(player, FireJet.class)
|
||||
|| CoreAbility.hasAbility(player, AvatarState.class)) {
|
||||
|
|
|
@ -56,6 +56,7 @@ public class WhoCommand extends PKCommand {
|
|||
//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("3c484e61-7876-46c0-98c9-88c7834dc96c", ChatColor.GREEN + "ProjectKorra Concept Designer"); //SamuraiSnowman (Zmeduna)
|
||||
|
||||
staff.put("3d5bc713-ab8b-4125-b5ba-a1c1c2400b2c", ChatColor.GOLD + "ProjectKorra Community Moderator"); // Gold
|
||||
|
||||
|
|
|
@ -184,8 +184,6 @@ public class ConfigManager {
|
|||
config.addDefault("Properties.Water.PlaySound", true);
|
||||
config.addDefault("Properties.Water.NightMessage", "You feel the strength of the rising moon empowering your waterbending.");
|
||||
config.addDefault("Properties.Water.DayMessage", "You feel the empowering of your waterbending subside as the moon sets.");
|
||||
config.addDefault("Properties.Water.LunarEclipseMessage", "A lunar eclipse is out! Waterbendings are temporarily powerless.");
|
||||
config.addDefault("Properties.Water.FullMoonMessage", "A full moon is rising, empowering your waterbending like never before.");
|
||||
|
||||
config.addDefault("Properties.Earth.RevertEarthbending", true);
|
||||
config.addDefault("Properties.Earth.SafeRevert", true);
|
||||
|
@ -202,8 +200,6 @@ public class ConfigManager {
|
|||
config.addDefault("Properties.Fire.PlaySound", true);
|
||||
config.addDefault("Properties.Fire.NightMessage", "You feel the empowering of your firebending subside as the sun sets.");
|
||||
config.addDefault("Properties.Fire.DayMessage", "You feel the strength of the rising sun empowering your firebending.");
|
||||
config.addDefault("Properties.Fire.SolarEclipseMessage", "A solar eclipse is out! Firebenders are temporarily powerless.");
|
||||
config.addDefault("Properties.Fire.CometMessage", "Sozin's Comet is passing overhead! Firebending is now at its most powerful.");
|
||||
config.addDefault("Properties.Fire.FireGriefing", false);
|
||||
config.addDefault("Properties.Fire.RevertTicks", 12000L);
|
||||
|
||||
|
|
|
@ -2,20 +2,54 @@ package com.projectkorra.projectkorra.util;
|
|||
|
||||
/**
|
||||
* An enum representation of the ways in which an ability can be activated.
|
||||
*
|
||||
* @author kingbirdy
|
||||
*/
|
||||
public enum ClickType {
|
||||
SHIFT,
|
||||
/**
|
||||
* The shift key being released
|
||||
* Use this to call your own click type.
|
||||
*/
|
||||
CUSTOM,
|
||||
/**
|
||||
* The player has jumped
|
||||
*/
|
||||
JUMP,
|
||||
/**
|
||||
* Player has swung their arm.
|
||||
*/
|
||||
LEFT_CLICK,
|
||||
/**
|
||||
* The player has moved backwards
|
||||
*/
|
||||
MOVE_BACKWARDS,
|
||||
/**
|
||||
* The player has moved forwards
|
||||
*/
|
||||
MOVE_FORWARDS,
|
||||
/**
|
||||
* The player has moved left
|
||||
*/
|
||||
MOVE_LEFT,
|
||||
/**
|
||||
* The player has moved right
|
||||
*/
|
||||
MOVE_RIGHT,
|
||||
/**
|
||||
* For any instance of right clicking that isn't with an entity or a block (Right clicking air will not work).
|
||||
*/
|
||||
RIGHT_CLICK,
|
||||
/**
|
||||
* Specifically for right clicking an entity.
|
||||
*/
|
||||
RIGHT_CLICK_ENTITY,
|
||||
/**
|
||||
* Specifically for right clicking a block.
|
||||
*/
|
||||
RIGHT_CLICK_BLOCK,
|
||||
/**
|
||||
* The shift key being released.
|
||||
*/
|
||||
SHIFT_DOWN,
|
||||
/**
|
||||
* The shift key being pressed
|
||||
* The shift key being pressed.
|
||||
*/
|
||||
SHIFT_UP,
|
||||
CLICK,
|
||||
LEFT_CLICK,
|
||||
RIGHT_CLICK
|
||||
SHIFT_UP;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class Flight {
|
|||
if (airScooterPlayers.contains(player) || waterSpoutPlayers.contains(player) || airSpoutPlayers.contains(player) || sandSpoutPlayers.contains(player)) {
|
||||
continue;
|
||||
}
|
||||
if (Bloodbending.isBloodbended(player)) {
|
||||
if (Bloodbending.isBloodbent(player)) {
|
||||
player.setAllowFlight(true);
|
||||
player.setFlying(false);
|
||||
continue;
|
||||
|
|
|
@ -278,7 +278,7 @@ public class Bloodbending extends BloodAbility {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isBloodbended(Entity entity) {
|
||||
public static boolean isBloodbent(Entity entity) {
|
||||
return entity != null ? TARGETED_ENTITIES.containsKey(entity) : null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue