Skip to content

Commit

Permalink
Fixed #9
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimordialMoros committed Dec 5, 2022
1 parent 71334ea commit 995fd08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "me.moros"
version = "1.7.0"
version = "1.7.1"

java {
toolchain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public enum Side {RIGHT, LEFT}
private LivingEntity grabbedTarget;
private Vector lastVelocity;
private Item glove;
private Side side;

@Attribute(Attribute.DAMAGE)
private double damage;
Expand All @@ -80,7 +79,6 @@ public EarthGlove(Player player) {

if (launchEarthGlove()) {
start();
bPlayer.addCooldown(getCooldownForSide(side), cooldown);
}
}

Expand Down Expand Up @@ -141,11 +139,12 @@ public void progress() {

private boolean launchEarthGlove() {
final Location gloveSpawnLocation;
side = lastUsedSide.get(player.getUniqueId());
Side side = lastUsedSide.get(player.getUniqueId());
if (side != null && bPlayer.isOnCooldown(getCooldownForSide(side))) {
return false;
}
side = lastUsedSide.computeIfPresent(player.getUniqueId(), (u, s) -> side == Side.LEFT ? Side.RIGHT : Side.LEFT);
side = lastUsedSide.compute(player.getUniqueId(), (u, s) -> (s == null || s == Side.LEFT) ? Side.RIGHT : Side.LEFT);
bPlayer.addCooldown(getCooldownForSide(side), cooldown);
if (side == Side.RIGHT) {
gloveSpawnLocation = GeneralMethods.getRightSide(player.getLocation(), 0.5).add(0, 0.8, 0);
} else {
Expand Down

0 comments on commit 995fd08

Please sign in to comment.