From 83e92df64cb01cd31ee4512c460dba18f760cbdb Mon Sep 17 00:00:00 2001 From: Necrontyr Date: Tue, 18 Oct 2022 23:56:21 +0200 Subject: [PATCH 1/5] [Feature] End fishing loot tables. Fixes quiqueck/BetterEnd#79 --- .../betterx/betterend/registry/EndTags.java | 2 + .../betterx/betterend/util/LootTableUtil.java | 108 +++++++++++++++++- .../loot_tables/gameplay/fishing/fish.json | 4 + .../loot_tables/gameplay/fishing/junk.json | 4 + .../gameplay/fishing/treasure.json | 4 + 5 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/data/betterend/loot_tables/gameplay/fishing/fish.json create mode 100644 src/main/resources/data/betterend/loot_tables/gameplay/fishing/junk.json create mode 100644 src/main/resources/data/betterend/loot_tables/gameplay/fishing/treasure.json diff --git a/src/main/java/org/betterx/betterend/registry/EndTags.java b/src/main/java/org/betterx/betterend/registry/EndTags.java index 9c6f0c28..aed4c6df 100644 --- a/src/main/java/org/betterx/betterend/registry/EndTags.java +++ b/src/main/java/org/betterx/betterend/registry/EndTags.java @@ -125,6 +125,8 @@ public class EndTags { TagManager.ITEMS.add(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON); TagManager.ITEMS.add(ALLOYING_GOLD, Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD); TagManager.ITEMS.add(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER); + + TagManager.ITEMS.add(ItemTags.FISHES, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED); } public static void addEndGround(Block bl) { diff --git a/src/main/java/org/betterx/betterend/util/LootTableUtil.java b/src/main/java/org/betterx/betterend/util/LootTableUtil.java index 1fcd0861..ef33521b 100644 --- a/src/main/java/org/betterx/betterend/util/LootTableUtil.java +++ b/src/main/java/org/betterx/betterend/util/LootTableUtil.java @@ -1,6 +1,20 @@ package org.betterx.betterend.util; +import net.minecraft.advancements.critereon.EntityPredicate; +import net.minecraft.advancements.critereon.FishingHookPredicate; +import net.minecraft.advancements.critereon.LocationPredicate; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.storage.loot.BuiltInLootTables; +import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.entries.*; +import net.minecraft.world.level.storage.loot.functions.EnchantWithLevelsFunction; +import net.minecraft.world.level.storage.loot.functions.SetItemDamageFunction; +import net.minecraft.world.level.storage.loot.predicates.LocationCheck; +import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; +import net.minecraft.world.level.storage.loot.predicates.LootItemEntityPropertyCondition; +import org.betterx.bclib.BCLib; import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome; +import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry; import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI; import org.betterx.bclib.complexmaterials.WoodenComplexMaterial; import org.betterx.betterend.BetterEnd; @@ -15,12 +29,12 @@ import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.storage.loot.LootPool; import net.minecraft.world.level.storage.loot.LootTable; -import net.minecraft.world.level.storage.loot.entries.LootItem; import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition; import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; import net.fabricmc.fabric.api.loot.v2.LootTableEvents; +import org.betterx.betterend.world.biome.EndBiome; public class LootTableUtil { private static final ResourceLocation END_CITY_TREASURE_ID = new ResourceLocation("chests/end_city_treasure"); @@ -30,6 +44,34 @@ public class LootTableUtil { private static final ResourceLocation SHADOW_FOREST = BetterEnd.makeID("chests/shadow_forest"); private static final ResourceLocation LANTERN_WOODS = BetterEnd.makeID("chests/lantern_woods"); private static final ResourceLocation UMBRELLA_JUNGLE = BetterEnd.makeID("chests/umbrella_jungle"); + private static final ResourceLocation FISHING_FISH = BetterEnd.makeID("gameplay/fishing/fish"); + private static final ResourceLocation FISHING_TREASURE = BetterEnd.makeID("gameplay/fishing/treasure"); + private static final ResourceLocation FISHING_JUNK = BetterEnd.makeID("gameplay/fishing/junk"); + + private static final LootItemCondition.Builder IN_END + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setDimension(Level.END)); + private static final LootItemCondition.Builder IN_FOGGY_MUSHROOMLAND + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.FOGGY_MUSHROOMLAND.getBiomeKey())); + private static final LootItemCondition.Builder IN_CHORUS_FOREST + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.CHORUS_FOREST.getBiomeKey())); + private static final LootItemCondition.Builder IN_AMBER_LAND + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.AMBER_LAND.getBiomeKey())); + private static final LootItemCondition.Builder IN_GLOWING_GRASSLANDS + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.GLOWING_GRASSLANDS.getBiomeKey())); + private static final LootItemCondition.Builder IN_LANTERN_WOODS + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.LANTERN_WOODS.getBiomeKey())); + private static final LootItemCondition.Builder IN_MEGALAKE + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.MEGALAKE.getBiomeKey())); + private static final LootItemCondition.Builder IN_MEGALAKE_GROVE + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.MEGALAKE_GROVE.getBiomeKey())); + private static final LootItemCondition.Builder IN_NEON_OASIS + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.NEON_OASIS.getBiomeKey())); + private static final LootItemCondition.Builder IN_SHADOW_FOREST + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.SHADOW_FOREST.getBiomeKey())); + private static final LootItemCondition.Builder IN_SULPHUR_SPRINGS + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.SULPHUR_SPRINGS.getBiomeKey())); + private static final LootItemCondition.Builder IN_UMBRELLA_JUNGLE + = LocationCheck.checkLocation(LocationPredicate.Builder.location().setBiome(EndBiomes.UMBRELLA_JUNGLE.getBiomeKey())); public static void init() { LootTableEvents.MODIFY.register((resourceManager, lootManager, id, table, setter) -> { @@ -48,6 +90,37 @@ public class LootTableUtil { builder.add(LootItem.lootTableItem(EndItems.MUSIC_DISC_EO_DRACONA)); table.withPool(builder); } else if (id.getNamespace().equals(BetterEnd.MOD_ID)) { + if (FISHING_FISH.equals(id)) { + LootPool.Builder builder = LootPool.lootPool() + .add(LootItem.lootTableItem(EndItems.END_FISH_RAW)); + table.withPool(builder); + return; + } else if (FISHING_JUNK.equals(id)) { + LootPool.Builder builder = LootPool.lootPool() + .add(LootItem.lootTableItem(EndItems.END_LILY_LEAF)) + .add(LootItem.lootTableItem(Items.ENDER_PEARL)) + .add(LootItem.lootTableItem(Items.CHORUS_FRUIT)) + .add(LootItem.lootTableItem(EndItems.GELATINE)) + .add(LootItem.lootTableItem(EndItems.CRYSTAL_SHARDS)); + addCharnia(builder); + table.withPool(builder); + return; + } else if (FISHING_TREASURE.equals(id)) { + LootPool.Builder builder = LootPool.lootPool() + .add(LootItem.lootTableItem(EndItems.AETERNIUM_SWORD_BLADE)) + .add(LootItem.lootTableItem(EndItems.AETERNIUM_FORGED_PLATE)) + .add(LootItem.lootTableItem(EndBlocks.MENGER_SPONGE)) + .add(LootItem.lootTableItem(Items.BOW) + .apply(SetItemDamageFunction.setDamage(UniformGenerator.between(0.0F, 0.25F))) + .apply(EnchantWithLevelsFunction.enchantWithLevels(ConstantValue.exactly(30.0F)).allowTreasure())) + .add(LootItem.lootTableItem(Items.FISHING_ROD) + .apply(SetItemDamageFunction.setDamage(UniformGenerator.between(0.0F, 0.25F))) + .apply(EnchantWithLevelsFunction.enchantWithLevels(ConstantValue.exactly(30.0F)).allowTreasure())) + .add(LootItem.lootTableItem(Items.BOOK) + .apply(EnchantWithLevelsFunction.enchantWithLevels(ConstantValue.exactly(30.0F)).allowTreasure())); + table.withPool(builder); + return; + } addCommonItems(table); if (FOGGY_MUSHROOMLAND.equals(id)) { LootPool.Builder builder = LootPool.lootPool(); @@ -88,6 +161,24 @@ public class LootTableUtil { } } }); + + LootTableEvents.REPLACE.register((resourceManager, lootManager, id, originalTable, setter) -> { + if (BuiltInLootTables.FISHING.equals(id)) { + LootTable.Builder builder = LootTable.lootTable() + .withPool(LootPool.lootPool().when(IN_END.invert()).setRolls(ConstantValue.exactly(1.0F)) + .add(LootTableReference.lootTableReference(BuiltInLootTables.FISHING_JUNK).setWeight(10).setQuality(-2)) + .add(LootTableReference.lootTableReference(BuiltInLootTables.FISHING_TREASURE).setWeight(5).setQuality(2) + .when(LootItemEntityPropertyCondition.hasProperties(LootContext.EntityTarget.THIS, + EntityPredicate.Builder.entity().subPredicate(FishingHookPredicate.inOpenWater(true))))) + .add(LootTableReference.lootTableReference(BuiltInLootTables.FISHING_FISH).setWeight(85).setQuality(-1))) + .withPool(LootPool.lootPool().when(IN_END).setRolls(ConstantValue.exactly(1.0F)) + .add(LootTableReference.lootTableReference(FISHING_FISH).setWeight(85).setQuality(-1)) + .add(LootTableReference.lootTableReference(FISHING_TREASURE).setWeight(5).setQuality(2)) + .add(LootTableReference.lootTableReference(FISHING_JUNK).setWeight(10).setQuality(-2))); + return builder.build(); + } + return null; + }); } public static ResourceLocation getTable(Holder biome) { @@ -106,6 +197,21 @@ public class LootTableUtil { return COMMON; } + private static void addCharnia(LootPool.Builder pool) { + pool.add(LootItem.lootTableItem(EndBlocks.CHARNIA_CYAN) + .when(IN_GLOWING_GRASSLANDS.or(IN_MEGALAKE).or(IN_MEGALAKE_GROVE).or(IN_NEON_OASIS))); + pool.add(LootItem.lootTableItem(EndBlocks.CHARNIA_LIGHT_BLUE) + .when(IN_FOGGY_MUSHROOMLAND.or(IN_GLOWING_GRASSLANDS).or(IN_MEGALAKE).or(IN_MEGALAKE_GROVE).or(IN_UMBRELLA_JUNGLE))); + pool.add(LootItem.lootTableItem(EndBlocks.CHARNIA_GREEN) + .when(IN_GLOWING_GRASSLANDS.or(IN_NEON_OASIS).or(IN_SULPHUR_SPRINGS).or(IN_UMBRELLA_JUNGLE))); + pool.add(LootItem.lootTableItem(EndBlocks.CHARNIA_RED) + .when(IN_AMBER_LAND.or(IN_LANTERN_WOODS).or(IN_NEON_OASIS))); + pool.add(LootItem.lootTableItem(EndBlocks.CHARNIA_ORANGE) + .when(IN_AMBER_LAND.or(IN_LANTERN_WOODS).or(IN_SULPHUR_SPRINGS))); + pool.add(LootItem.lootTableItem(EndBlocks.CHARNIA_PURPLE) + .when(IN_CHORUS_FOREST.or(IN_SHADOW_FOREST))); + } + private static void addCommonItems(LootTable.Builder table) { LootPool.Builder builder = LootPool.lootPool(); builder.setRolls(UniformGenerator.between(0, 2)); diff --git a/src/main/resources/data/betterend/loot_tables/gameplay/fishing/fish.json b/src/main/resources/data/betterend/loot_tables/gameplay/fishing/fish.json new file mode 100644 index 00000000..16cac10a --- /dev/null +++ b/src/main/resources/data/betterend/loot_tables/gameplay/fishing/fish.json @@ -0,0 +1,4 @@ +{ + "type": "minecraft:fishing", + "pools": [] +} diff --git a/src/main/resources/data/betterend/loot_tables/gameplay/fishing/junk.json b/src/main/resources/data/betterend/loot_tables/gameplay/fishing/junk.json new file mode 100644 index 00000000..16cac10a --- /dev/null +++ b/src/main/resources/data/betterend/loot_tables/gameplay/fishing/junk.json @@ -0,0 +1,4 @@ +{ + "type": "minecraft:fishing", + "pools": [] +} diff --git a/src/main/resources/data/betterend/loot_tables/gameplay/fishing/treasure.json b/src/main/resources/data/betterend/loot_tables/gameplay/fishing/treasure.json new file mode 100644 index 00000000..16cac10a --- /dev/null +++ b/src/main/resources/data/betterend/loot_tables/gameplay/fishing/treasure.json @@ -0,0 +1,4 @@ +{ + "type": "minecraft:fishing", + "pools": [] +} From 64993b395e0cf59aa6a560a2158651a7d2b3d1e7 Mon Sep 17 00:00:00 2001 From: Necrontyr Date: Tue, 18 Oct 2022 23:58:10 +0200 Subject: [PATCH 2/5] Remove unused imports --- src/main/java/org/betterx/betterend/util/LootTableUtil.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/org/betterx/betterend/util/LootTableUtil.java b/src/main/java/org/betterx/betterend/util/LootTableUtil.java index ef33521b..4a163bfa 100644 --- a/src/main/java/org/betterx/betterend/util/LootTableUtil.java +++ b/src/main/java/org/betterx/betterend/util/LootTableUtil.java @@ -12,9 +12,7 @@ import net.minecraft.world.level.storage.loot.functions.SetItemDamageFunction; import net.minecraft.world.level.storage.loot.predicates.LocationCheck; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemEntityPropertyCondition; -import org.betterx.bclib.BCLib; import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome; -import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry; import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI; import org.betterx.bclib.complexmaterials.WoodenComplexMaterial; import org.betterx.betterend.BetterEnd; @@ -34,7 +32,6 @@ import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; import net.fabricmc.fabric.api.loot.v2.LootTableEvents; -import org.betterx.betterend.world.biome.EndBiome; public class LootTableUtil { private static final ResourceLocation END_CITY_TREASURE_ID = new ResourceLocation("chests/end_city_treasure"); From 70eb63308375d59f9945fd38d000a305a034c172 Mon Sep 17 00:00:00 2001 From: Necrontyr Date: Wed, 19 Oct 2022 00:00:49 +0200 Subject: [PATCH 3/5] Avoid star import --- src/main/java/org/betterx/betterend/util/LootTableUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/betterx/betterend/util/LootTableUtil.java b/src/main/java/org/betterx/betterend/util/LootTableUtil.java index 4a163bfa..c9fd1c8b 100644 --- a/src/main/java/org/betterx/betterend/util/LootTableUtil.java +++ b/src/main/java/org/betterx/betterend/util/LootTableUtil.java @@ -6,7 +6,8 @@ import net.minecraft.advancements.critereon.LocationPredicate; import net.minecraft.world.level.Level; import net.minecraft.world.level.storage.loot.BuiltInLootTables; import net.minecraft.world.level.storage.loot.LootContext; -import net.minecraft.world.level.storage.loot.entries.*; +import net.minecraft.world.level.storage.loot.entries.LootItem; +import net.minecraft.world.level.storage.loot.entries.LootTableReference; import net.minecraft.world.level.storage.loot.functions.EnchantWithLevelsFunction; import net.minecraft.world.level.storage.loot.functions.SetItemDamageFunction; import net.minecraft.world.level.storage.loot.predicates.LocationCheck; From e72d87e6455d907e63f1ef88de25174005ce0c7f Mon Sep 17 00:00:00 2001 From: Necrontyr Date: Thu, 20 Oct 2022 04:33:40 +0200 Subject: [PATCH 4/5] Don't reset vanilla fishing tables to default --- build.gradle | 2 +- .../betterx/betterend/util/LootTableUtil.java | 49 ++++++------------- 2 files changed, 17 insertions(+), 34 deletions(-) diff --git a/build.gradle b/build.gradle index a0d17eb8..2c218f87 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,7 @@ loom { accessWidenerPath = file("src/main/resources/betterend.accesswidener") interfaceInjection { // When enabled injected interfaces from dependecies will be applied. - enableDependencyInterfaceInjection = false + enableDependencyInterfaceInjection = true } } diff --git a/src/main/java/org/betterx/betterend/util/LootTableUtil.java b/src/main/java/org/betterx/betterend/util/LootTableUtil.java index c9fd1c8b..1cd56b23 100644 --- a/src/main/java/org/betterx/betterend/util/LootTableUtil.java +++ b/src/main/java/org/betterx/betterend/util/LootTableUtil.java @@ -1,18 +1,5 @@ package org.betterx.betterend.util; -import net.minecraft.advancements.critereon.EntityPredicate; -import net.minecraft.advancements.critereon.FishingHookPredicate; -import net.minecraft.advancements.critereon.LocationPredicate; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.storage.loot.BuiltInLootTables; -import net.minecraft.world.level.storage.loot.LootContext; -import net.minecraft.world.level.storage.loot.entries.LootItem; -import net.minecraft.world.level.storage.loot.entries.LootTableReference; -import net.minecraft.world.level.storage.loot.functions.EnchantWithLevelsFunction; -import net.minecraft.world.level.storage.loot.functions.SetItemDamageFunction; -import net.minecraft.world.level.storage.loot.predicates.LocationCheck; -import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; -import net.minecraft.world.level.storage.loot.predicates.LootItemEntityPropertyCondition; import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome; import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI; import org.betterx.bclib.complexmaterials.WoodenComplexMaterial; @@ -21,21 +8,29 @@ import org.betterx.betterend.registry.EndBiomes; import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndItems; +import net.minecraft.advancements.critereon.LocationPredicate; import net.minecraft.core.Holder; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.Level; import net.minecraft.world.level.storage.loot.LootPool; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition; import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; +import net.minecraft.world.level.storage.loot.BuiltInLootTables; +import net.minecraft.world.level.storage.loot.entries.LootItem; +import net.minecraft.world.level.storage.loot.entries.LootTableReference; +import net.minecraft.world.level.storage.loot.functions.EnchantWithLevelsFunction; +import net.minecraft.world.level.storage.loot.functions.SetItemDamageFunction; +import net.minecraft.world.level.storage.loot.predicates.LocationCheck; +import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.fabricmc.fabric.api.loot.v2.LootTableEvents; public class LootTableUtil { - private static final ResourceLocation END_CITY_TREASURE_ID = new ResourceLocation("chests/end_city_treasure"); private static final ResourceLocation COMMON = BetterEnd.makeID("chests/common"); private static final ResourceLocation FOGGY_MUSHROOMLAND = BetterEnd.makeID("chests/foggy_mushroomland"); private static final ResourceLocation CHORUS_FOREST = BetterEnd.makeID("chests/chorus_forest"); @@ -73,7 +68,7 @@ public class LootTableUtil { public static void init() { LootTableEvents.MODIFY.register((resourceManager, lootManager, id, table, setter) -> { - if (END_CITY_TREASURE_ID.equals(id)) { + if (BuiltInLootTables.END_CITY_TREASURE.equals(id)) { LootPool.Builder builder = LootPool.lootPool(); builder.setRolls(ConstantValue.exactly(1)); builder.when(LootItemRandomChanceCondition.randomChance(0.2f)); @@ -87,6 +82,12 @@ public class LootTableUtil { builder.add(LootItem.lootTableItem(EndItems.MUSIC_DISC_ENDSEEKER)); builder.add(LootItem.lootTableItem(EndItems.MUSIC_DISC_EO_DRACONA)); table.withPool(builder); + } else if (BuiltInLootTables.FISHING.equals(id)) { + table.modifyPools((modifier) -> modifier.when(IN_END.invert())); + table.withPool(LootPool.lootPool().when(IN_END).setRolls(ConstantValue.exactly(1.0F)) + .add(LootTableReference.lootTableReference(FISHING_FISH).setWeight(85).setQuality(-1)) + .add(LootTableReference.lootTableReference(FISHING_TREASURE).setWeight(5).setQuality(2)) + .add(LootTableReference.lootTableReference(FISHING_JUNK).setWeight(10).setQuality(-2))); } else if (id.getNamespace().equals(BetterEnd.MOD_ID)) { if (FISHING_FISH.equals(id)) { LootPool.Builder builder = LootPool.lootPool() @@ -159,24 +160,6 @@ public class LootTableUtil { } } }); - - LootTableEvents.REPLACE.register((resourceManager, lootManager, id, originalTable, setter) -> { - if (BuiltInLootTables.FISHING.equals(id)) { - LootTable.Builder builder = LootTable.lootTable() - .withPool(LootPool.lootPool().when(IN_END.invert()).setRolls(ConstantValue.exactly(1.0F)) - .add(LootTableReference.lootTableReference(BuiltInLootTables.FISHING_JUNK).setWeight(10).setQuality(-2)) - .add(LootTableReference.lootTableReference(BuiltInLootTables.FISHING_TREASURE).setWeight(5).setQuality(2) - .when(LootItemEntityPropertyCondition.hasProperties(LootContext.EntityTarget.THIS, - EntityPredicate.Builder.entity().subPredicate(FishingHookPredicate.inOpenWater(true))))) - .add(LootTableReference.lootTableReference(BuiltInLootTables.FISHING_FISH).setWeight(85).setQuality(-1))) - .withPool(LootPool.lootPool().when(IN_END).setRolls(ConstantValue.exactly(1.0F)) - .add(LootTableReference.lootTableReference(FISHING_FISH).setWeight(85).setQuality(-1)) - .add(LootTableReference.lootTableReference(FISHING_TREASURE).setWeight(5).setQuality(2)) - .add(LootTableReference.lootTableReference(FISHING_JUNK).setWeight(10).setQuality(-2))); - return builder.build(); - } - return null; - }); } public static ResourceLocation getTable(Holder biome) { From d1572b4a77ca9d4b6506e5365c80a02e5e4e3ba7 Mon Sep 17 00:00:00 2001 From: Necrontyr Date: Thu, 27 Oct 2022 03:30:33 +0200 Subject: [PATCH 5/5] Replaced aeternium items with terminite. Added Hydralux petal. --- .../java/org/betterx/betterend/util/LootTableUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/betterx/betterend/util/LootTableUtil.java b/src/main/java/org/betterx/betterend/util/LootTableUtil.java index 1cd56b23..bb35e835 100644 --- a/src/main/java/org/betterx/betterend/util/LootTableUtil.java +++ b/src/main/java/org/betterx/betterend/util/LootTableUtil.java @@ -100,14 +100,15 @@ public class LootTableUtil { .add(LootItem.lootTableItem(Items.ENDER_PEARL)) .add(LootItem.lootTableItem(Items.CHORUS_FRUIT)) .add(LootItem.lootTableItem(EndItems.GELATINE)) - .add(LootItem.lootTableItem(EndItems.CRYSTAL_SHARDS)); + .add(LootItem.lootTableItem(EndItems.CRYSTAL_SHARDS)) + .add(LootItem.lootTableItem(EndItems.HYDRALUX_PETAL).when(IN_SULPHUR_SPRINGS)); addCharnia(builder); table.withPool(builder); return; } else if (FISHING_TREASURE.equals(id)) { LootPool.Builder builder = LootPool.lootPool() - .add(LootItem.lootTableItem(EndItems.AETERNIUM_SWORD_BLADE)) - .add(LootItem.lootTableItem(EndItems.AETERNIUM_FORGED_PLATE)) + .add(LootItem.lootTableItem(EndBlocks.TERMINITE.swordBlade)) + .add(LootItem.lootTableItem(EndBlocks.TERMINITE.forgedPlate)) .add(LootItem.lootTableItem(EndBlocks.MENGER_SPONGE)) .add(LootItem.lootTableItem(Items.BOW) .apply(SetItemDamageFunction.setDamage(UniformGenerator.between(0.0F, 0.25F)))