mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-26 06:24:31 +01:00
Fix lava and water matching
This commit is contained in:
parent
b674b74d4d
commit
fe1e6172c7
3 changed files with 21 additions and 8 deletions
|
@ -106,6 +106,8 @@ public abstract class StatePredicate implements Predicate<BlockState> {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "plants": return StatePredicate::isPlant;
|
case "plants": return StatePredicate::isPlant;
|
||||||
case "ores": return StatePredicate::isOre;
|
case "ores": return StatePredicate::isOre;
|
||||||
|
case "water": return StatePredicate::isWater;
|
||||||
|
case "lava": return StatePredicate::isLava;
|
||||||
default: throw new IllegalArgumentException("Invalid builtin type: " + type);
|
default: throw new IllegalArgumentException("Invalid builtin type: " + type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,6 +120,14 @@ public abstract class StatePredicate implements Predicate<BlockState> {
|
||||||
return s.getBlock() instanceof OreBlock;
|
return s.getBlock() instanceof OreBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean isWater(BlockState s) {
|
||||||
|
return s.getMaterial() == Material.WATER;
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean isLava(BlockState s) {
|
||||||
|
return s.getMaterial() == Material.LAVA;
|
||||||
|
}
|
||||||
|
|
||||||
public static Predicate<BlockState> ofState(String state) {
|
public static Predicate<BlockState> ofState(String state) {
|
||||||
Identifier id = new Identifier(state.split("\\{")[0]);
|
Identifier id = new Identifier(state.split("\\{")[0]);
|
||||||
List<PropertyOp> properties = Optional.of(state)
|
List<PropertyOp> properties = Optional.of(state)
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
"entries": [
|
"entries": [
|
||||||
{
|
{
|
||||||
"match": [
|
"match": [
|
||||||
{ "state": "minecraft:snow" },
|
{ "state": "minecraft:snow" },
|
||||||
{ "state": "minecraft:snow_block" },
|
{ "state": "minecraft:snow_block" },
|
||||||
{ "builtin": "plants" }
|
{ "builtin": "plants" }
|
||||||
],
|
],
|
||||||
"apply": {
|
"apply": {
|
||||||
"action": "unicopia:set_state",
|
"action": "unicopia:set_state",
|
||||||
|
@ -13,7 +13,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"match": { "state": "minecraft:ice" },
|
"match": [
|
||||||
|
{ "state": "minecraft:ice" },
|
||||||
|
{ "state": "minecraft:frosted_ice" }
|
||||||
|
],
|
||||||
"apply": {
|
"apply": {
|
||||||
"action": "unicopia:set_state",
|
"action": "unicopia:set_state",
|
||||||
"state": "minecraft:water"
|
"state": "minecraft:water"
|
||||||
|
@ -28,8 +31,8 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"match": [
|
"match": [
|
||||||
{ "state": "minecraft:obsidian" },
|
{ "state": "minecraft:obsidian" },
|
||||||
{ "state": "unicopia:frosted_obsidian" }
|
{ "state": "unicopia:frosted_obsidian" }
|
||||||
],
|
],
|
||||||
"apply": {
|
"apply": {
|
||||||
"action": "unicopia:set_state",
|
"action": "unicopia:set_state",
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"match": { "tag": "minecraft:water" },
|
"match": { "builtin": "water" },
|
||||||
"apply": {
|
"apply": {
|
||||||
"action": "unicopia:set_state",
|
"action": "unicopia:set_state",
|
||||||
"state": "minecraft:frosted_ice"
|
"state": "minecraft:frosted_ice"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"match": { "state": "minecraft:lava" },
|
"match": { "builtin": "lava" },
|
||||||
"apply": {
|
"apply": {
|
||||||
"action": "unicopia:set_state",
|
"action": "unicopia:set_state",
|
||||||
"state": "unicopia:frosted_obsidian"
|
"state": "unicopia:frosted_obsidian"
|
||||||
|
|
Loading…
Reference in a new issue