Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
Added a workaround to the fact that Minecraft no longer sends a block dig packet for bedrock.
Dieser Commit ist enthalten in:
Ursprung
92e5d80c90
Commit
2ccbcacfc2
@ -26,6 +26,9 @@ import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerItemEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
import com.sk89q.worldedit.LocalPlayer;
|
||||
import com.sk89q.worldedit.WorldVector;
|
||||
import com.sk89q.worldedit.blocks.BlockID;
|
||||
|
||||
/**
|
||||
* Handles all events thrown in relation to a Player
|
||||
@ -43,8 +46,18 @@ public class WorldEditPlayerListener extends PlayerListener {
|
||||
*/
|
||||
@Override
|
||||
public void onPlayerAnimation(PlayerAnimationEvent event) {
|
||||
LocalPlayer localPlayer = wrapPlayer(event.getPlayer());
|
||||
|
||||
if (event.getAnimationType() == PlayerAnimationType.ARM_SWING) {
|
||||
plugin.controller.handleArmSwing(wrapPlayer(event.getPlayer()));
|
||||
plugin.controller.handleArmSwing(localPlayer);
|
||||
}
|
||||
|
||||
// As of Minecraft 1.3, a block dig packet is no longer sent for
|
||||
// bedrock, so we have to do an (inaccurate) detection ourself
|
||||
WorldVector pt = localPlayer.getBlockTrace(5);
|
||||
if (pt != null && pt.getWorld().getBlockType(pt) == BlockID.BEDROCK) {
|
||||
if (plugin.controller.handleBlockLeftClick(localPlayer, pt)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren