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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added

- Updated to Minecraft 1.21.1 ([#985](https://github.com/FallingColors/HexMod/pull/985)) @SuperKnux @slava110
- Added Smelt, Freeze, Gravitate Block, Particles, and Factorial Purification, all of which were previously in Hexal ([#1183](https://github.com/FallingColors/HexMod/pull/1183)) @Robotgiggle
- Freeze now supports data-driven recipes for freezing liquids as well as blocks
- Smelt and Freeze now mishap if the target does not have a valid smelting/freezing recipe
- Factorial Purification now works on vectors as well as numbers, applying element-wise
- Added Simulate, which causes the next pattern drawn to be simulated (to check for mishaps) rather than executed ([#1194](https://github.com/FallingColors/HexMod/pull/1194)) @Robotgiggle
- 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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "#hexcasting:staves"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:blue_ice"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:blue_ice"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "#hexcasting:staves"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:cobblestone"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:cobblestone"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "#hexcasting:staves"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:ice"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:ice"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "#hexcasting:staves"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:obsidian"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:obsidian"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "#hexcasting:staves"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:packed_ice"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:packed_ice"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "#hexcasting:staves"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:powder_snow_cauldron"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:powder_snow_cauldron"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"conditions": {
"items": [
{
"items": "#hexcasting:staves"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "hexcasting:snow_block"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_item"
]
],
"rewards": {
"recipes": [
"hexcasting:snow_block"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "hexcasting:freeze",
"blockIn": {
"type": "hexcasting:block",
"block": "minecraft:packed_ice"
},
"result": {
"Name": "minecraft:blue_ice"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "hexcasting:freeze",
"blockIn": {
"type": "hexcasting:fluid",
"fluid": "minecraft:flowing_lava"
},
"result": {
"Name": "minecraft:cobblestone"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "hexcasting:freeze",
"blockIn": {
"type": "hexcasting:fluid",
"fluid": "minecraft:water"
},
"result": {
"Name": "minecraft:ice"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "hexcasting:freeze",
"blockIn": {
"type": "hexcasting:fluid",
"fluid": "minecraft:lava"
},
"result": {
"Name": "minecraft:obsidian"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "hexcasting:freeze",
"blockIn": {
"type": "hexcasting:block",
"block": "minecraft:ice"
},
"result": {
"Name": "minecraft:packed_ice"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "hexcasting:freeze",
"blockIn": {
"type": "hexcasting:block",
"block": "minecraft:water_cauldron"
},
"result": {
"Name": "minecraft:powder_snow_cauldron",
"Properties": {
"level": "1"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "hexcasting:freeze",
"blockIn": {
"type": "hexcasting:fluid",
"fluid": "minecraft:flowing_water"
},
"result": {
"Name": "minecraft:snow_block"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,25 @@ fun List<Iota>.getNumOrVec(idx: Int, argc: Int = 0): Either<Double, Vec3> {
}
}

fun List<Iota>.getVecOrVecList(idx: Int, argc: Int = 0): Either<Vec3, List<Vec3>> {
val x = this.getOrElse(idx) { throw MishapNotEnoughArgs(idx + 1, this.size) }
return when (x) {
is Vec3Iota -> Either.left(x.vec3)
is ListIota -> {
val out = mutableListOf<Vec3>()
for (v in x.list) {
if (v is Vec3Iota) {
out.add(v.vec3)
} else {
throw MishapInvalidIota.of(x, if (argc == 0) idx else argc - (idx + 1), "vec_or_veclist")
}
}
Either.right(out)
}
else -> throw MishapInvalidIota.of(x, if (argc == 0) idx else argc - (idx + 1), "vec_or_veclist")
}
}

fun List<Iota>.getLongOrList(idx: Int, argc: Int = 0): Either<Long, SpellList> {
val datum = this.getOrElse(idx) { throw MishapNotEnoughArgs(idx + 1, this.size) }
if (datum is DoubleIota) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public interface Arithmetic {
HexPattern ARCTAN2 = HexPattern.fromAngles("deadeeeeewd", HexDir.WEST);
HexPattern LOG = HexPattern.fromAngles("eqaqe", HexDir.NORTH_WEST);
HexPattern MOD = HexPattern.fromAngles("addwaad", HexDir.NORTH_EAST);
HexPattern FACT = HexPattern.fromAngles("wawdedwaw", HexDir.SOUTH_EAST);


// Vecs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import at.petrak.hexcasting.api.addldata.ADPigment;
import net.minecraft.util.FastColor;
import net.minecraft.util.RandomSource;
import net.minecraft.world.phys.Vec3;

public abstract class ColorProvider {
Expand Down Expand Up @@ -41,6 +42,14 @@ public final int getColor(float time, Vec3 position) {
return 0xff_000000 | (r << 16) | (g << 8) | b;
}

public final int getRandomColor(RandomSource random) {
return getColor(
random.nextFloat() * 16384,
new Vec3(random.nextFloat(),random.nextFloat(),random.nextFloat())
.scale((random.nextFloat() * 3))
);
}

public static final ColorProvider MISSING = new ColorProvider() {
@Override
protected int getRawColor(float time, Vec3 position) {
Expand Down
Loading
Loading