add first patch
This commit is contained in:
@@ -0,0 +1,331 @@
|
||||
ItemEvents.tooltip((tooltip) => {
|
||||
global.plushies.forEach((plush) => {
|
||||
tooltip.addAdvanced(plush, (item, advanced, text) => {
|
||||
if (item.nbt) {
|
||||
let type = global.plushieTraits[Number(item.nbt.getInt("type"))];
|
||||
if (tooltip.shift) {
|
||||
text.add(1, [
|
||||
Text.translatable("tooltip.society.plushies.trait"),
|
||||
global.getTranslatedTextWithColorCode(
|
||||
type.color,
|
||||
`society.item.plushie.${type.trait}`
|
||||
),
|
||||
]);
|
||||
text.add(2, [
|
||||
Text.translate(`society.item.plushie.trait.description`).darkGray(),
|
||||
]);
|
||||
let description = Text.translate(
|
||||
`society.item.plushie.${type.trait}.description`
|
||||
)
|
||||
.getString()
|
||||
.split("\n");
|
||||
text.add(3, [Text.gray(description[0])]);
|
||||
text.add(4, [description[1]]);
|
||||
} else {
|
||||
if (item.nbt.getCompound("quality_food"))
|
||||
text.add(1, [
|
||||
Text.translatable("tooltip.society.plushies.rarity"),
|
||||
Text.gold(
|
||||
"★".repeat(
|
||||
item.nbt.getCompound("quality_food").getInt("quality") + 1
|
||||
)
|
||||
),
|
||||
Text.gray(
|
||||
"☆".repeat(
|
||||
3 - item.nbt.getCompound("quality_food").getInt("quality")
|
||||
)
|
||||
),
|
||||
]);
|
||||
else text.add(1, [Text.gray("☆".repeat(4))]);
|
||||
let affection = item.nbt.getInt("affection");
|
||||
text.add(2, [
|
||||
Text.translatable("tooltip.society.plushies.affection"),
|
||||
`§c${affection > 0 ? `❤`.repeat(affection) : ""}§7${affection < 4 ? `❤`.repeat(4 - affection) : ""
|
||||
}`,
|
||||
]);
|
||||
text.add(3, [
|
||||
Text.translatable("tooltip.society.plushies.trait"),
|
||||
global.getTranslatedTextWithColorCode(
|
||||
type.color,
|
||||
`society.item.plushie.${type.trait}`
|
||||
),
|
||||
Text.of(" "),
|
||||
Text.translatable(
|
||||
"tooltip.society.hold_key",
|
||||
global.getTranslatedTextWithColorCode(
|
||||
type.color,
|
||||
"key.keyboard.shift"
|
||||
)
|
||||
).gray(),
|
||||
]);
|
||||
if (item.nbt.animal) {
|
||||
let animal = item.nbt.getCompound("animal");
|
||||
text.add(4, [
|
||||
Text.translatable("tooltip.society.plushies.animal_type"),
|
||||
global.getTranslatedEntityName(String(animal.type)).gold(),
|
||||
]);
|
||||
if (animal.name) {
|
||||
text.add(5, [
|
||||
Text.translatable("tooltip.society.plushies.animal_name"),
|
||||
`§6${String(animal.name)}`,
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
text.add(4, [Text.translatable("tooltip.society.plushies")]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
text.add(1, [Text.translatable("tooltip.society.plushies")]);
|
||||
}
|
||||
});
|
||||
});
|
||||
tooltip.addAdvanced("society:villager_invitation", (item, advanced, text) => {
|
||||
if (item.nbt) {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable(
|
||||
"block.society.fish_pond.fish.type",
|
||||
`${item.nbt.get("type")}`
|
||||
).aqua()
|
||||
);
|
||||
text.add(
|
||||
2,
|
||||
Text.translatable("block.society.fish_pond.description").gray()
|
||||
);
|
||||
} else {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable("block.society.fish_pond.description").gray()
|
||||
);
|
||||
}
|
||||
});
|
||||
tooltip.addAdvanced("society:villager_home", (item, advanced, text) => {
|
||||
if (item.nbt) {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable(
|
||||
"block.society.villager_home.type",
|
||||
`${item.nbt.getString("type")}`
|
||||
).green()
|
||||
);
|
||||
text.add(
|
||||
2,
|
||||
Text.translatable("block.society.villager_home.description").gray()
|
||||
);
|
||||
} else {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable("block.society.villager_home.description").gray()
|
||||
);
|
||||
}
|
||||
});
|
||||
tooltip.addAdvanced("society:fish_pond", (item, advanced, text) => {
|
||||
if (item.nbt) {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable(
|
||||
"block.society.fish_pond.fish.type",
|
||||
`${Item.of(item.nbt.get("type")).id}`
|
||||
).aqua()
|
||||
);
|
||||
text.add(
|
||||
2,
|
||||
Text.translatable(
|
||||
"block.society.fish_pond.fish.population",
|
||||
`${item.nbt.get("population")}`,
|
||||
`${item.nbt.get("max_population")}`
|
||||
).aqua()
|
||||
);
|
||||
} else {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable("block.society.fish_pond.description").gray()
|
||||
);
|
||||
text.add(
|
||||
2,
|
||||
Text.translatable(
|
||||
"block.society.fish_pond.description.place"
|
||||
).darkAqua()
|
||||
);
|
||||
}
|
||||
});
|
||||
tooltip.addAdvanced("society:caterpillar_eggs", (item, advanced, text) => {
|
||||
if (item.nbt) {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable("item.society.caterpillar_eggs.description").darkGray()
|
||||
);
|
||||
text.add(
|
||||
2,
|
||||
Text.translatable(
|
||||
"item.society.caterpillar_eggs.longwing.type",
|
||||
Text.translatable(`item.longwings.${item.nbt.getString("child")}`).gray()
|
||||
).green()
|
||||
);
|
||||
text.add(
|
||||
3,
|
||||
Text.translatable(
|
||||
"item.society.caterpillar_eggs.longwing.parents",
|
||||
Text.translatable(`item.longwings.${item.nbt.getString("parent")}`).gray(),
|
||||
Text.translatable(`item.longwings.${item.nbt.getString("coparent")}`).gray()
|
||||
).lightPurple()
|
||||
);
|
||||
text.add(
|
||||
4,
|
||||
Text.translatable(
|
||||
"item.society.caterpillar_eggs.longwing.size",
|
||||
`${item.nbt.getDouble("size")}`
|
||||
).darkGray()
|
||||
);
|
||||
} else {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable("item.society.caterpillar_eggs.description").gray()
|
||||
);
|
||||
}
|
||||
});
|
||||
// Sometimes season just breaks for the tooltip and I have no idea why
|
||||
tooltip.addAdvanced("farmersdelight:tomato_seeds", (item, advanced, text) => {
|
||||
if (tooltip.shift) {
|
||||
text.add(1, [
|
||||
Text.white("")
|
||||
.append(Text.translatable("desc.sereneseasons.fertile_seasons"))
|
||||
.append(":"),
|
||||
Text.of(" "),
|
||||
Text.translatable("desc.sereneseasons.spring").green().append(","),
|
||||
Text.of(" "),
|
||||
Text.translatable("desc.sereneseasons.summer").yellow().append(","),
|
||||
Text.of(" "),
|
||||
Text.translatable("desc.sereneseasons.autumn").gold(),
|
||||
]);
|
||||
} else {
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.hold_key",
|
||||
Text.translatable("key.keyboard.shift").gray()
|
||||
).darkGray(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
tooltip.addAdvanced(
|
||||
"farm_and_charm:strawberry_seed",
|
||||
(item, advanced, text) => {
|
||||
if (tooltip.shift) {
|
||||
text.add(1, [
|
||||
Text.white("")
|
||||
.append(Text.translatable("desc.sereneseasons.fertile_seasons"))
|
||||
.append(":"),
|
||||
Text.of(" "),
|
||||
Text.translatable("desc.sereneseasons.spring").green(),
|
||||
]);
|
||||
} else {
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.hold_key",
|
||||
Text.translatable("key.keyboard.shift").gray()
|
||||
).darkGray(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const magnifyingBlocks = [
|
||||
Text.translatable("block.society.auto_grabber"),
|
||||
Text.translatable("block.society.artisan_hopper"),
|
||||
Text.translatable("block.farmingforblockheads.chicken_nest"),
|
||||
Text.translatable("block.society.feeding_trough"),
|
||||
Text.translatable("block.splendid_slimes.slime_feeder"),
|
||||
Text.translatable("block.society.snow_melter"),
|
||||
Text.translatable("block.society.fish_pond_basket"),
|
||||
Text.translatable("block.society.fish_pond_hatchery"),
|
||||
Text.translatable("block.society.golden_clock"),
|
||||
Text.translatable("block.society.mana_clock"),
|
||||
Text.translatable("block.society.mana_milker"),
|
||||
Text.translatable("item.society.magnifying_glass.description.view_block.sprinklers"),
|
||||
Text.translatable("block.society.growth_obelisk"),
|
||||
Text.translatable("block.society.ribbit_hut"),
|
||||
Text.translatable("block.society.fish_pond_manager"),
|
||||
];
|
||||
tooltip.addAdvanced("society:magnifying_glass", (item, advanced, text) => {
|
||||
if (tooltip.shift) {
|
||||
magnifyingBlocks.forEach((block, index) => {
|
||||
text.add(index + 1, Text.gold(block));
|
||||
});
|
||||
} else {
|
||||
text.add(
|
||||
1,
|
||||
Text.translatable("item.society.magnifying_glass.description").green()
|
||||
);
|
||||
text.add(2, [
|
||||
Text.translatable(
|
||||
"item.society.magnifying_glass.description.view_block",
|
||||
Text.translatable("key.keyboard.shift").gray()
|
||||
).darkGray(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
tooltip.addAdvanced("society:car_key", (item, advanced, text) => {
|
||||
text.add(1, [Text.translatable("item.society.car_key.description").gray()]);
|
||||
if (item.nbt) {
|
||||
text.add(2, [
|
||||
Text.translatable("item.society.car_key.description.parked").green(),
|
||||
]);
|
||||
} else {
|
||||
text.add(2, [
|
||||
Text.translatable("item.society.car_key.description.empty").red(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
const getPigColoredName = (pig) => {
|
||||
switch (pig) {
|
||||
case "Red":
|
||||
return Text.translatable("society.pig_race.red_pig").red();
|
||||
case "Blue":
|
||||
return Text.translatable("society.pig_race.blue_pig").blue();
|
||||
case "Yellow":
|
||||
return Text.translatable("society.pig_race.yellow_pig").yellow();
|
||||
case "Green":
|
||||
return Text.translatable("society.pig_race.green_pig").green();
|
||||
default:
|
||||
console.log(`Invalid pig color`);
|
||||
}
|
||||
return Text.of(`${pig}`);
|
||||
};
|
||||
tooltip.addAdvanced(
|
||||
["society:pig_race_ticket", "society:multiplayer_pig_race_ticket"],
|
||||
(item, advanced, text) => {
|
||||
text.add(1, [
|
||||
Text.translatable("item.society.pig_race_ticket.description").gray(),
|
||||
]);
|
||||
if (item.nbt) {
|
||||
text.add(2, [
|
||||
Text.translatable(
|
||||
"item.society.pig_race_ticket.description.bet",
|
||||
getPigColoredName(item.nbt.bet)
|
||||
).gray(),
|
||||
]);
|
||||
} else {
|
||||
text.add(2, [
|
||||
Text.translatable(
|
||||
"item.society.pig_race_ticket.description.no_pig"
|
||||
).gray(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
);
|
||||
global.ageableProductInputs.forEach((product) => {
|
||||
const splitProduct = product.item.split(":");
|
||||
tooltip.addAdvanced(`society:aged_${splitProduct[1]}`, (item, advance, text) => {
|
||||
if (product.item === "brewery:whiskey_maggoallan" || product.item === "brewery:whiskey_smokey_reverie")
|
||||
text.set(0, text.get(0).copy().gold())
|
||||
else
|
||||
text.set(0, text.get(0).copy().aqua());
|
||||
});
|
||||
tooltip.addAdvanced(`society:double_aged_${splitProduct[1]}`, (item, advance, text) => {
|
||||
if (product.item === "brewery:whiskey_maggoallan" || product.item === "brewery:whiskey_smokey_reverie")
|
||||
text.set(0, text.get(0).copy().gold())
|
||||
else
|
||||
text.set(0, text.get(0).copy().darkAqua());
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,54 @@
|
||||
ItemEvents.tooltip((tooltip) => {
|
||||
const yearRound = ['aquaculture:minnow', 'aquaculture:carp', 'aquaculture:bluegill', 'society:neptuna']
|
||||
let springFish = [];
|
||||
let summerFish = [];
|
||||
let autumnFish = [];
|
||||
let winterFish = [];
|
||||
|
||||
tooltip.add(yearRound, [Text.of(" ").append(Text.translatable("desc.sereneseasons.year_round").lightPurple())]);
|
||||
const addSeasonTooltip = (item, seasonText, seasonArray) => {
|
||||
if (!yearRound.includes(item) && !seasonArray.includes(item)) {
|
||||
seasonArray.push(item);
|
||||
tooltip.add(item, [Text.of(" ").append(seasonText)]);
|
||||
}
|
||||
};
|
||||
global.springOcean.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.spring").green(), springFish)
|
||||
);
|
||||
global.springRiver.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.spring").green(), springFish)
|
||||
);
|
||||
global.springFresh.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.spring").green(), springFish)
|
||||
);
|
||||
|
||||
global.summerOcean.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.summer").yellow(), summerFish)
|
||||
);
|
||||
global.summerRiver.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.summer").yellow(), summerFish)
|
||||
);
|
||||
global.summerFresh.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.summer").yellow(), summerFish)
|
||||
);
|
||||
|
||||
global.autumnOcean.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.autumn").gold(), autumnFish)
|
||||
);
|
||||
global.autumnRiver.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.autumn").gold(), autumnFish)
|
||||
);
|
||||
global.autumnFresh.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.autumn").gold(), autumnFish)
|
||||
);
|
||||
|
||||
global.winterOcean.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.winter").aqua(), winterFish)
|
||||
);
|
||||
global.winterRiver.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.winter").aqua(), winterFish)
|
||||
);
|
||||
global.winterFresh.forEach((entry) =>
|
||||
addSeasonTooltip(entry.fish, Text.translatable("desc.sereneseasons.winter").aqua(), winterFish)
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,442 @@
|
||||
const formatNumber = (number, quality, doubled) => {
|
||||
let value;
|
||||
if (quality) {
|
||||
if (quality == 1.0) value = Math.round(number * (doubled ? 1.5 : 1.25));
|
||||
if (quality == 2.0) value = Math.round(number * (doubled ? 2 : 1.5));
|
||||
if (quality == 3.0) value = Math.round(number * (doubled ? 3 : 2));
|
||||
} else {
|
||||
value = number;
|
||||
}
|
||||
return global.formatPrice(value);
|
||||
};
|
||||
|
||||
const getStackBonusValueTooltips = (text, number, item, attribute, quality) => {
|
||||
let value = number;
|
||||
let clientStages = Client.player.stages;
|
||||
let bonusTooltips = [];
|
||||
let qualityDoubled = false;
|
||||
let attributeMult = global.getAttributeMultiplier(
|
||||
Client.player.nbt.Attributes,
|
||||
`shippingbin:${attribute}_sell_multiplier`
|
||||
);
|
||||
let hasMultipliers = attributeMult > 1;
|
||||
if (
|
||||
clientStages.has("bluegill_meridian") &&
|
||||
item.id == "aquaculture:bluegill"
|
||||
) {
|
||||
hasMultipliers = true;
|
||||
value = 666;
|
||||
bonusTooltips.push(
|
||||
Text.translatable("item.society.bluegill_meridian.price_modifier").aqua()
|
||||
);
|
||||
}
|
||||
if (
|
||||
clientStages.has("phenomenology_of_treasure") &&
|
||||
(item.hasTag("society:artifacts") || item.hasTag("society:relics"))
|
||||
) {
|
||||
hasMultipliers = true;
|
||||
value *= 3;
|
||||
bonusTooltips.push(
|
||||
Text.translatable(
|
||||
"item.society.phenomenology_of_treasure.price_modifier"
|
||||
).aqua()
|
||||
);
|
||||
}
|
||||
if (
|
||||
clientStages.has("brine_and_punishment") &&
|
||||
item.hasTag("society:brine_and_punishment")
|
||||
) {
|
||||
hasMultipliers = true;
|
||||
value *= 2;
|
||||
bonusTooltips.push(
|
||||
Text.translatable(
|
||||
"item.society.brine_and_punishment.price_modifier"
|
||||
).aqua()
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
clientStages.has("the_metamorphosize") &&
|
||||
["longwings:moth", "longwings:butterfly"].includes(item.id)
|
||||
) {
|
||||
hasMultipliers = true;
|
||||
let size = 1.0;
|
||||
if (item.nbt) {
|
||||
if (item.nbt.size && typeof item.nbt.size !== "function") {
|
||||
size = item.nbt.size;
|
||||
}
|
||||
}
|
||||
let increase = Number(Math.round((size / 0.01) * 4) * 2);
|
||||
value += increase;
|
||||
bonusTooltips.push(
|
||||
Text.translatable(
|
||||
"item.society.the_metamorphosize.price_modifier", String(increase)
|
||||
).aqua()
|
||||
);
|
||||
}
|
||||
if (
|
||||
quality > 0 &&
|
||||
clientStages.has("the_quality_of_the_earth") &&
|
||||
attribute.equals("crop") &&
|
||||
!item.hasTag("minecraft:fishes")
|
||||
) {
|
||||
hasMultipliers = true;
|
||||
qualityDoubled = true
|
||||
bonusTooltips.push(
|
||||
Text.translatable(
|
||||
"item.society.the_quality_of_the_earth.price_modifier"
|
||||
).aqua()
|
||||
);
|
||||
}
|
||||
value = Math.round(value * item.count * attributeMult);
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.coins",
|
||||
`${formatNumber(value, quality, qualityDoubled)}`
|
||||
).white(),
|
||||
Text.of(" "),
|
||||
Text.translatable("tooltip.society.stack_value")
|
||||
.gray()
|
||||
.append(
|
||||
hasMultipliers
|
||||
? Text.translatable("tooltip.society.multipliers")
|
||||
: Text.empty()
|
||||
),
|
||||
]);
|
||||
bonusTooltips.forEach((bonus, index) => {
|
||||
text.add(2 + index, [bonus]);
|
||||
});
|
||||
if (attributeMult > 1) {
|
||||
text.add(bonusTooltips.length + 2, [
|
||||
getAttributeText(attribute),
|
||||
Text.green(` +${Math.round((attributeMult - 1) * 100)}%`),
|
||||
]);
|
||||
} else {
|
||||
text.add(bonusTooltips.length + 2, [getAttributeText(attribute)]);
|
||||
}
|
||||
};
|
||||
|
||||
const getAttributeText = (attribute) => {
|
||||
switch (attribute) {
|
||||
case "crop":
|
||||
return Text.translatable("tooltip.society.farmer_product").gold();
|
||||
case "wood":
|
||||
return Text.translatable("tooltip.society.artisan_product").gold();
|
||||
case "gem":
|
||||
return Text.translatable("tooltip.society.geologist_product").gold();
|
||||
case "meat":
|
||||
return Text.translatable("tooltip.society.adventurer_product").gold();
|
||||
default:
|
||||
console.log(`Invalid attribute`);
|
||||
}
|
||||
};
|
||||
global.addPriceTooltip = (tooltip, sellable, attribute) => {
|
||||
let value = global.getConfiguredValue(sellable.value, attribute);
|
||||
tooltip.addAdvanced(sellable.item, (item, advanced, text) => {
|
||||
let quality;
|
||||
if (item.nbt && item.nbt.quality_food) {
|
||||
quality = item.nbt.quality_food.quality;
|
||||
}
|
||||
if (tooltip.shift) {
|
||||
getStackBonusValueTooltips(text, value, item, attribute, quality);
|
||||
} else {
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.coins",
|
||||
`${formatNumber(value, quality)}`
|
||||
).white(),
|
||||
Text.of(" "),
|
||||
Text.translatable(
|
||||
"tooltip.society.hold_key",
|
||||
Text.translatable("key.keyboard.shift").gray()
|
||||
).darkGray(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ItemEvents.tooltip((tooltip) => {
|
||||
const calculateCost = (coin, count, stackSize) => {
|
||||
let value = 0;
|
||||
switch (coin) {
|
||||
case "spur":
|
||||
value = 1;
|
||||
break;
|
||||
case "bevel":
|
||||
value = 8;
|
||||
break;
|
||||
case "sprocket":
|
||||
value = 16;
|
||||
break;
|
||||
case "cog":
|
||||
value = 64;
|
||||
break;
|
||||
case "crown":
|
||||
value = 512;
|
||||
break;
|
||||
case "sun":
|
||||
value = 4096;
|
||||
break;
|
||||
case "neptunium_coin":
|
||||
value = 32768;
|
||||
break;
|
||||
case "ancient_coin":
|
||||
value = 262144;
|
||||
break;
|
||||
case "prismatic_coin":
|
||||
value = 16777216;
|
||||
break;
|
||||
default:
|
||||
console.log(`Invalid coin`);
|
||||
}
|
||||
return formatNumber(value * count * (stackSize || 1));
|
||||
};
|
||||
const coinTooltips = [
|
||||
"numismatics:spur",
|
||||
"numismatics:bevel",
|
||||
"numismatics:sprocket",
|
||||
"numismatics:cog",
|
||||
"numismatics:crown",
|
||||
"numismatics:sun",
|
||||
"numismatics:neptunium_coin",
|
||||
"numismatics:ancient_coin",
|
||||
"numismatics:prismatic_coin",
|
||||
];
|
||||
coinTooltips.forEach((coin) => {
|
||||
tooltip.addAdvanced(coin, (item, advanced, text) => {
|
||||
if (!coin.includes("_coin")) {
|
||||
text.remove(1);
|
||||
}
|
||||
if (tooltip.shift) {
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.coins",
|
||||
`${calculateCost(coin.path, 1, item.count)}`
|
||||
).white(),
|
||||
Text.of(" "),
|
||||
Text.translatable("tooltip.society.stack_value").gray(),
|
||||
]);
|
||||
} else {
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.coins",
|
||||
`${calculateCost(coin.path, 1, 1)}`
|
||||
).white(),
|
||||
Text.of(" "),
|
||||
Text.translatable(
|
||||
"tooltip.society.hold_key",
|
||||
Text.translatable("key.keyboard.shift").gray()
|
||||
).darkGray(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
tooltip.addAdvanced("splendid_slimes:plort", (item, advanced, text) => {
|
||||
let plortType;
|
||||
let price;
|
||||
if (item.nbt && item.nbt.plort) {
|
||||
plortType = item.nbt.plort.id;
|
||||
}
|
||||
global.plorts.forEach((plort) => {
|
||||
if (plort.type == plortType) price = plort.value;
|
||||
});
|
||||
if (tooltip.shift) {
|
||||
getStackBonusValueTooltips(text, price, item, "crop", 0);
|
||||
} else {
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.coins",
|
||||
`${formatNumber(price, 0)}`
|
||||
).white(),
|
||||
Text.of(" "),
|
||||
Text.translatable(
|
||||
"tooltip.society.hold_key",
|
||||
Text.translatable("key.keyboard.shift").gray()
|
||||
).darkGray(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
tooltip.addAdvanced("splendid_slimes:slime_heart", (item, advanced, text) => {
|
||||
let heartType;
|
||||
let price;
|
||||
if (item.nbt && item.nbt.slime) {
|
||||
heartType = item.nbt.slime.id;
|
||||
}
|
||||
global.slimeHearts.forEach((heart) => {
|
||||
if (heart.type == heartType) price = heart.value;
|
||||
});
|
||||
if (tooltip.shift) {
|
||||
getStackBonusValueTooltips(text, price, item, "crop", 0);
|
||||
} else {
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.coins",
|
||||
`${formatNumber(price, 0)}`
|
||||
).white(),
|
||||
Text.of(" "),
|
||||
Text.translatable(
|
||||
"tooltip.society.hold_key",
|
||||
Text.translatable("key.keyboard.shift").gray()
|
||||
).darkGray(),
|
||||
]);
|
||||
}
|
||||
});
|
||||
const getLongwingTooltips = (item, text) => {
|
||||
let variant;
|
||||
let size = 1.0;
|
||||
let price = 1;
|
||||
if (item.nbt) {
|
||||
if (item.nbt.variant) {
|
||||
variant = item.nbt.variant;
|
||||
}
|
||||
if (item.nbt.size && typeof item.nbt.size !== "function") {
|
||||
size = item.nbt.size;
|
||||
}
|
||||
}
|
||||
global.longwings.forEach((wing) => {
|
||||
if (wing.variant == variant) price = (16 - wing.rarity) * 78;
|
||||
});
|
||||
price += Math.round((size / 0.01) * 4)
|
||||
if (tooltip.shift) {
|
||||
getStackBonusValueTooltips(text, price, item, "meat", 0);
|
||||
} else {
|
||||
text.add(1, [
|
||||
Text.translatable(
|
||||
"tooltip.society.coins",
|
||||
`${formatNumber(price, 0)}`
|
||||
).white(),
|
||||
Text.of(" "),
|
||||
Text.translatable(
|
||||
"tooltip.society.hold_key",
|
||||
Text.translatable("key.keyboard.shift").gray()
|
||||
).darkGray(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
// Item.of('longwings:moth', '{size:1.0f,variant:"small_emerald"}')
|
||||
tooltip.addAdvanced("longwings:butterfly", (item, advanced, text) => {
|
||||
getLongwingTooltips(item, text)
|
||||
});
|
||||
tooltip.addAdvanced("longwings:moth", (item, advanced, text) => {
|
||||
getLongwingTooltips(item, text)
|
||||
});
|
||||
// Ore
|
||||
global.ore.forEach((item) => {
|
||||
global.addPriceTooltip(tooltip, item, "gem");
|
||||
});
|
||||
// Pristine
|
||||
global.pristine.forEach((item) => {
|
||||
global.addPriceTooltip(tooltip, item, "gem");
|
||||
});
|
||||
// Geodes
|
||||
global.geodeList.forEach((geodeItem) => {
|
||||
global.addPriceTooltip(tooltip, geodeItem, "gem");
|
||||
tooltip.add(
|
||||
geodeItem.item,
|
||||
Text.translatable("tooltip.society.item_type.mineral").gray()
|
||||
);
|
||||
});
|
||||
global.frozenGeodeList.forEach((geodeItem) => {
|
||||
global.addPriceTooltip(tooltip, geodeItem, "gem");
|
||||
tooltip.add(
|
||||
geodeItem.item,
|
||||
Text.translatable("tooltip.society.item_type.mineral").gray()
|
||||
);
|
||||
});
|
||||
global.magmaGeodeList.forEach((geodeItem) => {
|
||||
global.addPriceTooltip(tooltip, geodeItem, "gem");
|
||||
tooltip.add(
|
||||
geodeItem.item,
|
||||
Text.translatable("tooltip.society.item_type.mineral").gray()
|
||||
);
|
||||
});
|
||||
// Gem
|
||||
global.gems.forEach((gem) => {
|
||||
global.addPriceTooltip(tooltip, gem, "gem");
|
||||
tooltip.add(
|
||||
gem.item,
|
||||
Text.translatable("tooltip.society.item_type.gem").gray()
|
||||
);
|
||||
});
|
||||
[
|
||||
"society:sparkstone",
|
||||
"minecraft:emerald",
|
||||
"minecraft:diamond",
|
||||
"minecraft:amethyst_shard",
|
||||
"minecraft:quartz",
|
||||
"society:prismatic_shard",
|
||||
"minecraft:prismarine_crystals",
|
||||
].forEach((gem) => {
|
||||
tooltip.add(gem, Text.translatable("tooltip.society.item_type.gem").gray());
|
||||
});
|
||||
global.miscGeologist.forEach((gem) => {
|
||||
global.addPriceTooltip(tooltip, gem, "gem");
|
||||
});
|
||||
// Artifact
|
||||
global.artifacts.forEach((artifact) => {
|
||||
global.addPriceTooltip(tooltip, artifact, "meat");
|
||||
});
|
||||
global.relics.forEach((artifact) => {
|
||||
global.addPriceTooltip(tooltip, artifact, "meat");
|
||||
});
|
||||
// Crops
|
||||
global.crops.forEach((crop) => {
|
||||
global.addPriceTooltip(tooltip, crop, "crop");
|
||||
});
|
||||
// Meat
|
||||
global.animalProducts.forEach((meat) => {
|
||||
global.addPriceTooltip(tooltip, meat, "crop");
|
||||
});
|
||||
// Wines
|
||||
global.wines.forEach((wine) => {
|
||||
global.addPriceTooltip(tooltip, wine, "wood");
|
||||
});
|
||||
// Brews
|
||||
global.brews.forEach((brew) => {
|
||||
global.addPriceTooltip(tooltip, brew, "wood");
|
||||
});
|
||||
// Preserves
|
||||
global.preserves.forEach((jar) => {
|
||||
global.addPriceTooltip(tooltip, jar, "wood");
|
||||
});
|
||||
// Dehydrated
|
||||
global.dehydrated.forEach((jar) => {
|
||||
global.addPriceTooltip(tooltip, jar, "wood");
|
||||
});
|
||||
// Artisan goods
|
||||
global.artisanGoods.forEach((good) => {
|
||||
global.addPriceTooltip(tooltip, good, "wood");
|
||||
});
|
||||
// Fish
|
||||
global.fish.forEach((fish) => {
|
||||
global.addPriceTooltip(tooltip, fish, "crop");
|
||||
});
|
||||
global.smokedFish.forEach((fish) => {
|
||||
global.addPriceTooltip(tooltip, fish, "wood");
|
||||
});
|
||||
global.agedRoe.forEach((fish) => {
|
||||
global.addPriceTooltip(tooltip, fish, "wood");
|
||||
});
|
||||
// Cocktails
|
||||
global.cocktails.forEach((cocktail) => {
|
||||
global.addPriceTooltip(tooltip, cocktail, "crop");
|
||||
});
|
||||
// herbalbrews
|
||||
global.herbalBrews.forEach((brew) => {
|
||||
global.addPriceTooltip(tooltip, brew, "crop");
|
||||
});
|
||||
// Logs
|
||||
global.logs.forEach((log) => {
|
||||
global.addPriceTooltip(tooltip, log, "crop");
|
||||
});
|
||||
// Cooking
|
||||
global.cooking.forEach((dish) => {
|
||||
global.addPriceTooltip(tooltip, dish, "crop");
|
||||
});
|
||||
// Misc
|
||||
global.miscAdventurer.forEach((miscItem) => {
|
||||
global.addPriceTooltip(tooltip, miscItem, "meat");
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user