Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ public class HexLootHandler {
new ScrollInjection(new ResourceLocation("minecraft", "chests/stronghold_library"), 5)
);

public static final ImmutableList<ResourceLocation> DEFAULT_LORE_INJECTS = ImmutableList.of(
new ResourceLocation("minecraft", "chests/simple_dungeon"),
new ResourceLocation("minecraft", "chests/abandoned_mineshaft"),
new ResourceLocation("minecraft", "chests/pillager_outpost"),
new ResourceLocation("minecraft", "chests/woodland_mansion"),
new ResourceLocation("minecraft", "chests/stronghold_library"),
// >:)
new ResourceLocation("minecraft", "chests/village/village_desert_house"),
new ResourceLocation("minecraft", "chests/village/village_plains_house"),
new ResourceLocation("minecraft", "chests/village/village_savanna_house"),
new ResourceLocation("minecraft", "chests/village/village_snowy_house"),
new ResourceLocation("minecraft", "chests/village/village_taiga_house")
public static final ImmutableList<String> DEFAULT_LORE_INJECTS = ImmutableList.of(
"minecraft:chests/simple_dungeon",
"minecraft:chests/abandoned_mineshaft",
"minecraft:chests/pillager_outpost",
"minecraft:chests/woodland_mansion",
"minecraft:chests/stronghold_library",
// >:3
"minecraft:chests/village/village_desert_house",
"minecraft:chests/village/village_plains_house",
"minecraft:chests/village/village_savanna_house",
"minecraft:chests/village/village_snowy_house",
"minecraft:chests/village/village_taiga_house"
);

public static int getScrollCount(int range, RandomSource random) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.List;

import static at.petrak.hexcasting.api.mod.HexConfig.anyMatchResLoc;
import static at.petrak.hexcasting.api.mod.HexConfig.anyMatch;
import static at.petrak.hexcasting.api.mod.HexConfig.noneMatch;

@Config(name = HexAPI.MOD_ID)
Expand Down Expand Up @@ -192,7 +192,7 @@ public static final class Server implements HexConfig.ServerConfigAccess, Config

// TODO: hook this up to the config, change Jankery, test, also test scroll injects on fabric
@ConfigEntry.Gui.Tooltip
private List<ResourceLocation> loreInjections = HexLootHandler.DEFAULT_LORE_INJECTS;
private List<String> loreInjections = HexLootHandler.DEFAULT_LORE_INJECTS;
@ConfigEntry.Gui.Tooltip
private double loreChance = HexLootHandler.DEFAULT_LORE_CHANCE;

Expand Down Expand Up @@ -266,7 +266,7 @@ public int scrollRangeForLootTable(ResourceLocation lootTable) {
}

public boolean shouldInjectLore(ResourceLocation lootTable) {
return anyMatchResLoc(this.loreInjections, lootTable);
return anyMatch(this.loreInjections, lootTable);
}

public double getLoreChance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import at.petrak.hexcasting.forge.loot.ForgeHexLoreLootMod;
import at.petrak.hexcasting.forge.loot.ForgeHexScrollLootMod;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
import net.minecraftforge.common.data.GlobalLootModifierProvider;
Expand All @@ -26,9 +27,9 @@ protected void start() {
}

for (var injection : HexLootHandler.DEFAULT_LORE_INJECTS) {
var name = "lore/%s/%s".formatted(injection.getNamespace(), injection.getPath());
var name = "lore/%s".formatted(injection.replace(':', '/'));
add(name, new ForgeHexLoreLootMod(new LootItemCondition[]{
LootTableIdCondition.builder(injection).build(),
LootTableIdCondition.builder(new ResourceLocation(injection)).build(),
}, HexLootHandler.DEFAULT_LORE_CHANCE));
}

Expand Down