CryptoMorin / XSeries

Library for cross-version Minecraft Bukkit support and various efficient API methods.
https://www.spigotmc.org/threads/378136/
MIT License
403 stars 126 forks source link

XBlock - setDirection places ladders backwards on old versions #192

Closed datatags closed 2 years ago

datatags commented 2 years ago

Description When using XBlock.setDirection on ladders on 1.8.8, the direction given is flipped. XBlock.setDirection(ladder, BlockFace.EAST); will place a west-facing ladder. To be clear, a west-facing ladder is one that is attached to the west side of another block, and says facing: west when looking at it with the debug screen open.

Small reproducible example:

@EventHandler
public void onClick(PlayerInteractEvent event) {
    if (event.getAction() != Action.RIGHT_CLICK_BLOCK || !event.getPlayer().isSneaking()) return;
    XBlock.setDirection(event.getClickedBlock(), BlockFace.EAST);
}

Holding sneak and right-clicking on a ladder in 1.8.8 will result in the ladder facing to the west. Holding sneak and right-clicking in 1.19.2 will result in the ladder facing east.

Version I'm using git-Spigot-21fe707-741a1bd (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT) for my 1.8.8 test server and git-Paper-235 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 1c1aeb2)

CryptoMorin commented 2 years ago

Does this happen to other blocks like stairs?

datatags commented 2 years ago

It doesn't look like it, I also tried with torches and they both point the correct direction.

datatags commented 2 years ago

Hey, any update on this? Do I have to just work around it?

CryptoMorin commented 2 years ago

Looks like this is an intended bug. So one way I can fix it is to simply flip the facing if the block is a ladder. I'm not sure why they're having issues with stairs tho. It's working fine for me.

This was fixed in ea3736f, but I'm not in a situation to publish it as a standalone version.