Fast 1.9 fixes, still a lot todo!

This commit is contained in:
Rammelkast committed 2016-05-25 21:14:16 +02:00
1 parent 6881456954
commit ff66b70bac
1 file changed
+4 -2
@@ -197,6 +197,7 @@ public class PlayerListener extends EventListener {
Player player = event.getPlayer(); Player player = event.getPlayer();
PlayerInventory inv = player.getInventory(); PlayerInventory inv = player.getInventory();
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) { if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
// TODO: offhand (1.9)
Material m = inv.getItemInHand().getType(); Material m = inv.getItemInHand().getType();
if (m == Material.BOW) { if (m == Material.BOW) {
getBackend().logBowWindUp(player); getBackend().logBowWindUp(player);
@@ -313,7 +314,7 @@ public class PlayerListener extends EventListener {
log(result.getMessage(), player, CheckType.SPRINT); log(result.getMessage(), player, CheckType.SPRINT);
} }
} }
if (getCheckManager().willCheckQuick(player, CheckType.FLY) && !player.isFlying()) { if (getCheckManager().willCheckQuick(player, CheckType.FLY) && !player.isFlying() && !player.isGliding() /*TODO: ElytraFly check, this is a quick workaround */) {
CheckResult result = getBackend().checkFlight(player, distance); CheckResult result = getBackend().checkFlight(player, distance);
if (result.failed()) { if (result.failed()) {
if (!silentMode()) { if (!silentMode()) {
@@ -343,7 +344,7 @@ public class PlayerListener extends EventListener {
if (result.failed()) { if (result.failed()) {
if (!silentMode()) { if (!silentMode()) {
event.setTo(user.getGoodLocation(from.clone())); event.setTo(user.getGoodLocation(from.clone()));
player.damage(1); // I added this in here so the player would still receive damage. /*TODO: player.damage(1); better system for this, too exploitable*/
} }
log(result.getMessage(), player, CheckType.NOFALL); log(result.getMessage(), player, CheckType.NOFALL);
} }
@@ -382,6 +383,7 @@ public class PlayerListener extends EventListener {
changed = true; changed = true;
} }
} }
TODO
*/ */
} }
if (getCheckManager().willCheckQuick(player, CheckType.WATER_WALK)) { if (getCheckManager().willCheckQuick(player, CheckType.WATER_WALK)) {