PaperMC / PaperMC/Paper

BlockRedstoneEvent Being Fired on Redstone Dust AFTER Broken? (Dup Glitch)

Open
#7,147 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: accepted type: bug version: 1.17
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

Block should break yielding one redstone dust. Redstone should not continue to exist such that breakNaturally() can successfully be called again. NOT an with spigot-1.17.1, ONLY in paper-1.17.1

Observed/Actual behavior

Redstone dust continues to exist after breakNaturally() allowing BlockRedstoneEvent to fire on a block that shouldn't exist. This cause a repeated duplication of any redstone dust that didn't breakNaturally() the first time until it is successfully removed from the world.

Steps/models to reproduce
  1. Set up a fast redstone clock
  2. In BlockRedstoneEvent, call event.getBlock().breakNaturally();
  3. Start the clock
  4. Watch the redstone dust explosion
Plugin and Datapack List

None except 1 custom plugin with code described in reproduction

Code in listener:

@EventHandler
public void redstoneSignal(BlockRedstoneEvent event) 
{
	event.getBlock().breakNaturally();
}
Paper version

1.17.1

Other

Here is the exception generated by paper:

    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1.execute(Unknown Source)
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69)
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628)
    at net.minecraft.world.level.block.BlockRedstoneWire.a(BlockRedstoneWire.java:383)
    at net.minecraft.world.level.block.BlockRedstoneWire.updateSurroundingRedstone(BlockRedstoneWire.java:275)
    at net.minecraft.world.level.block.BlockRedstoneWire.doPhysics(BlockRedstoneWire.java:530)
    at net.minecraft.world.level.block.state.BlockBase$BlockData.doPhysics(BlockBase.java:875)
    at net.minecraft.world.level.World.a(World.java:816)
    at net.minecraft.world.level.World.applyPhysics(World.java:768)
    at net.minecraft.world.level.block.BlockRedstoneWire.remove(BlockRedstoneWire.java:492)
    at net.minecraft.world.level.block.state.BlockBase$BlockData.remove(BlockBase.java:913)
    at org.bukkit.craftbukkit.v1_17_R1.block.CraftBlock.breakNaturally(CraftBlock.java:519)
    at org.bukkit.craftbukkit.v1_17_R1.block.CraftBlock.breakNaturally(CraftBlock.java:493)
    at org.bukkit.craftbukkit.v1_17_R1.block.CraftBlock.breakNaturally(CraftBlock.java:487)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack-trace entry points in BlockRedstoneWire and CraftBlock.breakNaturally, then reproduce the issue using the fast redstone clock and listener code from the report. Trace why the redstone block remains after breakNaturally() during BlockRedstoneEvent handling. Done means the block is removed once, no further event fires for it, and the reported duplication no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.