-
Notifications
You must be signed in to change notification settings - Fork 91
Destroyed blocks not getting "break block" status #260
Comments
Could this be causing the block lag we've been having in 1.3 and hmod135? Been thinking it's a MC issue, but apparently it's no longer present in a recent Bukkit version, so it can be fixed. Basically, while mining, blocks constantly pop back randomly, making it take about twice the amount of time to mine. |
jeb_ redid digging in 1.3 to prevent intstant mining IIRC (I remember being pointed to his twitter). In decompiled code, status 1 was removed, but 3 is still there, which has lead me to believe nothing much has changed. I haven't done proper research when updating the code, so errors could've slipped into it. |
yah, I noticed that status 1 was removed. My tests were only showing status 0 and 2 being sent. There can be more statuses, but I wasn't seeing them when breaking basic blocks. Looking at bukkit's NetServerHandler.java, they handle their "block broken" (3) status by getting the amount of damage from the block (using OBlock's a(OEntityPlayer) method) and on status 0 they check if the damage is 1 or greater. If the damage is 1 or more, then they send out the "block broken" status, otherwise, they send the "started digging" status. Status 2 in my not so thorough tests were being sent on block breaks, but not for blocks such as redstone dust or the new redstone diodes. So my previous suggestion of plugins updating to use status 2 was wrong. This looks like something hMod needs to probably update. I don't know if this issue is related to liquidox's mention of block lag, but it is the cause of Craftbook's apple drop feature from not working. |
So going back to the previous minecraft server 1.2x and testing, I was getting: and now it's: So in ONetServerHandler.java And after line# 293, it is recommended to add: This recommendation isn't necessary as plug-ins obviously haven't needed it so far, but it would set the correct internal state. Also, it would be nice if we could use the proper status number 2 as the new block break status, since that's what it is now, but it's better for plug-ins that the internal status as 3 is kept since that's how it is defined in hMod |
In ONetServerHandler.java
The value of "paramOPacket14BlockDig.e" appears to never be "3" anymore when destroying a block.
This causes "block.setStatus(3);" on line# 312 to never be reached, where the block status of 3 is supposed to be the "broken block" state.
I could be wrong, but in my tests the OPacket14BlockDig class was no longer getting the "3" value for variable e, suggesting block break status has changed in minecraft.
If true, hMod will need to be updated to trigger the BLOCK_DESTROYED hook with the set block status of 3 at the appropriate time, or plugins that use the Block getStatus() value will need to be updated to use the "stopped digging" status (2) instead.
The text was updated successfully, but these errors were encountered: