-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add off hand support for Armor stands #520
Conversation
also add equipment sounds closes GlowstoneMC#471
some javadocs fix implementation of setArmorContents
implemented the HandItems, ArmorItems
@@ -1,13 +1,20 @@ | |||
package net.glowstone.entity.objects; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace! ;)
// Deprecated since 15w31a, left here for compatibilty for now | ||
if (compound.isList("Equipment", TagType.COMPOUND)) { | ||
List<CompoundTag> list = compound.getCompoundList("Equipment"); | ||
if (list.size() == 5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to allow for a variable size of this list? For example, having a list with only 1 element would only set the "item in hand" slot, and so forth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see a Situation where:
- A world is saved with an incomplete list of "Equipment", "HandItems" or "ArmorItems"
- and the client still working
Just tried this situation out. Client is just black, and I can't move.
Since it is not safe to have incomplete lists in vanilla, I don't see how useful handling loading of them is going to be for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, more testing revealed, that paper has no problem with incomplete *Items lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only situation I could see this happening is when using data-tags in commands (/summon, for example): it would be possible for a command to not have all the items in the list, and the Entity Store would have to handle that.
don't call equipmentmonitor.reset() twice
we already do that properly in the livingentity Also don't save the *Items and *Chances Tag for a player, since he can never have these tags
order of the lists musts still be correct, e.g. feet must be before leg If no Item or dropChance is available, load an empty Itemstack or 1f respectively
@Postremus I don't have time to test this on my own system right now. Can you confirm that your changes work without major breakage? If not, I'll have a look myself tonight or during the weekend. |
It seems to work without breaking anything. Executing: No other entity uses an EntityEquipment right now in Glowstone. |
@Postremus Alright, thank you for confirming this works :) Perhaps adding EntityEquipment support for other entities can be done in a future PR. The scope of your PR is mostly about Armor Stands anyways. |
Thank you again for your contribution! |
Add equipment sounds for armorstands. They are played to the player who equipped the armor stand. Currently no sound is played because of #519.
Implement EntityEquipment. This allows the armorstand to use the equipmentmonitor.
Save the off hand item of the livingentity. Use the tags HandItems, ArmorItems, HandDropChances, ArmorDropChances for this. Keep the old Equipment and DropChances tags for backwards compatibility.
Add off hand support for armor stands.
closes #471