mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-20 07:02:32 +01:00
Fix rebase
This commit is contained in:
parent
63004cf4ba
commit
a70fe174bf
@ -3,8 +3,6 @@ package net.minestom.server.event.player;
|
||||
import net.minestom.server.entity.Player;
|
||||
import net.minestom.server.event.trait.CancellableEvent;
|
||||
import net.minestom.server.event.trait.PlayerEvent;
|
||||
import net.minestom.server.event.CancellableEvent;
|
||||
import net.minestom.server.event.PlayerEvent;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
import net.minestom.server.utils.BlockPosition;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -1,9 +1,6 @@
|
||||
package net.minestom.server.event.player;
|
||||
|
||||
import net.minestom.server.entity.Player;
|
||||
import net.minestom.server.event.CancellableEvent;
|
||||
import net.minestom.server.event.PlayerEvent;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
import net.minestom.server.event.trait.CancellableEvent;
|
||||
import net.minestom.server.event.trait.PlayerEvent;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
@ -31,7 +28,7 @@ public class PlayerBlockInteractEvent implements PlayerEvent, CancellableEvent {
|
||||
|
||||
private boolean cancelled;
|
||||
|
||||
public PlayerBlockInteractEvent(@NotNull Player player,@NotNull Player.Hand hand,
|
||||
public PlayerBlockInteractEvent(@NotNull Player player, @NotNull Player.Hand hand,
|
||||
@NotNull Block block, @NotNull BlockPosition blockPosition,
|
||||
@NotNull BlockFace blockFace) {
|
||||
this.player = player;
|
||||
|
@ -16,8 +16,6 @@ import net.minestom.server.event.EventCallback;
|
||||
import net.minestom.server.event.EventDispatcher;
|
||||
import net.minestom.server.event.EventFilter;
|
||||
import net.minestom.server.event.EventNode;
|
||||
import net.minestom.server.event.InstanceEvent;
|
||||
import net.minestom.server.event.handler.EventHandler;
|
||||
import net.minestom.server.event.instance.AddEntityToInstanceEvent;
|
||||
import net.minestom.server.event.instance.InstanceTickEvent;
|
||||
import net.minestom.server.event.instance.RemoveEntityFromInstanceEvent;
|
||||
@ -45,6 +43,8 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minestom.server.event.handler.EventHandler;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Consumer;
|
||||
|
@ -275,7 +275,7 @@ public class InstanceContainer extends Instance {
|
||||
}
|
||||
|
||||
PlayerBlockBreakEvent blockBreakEvent = new PlayerBlockBreakEvent(player, block, Block.AIR, blockPosition);
|
||||
EventDispatcher.call(PlayerBlockBreakEvent.class, blockBreakEvent);
|
||||
EventDispatcher.call(blockBreakEvent);
|
||||
final boolean allowed = !blockBreakEvent.isCancelled();
|
||||
if (allowed) {
|
||||
// Break or change the broken block based on event result
|
||||
|
@ -54,7 +54,7 @@ public class BlockPlacementListener {
|
||||
// Interact at block
|
||||
// FIXME: onUseOnBlock
|
||||
PlayerBlockInteractEvent playerBlockInteractEvent = new PlayerBlockInteractEvent(player, hand, interactedBlock, blockPosition, blockFace);
|
||||
player.callEvent(PlayerBlockInteractEvent.class, playerBlockInteractEvent);
|
||||
EventDispatcher.call(playerBlockInteractEvent);
|
||||
if (playerBlockInteractEvent.isBlockingItemUse()) {
|
||||
return;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class PlayerDiggingListener {
|
||||
breakBlock(instance, player, blockPosition, block, status);
|
||||
} else {
|
||||
PlayerStartDiggingEvent playerStartDiggingEvent = new PlayerStartDiggingEvent(player, block, blockPosition);
|
||||
EventDispatcher.call(PlayerStartDiggingEvent.class, playerStartDiggingEvent);
|
||||
EventDispatcher.call(playerStartDiggingEvent);
|
||||
|
||||
if (playerStartDiggingEvent.isCancelled()) {
|
||||
addEffect(player);
|
||||
|
Loading…
Reference in New Issue
Block a user