Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upBow and arrow fixes #1098
Conversation
Howaner
added some commits
Jun 16, 2014
Howaner
changed the title from
Bow changes
to
Bow
Jun 16, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
archshift
Jun 16, 2014
Contributor
Please, some description! What does your PR add? You should have a descriptive title and comment that explains what you actually did.
|
Please, some description! What does your PR add? You should have a descriptive title and comment that explains what you actually did. |
archshift
changed the title from
Bow
to
Bow and arrow fixes
Jun 17, 2014
Howaner
added some commits
Jun 17, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Changed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
madmaxoft
Jun 17, 2014
Member
I still don't understand why you're checking the m_PickupState for the arrow. It's already been checked by CanPickup, and there ARE arrows that can be picked even in creative. Vanilla doesn't create them, but obeys them when created using NBT editors.
|
I still don't understand why you're checking the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Howaner
Jun 17, 2014
Contributor
Only creative player can pickup arrows from other creative players.
But the arrow wouldn't add to the inventory.
Vanilla:
https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/EntityArrow.java#L372
|
Only creative player can pickup arrows from other creative players. Vanilla: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
madmaxoft
Jun 17, 2014
Member
You shouldn't check the m_PickupState then, but the player instead, if they are in Creative. And add a comment along those lines to the source.
|
You shouldn't check the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Howaner
added some commits
Jun 26, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
done |
madmaxoft
merged commit bf32298
into
cuberite:master
Jun 26, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
madmaxoft
Jun 26, 2014
Member
I merged the code, but I had to remove the BroadcastCollectPickup() call. It expects a cPickup, you can't simply cast a cArrowEntity to a cPickup. The code compiles, but it will crash.
In order to implement proper collection broadcast, you will need to change the BroadcastCollectPickup function: Rename it to BroadcastCollectEntity, make it take a cEntity & and the protocol will have to see what packet to send, based on the entity type (pickup / arrow / XP orb (?) / ...), if it even needs to distinguish between those. If not, even better, we can make "collectible creepers" :)
|
I merged the code, but I had to remove the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tigerw
Jun 26, 2014
Member
But the arrow collection animation was working fine before with that call.
|
But the arrow collection animation was working fine before with that call. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
madmaxoft
Jun 26, 2014
Member
That's just a coincidence that it worked for you, the C++ standard says it's an undefined behavior, so the program was allowed to start a nuclear war and it'd still be correct.
|
That's just a coincidence that it worked for you, the C++ standard says it's an undefined behavior, so the program was allowed to start a nuclear war and it'd still be correct. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@tigerw working is a valid value of anything can happen. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tigerw
Jun 26, 2014
Member
Ah. I've always wondered about undefined behaviour and the law.
If the program, through undefined behaviour, commits a crime (blackmailing your neighbour's cat, for example), who is responsible? The standard makers? The compiler programmers? The programmer? The program as a legal entity? Is it a grey area?
If there is no punishment, who gives the authority for the program to do what it likes?
|
Ah. I've always wondered about undefined behaviour and the law. If the program, through undefined behaviour, commits a crime (blackmailing your neighbour's cat, for example), who is responsible? The standard makers? The compiler programmers? The programmer? The program as a legal entity? Is it a grey area? If there is no punishment, who gives the authority for the program to do what it likes? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
worktycho
Jun 26, 2014
Member
@tigerw probably the company/organisation responsible for creating the program. See the Toyota case. However it is a bit of a grey area as there haven't been many cases of programs committing crimes through failure.
|
@tigerw probably the company/organisation responsible for creating the program. See the Toyota case. However it is a bit of a grey area as there haven't been many cases of programs committing crimes through failure. |
Howaner commentedJun 16, 2014