Fixed short grass dropping wheat worms instead of oat seeds

This commit is contained in:
Sollace 2024-10-11 16:01:43 +01:00
parent 1bbc5b7569
commit 932c773e12
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -79,7 +79,7 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid
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);
@ -114,15 +114,19 @@ public class UBlockAdditionsLootTableProvider extends FabricBlockLootTableProvid
);
}
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()