Skip to content

Commit

Permalink
Merge pull request #38 from Grzybol/zephyr-patches3
Browse files Browse the repository at this point in the history
- final fix I hope
  • Loading branch information
Grzybol authored Apr 5, 2024
2 parents f44c941 + 1db4aad commit dcd1f80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>betterbox.mine.game</groupId>
<artifactId>BetterElo</artifactId>
<version>4.0.7-SNAPSHOT</version>
<version>4.0.8-SNAPSHOT</version>
<packaging>jar</packaging>

<name>BetterElo</name>
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/betterbox/mine/game/betterelo/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {

}
pluginLogger.log(PluginLogger.LogLevel.ZEPHYR, "Event.checking canUseZephyr");
if(canUseZephyr(player) && event.getAction() != Action.RIGHT_CLICK_AIR) {
if(canUseZephyr(player) && event.getAction() == Action.RIGHT_CLICK_AIR) {
pluginLogger.log(PluginLogger.LogLevel.ZEPHYR, "Event.canUseZephyr passed");
hasZephyrLore(player);

Expand Down Expand Up @@ -666,11 +666,14 @@ public boolean hasZephyrLore(Player player) {
return false;
}
private boolean canUseZephyr(Player player) {
pluginLogger.log(PluginLogger.LogLevel.ZEPHYR,"Event.canUseZephyr called");
if (!lastZephyrUsage.containsKey(player)) {
pluginLogger.log(PluginLogger.LogLevel.ZEPHYR,"Event.canUseZephyr PLAYER NOT LISTED");
return true; // Gracz jeszcze nie używał fajerwerka
}
long lastUsage = lastZephyrUsage.get(player);
long currentTime = System.currentTimeMillis();
pluginLogger.log(PluginLogger.LogLevel.ZEPHYR,"Event.canUseZephyr lastUsage: "+lastUsage+" currentTime: "+currentTime);
return (currentTime - lastUsage) >= configManager.fireworkCooldown;
}
public boolean hasAntywebLore(ItemStack itemStack) {
Expand Down

0 comments on commit dcd1f80

Please sign in to comment.