Skip to content
Open
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
23 changes: 23 additions & 0 deletions kubejs/data/trofers/trophies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"wilden_guardian": {
"folder": "ars",
"entity": "ars_nouveau:wilden_guardian",
"name": "entity.ars_nouveau.wilden_guardian",
"accent_color": "#ff822f",
"effects": {"sound": {"id": "ars_nouveau:ignis_death"}}
},
"wilden_hunter": {
"folder": "ars",
"entity": "ars_nouveau:wilden_hunter",
"name": "entity.ars_nouveau.wilden_hunter",
"accent_color": "#fafafa",
"effects": {"sound": {"id": "ars_nouveau:deepling_idle"}}
},
"wilden_stalker": {
"folder": "ars",
"entity": "ars_nouveau:wilden_stalker",
"name": "entity.ars_nouveau.wilden_stalker",
"accent_color": "#6b6348",
"effects": {"sound": {"id": "ars_nouveau:ignis_death"}}
}
}
76 changes: 76 additions & 0 deletions kubejs/server_scripts/trophies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
ServerEvents.generateData('after_mods', event => {
// Carico il file compatto
const trophies = JsonIO.read('kubejs/data/trofers/trophies.json');

let drops = {
"neoforge:conditions": [
{
"type": "neoforge:mod_loaded",
"modid": "cataclysm"
}
],
"conditions": [
{ "condition": "minecraft:killed_by_player" },
{ "condition": "trofers:random_trophy_chance" }
],
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": ["cataclysm"]
}
],
"trophies": {},
"trophy_base": "trofers:small_plate"
};

// Loop su ogni trofeo
Object.entries(trophies).forEach(([id, data]) => {
// Creiamo un nome univoco e valido per il trofeo
// Esempio: "cataclysm_ender_golem"
const trophy_name = `${data.folder}/${id}`;

let trophy = {
colors: {
base: "#606060",
accent: data.accent_color
},
entity: {
id: data.entity
},
name: {
color: data.accent_color,
translate: "trophy.trofers.composed",
with: [
{
translate: data.name
}
]
}
};

// alcune variabili con un default
if(data.display){
trophy.display = data.display;
}else{
trophy.display = {"scale": 0.25};
}

if(data.nbt){
trophy.entity.nbt = data.nbt;
}

if(data.effects){
trophy.effects = data.effects;
}

// Salva il JSON nella cartella trofei di Trofers, usando il nome univoco
event.json(`trofers:trofers/trophies/${trophy_name}`, trophy);

// Aggiungi il trofeo alla lista dei drop, usando il nome univoco
drops.trophies[data.entity] = `trofers:trophies/${trophy_name}`;
});


// Scrivo il file completo per tutti i mob Cataclysm
event.json(`trofers:trofers/entity_drops/mod_drops`, drops);
});