Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

- Updated to Minecraft 1.21.1 ([#985](https://github.com/FallingColors/HexMod/pull/985)) @SuperKnux @slava110
- Added the `hex_unbreakable` tag for blocks that should be immune to Break Block regardless of the configured mining tier ([#1186](https://github.com/FallingColors/HexMod/pull/1186)) @Robotgiggle @slava110
- Added Coalescing Distillation, which performs the null-coalescing operation ([#1196](https://github.com/FallingColors/HexMod/pull/1196)) @Robotgiggle

### Fixed

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package at.petrak.hexcasting.common.casting.actions.math.logic

import at.petrak.hexcasting.api.casting.castables.ConstMediaAction
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.iota.NullIota

object OpNullCoalesce : ConstMediaAction {
override val argc = 2

override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> {
if (args[0] is NullIota)
return listOf(args[1])
return listOf(args[0])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
import at.petrak.hexcasting.common.casting.actions.local.OpPushLocal;
import at.petrak.hexcasting.common.casting.actions.math.OpCoerceToAxial;
import at.petrak.hexcasting.common.casting.actions.math.OpRandom;
import at.petrak.hexcasting.common.casting.actions.math.logic.OpBoolIf;
import at.petrak.hexcasting.common.casting.actions.math.logic.OpCoerceToBool;
import at.petrak.hexcasting.common.casting.actions.math.logic.OpEquality;
import at.petrak.hexcasting.common.casting.actions.math.logic.OpTypeEquality;
import at.petrak.hexcasting.common.casting.actions.math.logic.*;
import at.petrak.hexcasting.common.casting.actions.queryentity.*;
import at.petrak.hexcasting.common.casting.actions.raycast.OpBlockAxisRaycast;
import at.petrak.hexcasting.common.casting.actions.raycast.OpBlockRaycast;
Expand Down Expand Up @@ -199,6 +196,8 @@ public class HexActions {
new ActionRegistryEntry(HexPattern.fromAngles("aw", HexDir.NORTH_EAST), OpCoerceToBool.INSTANCE));
public static final ActionRegistryEntry IF = make("if",
new ActionRegistryEntry(HexPattern.fromAngles("awdd", HexDir.SOUTH_EAST), OpBoolIf.INSTANCE));
public static final ActionRegistryEntry NULL_COALESCE = make("null_coalesce",
new ActionRegistryEntry(HexPattern.fromAngles("wawaa", HexDir.SOUTH_EAST), OpNullCoalesce.INSTANCE));

public static final ActionRegistryEntry RANDOM = make("random",
new ActionRegistryEntry(HexPattern.fromAngles("eqqq", HexDir.NORTH_WEST), OpRandom.INSTANCE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@
not: "Negation Purification",
bool_coerce: "Augur's Purification",
if: "Augur's Exaltation",
null_coalesce: "Coalescing Distillation",

add: "Additive Distillation",
sub: "Subtractive Distillation",
Expand Down Expand Up @@ -1905,7 +1906,8 @@
or: "Returns True if at least one of the arguments are True; otherwise returns False.",
and: "Returns True if both arguments are true; otherwise returns False.",
xor: "Returns True if exactly one of the arguments is true; otherwise returns False.",
if: "If the first argument is True, keeps the second and discards the third; otherwise discards the second and keeps the third.",
if: "If the first argument is True, returns the second argument. Otherwise, returns the third argument.",
null_coalesce: "If the first argument is not $(l:casting/influences)$(thing)Null/$, returns it. Otherwise, returns the second argument.",
equals: "If the first argument equals the second (within a small tolerance), return True. Otherwise, return False.",
not_equals: "If the first argument does not equal the second (outside a small tolerance), return True. Otherwise, return False.",
type_equals: "If the type of the first argument matches the type of the second, return True. Otherwise, return False.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
"output": "any",
"text": "hexcasting.page.logic.if"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:null_coalesce",
"anchor": "hexcasting:null_coalesce",
"input": "any, any",
"output": "any",
"text": "hexcasting.page.logic.null_coalesce"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:equals",
Expand Down
Loading