Skip to content

Commit

Permalink
feat[no-ci]: Add islandOnly tag to island_level predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
Awakened-Redstone committed Jul 16, 2024
1 parent f991211 commit 35b63c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.StringIdentifiable;

public record IslandLevelPredicate(int amount, Type type) implements LootCondition {
public record IslandLevelPredicate(int amount, Type type, boolean islandOnly) implements LootCondition {
public static final MapCodec<IslandLevelPredicate> CODEC = RecordCodecBuilder.mapCodec(instance ->
instance.group(
Codec.INT.fieldOf("amount").forGetter(IslandLevelPredicate::amount),
StringIdentifiable.createCodec(Type::values).optionalFieldOf("type", Type.LEVEL).forGetter(IslandLevelPredicate::type)
StringIdentifiable.createCodec(Type::values).optionalFieldOf("type", Type.LEVEL).forGetter(IslandLevelPredicate::type),
Codec.BOOL.optionalFieldOf("islandOnly", true).forGetter(IslandLevelPredicate::islandOnly)
).apply(instance, IslandLevelPredicate::new)
);

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/data/neoskies/block_gen/cobblestone.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"weight": 1,
"predicate": {
"condition": "neoskies:island_level",
"amount": 3
"amount": 3,
"islandOnly": false
}
}
]
Expand Down

0 comments on commit 35b63c7

Please sign in to comment.