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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cyclops.integrateddynamics.api.item.IVariableFacade
IVariableFacade.IValidator -
Constructor Summary
ConstructorsConstructorDescriptionValueTypeVariableFacade(boolean generateId, IValueType<V> valueType, ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) ValueTypeVariableFacade(boolean generateId, IValueType<V> valueType, V value) ValueTypeVariableFacade(int id, IValueType<V> valueType, ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) ValueTypeVariableFacade(int id, IValueType<V> valueType, V value) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModelOverlay(IVariableModelBaked variableModelBaked, List<net.minecraft.client.renderer.block.model.BakedQuad> quads, net.minecraft.util.RandomSource random, net.minecraftforge.client.model.data.ModelData modelData) Handle the quads for the given baked model.voidappendHoverText(List<net.minecraft.network.chat.Component> list, net.minecraft.world.level.Level world) Add information about this variable facade to the list.getVariable(IPartNetwork network) Get the variable.net.minecraft.client.resources.model.BakedModelgetVariableItemOverrideModel(net.minecraft.client.resources.model.BakedModel model, net.minecraft.world.item.ItemStack stack, net.minecraft.client.multiplayer.ClientLevel world, net.minecraft.world.entity.LivingEntity livingEntity) An optional baked model to override when rendering the variable as item.booleanisValid()voidrenderISTER(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) Called during ISTER rendering of an variable item.voidvalidate(IPartNetwork network, IVariableFacade.IValidator validator, IValueType containingValueType) Check if this facade is valid, otherwise notify the validator of any errors.Methods inherited from class org.cyclops.integrateddynamics.core.item.VariableFacadeBase
generateId, getLabel, getReferenceDisplayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.item.IValueTypeVariableFacade
getValue, getValueType, getVariableMethods inherited from interface org.cyclops.integrateddynamics.api.item.IVariableFacade
getId, getLabel, getVariable, validate
-
Constructor Details
-
ValueTypeVariableFacade
-
ValueTypeVariableFacade
-
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
Description copied from interface:IVariableFacadeGet the variable.- Specified by:
getVariablein interfaceIVariableFacade- Overrides:
getVariablein classVariableFacadeBase- Parameters:
network- The object used to look for the variable.- Returns:
- The variable.
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceIVariableFacade- Returns:
- If this is a valid reference.
-
validate
public void validate(IPartNetwork network, IVariableFacade.IValidator validator, IValueType containingValueType) Description copied from interface:IVariableFacadeCheck if this facade is valid, otherwise notify the validator of any errors.- Specified by:
validatein interfaceIVariableFacade- Overrides:
validatein classVariableFacadeBase- 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
- Specified by:
getOutputTypein interfaceIVariableFacade- 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:IVariableFacadeAdd information about this variable facade to the list.- Specified by:
appendHoverTextin interfaceIVariableFacade- Overrides:
appendHoverTextin classVariableFacadeBase- 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:IVariableFacadeHandle the quads for the given baked model.- Specified by:
addModelOverlayin interfaceIVariableFacade- 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:IVariableFacadeAn optional baked model to override when rendering the variable as item.- Specified by:
getVariableItemOverrideModelin interfaceIVariableFacade- 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:IVariableFacadeCalled during ISTER rendering of an variable item.- Specified by:
renderISTERin interfaceIVariableFacade- Parameters:
stack- The variable stack.transformType- Transform type.matrixStack- Matrix stack.buffer- Render buffer.combinedLight- Lighting.combinedOverlay- Overlay.
-