Skip to content

Commit

Permalink
Merge pull request #53 from josemmo/develop
Browse files Browse the repository at this point in the history
v1.2.5
  • Loading branch information
josemmo authored Aug 16, 2022
2 parents 0d35c48 + e973a06 commit 0abaec8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 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>io.josemmo.bukkit.plugin</groupId>
<artifactId>YamipaPlugin</artifactId>
<version>1.2.4</version>
<version>1.2.5</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.comphenix.protocol.events.PacketListener;
import com.comphenix.protocol.wrappers.EnumWrappers;
import io.josemmo.bukkit.plugin.YamipaPlugin;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -87,13 +86,9 @@ public final void onPacketReceiving(@NotNull PacketEvent event) {
boolean allowEvent = true;
try {
if (action == EnumWrappers.EntityUseAction.ATTACK) {
allowEvent = Bukkit.getScheduler()
.callSyncMethod(getPlugin(), () -> onAttack(player, targetBlock, targetBlockFace))
.get();
allowEvent = onAttack(player, targetBlock, targetBlockFace);
} else if (action == EnumWrappers.EntityUseAction.INTERACT_AT) {
allowEvent = Bukkit.getScheduler()
.callSyncMethod(getPlugin(), () -> onInteract(player, targetBlock, targetBlockFace))
.get();
allowEvent = onInteract(player, targetBlock, targetBlockFace);
}
} catch (Exception e) {
YamipaPlugin.getInstance().log(Level.SEVERE, "Failed to notify entity listener handler", e);
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/io/josemmo/bukkit/plugin/utils/SelectBlockTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.event.player.PlayerAnimationType;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -143,18 +141,6 @@ public void onBlockInteraction(@NotNull PlayerInteractEvent event) {
}
}

@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onArmSwing(@NotNull PlayerAnimationEvent event) {
if (event.getAnimationType() != PlayerAnimationType.ARM_SWING) {
// Sanity check, vanilla Minecraft does not have any other player animation type
return;
}
boolean allowEvent = handle(event.getPlayer(), null, null);
if (!allowEvent) {
event.setCancelled(true);
}
}

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerQuit(@NotNull PlayerQuitEvent event) {
UUID uuid = event.getPlayer().getUniqueId();
Expand Down

0 comments on commit 0abaec8

Please sign in to comment.