Class StateContainer<O,​S extends StateHolder<O,​S>>


  • public class StateContainer<O,​S extends StateHolder<O,​S>>
    extends java.lang.Object
    • Field Detail

      • NAME_PATTERN

        private static final java.util.regex.Pattern NAME_PATTERN
      • owner

        private final O owner
      • propertiesByName

        private final com.google.common.collect.ImmutableSortedMap<java.lang.String,​Property<?>> propertiesByName
      • states

        private final com.google.common.collect.ImmutableList<S extends StateHolder<O,​S>> states
    • Constructor Detail

      • StateContainer

        protected StateContainer​(java.util.function.Function<O,​S> p_i231877_1_,
                                 O p_i231877_2_,
                                 StateContainer.IFactory<O,​S> p_i231877_3_,
                                 java.util.Map<java.lang.String,​Property<?>> p_i231877_4_)
    • Method Detail

      • appendPropertyCodec

        private static <S extends StateHolder<?,​S>,​T extends java.lang.Comparable<T>> com.mojang.serialization.MapCodec<S> appendPropertyCodec​(com.mojang.serialization.MapCodec<S> p_241487_0_,
                                                                                                                                                           java.util.function.Supplier<S> p_241487_1_,
                                                                                                                                                           java.lang.String p_241487_2_,
                                                                                                                                                           Property<T> p_241487_3_)
      • getPossibleStates

        public com.google.common.collect.ImmutableList<S> getPossibleStates()
      • any

        public S any()
      • getOwner

        public O getOwner()
      • getProperties

        public java.util.Collection<Property<?>> getProperties()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getProperty

        @Nullable
        public Property<?> getProperty​(java.lang.String p_185920_1_)