Class GameTestsValueEncoding
java.lang.Object
org.cyclops.integrateddynamics.gametest.GameTestsValueEncoding
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidassertCardHolds(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.item.ItemStack card, IValue value) protected static ValueDeseralizationContextcontext(net.minecraft.gametest.framework.GameTestHelper helper) protected static net.minecraft.world.item.ItemStackdecodeIntoCard(net.minecraft.gametest.framework.GameTestHelper helper, String encoded) Decode a value into a variable card, the way the decode element of the logic programmer does.protected static IValuedecodeOperator(String encoded) protected static IValueencodeCompressedOperator(IValue value) protected static IValueencodeOperator(IValue value) protected static StringhandcraftEncoded(net.minecraft.gametest.framework.GameTestHelper helper, IValue value) Encoding refuses values that are not materialized, so a handcrafted one has to bypass it.protected static IValueprotected static IValuepositionedList(net.minecraft.gametest.framework.GameTestHelper helper) voidtestDecodeElementCompressed(net.minecraft.gametest.framework.GameTestHelper helper) voidtestDecodeElementInteger(net.minecraft.gametest.framework.GameTestHelper helper) voidtestDecodeElementItemStackList(net.minecraft.gametest.framework.GameTestHelper helper) Item stacks are only serializable with a registry context, so they can not be covered by a unit test.voidtestDecodeElementRequiresValue(net.minecraft.gametest.framework.GameTestHelper helper) voidtestDecodeElementString(net.minecraft.gametest.framework.GameTestHelper helper) voidtestDecodeOperatorCompressed(net.minecraft.gametest.framework.GameTestHelper helper) voidtestDecodeOperatorDisabled(net.minecraft.gametest.framework.GameTestHelper helper) voidtestDecodeOperatorRejectsGarbage(net.minecraft.gametest.framework.GameTestHelper helper) voidtestDecodeOperatorRejectsPositionedList(net.minecraft.gametest.framework.GameTestHelper helper) Strings can be built with operators, so the operator must not accept what the decode element refuses.voidtestDecodeRejectsPositionedList(net.minecraft.gametest.framework.GameTestHelper helper) A list that reads an inventory at a position must not be decodable, as it would otherwise allow reading inventories anywhere.voidtestEncodeCompressedDecodeOperators(net.minecraft.gametest.framework.GameTestHelper helper) voidtestEncodeCompressedOperatorMaterializes(net.minecraft.gametest.framework.GameTestHelper helper) voidtestEncodeDecodeOperators(net.minecraft.gametest.framework.GameTestHelper helper) voidtestEncodeOperatorMaterializes(net.minecraft.gametest.framework.GameTestHelper helper) The encode operator materializes its input, so a list that reads an inventory can be encoded, and decodes into the contents that the inventory had at that moment.voidtestEncodeOperatorTooLarge(net.minecraft.gametest.framework.GameTestHelper helper) voidtestEncodeRejectsPositionedList(net.minecraft.gametest.framework.GameTestHelper helper)
-
Field Details
-
TEMPLATE_EMPTY
- See Also:
-
POS
public static final net.minecraft.core.BlockPos POS
-
-
Constructor Details
-
GameTestsValueEncoding
public GameTestsValueEncoding()
-
-
Method Details
-
context
protected static ValueDeseralizationContext context(net.minecraft.gametest.framework.GameTestHelper helper) -
itemStackList
-
positionedList
-
handcraftEncoded
-
decodeIntoCard
protected static net.minecraft.world.item.ItemStack decodeIntoCard(net.minecraft.gametest.framework.GameTestHelper helper, String encoded) throws ValueEncodingHelpers.ValueEncodingException Decode a value into a variable card, the way the decode element of the logic programmer does. -
assertCardHolds
protected static void assertCardHolds(net.minecraft.gametest.framework.GameTestHelper helper, net.minecraft.world.item.ItemStack card, IValue value) -
encodeOperator
- Throws:
EvaluationException
-
encodeCompressedOperator
- Throws:
EvaluationException
-
decodeOperator
- Throws:
EvaluationException
-
testDecodeElementInteger
public void testDecodeElementInteger(net.minecraft.gametest.framework.GameTestHelper helper) throws ValueEncodingHelpers.ValueEncodingException -
testDecodeElementString
public void testDecodeElementString(net.minecraft.gametest.framework.GameTestHelper helper) throws ValueEncodingHelpers.ValueEncodingException -
testDecodeElementItemStackList
public void testDecodeElementItemStackList(net.minecraft.gametest.framework.GameTestHelper helper) throws ValueEncodingHelpers.ValueEncodingException Item stacks are only serializable with a registry context, so they can not be covered by a unit test. -
testDecodeElementCompressed
public void testDecodeElementCompressed(net.minecraft.gametest.framework.GameTestHelper helper) throws ValueEncodingHelpers.ValueEncodingException -
testDecodeElementRequiresValue
public void testDecodeElementRequiresValue(net.minecraft.gametest.framework.GameTestHelper helper) -
testDecodeRejectsPositionedList
public void testDecodeRejectsPositionedList(net.minecraft.gametest.framework.GameTestHelper helper) A list that reads an inventory at a position must not be decodable, as it would otherwise allow reading inventories anywhere. -
testEncodeRejectsPositionedList
public void testEncodeRejectsPositionedList(net.minecraft.gametest.framework.GameTestHelper helper) -
testEncodeDecodeOperators
public void testEncodeDecodeOperators(net.minecraft.gametest.framework.GameTestHelper helper) throws EvaluationException - Throws:
EvaluationException
-
testEncodeCompressedDecodeOperators
public void testEncodeCompressedDecodeOperators(net.minecraft.gametest.framework.GameTestHelper helper) throws EvaluationException - Throws:
EvaluationException
-
testEncodeCompressedOperatorMaterializes
public void testEncodeCompressedOperatorMaterializes(net.minecraft.gametest.framework.GameTestHelper helper) throws EvaluationException - Throws:
EvaluationException
-
testEncodeOperatorMaterializes
public void testEncodeOperatorMaterializes(net.minecraft.gametest.framework.GameTestHelper helper) throws EvaluationException The encode operator materializes its input, so a list that reads an inventory can be encoded, and decodes into the contents that the inventory had at that moment.- Throws:
EvaluationException
-
testEncodeOperatorTooLarge
public void testEncodeOperatorTooLarge(net.minecraft.gametest.framework.GameTestHelper helper) -
testDecodeOperatorCompressed
public void testDecodeOperatorCompressed(net.minecraft.gametest.framework.GameTestHelper helper) throws EvaluationException, ValueEncodingHelpers.ValueEncodingException -
testDecodeOperatorRejectsGarbage
public void testDecodeOperatorRejectsGarbage(net.minecraft.gametest.framework.GameTestHelper helper) -
testDecodeOperatorRejectsPositionedList
public void testDecodeOperatorRejectsPositionedList(net.minecraft.gametest.framework.GameTestHelper helper) Strings can be built with operators, so the operator must not accept what the decode element refuses. -
testDecodeOperatorDisabled
public void testDecodeOperatorDisabled(net.minecraft.gametest.framework.GameTestHelper helper) throws ValueEncodingHelpers.ValueEncodingException
-