Skip to content

Commit

Permalink
Send AcknowledgeBlockChangePacket on block placement
Browse files Browse the repository at this point in the history
Signed-off-by: TheMode <themode@outlook.fr>
  • Loading branch information
TheMode committed Aug 25, 2022
1 parent 85c5190 commit c2db82a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import net.minestom.server.item.ItemStack;
import net.minestom.server.item.Material;
import net.minestom.server.network.packet.client.play.ClientPlayerBlockPlacementPacket;
import net.minestom.server.network.packet.server.play.AcknowledgeBlockChangePacket;
import net.minestom.server.network.packet.server.play.BlockChangePacket;
import net.minestom.server.utils.chunk.ChunkUtils;
import net.minestom.server.utils.validate.Check;
Expand Down Expand Up @@ -139,6 +140,7 @@ public static void listener(ClientPlayerBlockPlacementPacket packet, Player play
return;
}
// Place the block
player.sendPacket(new AcknowledgeBlockChangePacket(packet.sequence()));
instance.placeBlock(new BlockHandler.PlayerPlacement(resultBlock, instance, placementPosition, player, hand, blockFace,
packet.cursorPositionX(), packet.cursorPositionY(), packet.cursorPositionZ()));
// Block consuming
Expand Down

0 comments on commit c2db82a

Please sign in to comment.