Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import org.jetbrains.annotations.Nullable;

/**
* Called when a block is ignited. If you want to catch when a Player places
* fire, you need to use {@link BlockPlaceEvent}.
* Called when a block is ignited.
* <p>
* If this event is cancelled, the block will not be ignited.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
*/
public class BlockMultiPlaceEvent extends BlockPlaceEvent {

private final List<BlockState> states;
private final List<BlockState> replacedStates;

@ApiStatus.Internal
@Deprecated(forRemoval = true)
public BlockMultiPlaceEvent(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) {
this(states, clicked, itemInHand, thePlayer, canBuild, org.bukkit.inventory.EquipmentSlot.HAND);
public BlockMultiPlaceEvent(@NotNull List<BlockState> replacedStates, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) {
this(replacedStates, clicked, itemInHand, thePlayer, canBuild, org.bukkit.inventory.EquipmentSlot.HAND);
}

@ApiStatus.Internal
public BlockMultiPlaceEvent(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild, @NotNull org.bukkit.inventory.EquipmentSlot hand) {
super(states.get(0).getBlock(), states.get(0), clicked, itemInHand, thePlayer, canBuild, hand);
this.states = ImmutableList.copyOf(states);
public BlockMultiPlaceEvent(@NotNull List<BlockState> replacedStates, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild, @NotNull org.bukkit.inventory.EquipmentSlot hand) {
super(replacedStates.getFirst().getBlock(), replacedStates.getFirst(), clicked, itemInHand, thePlayer, canBuild, hand);
this.replacedStates = ImmutableList.copyOf(replacedStates);
}

/**
Expand All @@ -41,6 +41,6 @@ public BlockMultiPlaceEvent(@NotNull List<BlockState> states, @NotNull Block cli
*/
@NotNull
public List<BlockState> getReplacedBlockStates() {
return this.states;
return this.replacedStates;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
protected Block placedAgainst;
protected ItemStack itemInHand;
protected Player player;
protected BlockState replacedBlockState;
protected BlockState replacedState;
protected boolean canBuild;
protected EquipmentSlot hand;

protected boolean cancelled;

@ApiStatus.Internal
@Deprecated(since = "1.9", forRemoval = true)
public BlockPlaceEvent(@NotNull final Block placedBlock, @NotNull final BlockState replacedBlockState, @NotNull final Block placedAgainst, @NotNull final ItemStack itemInHand, @NotNull final Player thePlayer, final boolean canBuild) {
this(placedBlock, replacedBlockState, placedAgainst, itemInHand, thePlayer, canBuild, EquipmentSlot.HAND);
public BlockPlaceEvent(@NotNull final Block placedBlock, @NotNull final BlockState replacedState, @NotNull final Block placedAgainst, @NotNull final ItemStack itemInHand, @NotNull final Player thePlayer, final boolean canBuild) {
this(placedBlock, replacedState, placedAgainst, itemInHand, thePlayer, canBuild, EquipmentSlot.HAND);
}

@ApiStatus.Internal
public BlockPlaceEvent(@NotNull final Block placedBlock, @NotNull final BlockState replacedBlockState, @NotNull final Block placedAgainst, @NotNull final ItemStack itemInHand, @NotNull final Player thePlayer, final boolean canBuild, @NotNull final EquipmentSlot hand) {
public BlockPlaceEvent(@NotNull final Block placedBlock, @NotNull final BlockState replacedState, @NotNull final Block placedAgainst, @NotNull final ItemStack itemInHand, @NotNull final Player thePlayer, final boolean canBuild, @NotNull final EquipmentSlot hand) {
super(placedBlock);
this.placedAgainst = placedAgainst;
this.itemInHand = itemInHand;
this.player = thePlayer;
this.replacedBlockState = replacedBlockState;
this.replacedState = replacedState;
this.canBuild = canBuild;
this.hand = hand;
}
Expand Down Expand Up @@ -95,7 +95,7 @@ public Block getBlockPlaced() {
*/
@NotNull
public BlockState getBlockReplacedState() {
return this.replacedBlockState;
return this.replacedState;
}

/**
Expand Down
Loading
Loading