fix: diets

This commit is contained in:
hyper 2025-12-02 13:38:01 +08:00
parent 79631b6eb6
commit 06c6a271ab
1 changed files with 17 additions and 17 deletions

View File

@ -142,13 +142,13 @@ const food_list = [
];
const main_diet = {
'minecraft:desert': '8x #forge:milk',
'minecraft:plains': '8x bread',
'minecraft:savanna': '8x carrot',
'minecraft:snowy': '8x pumpkin_slice',
'minecraft:taiga': '8x baked_potato',
'minecraft:jungle': '8x farmersdelight:cooked_rice',
'minecraft:swamp': '8x mushroom_stew',
'desert': '8x #forge:milk',
'plains': '8x bread',
'savanna': '8x carrot',
'snowy': '8x pumpkin_slice',
'taiga': '8x baked_potato',
'jungle': '8x farmersdelight:cooked_rice',
'swamp': '8x mushroom_stew',
'atmospheric:scrubland': '8x atmospheric:dragon_fruit',
default: '8x bread'
}
@ -243,13 +243,13 @@ const village_structures = {
"atmospheric:village_scrubland" : 1
};
const village_logs = {
'minecraft:desert': 'minecraft:cactus',
'minecraft:plains': 'minecraft:oak_log',
'minecraft:savanna': 'minecraft:acacia_log',
'minecraft:snowy': 'minecraft:spruce_log',
'minecraft:taiga': 'minecraft:birch_log',
'minecraft:jungle': 'minecraft:jungle_log',
'minecraft:swamp': 'minecraft:dark_oak_log',
'desert': 'minecraft:cactus',
'plains': 'minecraft:oak_log',
'savanna': 'minecraft:acacia_log',
'snowy': 'minecraft:spruce_log',
'taiga': 'minecraft:birch_log',
'jungle': 'minecraft:jungle_log',
'swamp': 'minecraft:dark_oak_log',
'atmospheric:scrubland': 'atmospheric:yucca_log'
};
// various saplings
@ -302,6 +302,7 @@ MoreJSEvents.villagerTrades((event) => {
const villagerData = villager.getVillagerData();
const biome = villagerData.getType().toString();
const log = village_logs[biome] || 'minecraft:oak_log';
if(!village_logs[biome]) console.warn("No log for " + biome);
offer.setFirstInput('2x emerald');
offer.setOutput('16x ' + log);
@ -344,11 +345,10 @@ MoreJSEvents.villagerTrades((event) => {
});
// 1 diet trade
event.addCustomTrade(prof, 1, (offer, entity, random) => {
/** @type {$Villager} */
const villager = entity;
const villagerData = villager.getVillagerData();
const villagerData = entity.getVillagerData();
const biome = villagerData.getType().toString();
const diet = main_diet[biome] || main_diet.default;
if(!main_diet[biome]) console.log("No diet for " + biome);
offer.setFirstInput(diet);
offer.setOutput('1x emerald');
offer.setMaxUses(1);