mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 01:47:54 +01:00
Merge remote-tracking branch 'upstream/master' into extension-exposing
This commit is contained in:
commit
d1e0247754
@ -3,6 +3,7 @@ package net.minestom.server.listener;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.data.Data;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.EntityType;
|
||||
import net.minestom.server.entity.GameMode;
|
||||
import net.minestom.server.entity.Player;
|
||||
import net.minestom.server.event.player.PlayerBlockInteractEvent;
|
||||
@ -122,9 +123,11 @@ public class BlockPlacementListener {
|
||||
// Check if the player is trying to place a block in an entity
|
||||
boolean intersect = player.getBoundingBox().intersect(blockPosition);
|
||||
if (!intersect && block.isSolid()) {
|
||||
// TODO push entities too close to the position
|
||||
for (Entity entity : entities) {
|
||||
// 'player' has already been checked
|
||||
if (entity == player)
|
||||
if (entity == player ||
|
||||
entity.getEntityType() == EntityType.ITEM)
|
||||
continue;
|
||||
|
||||
intersect = entity.getBoundingBox().intersect(blockPosition);
|
||||
|
@ -302,6 +302,17 @@ public final class ConnectionManager {
|
||||
this.playerInitializations.add(playerInitialization);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an existing player initialization consumer.
|
||||
* <p>
|
||||
* Removal of player initializations should be done by reference, and not cloning.
|
||||
*
|
||||
* @param playerInitialization the {@link Player} initialization consumer
|
||||
*/
|
||||
public void removePlayerInitialization(@NotNull Consumer<Player> playerInitialization) {
|
||||
this.playerInitializations.remove(playerInitialization);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the kick reason when the server is shutdown using {@link MinecraftServer#stopCleanly()}.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user