Slimefun

Slimefun

3M Downloads

The block placer wrongly place some blocks

andris155 opened this issue ยท 8 comments

commented

Description (REQUIRED)

The block placer wrongly place some blocks

The block placer place one block the from two block height plant.
2020-08-21_15 40 47

The block placer place one block the from two block long bed.
2020-08-21_15 29 00

The block placer able to place lily pad to grass and all block to air.
2020-08-21_15 32 11
2020-08-21_15 35 29
2020-08-21_15 35 44
2020-08-21_15 37 24

The block placer place one block the from two block height doors.
2020-08-21_15 38 41

The block placer able to place mushrooms without dark.
2020-08-21_15 41 41

The block placer able to place dead bush to grass.
2020-08-21_15 43 13

Steps to reproduce the Issue (REQUIRED)

  1. Place specific blocks with Block Placer

Expected behavior (REQUIRED)

The block placer follows the vanilla Minecraft block place rules.

Server Log

Error Reports

Environment (REQUIRED)

  • Server Software (Spigot/Paper): Paper
  • Minecraft Version: 1.16.2
  • Slimefun Version: Slimefun vDEV - 635 (git 6be0709)
  • CS-CoreLib Version: vDEV - 90 (git 9dd4a1cf)
commented

Welcome to MC. There's some things here which can be "fixed" by updating the block, it will just make the block break itself.

These multi-block things aren't something that can be handled on a high level. We'd need to literally make special cases for all of this

commented

Usage of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/BlockPlaceEvent.html in blockPlace method in BlockPlacer.java will possibly fix this.

commented

No, absolutely not.

commented

Then we could force a block update in placeBlock method after placing this way it'd just function as a normal dispenser(kind of).

commented

Placing a block already causes a block update, causing another one would most likely just make the block realize it's in an invalid state and pop off. It would also effectively double the performance impact.

commented

Placing a block already causes a block update, causing another one would most likely just make the block realize it's in an invalid state and pop off. It would also effectively double the performance impact.

Yes it does normally but Block.setType() doesn't. For the block update it must be explicitly called.

I mean if it caused a block update then why the blocks don't pop off already?

commented

.setType() does explicitly cause a block update on all surrounding blocks.

commented

https://www.spigotmc.org/threads/best-way-for-block-update.238421/#post-2399377
.setType() only causes a block update if true is passed to it.