Closed ShinyDialga closed 9 years ago
Does this let you draw a bow while looking at a fence?
You will continue interacting with the fence like it did before, it just won't let you right click it so that your bow will still be drawn. So no, when you right click a fence your bow won't draw to both the server and your client.
Just added a commit to add food, and checked it using instanceof instead of using Item[]. In case my last comments weren't clear, I'm sharing this information I learned. When leashes were added, they allowed the interaction of fences so that you can add leashes to them. By making them interactable, the client cannot see what changes when they right click a fence. For example, when you draw your bow while right clicking a fence, all you see is an interaction between the fence, while the server thinks you are charging up a bow. This code attempts to fix that by cancelling the interaction before it occurs if the item will cause any glitches.
How well is this tested? I'm down to merge it.
I tested this with me and @Electroid and found no issues, but feel free to test it to make sure there are none. There were 6 possible outcomes, and they were when you right click a fence with nothing, a leash, or a separate item, and the same things while a leash was attached to your character. They all matched vanilla 1.7.10 behavior, and I found no other bugs. If you'd like to try it out, go ahead.
Doesn't appear to be an issue anymore as of 1.8, closing this PR.
Currently, there is a bug where if you right click a fence with a certain item it glitches. This due to the fact leashes allow the player to interact with fences, even though they don't need to hold a leash. This patch fixes it by checking their held item, and if it is one that causes a glitch, then end it there instead of going on to start the glitch. It also checks if the player has a leash attached to them to make sure that it won't cancel the leash being attached when they interact a fence. I had good results after testing this several times on my local, but feel free to test it out to find any potential bugs that could arise from this. While testing, I attempted to re-create 1.7.10 behavior, and it seems to be functioning properly so far. Thanks.