Fix rebase

This commit is contained in:
TheMode 2021-06-14 15:26:16 +02:00
parent 63004cf4ba
commit a70fe174bf
6 changed files with 6 additions and 11 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;
}

View File

@ -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);