Skip to content

Commit

Permalink
Fixed short grass dropping wheat worms instead of oat seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Oct 11, 2024
1 parent 1bbc5b7 commit 932c773
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void generate() {
addVanillaDrop(Blocks.DIRT, block -> gemstoneAndWormDrops(block, 2, 0.05F, 0.052222223F, 0.055F, 0.066666665F, 0.1F));
addVanillaDrop(Blocks.COARSE_DIRT, block -> gemstoneAndWormDrops(block, 2, 0.05F, 0.052222223F, 0.055F, 0.066666665F, 0.1F));
addVanillaDrop(Blocks.GRASS_BLOCK, block -> gemstoneAndWormDrops(block, 2, 0.05F, 0.052222223F, 0.055F, 0.066666665F, 0.1F));
addVanillaDrop(Blocks.SHORT_GRASS, block -> wormDrops(block, 2, 0.05F, 0.052222223F, 0.055F, 0.066666665F, 0.1F));
addVanillaDrop(Blocks.SHORT_GRASS, block -> chanceDrop(block, UItems.OAT_SEEDS, 2, 0.05F, 0.052222223F, 0.055F, 0.066666665F, 0.1F));
addVanillaDrop(Blocks.MYCELIUM, block -> wormDrops(block, 3, 0.06F, 0.062222223F, 0.065F, 0.077777776F, 0.2F));
addVanillaDrop(Blocks.PODZOL, block -> wormDrops(block, 4, 0.06F, 0.062222223F, 0.065F, 0.077777776F, 0.2F));
addVanillaDrop(Blocks.DIAMOND_ORE, this::crystalShardDrops);
Expand Down Expand Up @@ -114,15 +114,19 @@ public LootTable.Builder chanceDropWithShears(Block block, ItemConvertible drop,
);
}

public LootTable.Builder wormDrops(Block block, int max, float...chance) {
public LootTable.Builder chanceDrop(Block block, ItemConvertible item, int max, float...chance) {
return LootTable.builder()
.pool(LootPool.builder()
.rolls(ConstantLootNumberProvider.create(1))
.conditionally(createWithoutSilkTouchCondition())
.with(chanceDrops(block, UItems.WHEAT_WORMS, max, chance))
.with(chanceDrops(block, item, max, chance))
);
}

public LootTable.Builder wormDrops(Block block, int max, float...chance) {
return chanceDrop(block, UItems.WHEAT_WORMS, max, chance);
}

public LootTable.Builder gemstoneAndWormDrops(Block block, int max, float...chance) {
return LootTable.builder()
.pool(LootPool.builder()
Expand Down

0 comments on commit 932c773

Please sign in to comment.