BlockRedstoneEvent not called for fence gates
Closed this issue · 2 comments
This bugreport is essentially a duplicate of https://hub.spigotmc.org/jira/browse/SPIGOT-5606, but my report is being ghosted there, so I thought maybe you guys can fix the issue in Paper at least.
This bug affects the current latest version of Paper, and probably many versions before.
/version
output:
[19:13:37 INFO]: Checking version, please wait...
[19:13:37 INFO]: Previous version: git-Paper-3dafa6a0 (MC: 1.15.2)
[19:13:37 INFO]: You are running the latest version
The bug is that BlockRedstoneEvent is not called when fence gates receive redstone updates. This goes against the expection of plugin developers, because the same event does get called for doors.
Steps to reproduce:
package com.example;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockRedstoneEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class TestPlugin extends JavaPlugin implements Listener {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onBlockRedstoneEvent(BlockRedstoneEvent event) {
getLogger().info(event.getBlock().getType().name());
}
}
- Check the logs and verify that the event is not called for the OAK_FENCE_GATE material.
You linked some PR in that SpigotMC issue ticket, is that some actual fix? Do you intend to port that to Paper? I don't have an account on the SpigotMC Stash and I can't be bothered to create one, that's why I'm asking.
The PR there is a fix for the issue yes. I ported some code from the BlockDoor patch to the BlockFenceGate patch. I didn't have time to PR it here yet but could probably do so in an hour once I'm familiar with generating patches for paper and your style guide. I thought it'd be quicker to just have one of you guys fix it since it's quite trivial. I'll start working on a PR now.