mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +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) {
|
||||
case "plants": return StatePredicate::isPlant;
|
||||
case "ores": return StatePredicate::isOre;
|
||||
case "water": return StatePredicate::isWater;
|
||||
case "lava": return StatePredicate::isLava;
|
||||
default: throw new IllegalArgumentException("Invalid builtin type: " + type);
|
||||
}
|
||||
}
|
||||
|
@ -118,6 +120,14 @@ public abstract class StatePredicate implements Predicate<BlockState> {
|
|||
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) {
|
||||
Identifier id = new Identifier(state.split("\\{")[0]);
|
||||
List<PropertyOp> properties = Optional.of(state)
|
||||
|
|
|
@ -13,7 +13,10 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"match": { "state": "minecraft:ice" },
|
||||
"match": [
|
||||
{ "state": "minecraft:ice" },
|
||||
{ "state": "minecraft:frosted_ice" }
|
||||
],
|
||||
"apply": {
|
||||
"action": "unicopia:set_state",
|
||||
"state": "minecraft:water"
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"match": { "tag": "minecraft:water" },
|
||||
"match": { "builtin": "water" },
|
||||
"apply": {
|
||||
"action": "unicopia:set_state",
|
||||
"state": "minecraft:frosted_ice"
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": { "state": "minecraft:lava" },
|
||||
"match": { "builtin": "lava" },
|
||||
"apply": {
|
||||
"action": "unicopia:set_state",
|
||||
"state": "unicopia:frosted_obsidian"
|
||||
|
|
Loading…
Reference in a new issue