Class ValueTypeVariableFacade<V extends IValue>

java.lang.Object
org.cyclops.integrateddynamics.core.item.VariableFacadeBase
org.cyclops.integrateddynamics.core.item.ValueTypeVariableFacade<V>
All Implemented Interfaces:
IValueTypeVariableFacade<V>, IVariableFacade

public class ValueTypeVariableFacade<V extends IValue> extends VariableFacadeBase implements IValueTypeVariableFacade<V>
Variable facade for variables determined by a raw value.
  • Constructor Details

    • ValueTypeVariableFacade

      public ValueTypeVariableFacade(boolean generateId, IValueType<V> valueType, V value)
    • ValueTypeVariableFacade

      public ValueTypeVariableFacade(int id, IValueType<V> valueType, V value)
    • ValueTypeVariableFacade

      public ValueTypeVariableFacade(boolean generateId, IValueType<V> valueType, ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value)
    • ValueTypeVariableFacade

      public ValueTypeVariableFacade(int id, IValueType<V> valueType, ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value)
  • Method Details

    • getVariable

      public IVariable<V> getVariable(IPartNetwork network)
      Description copied from interface: IVariableFacade
      Get the variable.
      Specified by:
      getVariable in interface IVariableFacade
      Overrides:
      getVariable in class VariableFacadeBase
      Parameters:
      network - The object used to look for the variable.
      Returns:
      The variable.
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface IVariableFacade
      Returns:
      If this is a valid reference.
    • validate

      public void validate(IPartNetwork network, IVariableFacade.IValidator validator, IValueType containingValueType)
      Description copied from interface: IVariableFacade
      Check if this facade is valid, otherwise notify the validator of any errors.
      Specified by:
      validate in interface IVariableFacade
      Overrides:
      validate in class VariableFacadeBase
      Parameters:
      network - The object used to look for the variable.
      validator - The object to notify errors to.
      containingValueType - The value type in which this variable facade is being used.
    • getOutputType

      public IValueType getOutputType()
      Specified by:
      getOutputType in interface IVariableFacade
      Returns:
      The output type of this variable facade.
    • appendHoverText

      public void appendHoverText(List<net.minecraft.network.chat.Component> list, net.minecraft.world.level.Level world)
      Description copied from interface: IVariableFacade
      Add information about this variable facade to the list.
      Specified by:
      appendHoverText in interface IVariableFacade
      Overrides:
      appendHoverText in class VariableFacadeBase
      Parameters:
      list - The list to add lines to.
      world - The world.
    • addModelOverlay

      public void addModelOverlay(IVariableModelBaked variableModelBaked, List<net.minecraft.client.renderer.block.model.BakedQuad> quads, net.minecraft.util.RandomSource random, net.minecraftforge.client.model.data.ModelData modelData)
      Description copied from interface: IVariableFacade
      Handle the quads for the given baked model.
      Specified by:
      addModelOverlay in interface IVariableFacade
      Parameters:
      variableModelBaked - The baked model.
      quads - The quads that can be added to.
      random - A random instance.
      modelData - Model data.
    • getVariableItemOverrideModel

      @Nullable public net.minecraft.client.resources.model.BakedModel getVariableItemOverrideModel(net.minecraft.client.resources.model.BakedModel model, net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.client.multiplayer.ClientLevel world, @Nullable net.minecraft.world.entity.LivingEntity livingEntity)
      Description copied from interface: IVariableFacade
      An optional baked model to override when rendering the variable as item.
      Specified by:
      getVariableItemOverrideModel in interface IVariableFacade
      Parameters:
      model - The original baked model.
      stack - The variable stack.
      world - The client world.
      livingEntity - The entity holding the stack.
      Returns:
      The overridden model. Will fallback to default if null.
    • renderISTER

      public void renderISTER(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.ItemDisplayContext transformType, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, int combinedLight, int combinedOverlay)
      Description copied from interface: IVariableFacade
      Called during ISTER rendering of an variable item.
      Specified by:
      renderISTER in interface IVariableFacade
      Parameters:
      stack - The variable stack.
      transformType - Transform type.
      matrixStack - Matrix stack.
      buffer - Render buffer.
      combinedLight - Lighting.
      combinedOverlay - Overlay.