Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master-1.20-lts' into master-1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Dec 17, 2024
2 parents 8edbc4a + f6b8f70 commit 464c7ed
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resources/changelog/1.19.2-1.23.11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
As always, don't forget to backup your world before updating!
Requires CyclopsCore version 1.18.2 or higher.

Changes:
* Drop Part Offsets into their original form, Closes #1418

Fixes:
* Fix creative batteries not providing energy, Closes #1421

8 changes: 8 additions & 0 deletions resources/changelog/1.19.2-1.24.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
As always, don't forget to backup your world before updating!
Requires CyclopsCore version 1.18.2 or higher.

Additions:
* Add dedicated REI support, Closes CyclopsMC/IntegratedDynamics#1348
* Restore Refined Storage integration
* Restore Jade/Waila integration, Closes CyclopsMC/IntegratedDynamics#1413

7 changes: 7 additions & 0 deletions resources/changelog/1.19.2-1.24.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
As always, don't forget to backup your world before updating!
Requires CyclopsCore version 1.18.2 or higher.

Fixes:
* Fix cable placement with commands initializing networks
This was broken since CyclopsMC/IntegratedTunnels#243

10 changes: 10 additions & 0 deletions resources/changelog/1.19.2-1.24.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
As always, don't forget to backup your world before updating!
Requires CyclopsCore version 1.18.2 or higher.

Additions:
* Add error operator

Changes:
* Reduce network inits by half when placing cables, Closes #1439


8 changes: 8 additions & 0 deletions resources/changelog/1.20.1-1.23.13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
As always, don't forget to backup your world before updating!
Requires CyclopsCore version 1.18.4 or higher.

Changes:
* Drop Part Offsets into their original form, Closes #1418

Fixes:
* Fix creative batteries not providing energy, Closes #1421
11 changes: 11 additions & 0 deletions resources/changelog/1.20.1-1.24.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
As always, don't forget to backup your world before updating!
Requires CyclopsCore version 1.18.4 or higher.

Additions:
* Add dedicated REI support, Closes CyclopsMC/IntegratedDynamics#1348
* Restore Refined Storage integration
* Restore Jade/Waila integration, Closes CyclopsMC/IntegratedDynamics#1413

Fixes:
* Fix cable placement with commands initializing networks
This was broken since CyclopsMC/IntegratedTunnels#243
8 changes: 8 additions & 0 deletions resources/changelog/1.20.1-1.24.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
As always, don't forget to backup your world before updating!
Requires CyclopsCore version 1.18.4 or higher.

Additions:
* Add error operator

Changes:
* Reduce network inits by half when placing cables, Closes #1439
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,17 @@ public IValue evaluate(OperatorBase.SafeVariablesGetter variables) throws Evalua
variables -> ValueTypeString.ValueString.of(ValueTypes.CATEGORY_UNIQUELY_NAMED.getUniqueName(variables.getVariables()[0]))
).build());

/**
* Throw a custom error
*/
public static final IOperator STRING_ERROR = REGISTRY.register(OperatorBuilders.STRING_2.symbol("error").operatorName("string_error").interactName("stringError")
.inputType(ValueTypes.STRING).renderPattern(IConfigRenderPattern.SUFFIX_1_LONG)
.function(
(variables) -> {
throw new EvaluationException(Component.translatable(variables.getValue(0, ValueTypes.STRING).getRawValue()));
}
).build());

/**
* ----------------------------------- NUMBER OPERATORS -----------------------------------
*/
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/integrateddynamics/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@
"valuetype.integrateddynamics.named.info": "Something that has a name, such as display names of items and blocks.",
"valuetype.integrateddynamics.uniquely_named": "Uniquely Named",
"valuetype.integrateddynamics.uniquely_named.info": "Something that has a unique name, such as items and blocks.",
"operator.integrateddynamics.string.string_error": "Error",
"operator.integrateddynamics.string.string_error.info": "Throw a custom error",


"valuetype.integrateddynamics.boolean": "Boolean",
"valuetype.integrateddynamics.integer": "Integer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,4 +795,32 @@ public void testInvalidInputTypeNamedName() throws EvaluationException {
Operators.NAMED_NAME.evaluate(new IVariable[]{DUMMY_VARIABLE});
}

/**
* ----------------------------------- STRING_ERROR -----------------------------------
*/

@Test(expected = EvaluationException.class)
public void testStringErrorWithSymbols() throws EvaluationException {
Operators.STRING_ERROR.evaluate(sregex);
}

@Test(expected = EvaluationException.class)
public void testStringErrorWithSpaces() throws EvaluationException {
Operators.STRING_ERROR.evaluate(shelloWorld);
}

@Test(expected = EvaluationException.class)
public void testInvalidInputSizeErrorLong() throws EvaluationException {
Operators.STRING_ERROR.evaluate(new IVariable[]{sabc, sabc});
}

@Test(expected = EvaluationException.class)
public void testInvalidInputSizeErrorSmall() throws EvaluationException {
Operators.STRING_ERROR.evaluate(new IVariable[]{});
}

@Test(expected = EvaluationException.class)
public void testInvalidInputTypeError() throws EvaluationException {
Operators.STRING_ERROR.evaluate(new IVariable[]{DUMMY_VARIABLE, DUMMY_VARIABLE});
}
}

0 comments on commit 464c7ed

Please sign in to comment.