retrooper / packetevents

Precision meets performance—a powerful tool for mastering Minecraft packet manipulation with speed and finesse.
GNU General Public License v3.0
564 stars 152 forks source link

Powered Rail States are Modeled Incorrectly on 1.8 Servers #1013

Closed Axionize closed 2 months ago

Axionize commented 2 months ago

Describe the bug The blockstates of golden/powered rails when they are in the on/powered state are modeled incorrectly. Ascending golden/powered rails that are activated/on/powered always have their shape returned as "NORTH_SOUTH" regardless of the direction they face.

In addition, east-west rails are modeled as north-east, north-south rails are modeled as north-west, etc... all obviously impossible states.

Software brand PandaSpigot 1.8.8,

Plugins GrimAC, LuckPerms, ViaVeresion

How To Reproduce Steps to reproduce the behavior:

  1. Join with the 1.8.9 vanilla Minecraft client.
  2. Place powered rail down and power it.
  3. Get it's blockstate. If you don't have an easy means of doing this you can test my new check being added to GrimAC https://github.com/Axionize/Grim/tree/los-containers. Once you've built and installed the plugin, run /grim verbose and breakpoint
    RAILS((player, item, version, data, x, y, z) -> {
    ----->        switch (data.getShape()) {

    in HitBox.java then right click on a rail to see the wrong blockstate being returned.

Expected behavior Should return the correct blockstate. I assume you're extracting blockstates for rails with some bit manipulation, and you probably forgot to account for powered rails when they're powered on properly.

Screenshots 2024-09-28_18 09 36 Screenshot_20240928_180929

ManInMyVan commented 2 months ago

l'll fix it