Skip to content
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

Generify Palettes Implementation #3178

Merged
merged 3 commits into from
Nov 13, 2020
Merged

Generify Palettes Implementation #3178

merged 3 commits into from
Nov 13, 2020

Commits on Nov 13, 2020

  1. Introduce MemoizedSupplier for Supplier memoization

    A Supplier normally would evaluate every single time being called, but in
    some cases, we'd rather be able to memoize the value generated from the
    Supplier after the first call. This is not meant to be leaked beyond memoizing
    global objects that are referentially transparent themselves (like an object
    being comprised of functions/suppliers that rely on other global variables).
    
    Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
    gabizou committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    adc69af View commit details
    Browse the repository at this point in the history
  2. Reintroduce Blockstate(De)Serializer

    Traditionally, Mojang is appearing to want to store a BlockState as a map to better
    suit DFU's ability to update a state's values and properties. This map based
    representation however, is not ideal to being used for storage with a palette that
    retains the integer to string like mapping internally. It may well be possible to
    take advantage of DFU in the future, but at this time, a less breakage of the
    Schematic Specification is required.
    
    Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
    gabizou committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    702dc99 View commit details
    Browse the repository at this point in the history
  3. Implement new Palettes

    Palettes are much more streamlined now, with global palettes being memoized functions
    built off the global registries (meaning they are reload-aware) while copies can be
    isolated by themselves and rebuilt however need be.
    
    Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
    gabizou committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    77a6d32 View commit details
    Browse the repository at this point in the history