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