Buildinggadgets: Trapdoor State Is Not Copied

Created on 31 Dec 2018  路  13Comments  路  Source: Direwolf20-MC/BuildingGadgets

While creating a (terrible) street lamp design, I found out that the state of trapdoors is not getting copied by the Copy-Paste Gadget.

In the following screenshot, to the left is the original (terrible) design, and to the right is the pasted result.

image

This might be related to #28, being that maybe trapdoors need to be added to the blacklist.

oversight

Most helpful comment

ok

All 13 comments

@MajorTuvok is there a specific reason we avoid copying the state of trap doors? I've not got a good understanding of what is a tile entity and what isn't. I'd assume it's just that they're tile entities?

To my knowledge they are not, (though I intended to debug why this is happening through this afternoon, granted I have time). They just seem to have similiar Problems like doors...
There just weren't any other suggestions, so I just did this and waited for some to come up with a better idea. (Like a makeshift solution)

I just saw something: UniqueItem overrides Equals but not hashcode and is used as a Map Key!!! I'm not sure, whether that causes Problems, but it definitly violates the contract of these 2 Methods!!!

Code snippets plz :D

UniqueItem is used as a key here...

I'm testing whether allowing copying of the Trapdoor open Property has any side effects... (Currently it isn't in the safe to copy blacklist...)

(allowing that makes it work)

Why is that even a hash map?

Don't ask me

I'll just create a new branch to fix this issue here, allowing copying of the open state, doesn't have any obvious side effects...

Sneaky little UniqueItem: it doesn't override equals at all!

Changing all these Maps to Multisets is more than I thought...
@MichaelHillcox / @Direwolf20-MC should I put this in a seperate PR?

A change like that should be in a separate PR, yes.

ok

Was this page helpful?
0 / 5 - 0 ratings

Related issues

generrosity picture generrosity  路  5Comments

WenXin20 picture WenXin20  路  4Comments

MajorTuvok picture MajorTuvok  路  3Comments

delta2k picture delta2k  路  3Comments

wain99 picture wain99  路  3Comments