Commit graph

2 commits

Author SHA1 Message Date
Spottedleaf
9c7e369607 More 1.14 work 2019-04-26 23:26:04 -07:00
Aikar
f81fb06341 Fix BlockState hashCode optimization patch performance bug
we missed something in updating this patch and accidently left
hashCode as a 0 value. This caused a pretty nasty performance hit
for BlockStateEnum instances as they would be all a hash collision.

This update fixes that and also promotes the optimizations to cover
ALL cases of Block States, not just enums.

While mojang cached hashCode in 1.13, we can still just use a simple
large prime based hashCode that auto increments guaranteeing no overlap.

Additionally, replace all equals with an identity check.
2019-02-28 01:35:06 -05:00