Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7315

Bed placement duplicates crops if cancelled

XMLWordPrintable

    • This server is running CraftBukkit version 3697-Spigot-6ad4b93-9381350 (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT)
    • Yes

      Simple listener for reproduction:

      @EventHandler(ignoreCancelled = true)
      private void onMultiPlace(@NotNull BlockMultiPlaceEvent event) {
        event.setCancelled(true);
      } 
      1. Create an enclosed farming plot to block sky light - underground, in a house, etc.
      2. Plant crops
      3. Remove all light sources
      4. Attempt to place a bed adjacent to a crop
      5. Cancel BlockMultiPlaceEvent

      The crops drop items as if broken in addition to being restored to their previous unbroken state.

      Tried to play around with it to see where the issue was. The adjacent crop blocks are already Material.AIR and the corresponding ItemSpawnEvent has been fired by the time the BlockMultiPlaceEvent is fired. The blocks are then reset to crops after the event has been completed and cancelled. Other multi-block items do not appear to be affected, only beds. The crops themselves do not seem to be affected by physics - crops adjacent to the affected one are not affected.

      This has apparently been around since 1.16 at least:

      https://github.com/TechFortress/GriefPrevention/issues/2027

      https://github.com/BG-Software-LLC/SuperiorSkyblock2/issues/1600

      https://www.spigotmc.org/resources/beddupefix.105189/

            DerFrZocker Marvin Rieple
            Jikoo Jikoo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: