Class InventoryVariableEvaluator<V extends IValue>
java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.InventoryVariableEvaluator<V>
- Type Parameters:
V
- The variable value type
- All Implemented Interfaces:
IVariableFacade.IValidator
public class InventoryVariableEvaluator<V extends IValue>
extends Object
implements IVariableFacade.IValidator
A convenience holder class for getting variables from variable cards in a certain inventory slot.
-
Constructor Summary
ConstructorDescriptionInventoryVariableEvaluator
(net.minecraft.world.Container inventory, int slot, Supplier<ValueDeseralizationContext> valueDeseralizationContext, IValueType<V> containingValueType) InventoryVariableEvaluator
(net.minecraft.world.Container inventory, int slot, ValueDeseralizationContext valueDeseralizationContext, IValueType<V> containingValueType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(net.minecraft.network.chat.MutableComponent error) Set the current error for the given aspect.void
List
<net.minecraft.network.chat.MutableComponent> getVariable
(INetwork network) getVariable
(INetwork network, IPartNetwork partNetwork) boolean
void
protected void
void
refreshVariable
(INetwork network, boolean sendVariablesUpdateEvent) Refresh the variable reference by checking the inventory, and validating the containing variable.void
-
Constructor Details
-
InventoryVariableEvaluator
public InventoryVariableEvaluator(net.minecraft.world.Container inventory, int slot, Supplier<ValueDeseralizationContext> valueDeseralizationContext, IValueType<V> containingValueType) -
InventoryVariableEvaluator
public InventoryVariableEvaluator(net.minecraft.world.Container inventory, int slot, ValueDeseralizationContext valueDeseralizationContext, IValueType<V> containingValueType)
-
-
Method Details
-
hasVariable
public boolean hasVariable()- Returns:
- If the configured slot has an item.
-
refreshVariable
Refresh the variable reference by checking the inventory, and validating the containing variable.- Parameters:
network
- The network.sendVariablesUpdateEvent
- If aVariableContentsUpdatedEvent
event must be sent if the variable has changed.
-
getVariable
-
getVariable
-
getVariableFacade
-
preValidate
protected void preValidate() -
clearErrors
public void clearErrors() -
setErrors
-
getErrors
-
addError
public void addError(net.minecraft.network.chat.MutableComponent error) Description copied from interface:IVariableFacade.IValidator
Set the current error for the given aspect.- Specified by:
addError
in interfaceIVariableFacade.IValidator
- Parameters:
error
- The error to set, or null to clear.
-
onErrorsChanged
public void onErrorsChanged()
-