Paper icon indicating copy to clipboard operation
Paper copied to clipboard

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

Open GrainsofSalt opened this issue 4 years ago • 10 comments

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)

GrainsofSalt avatar Dec 19 '21 20:12 GrainsofSalt

Can you show the Redstone contraption? I am able to reproduce this issue for all Redstone like components, except for Redstone wire itself.

Owen1212055 avatar Dec 27 '21 02:12 Owen1212055

Yes, will you be available around 9:30pm est tonight?

On Sun, Dec 26, 2021, 9:13 PM Owen1212055 @.***> wrote:

Can you show the Redstone contraption? I am able to reproduce this for all but Redstone dust.. which seems to get broken naturally just fine.

— Reply to this email directly, view it on GitHub https://github.com/PaperMC/Paper/issues/7147#issuecomment-1001292769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZ5B2ROLFRQINYEVLEA5ULUS7DVDANCNFSM5KMIOCPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

GrainsofSalt avatar Dec 27 '21 17:12 GrainsofSalt

Just post a video here so we can all see it

Chew avatar Dec 27 '21 17:12 Chew

Its literally as soon as any redstone wire is powered... I can still post a video, but if any redstone is powered and this is in any active event listener:

@EventHandler public void testMethod(BlockRedstoneEvent event) { event.getBlock().breakNaturally(); }

... The redstone wire will explode into a bunch of stacks.

GrainsofSalt avatar Dec 28 '21 23:12 GrainsofSalt

I followed the steps, I would really appreciate a video. :)

The redstone wire would break and would be fine.

Owen1212055 avatar Dec 28 '21 23:12 Owen1212055

Fwiw I reproduced it a few days ago already, but it also seems like it wouldn't be 100% unexpected getting into a loop there by breaking the redstone in a redstone update event

kennytv avatar Dec 28 '21 23:12 kennytv

As stated previously, this doesn't happen when using spigot 1.17.1 instead of paper

GrainsofSalt avatar Dec 28 '21 23:12 GrainsofSalt

https://user-images.githubusercontent.com/20173034/147615049-15346210-5d4c-4457-a59c-312dc45d148c.mp4

GrainsofSalt avatar Dec 28 '21 23:12 GrainsofSalt

Fwiw I reproduced it a few days ago already, but it also seems like it wouldn't be 100% unexpected getting into a loop there by breaking the redstone in a redstone update event

It wouldn't be bad if it was a single time and duplicated once, but many stacks are made every time this happens

GrainsofSalt avatar Dec 29 '21 00:12 GrainsofSalt

Ah, my bad, I was testing on 1.18 (in which it's fixed, I guess) https://user-images.githubusercontent.com/23108066/147616564-f3818cd0-5457-4608-905e-f12000716e3c.mp4

I can confirm the issue here.

Owen1212055 avatar Dec 29 '21 00:12 Owen1212055