From 1afcb0f2af36d3f8e63242140bd1e1418da31cd1 Mon Sep 17 00:00:00 2001 From: ACCBDD <9992251+ACCBDD@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:52:37 -0700 Subject: [PATCH] make leaves drop nuggets, like in the original dartcraft (#107) * make leaves drop nuggets, like in the original dartcraft * Remove wildcart import --------- Co-authored-by: Mrbysco --- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 6 +- .../loot_table/blocks/force_leaves.json | 57 ++ .../datagen/data/ForceLootProvider.java | 793 +++++++++--------- 3 files changed, 467 insertions(+), 389 deletions(-) diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index e6869652..fdfa113f 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.21.1 2024-08-25T23:46:34.836875276 Loot Tables +// 1.21.1 2024-10-31T14:17:58.1192349 Loot Tables a3f924f448e689c5b6356bc3513913f4a3e9d232 data/forcecraft/loot_table/blocks/black_force_furnace.json 08db02555ece2c9aa153c66c226a557cd8dc8f97 data/forcecraft/loot_table/blocks/blue_force_furnace.json 7abfdb8279c0cbb51bcbf6546cdf8618ac5676a4 data/forcecraft/loot_table/blocks/brown_force_furnace.json @@ -63,7 +63,7 @@ f9722d90ff154c2af7308081c18c5c7af4972fb6 data/forcecraft/loot_table/blocks/force 2beb7934090b2c2f09592e1e9b980a50bdc87536 data/forcecraft/loot_table/blocks/force_furnace.json 3d040912271d927c4fdd10a2a71fd89821f1de70 data/forcecraft/loot_table/blocks/force_gray_torch.json 4aa0d21c2520bf48db242337c5be1c4cca6f64bb data/forcecraft/loot_table/blocks/force_green_torch.json -ca78ec4c4855ebeb2489705fa72bb6158cc78dd4 data/forcecraft/loot_table/blocks/force_leaves.json +0403e710e2f1bb4e864381db03bf72b18e808f17 data/forcecraft/loot_table/blocks/force_leaves.json 28da173cfba709dfbb594bf9f45f06badf34d3e0 data/forcecraft/loot_table/blocks/force_light_blue_torch.json f24da43bc2b85f1140daeafb90640308683d0fe0 data/forcecraft/loot_table/blocks/force_light_gray_torch.json 38fd4c2a5d05f1260da54dd06f9bd93fdb51e284 data/forcecraft/loot_table/blocks/force_lime_torch.json @@ -71,9 +71,9 @@ f24da43bc2b85f1140daeafb90640308683d0fe0 data/forcecraft/loot_table/blocks/force acb7e9c8292bd186e836fe5c0d28acb12d6fbe43 data/forcecraft/loot_table/blocks/force_magenta_torch.json ec7ca1de7a6751bc696bc4f547a27ae3ad4e8acb data/forcecraft/loot_table/blocks/force_orange_torch.json 0779d86e0cf67fcdcc03b4d5e0d691d4c48276db data/forcecraft/loot_table/blocks/force_pink_torch.json +343e4bef1e27494008e39e5bf990486e42b50d19 data/forcecraft/loot_table/blocks/force_planks.json 75081f63b92cb2a22860243684dba8f45024d7f1 data/forcecraft/loot_table/blocks/force_plank_slab.json 04cc0186657cfcb9900cd27d801910e761dfe82a data/forcecraft/loot_table/blocks/force_plank_stairs.json -343e4bef1e27494008e39e5bf990486e42b50d19 data/forcecraft/loot_table/blocks/force_planks.json 4f87db2d1c069ab627216e6dd7ddf51b64a7a242 data/forcecraft/loot_table/blocks/force_purple_torch.json 379baf564fba3e64b30e6e25760725045b358dd1 data/forcecraft/loot_table/blocks/force_red_torch.json 4332e2e370d812736b9ae462ed6597f023cf3f83 data/forcecraft/loot_table/blocks/force_sapling.json diff --git a/src/generated/resources/data/forcecraft/loot_table/blocks/force_leaves.json b/src/generated/resources/data/forcecraft/loot_table/blocks/force_leaves.json index 0e019c51..27f6ea77 100644 --- a/src/generated/resources/data/forcecraft/loot_table/blocks/force_leaves.json +++ b/src/generated/resources/data/forcecraft/loot_table/blocks/force_leaves.json @@ -187,6 +187,63 @@ } ], "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": "minecraft:shears" + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + } + ] + } + } + ], + "entries": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:survives_explosion" + }, + { + "chances": [ + 0.025, + 0.03, + 0.035, + 0.04, + 0.045 + ], + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune" + } + ], + "name": "forcecraft:force_nugget" + } + ], + "rolls": 1.0 } ], "random_sequence": "forcecraft:blocks/force_leaves" diff --git a/src/main/java/com/mrbysco/forcecraft/datagen/data/ForceLootProvider.java b/src/main/java/com/mrbysco/forcecraft/datagen/data/ForceLootProvider.java index 7b3c168a..35155641 100644 --- a/src/main/java/com/mrbysco/forcecraft/datagen/data/ForceLootProvider.java +++ b/src/main/java/com/mrbysco/forcecraft/datagen/data/ForceLootProvider.java @@ -24,11 +24,13 @@ import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.ValidationContext; import net.minecraft.world.level.storage.loot.entries.LootItem; +import net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer; import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount; import net.minecraft.world.level.storage.loot.functions.EnchantedCountIncreaseFunction; import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction; import net.minecraft.world.level.storage.loot.functions.SmeltItemFunction; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; +import net.minecraft.world.level.storage.loot.predicates.BonusLevelTableCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemEntityPropertyCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceWithEnchantedBonusCondition; import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; @@ -111,6 +113,7 @@ import static com.mrbysco.forcecraft.registry.ForceRegistry.FORCE_LIME_TORCH; import static com.mrbysco.forcecraft.registry.ForceRegistry.FORCE_LOG; import static com.mrbysco.forcecraft.registry.ForceRegistry.FORCE_MAGENTA_TORCH; +import static com.mrbysco.forcecraft.registry.ForceRegistry.FORCE_NUGGET; import static com.mrbysco.forcecraft.registry.ForceRegistry.FORCE_ORANGE_TORCH; import static com.mrbysco.forcecraft.registry.ForceRegistry.FORCE_PINK_TORCH; import static com.mrbysco.forcecraft.registry.ForceRegistry.FORCE_PLANKS; @@ -156,414 +159,432 @@ import static com.mrbysco.forcecraft.registry.ForceRegistry.WHITE_FORCE_FURNACE; public class ForceLootProvider extends LootTableProvider { - public ForceLootProvider(PackOutput packOutput, CompletableFuture lookupProvider) { - super(packOutput, Set.of(), List.of( - new SubProviderEntry(ForceBlockLoot::new, LootContextParamSets.BLOCK), - new SubProviderEntry(ForceEntityLoot::new, LootContextParamSets.ENTITY), - new SubProviderEntry(SpoilsBagLootTableProvider::new, LootContextParamSets.GIFT) - ), lookupProvider); - } + public ForceLootProvider(PackOutput packOutput, CompletableFuture lookupProvider) { + super(packOutput, Set.of(), List.of( + new SubProviderEntry(ForceBlockLoot::new, LootContextParamSets.BLOCK), + new SubProviderEntry(ForceEntityLoot::new, LootContextParamSets.ENTITY), + new SubProviderEntry(SpoilsBagLootTableProvider::new, LootContextParamSets.GIFT) + ), lookupProvider); + } - private static class ForceBlockLoot extends BlockLootSubProvider { + private static class ForceBlockLoot extends BlockLootSubProvider { - protected ForceBlockLoot(HolderLookup.Provider provider) { - super(Set.of(), FeatureFlags.REGISTRY.allFlags(), provider); - } + protected ForceBlockLoot(HolderLookup.Provider provider) { + super(Set.of(), FeatureFlags.REGISTRY.allFlags(), provider); + } - @Override - public void generate() { - HolderLookup.RegistryLookup registrylookup = this.registries.lookupOrThrow(Registries.ENCHANTMENT); - add(POWER_ORE.get(), (ore) -> createSilkTouchDispatchTable(ore, applyExplosionDecay(POWER_ORE_ITEM.get(), LootItem.lootTableItem(FORCE_GEM.get()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F))).apply(ApplyBonusCount.addUniformBonusCount(registrylookup.getOrThrow(Enchantments.FORTUNE)))))); - add(DEEPSLATE_POWER_ORE.get(), (ore) -> createSilkTouchDispatchTable(ore, applyExplosionDecay(POWER_ORE_ITEM.get(), LootItem.lootTableItem(FORCE_GEM.get()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F))).apply(ApplyBonusCount.addUniformBonusCount(registrylookup.getOrThrow(Enchantments.FORTUNE)))))); + @Override + public void generate() { + HolderLookup.RegistryLookup registrylookup = this.registries.lookupOrThrow(Registries.ENCHANTMENT); + add(POWER_ORE.get(), (ore) -> createSilkTouchDispatchTable(ore, applyExplosionDecay(POWER_ORE_ITEM.get(), LootItem.lootTableItem(FORCE_GEM.get()) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F))).apply(ApplyBonusCount.addUniformBonusCount(registrylookup.getOrThrow(Enchantments.FORTUNE)))))); + add(DEEPSLATE_POWER_ORE.get(), (ore) -> createSilkTouchDispatchTable(ore, applyExplosionDecay(POWER_ORE_ITEM.get(), LootItem.lootTableItem(FORCE_GEM.get()) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(2.0F, 4.0F))).apply(ApplyBonusCount.addUniformBonusCount(registrylookup.getOrThrow(Enchantments.FORTUNE)))))); - dropSelf(INFUSER.get()); - add(FORCE_FURNACE.get(), createNameableBlockEntityTable(FORCE_FURNACE.get())); - add(BLACK_FORCE_FURNACE.get(), createNameableBlockEntityTable(BLACK_FORCE_FURNACE.get())); - add(BLUE_FORCE_FURNACE.get(), createNameableBlockEntityTable(BLUE_FORCE_FURNACE.get())); - add(BROWN_FORCE_FURNACE.get(), createNameableBlockEntityTable(BROWN_FORCE_FURNACE.get())); - add(CYAN_FORCE_FURNACE.get(), createNameableBlockEntityTable(CYAN_FORCE_FURNACE.get())); - add(GRAY_FORCE_FURNACE.get(), createNameableBlockEntityTable(GRAY_FORCE_FURNACE.get())); - add(GREEN_FORCE_FURNACE.get(), createNameableBlockEntityTable(GREEN_FORCE_FURNACE.get())); - add(LIGHT_BLUE_FORCE_FURNACE.get(), createNameableBlockEntityTable(LIGHT_BLUE_FORCE_FURNACE.get())); - add(LIGHT_GRAY_FORCE_FURNACE.get(), createNameableBlockEntityTable(LIGHT_GRAY_FORCE_FURNACE.get())); - add(LIME_FORCE_FURNACE.get(), createNameableBlockEntityTable(LIME_FORCE_FURNACE.get())); - add(MAGENTA_FORCE_FURNACE.get(), createNameableBlockEntityTable(MAGENTA_FORCE_FURNACE.get())); - add(ORANGE_FORCE_FURNACE.get(), createNameableBlockEntityTable(ORANGE_FORCE_FURNACE.get())); - add(PINK_FORCE_FURNACE.get(), createNameableBlockEntityTable(PINK_FORCE_FURNACE.get())); - add(PURPLE_FORCE_FURNACE.get(), createNameableBlockEntityTable(PURPLE_FORCE_FURNACE.get())); - add(RED_FORCE_FURNACE.get(), createNameableBlockEntityTable(RED_FORCE_FURNACE.get())); - add(WHITE_FORCE_FURNACE.get(), createNameableBlockEntityTable(WHITE_FORCE_FURNACE.get())); + dropSelf(INFUSER.get()); + add(FORCE_FURNACE.get(), createNameableBlockEntityTable(FORCE_FURNACE.get())); + add(BLACK_FORCE_FURNACE.get(), createNameableBlockEntityTable(BLACK_FORCE_FURNACE.get())); + add(BLUE_FORCE_FURNACE.get(), createNameableBlockEntityTable(BLUE_FORCE_FURNACE.get())); + add(BROWN_FORCE_FURNACE.get(), createNameableBlockEntityTable(BROWN_FORCE_FURNACE.get())); + add(CYAN_FORCE_FURNACE.get(), createNameableBlockEntityTable(CYAN_FORCE_FURNACE.get())); + add(GRAY_FORCE_FURNACE.get(), createNameableBlockEntityTable(GRAY_FORCE_FURNACE.get())); + add(GREEN_FORCE_FURNACE.get(), createNameableBlockEntityTable(GREEN_FORCE_FURNACE.get())); + add(LIGHT_BLUE_FORCE_FURNACE.get(), createNameableBlockEntityTable(LIGHT_BLUE_FORCE_FURNACE.get())); + add(LIGHT_GRAY_FORCE_FURNACE.get(), createNameableBlockEntityTable(LIGHT_GRAY_FORCE_FURNACE.get())); + add(LIME_FORCE_FURNACE.get(), createNameableBlockEntityTable(LIME_FORCE_FURNACE.get())); + add(MAGENTA_FORCE_FURNACE.get(), createNameableBlockEntityTable(MAGENTA_FORCE_FURNACE.get())); + add(ORANGE_FORCE_FURNACE.get(), createNameableBlockEntityTable(ORANGE_FORCE_FURNACE.get())); + add(PINK_FORCE_FURNACE.get(), createNameableBlockEntityTable(PINK_FORCE_FURNACE.get())); + add(PURPLE_FORCE_FURNACE.get(), createNameableBlockEntityTable(PURPLE_FORCE_FURNACE.get())); + add(RED_FORCE_FURNACE.get(), createNameableBlockEntityTable(RED_FORCE_FURNACE.get())); + add(WHITE_FORCE_FURNACE.get(), createNameableBlockEntityTable(WHITE_FORCE_FURNACE.get())); - add(FORCE_ENGINE.get(), createNameableBlockEntityTable(FORCE_ENGINE.get())); + add(FORCE_ENGINE.get(), createNameableBlockEntityTable(FORCE_ENGINE.get())); - dropSelf(FORCE_SAPLING.get()); - dropSelf(FORCE_LOG.get()); - dropSelf(FORCE_WOOD.get()); - dropSelf(FORCE_PLANKS.get()); - add(FORCE_LEAVES.get(), (leaves) -> createOakLeavesDrops(leaves, FORCE_SAPLING.get(), NORMAL_LEAVES_SAPLING_CHANCES)); + dropSelf(FORCE_SAPLING.get()); + dropSelf(FORCE_LOG.get()); + dropSelf(FORCE_WOOD.get()); + dropSelf(FORCE_PLANKS.get()); + add(FORCE_LEAVES.get(), (leaves) -> { + var pool = createOakLeavesDrops(leaves, FORCE_SAPLING.get(), NORMAL_LEAVES_SAPLING_CHANCES); + //add a loot pool for nuggets, base chance 0.025 (as in og dartcraft), + 0.005 per level of fortune + pool.withPool( + LootPool.lootPool() + .setRolls(ConstantValue.exactly(1.0F)) + .when(HAS_SHEARS.or(this.hasSilkTouch()).invert()) + .add( + ((LootPoolSingletonContainer.Builder) this.applyExplosionCondition(leaves, LootItem.lootTableItem(FORCE_NUGGET))) + .when( + BonusLevelTableCondition.bonusLevelFlatChance( + registrylookup.getOrThrow(Enchantments.FORTUNE), 0.025f, 0.03f, 0.035f, 0.04f, 0.045f + ) + ) + ) - dropSelf(FORCE_TORCH.get()); - dropSelf(FORCE_RED_TORCH.get()); - dropSelf(FORCE_ORANGE_TORCH.get()); - dropSelf(FORCE_GREEN_TORCH.get()); - dropSelf(FORCE_BLUE_TORCH.get()); - dropSelf(FORCE_WHITE_TORCH.get()); - dropSelf(FORCE_BLACK_TORCH.get()); - dropSelf(FORCE_BROWN_TORCH.get()); - dropSelf(FORCE_LIGHT_BLUE_TORCH.get()); - dropSelf(FORCE_MAGENTA_TORCH.get()); - dropSelf(FORCE_PINK_TORCH.get()); - dropSelf(FORCE_LIGHT_GRAY_TORCH.get()); - dropSelf(FORCE_LIME_TORCH.get()); - dropSelf(FORCE_CYAN_TORCH.get()); - dropSelf(FORCE_PURPLE_TORCH.get()); - dropSelf(FORCE_GRAY_TORCH.get()); - dropSelf(TIME_TORCH.get()); + ); + return pool; + }); - dropOther(WALL_FORCE_TORCH.get(), FORCE_TORCH.get()); - dropOther(WALL_FORCE_RED_TORCH.get(), FORCE_RED_TORCH.get()); - dropOther(WALL_FORCE_ORANGE_TORCH.get(), FORCE_ORANGE_TORCH.get()); - dropOther(WALL_FORCE_GREEN_TORCH.get(), FORCE_GREEN_TORCH.get()); - dropOther(WALL_FORCE_BLUE_TORCH.get(), FORCE_BLUE_TORCH.get()); - dropOther(WALL_FORCE_WHITE_TORCH.get(), FORCE_WHITE_TORCH.get()); - dropOther(WALL_FORCE_BLACK_TORCH.get(), FORCE_BLACK_TORCH.get()); - dropOther(WALL_FORCE_BROWN_TORCH.get(), FORCE_BROWN_TORCH.get()); - dropOther(WALL_FORCE_LIGHT_BLUE_TORCH.get(), FORCE_LIGHT_BLUE_TORCH.get()); - dropOther(WALL_FORCE_MAGENTA_TORCH.get(), FORCE_MAGENTA_TORCH.get()); - dropOther(WALL_FORCE_PINK_TORCH.get(), FORCE_PINK_TORCH.get()); - dropOther(WALL_FORCE_LIGHT_GRAY_TORCH.get(), FORCE_LIGHT_GRAY_TORCH.get()); - dropOther(WALL_FORCE_LIME_TORCH.get(), FORCE_LIME_TORCH.get()); - dropOther(WALL_FORCE_CYAN_TORCH.get(), FORCE_CYAN_TORCH.get()); - dropOther(WALL_FORCE_PURPLE_TORCH.get(), FORCE_PURPLE_TORCH.get()); - dropOther(WALL_FORCE_GRAY_TORCH.get(), FORCE_GRAY_TORCH.get()); - dropSelf(WALL_TIME_TORCH.get()); + dropSelf(FORCE_TORCH.get()); + dropSelf(FORCE_RED_TORCH.get()); + dropSelf(FORCE_ORANGE_TORCH.get()); + dropSelf(FORCE_GREEN_TORCH.get()); + dropSelf(FORCE_BLUE_TORCH.get()); + dropSelf(FORCE_WHITE_TORCH.get()); + dropSelf(FORCE_BLACK_TORCH.get()); + dropSelf(FORCE_BROWN_TORCH.get()); + dropSelf(FORCE_LIGHT_BLUE_TORCH.get()); + dropSelf(FORCE_MAGENTA_TORCH.get()); + dropSelf(FORCE_PINK_TORCH.get()); + dropSelf(FORCE_LIGHT_GRAY_TORCH.get()); + dropSelf(FORCE_LIME_TORCH.get()); + dropSelf(FORCE_CYAN_TORCH.get()); + dropSelf(FORCE_PURPLE_TORCH.get()); + dropSelf(FORCE_GRAY_TORCH.get()); + dropSelf(TIME_TORCH.get()); - //Bricks - dropSelf(FORCE_BRICK_RED.get()); - dropSelf(FORCE_BRICK_YELLOW.get()); - dropSelf(FORCE_BRICK_GREEN.get()); - dropSelf(FORCE_BRICK_BLUE.get()); - dropSelf(FORCE_BRICK_WHITE.get()); - dropSelf(FORCE_BRICK_BLACK.get()); - dropSelf(FORCE_BRICK_BROWN.get()); - dropSelf(FORCE_BRICK_ORANGE.get()); - dropSelf(FORCE_BRICK_LIGHT_BLUE.get()); - dropSelf(FORCE_BRICK_MAGENTA.get()); - dropSelf(FORCE_BRICK_PINK.get()); - dropSelf(FORCE_BRICK_LIGHT_GRAY.get()); - dropSelf(FORCE_BRICK_LIME.get()); - dropSelf(FORCE_BRICK_CYAN.get()); - dropSelf(FORCE_BRICK_PURPLE.get()); - dropSelf(FORCE_BRICK_GRAY.get()); - dropSelf(FORCE_BRICK.get()); + dropOther(WALL_FORCE_TORCH.get(), FORCE_TORCH.get()); + dropOther(WALL_FORCE_RED_TORCH.get(), FORCE_RED_TORCH.get()); + dropOther(WALL_FORCE_ORANGE_TORCH.get(), FORCE_ORANGE_TORCH.get()); + dropOther(WALL_FORCE_GREEN_TORCH.get(), FORCE_GREEN_TORCH.get()); + dropOther(WALL_FORCE_BLUE_TORCH.get(), FORCE_BLUE_TORCH.get()); + dropOther(WALL_FORCE_WHITE_TORCH.get(), FORCE_WHITE_TORCH.get()); + dropOther(WALL_FORCE_BLACK_TORCH.get(), FORCE_BLACK_TORCH.get()); + dropOther(WALL_FORCE_BROWN_TORCH.get(), FORCE_BROWN_TORCH.get()); + dropOther(WALL_FORCE_LIGHT_BLUE_TORCH.get(), FORCE_LIGHT_BLUE_TORCH.get()); + dropOther(WALL_FORCE_MAGENTA_TORCH.get(), FORCE_MAGENTA_TORCH.get()); + dropOther(WALL_FORCE_PINK_TORCH.get(), FORCE_PINK_TORCH.get()); + dropOther(WALL_FORCE_LIGHT_GRAY_TORCH.get(), FORCE_LIGHT_GRAY_TORCH.get()); + dropOther(WALL_FORCE_LIME_TORCH.get(), FORCE_LIME_TORCH.get()); + dropOther(WALL_FORCE_CYAN_TORCH.get(), FORCE_CYAN_TORCH.get()); + dropOther(WALL_FORCE_PURPLE_TORCH.get(), FORCE_PURPLE_TORCH.get()); + dropOther(WALL_FORCE_GRAY_TORCH.get(), FORCE_GRAY_TORCH.get()); + dropSelf(WALL_TIME_TORCH.get()); - //Stairs - dropSelf(FORCE_PLANK_STAIRS.get()); - dropSelf(FORCE_BRICK_RED_STAIRS.get()); - dropSelf(FORCE_BRICK_YELLOW_STAIRS.get()); - dropSelf(FORCE_BRICK_GREEN_STAIRS.get()); - dropSelf(FORCE_BRICK_BLUE_STAIRS.get()); - dropSelf(FORCE_BRICK_WHITE_STAIRS.get()); - dropSelf(FORCE_BRICK_BLACK_STAIRS.get()); - dropSelf(FORCE_BRICK_BROWN_STAIRS.get()); - dropSelf(FORCE_BRICK_ORANGE_STAIRS.get()); - dropSelf(FORCE_BRICK_LIGHT_BLUE_STAIRS.get()); - dropSelf(FORCE_BRICK_MAGENTA_STAIRS.get()); - dropSelf(FORCE_BRICK_PINK_STAIRS.get()); - dropSelf(FORCE_BRICK_LIGHT_GRAY_STAIRS.get()); - dropSelf(FORCE_BRICK_LIME_STAIRS.get()); - dropSelf(FORCE_BRICK_CYAN_STAIRS.get()); - dropSelf(FORCE_BRICK_PURPLE_STAIRS.get()); - dropSelf(FORCE_BRICK_GRAY_STAIRS.get()); - dropSelf(FORCE_BRICK_STAIRS.get()); + //Bricks + dropSelf(FORCE_BRICK_RED.get()); + dropSelf(FORCE_BRICK_YELLOW.get()); + dropSelf(FORCE_BRICK_GREEN.get()); + dropSelf(FORCE_BRICK_BLUE.get()); + dropSelf(FORCE_BRICK_WHITE.get()); + dropSelf(FORCE_BRICK_BLACK.get()); + dropSelf(FORCE_BRICK_BROWN.get()); + dropSelf(FORCE_BRICK_ORANGE.get()); + dropSelf(FORCE_BRICK_LIGHT_BLUE.get()); + dropSelf(FORCE_BRICK_MAGENTA.get()); + dropSelf(FORCE_BRICK_PINK.get()); + dropSelf(FORCE_BRICK_LIGHT_GRAY.get()); + dropSelf(FORCE_BRICK_LIME.get()); + dropSelf(FORCE_BRICK_CYAN.get()); + dropSelf(FORCE_BRICK_PURPLE.get()); + dropSelf(FORCE_BRICK_GRAY.get()); + dropSelf(FORCE_BRICK.get()); - //Slabs - add(FORCE_PLANK_SLAB.get(), createSlabItemTable(FORCE_PLANK_SLAB.get())); - add(FORCE_BRICK_RED_SLAB.get(), createSlabItemTable(FORCE_BRICK_RED_SLAB.get())); - add(FORCE_BRICK_YELLOW_SLAB.get(), createSlabItemTable(FORCE_BRICK_YELLOW_SLAB.get())); - add(FORCE_BRICK_GREEN_SLAB.get(), createSlabItemTable(FORCE_BRICK_GREEN_SLAB.get())); - add(FORCE_BRICK_BLUE_SLAB.get(), createSlabItemTable(FORCE_BRICK_BLUE_SLAB.get())); - add(FORCE_BRICK_WHITE_SLAB.get(), createSlabItemTable(FORCE_BRICK_WHITE_SLAB.get())); - add(FORCE_BRICK_BLACK_SLAB.get(), createSlabItemTable(FORCE_BRICK_BLACK_SLAB.get())); - add(FORCE_BRICK_BROWN_SLAB.get(), createSlabItemTable(FORCE_BRICK_BROWN_SLAB.get())); - add(FORCE_BRICK_ORANGE_SLAB.get(), createSlabItemTable(FORCE_BRICK_ORANGE_SLAB.get())); - add(FORCE_BRICK_LIGHT_BLUE_SLAB.get(), createSlabItemTable(FORCE_BRICK_LIGHT_BLUE_SLAB.get())); - add(FORCE_BRICK_MAGENTA_SLAB.get(), createSlabItemTable(FORCE_BRICK_MAGENTA_SLAB.get())); - add(FORCE_BRICK_PINK_SLAB.get(), createSlabItemTable(FORCE_BRICK_PINK_SLAB.get())); - add(FORCE_BRICK_LIGHT_GRAY_SLAB.get(), createSlabItemTable(FORCE_BRICK_LIGHT_GRAY_SLAB.get())); - add(FORCE_BRICK_LIME_SLAB.get(), createSlabItemTable(FORCE_BRICK_LIME_SLAB.get())); - add(FORCE_BRICK_CYAN_SLAB.get(), createSlabItemTable(FORCE_BRICK_CYAN_SLAB.get())); - add(FORCE_BRICK_PURPLE_SLAB.get(), createSlabItemTable(FORCE_BRICK_PURPLE_SLAB.get())); - add(FORCE_BRICK_GRAY_SLAB.get(), createSlabItemTable(FORCE_BRICK_GRAY_SLAB.get())); - add(FORCE_BRICK_SLAB.get(), createSlabItemTable(FORCE_BRICK_SLAB.get())); - } + //Stairs + dropSelf(FORCE_PLANK_STAIRS.get()); + dropSelf(FORCE_BRICK_RED_STAIRS.get()); + dropSelf(FORCE_BRICK_YELLOW_STAIRS.get()); + dropSelf(FORCE_BRICK_GREEN_STAIRS.get()); + dropSelf(FORCE_BRICK_BLUE_STAIRS.get()); + dropSelf(FORCE_BRICK_WHITE_STAIRS.get()); + dropSelf(FORCE_BRICK_BLACK_STAIRS.get()); + dropSelf(FORCE_BRICK_BROWN_STAIRS.get()); + dropSelf(FORCE_BRICK_ORANGE_STAIRS.get()); + dropSelf(FORCE_BRICK_LIGHT_BLUE_STAIRS.get()); + dropSelf(FORCE_BRICK_MAGENTA_STAIRS.get()); + dropSelf(FORCE_BRICK_PINK_STAIRS.get()); + dropSelf(FORCE_BRICK_LIGHT_GRAY_STAIRS.get()); + dropSelf(FORCE_BRICK_LIME_STAIRS.get()); + dropSelf(FORCE_BRICK_CYAN_STAIRS.get()); + dropSelf(FORCE_BRICK_PURPLE_STAIRS.get()); + dropSelf(FORCE_BRICK_GRAY_STAIRS.get()); + dropSelf(FORCE_BRICK_STAIRS.get()); - @Override - protected Iterable getKnownBlocks() { - return (Iterable) ForceRegistry.BLOCKS.getEntries().stream().map(holder -> (Block) holder.get())::iterator; - } - } + //Slabs + add(FORCE_PLANK_SLAB.get(), createSlabItemTable(FORCE_PLANK_SLAB.get())); + add(FORCE_BRICK_RED_SLAB.get(), createSlabItemTable(FORCE_BRICK_RED_SLAB.get())); + add(FORCE_BRICK_YELLOW_SLAB.get(), createSlabItemTable(FORCE_BRICK_YELLOW_SLAB.get())); + add(FORCE_BRICK_GREEN_SLAB.get(), createSlabItemTable(FORCE_BRICK_GREEN_SLAB.get())); + add(FORCE_BRICK_BLUE_SLAB.get(), createSlabItemTable(FORCE_BRICK_BLUE_SLAB.get())); + add(FORCE_BRICK_WHITE_SLAB.get(), createSlabItemTable(FORCE_BRICK_WHITE_SLAB.get())); + add(FORCE_BRICK_BLACK_SLAB.get(), createSlabItemTable(FORCE_BRICK_BLACK_SLAB.get())); + add(FORCE_BRICK_BROWN_SLAB.get(), createSlabItemTable(FORCE_BRICK_BROWN_SLAB.get())); + add(FORCE_BRICK_ORANGE_SLAB.get(), createSlabItemTable(FORCE_BRICK_ORANGE_SLAB.get())); + add(FORCE_BRICK_LIGHT_BLUE_SLAB.get(), createSlabItemTable(FORCE_BRICK_LIGHT_BLUE_SLAB.get())); + add(FORCE_BRICK_MAGENTA_SLAB.get(), createSlabItemTable(FORCE_BRICK_MAGENTA_SLAB.get())); + add(FORCE_BRICK_PINK_SLAB.get(), createSlabItemTable(FORCE_BRICK_PINK_SLAB.get())); + add(FORCE_BRICK_LIGHT_GRAY_SLAB.get(), createSlabItemTable(FORCE_BRICK_LIGHT_GRAY_SLAB.get())); + add(FORCE_BRICK_LIME_SLAB.get(), createSlabItemTable(FORCE_BRICK_LIME_SLAB.get())); + add(FORCE_BRICK_CYAN_SLAB.get(), createSlabItemTable(FORCE_BRICK_CYAN_SLAB.get())); + add(FORCE_BRICK_PURPLE_SLAB.get(), createSlabItemTable(FORCE_BRICK_PURPLE_SLAB.get())); + add(FORCE_BRICK_GRAY_SLAB.get(), createSlabItemTable(FORCE_BRICK_GRAY_SLAB.get())); + add(FORCE_BRICK_SLAB.get(), createSlabItemTable(FORCE_BRICK_SLAB.get())); + } - private static class ForceEntityLoot extends EntityLootSubProvider { + @Override + protected Iterable getKnownBlocks() { + return (Iterable) ForceRegistry.BLOCKS.getEntries().stream().map(holder -> (Block) holder.get())::iterator; + } + } - protected ForceEntityLoot(HolderLookup.Provider provider) { - super(FeatureFlags.REGISTRY.allFlags(), provider); - } + private static class ForceEntityLoot extends EntityLootSubProvider { - @Override - public void generate() { - //Cold mobs - this.add( - ForceEntities.COLD_CHICKEN.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(Items.CHICKEN) - .apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - ) - ) - ); - this.add( - ForceEntities.COLD_COW.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(Items.BEEF) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F))) - .apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - ) - ) - ); - this.add( - ForceEntities.COLD_PIG.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(Items.PORKCHOP) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F))) - .apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - ) - ) - ); + protected ForceEntityLoot(HolderLookup.Provider provider) { + super(FeatureFlags.REGISTRY.allFlags(), provider); + } - //Ender mobs - this.add( - ForceEntities.ANGRY_ENDERMAN.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(Items.ENDER_PEARL) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F))) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - ) - ) - ); - this.add( - ForceEntities.ENDER_TOT.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(Items.ENDER_PEARL) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F))) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - ) - ) - .withPool( - LootPool.lootPool() - .name("spoils") - .setRolls(ConstantValue.exactly(1.0F)) - .when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F)) - .add( - LootItem.lootTableItem(ForceRegistry.SPOILS_BAG.get()) - ) - ) - ); - //Creeper tot - this.add( - ForceEntities.CREEPER_TOT.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(ForceRegistry.PILE_OF_GUNPOWDER.get()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - ) - ) - .withPool( - LootPool.lootPool() - .name("head") - .setRolls(ConstantValue.exactly(1.0F)) - .when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F)) - .add( - LootItem.lootTableItem(Items.CREEPER_HEAD) - ) - ) - .withPool( - LootPool.lootPool() - .name("spoils") - .setRolls(ConstantValue.exactly(1.0F)) - .when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F)) - .add( - LootItem.lootTableItem(ForceRegistry.SPOILS_BAG.get()) - ) - ) - ); - //Chu Chu mobs - this.add( - ForceEntities.BLUE_CHU_CHU.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(ForceRegistry.BLUE_CHU_JELLY.get()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - .when(this.killedByFrog().invert()) - ) - .add( - LootItem.lootTableItem(ForceRegistry.BLUE_CHU_JELLY.get()) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) - .when(this.killedByFrog()) - ) - .when( - LootItemEntityPropertyCondition.hasProperties( - LootContext.EntityTarget.THIS, - EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1))) - ) - ) - ) - ); - this.add( - ForceEntities.GOLD_CHU_CHU.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(ForceRegistry.GOLD_CHU_JELLY.get()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - .when(this.killedByFrog().invert()) - ) - .add( - LootItem.lootTableItem(ForceRegistry.GOLD_CHU_JELLY.get()) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) - .when(this.killedByFrog()) - ) - .when( - LootItemEntityPropertyCondition.hasProperties( - LootContext.EntityTarget.THIS, - EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1))) - ) - ) - ) - ); - this.add( - ForceEntities.GREEN_CHU_CHU.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(ForceRegistry.GREEN_CHU_JELLY.get()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - .when(this.killedByFrog().invert()) - ) - .add( - LootItem.lootTableItem(ForceRegistry.GREEN_CHU_JELLY.get()) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) - .when(this.killedByFrog()) - ) - .when( - LootItemEntityPropertyCondition.hasProperties( - LootContext.EntityTarget.THIS, - EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1))) - ) - ) - ) - ); - this.add( - ForceEntities.RED_CHU_CHU.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - .setRolls(ConstantValue.exactly(1.0F)) - .add( - LootItem.lootTableItem(ForceRegistry.RED_CHU_JELLY.get()) - .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) - .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) - .when(this.killedByFrog().invert()) - ) - .add( - LootItem.lootTableItem(ForceRegistry.RED_CHU_JELLY.get()) - .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) - .when(this.killedByFrog()) - ) - .when( - LootItemEntityPropertyCondition.hasProperties( - LootContext.EntityTarget.THIS, - EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1))) - ) - ) - ) - ); + @Override + public void generate() { + //Cold mobs + this.add( + ForceEntities.COLD_CHICKEN.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(Items.CHICKEN) + .apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + ) + ) + ); + this.add( + ForceEntities.COLD_COW.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(Items.BEEF) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F))) + .apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + ) + ) + ); + this.add( + ForceEntities.COLD_PIG.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(Items.PORKCHOP) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 3.0F))) + .apply(SmeltItemFunction.smelted().when(this.shouldSmeltLoot())) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + ) + ) + ); - //Fairy - this.add( - ForceEntities.FAIRY.get(), - LootTable.lootTable() - .withPool( - LootPool.lootPool() - .name("main") - ) - ); - } + //Ender mobs + this.add( + ForceEntities.ANGRY_ENDERMAN.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(Items.ENDER_PEARL) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F))) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + ) + ) + ); + this.add( + ForceEntities.ENDER_TOT.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(Items.ENDER_PEARL) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 1.0F))) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + ) + ) + .withPool( + LootPool.lootPool() + .name("spoils") + .setRolls(ConstantValue.exactly(1.0F)) + .when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F)) + .add( + LootItem.lootTableItem(ForceRegistry.SPOILS_BAG.get()) + ) + ) + ); + //Creeper tot + this.add( + ForceEntities.CREEPER_TOT.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(ForceRegistry.PILE_OF_GUNPOWDER.get()) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + ) + ) + .withPool( + LootPool.lootPool() + .name("head") + .setRolls(ConstantValue.exactly(1.0F)) + .when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F)) + .add( + LootItem.lootTableItem(Items.CREEPER_HEAD) + ) + ) + .withPool( + LootPool.lootPool() + .name("spoils") + .setRolls(ConstantValue.exactly(1.0F)) + .when(LootItemRandomChanceWithEnchantedBonusCondition.randomChanceAndLootingBoost(this.registries, 0.025F, 0.01F)) + .add( + LootItem.lootTableItem(ForceRegistry.SPOILS_BAG.get()) + ) + ) + ); + //Chu Chu mobs + this.add( + ForceEntities.BLUE_CHU_CHU.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(ForceRegistry.BLUE_CHU_JELLY.get()) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + .when(this.killedByFrog().invert()) + ) + .add( + LootItem.lootTableItem(ForceRegistry.BLUE_CHU_JELLY.get()) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) + .when(this.killedByFrog()) + ) + .when( + LootItemEntityPropertyCondition.hasProperties( + LootContext.EntityTarget.THIS, + EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1))) + ) + ) + ) + ); + this.add( + ForceEntities.GOLD_CHU_CHU.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(ForceRegistry.GOLD_CHU_JELLY.get()) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + .when(this.killedByFrog().invert()) + ) + .add( + LootItem.lootTableItem(ForceRegistry.GOLD_CHU_JELLY.get()) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) + .when(this.killedByFrog()) + ) + .when( + LootItemEntityPropertyCondition.hasProperties( + LootContext.EntityTarget.THIS, + EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1))) + ) + ) + ) + ); + this.add( + ForceEntities.GREEN_CHU_CHU.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(ForceRegistry.GREEN_CHU_JELLY.get()) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + .when(this.killedByFrog().invert()) + ) + .add( + LootItem.lootTableItem(ForceRegistry.GREEN_CHU_JELLY.get()) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) + .when(this.killedByFrog()) + ) + .when( + LootItemEntityPropertyCondition.hasProperties( + LootContext.EntityTarget.THIS, + EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1))) + ) + ) + ) + ); + this.add( + ForceEntities.RED_CHU_CHU.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + .setRolls(ConstantValue.exactly(1.0F)) + .add( + LootItem.lootTableItem(ForceRegistry.RED_CHU_JELLY.get()) + .apply(SetItemCountFunction.setCount(UniformGenerator.between(0.0F, 2.0F))) + .apply(EnchantedCountIncreaseFunction.lootingMultiplier(this.registries, UniformGenerator.between(0.0F, 1.0F))) + .when(this.killedByFrog().invert()) + ) + .add( + LootItem.lootTableItem(ForceRegistry.RED_CHU_JELLY.get()) + .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F))) + .when(this.killedByFrog()) + ) + .when( + LootItemEntityPropertyCondition.hasProperties( + LootContext.EntityTarget.THIS, + EntityPredicate.Builder.entity().subPredicate(SlimePredicate.sized(MinMaxBounds.Ints.exactly(1))) + ) + ) + ) + ); - @Override - protected boolean canHaveLootTable(EntityType p_249029_) { - return super.canHaveLootTable(p_249029_); - } + //Fairy + this.add( + ForceEntities.FAIRY.get(), + LootTable.lootTable() + .withPool( + LootPool.lootPool() + .name("main") + ) + ); + } - @Override - protected Stream> getKnownEntityTypes() { - return ForceEntities.ENTITY_TYPES.getEntries().stream().map(DeferredHolder::get); - } + @Override + protected boolean canHaveLootTable(EntityType p_249029_) { + return super.canHaveLootTable(p_249029_); + } - } + @Override + protected Stream> getKnownEntityTypes() { + return ForceEntities.ENTITY_TYPES.getEntries().stream().map(DeferredHolder::get); + } - @Override - protected void validate(WritableRegistry writableregistry, ValidationContext validationcontext, ProblemReporter.Collector problemreporter$collector) { + } + + @Override + protected void validate(WritableRegistry writableregistry, ValidationContext validationcontext, ProblemReporter.Collector problemreporter$collector) { // super.validate(writableregistry, validationcontext, problemreporter$collector); - } + } // @Override // protected void validate(Map map, @NotNull ValidationContext validationContext) {