This commit is contained in:
Pyritie 2026-02-10 14:28:08 +00:00
commit 5a6b9bb6eb
5 changed files with 53 additions and 2 deletions

View file

@ -2,6 +2,7 @@
## Unreleased ## Unreleased
### Changes ### Changes
- High Tier saws can Silk Harvest Ice (#3019) @Nebby1999
### Bug fixes ### Bug fixes
### Translation updates ### Translation updates

View file

@ -521,4 +521,16 @@ const registerTooltips = (event) => {
event.addAdvanced(['gtceu:ice_bucket'], (item, advanced, text) => { event.addAdvanced(['gtceu:ice_bucket'], (item, advanced, text) => {
text.add(1, Text.translate('tfg.tooltip.cooling_foods')); text.add(1, Text.translate('tfg.tooltip.cooling_foods'));
}) })
// Saw can silk harvest ice
//This kinda sucks, but it works. We're basically getting the default "silk_ice" harvesting tooltip, getting the index, then removing it.
//Then, we insert on that index our custom tooltip that tells the player it harvests ALL ice blocks
event.addAdvanced(['#tfg:silk_harvest_ice'], (item, advanced, text) => {
const sculptorKey = "item.gtceu.tool.behavior.silk_ice";
let keyToRemove = text.find(tip => tip.toString().indexOf(sculptorKey) != -1);
let indexOf = text.findIndex(tip => tip.toString().indexOf(sculptorKey) != -1);
text.remove(keyToRemove);
text.add(indexOf, Text.translate("tfg.tooltip.tool_behaviour.silk_ice"));
})
} }

View file

@ -37,6 +37,18 @@ function registerGTCEUItemTags(event) {
event.add("tfc:saws", "#forge:tools/buzzsaws"); event.add("tfc:saws", "#forge:tools/buzzsaws");
event.add("tfc:saws", "#forge:tools/chainsaws"); event.add("tfc:saws", "#forge:tools/chainsaws");
const saws = event.get('forge:tools/saws').getObjectIds().concat(event.get('forge:tools/chainsaws').getObjectIds());
saws.forEach(sawId =>
{
const id = sawId.getNamespace() + ":" + sawId.getPath();
if(global.ICE_SAW_BLACKLIST.includes(id) || Item.of(sawId).hasTag('forge:tools/buzzsaws'))
{
return;
}
event.add("tfg:silk_harvest_ice", id);
});
global.GTCEU_CASTING_MOLDS.concat(global.TFG_CASTING_MOLDS).forEach((mold) => { global.GTCEU_CASTING_MOLDS.concat(global.TFG_CASTING_MOLDS).forEach((mold) => {
event.add("gtceu:casting_molds", mold); event.add("gtceu:casting_molds", mold);
}); });

View file

@ -1,6 +1,9 @@
// priority: 0 // priority: 0
"use strict"; "use strict";
/**
*
* @param {Internal.LootModificationEventJS} event
*/
function registerTFCLoots(event) { function registerTFCLoots(event) {
// Hostile animals // Hostile animals
@ -352,8 +355,15 @@ function registerTFCLoots(event) {
event.addBlockLootModifier('minecraft:ice') event.addBlockLootModifier('minecraft:ice')
.removeLoot(ItemFilter.ALWAYS_TRUE) .removeLoot(ItemFilter.ALWAYS_TRUE)
event.addBlockLootModifier('minecraft:ice')
.not(n => n.matchMainHand("#tfg:silk_harvest_ice"))
.addLoot('firmalife:ice_shavings') .addLoot('firmalife:ice_shavings')
event.addBlockLootModifier('minecraft:ice')
.matchMainHand("#tfg:silk_harvest_ice")
.addLoot('minecraft:ice');
event.addBlockLootModifier('minecraft:packed_ice') event.addBlockLootModifier('minecraft:packed_ice')
.not(n => n.matchMainHand("#forge:tools/saws")) .not(n => n.matchMainHand("#forge:tools/saws"))
.addWeightedLoot([4, 6], ['firmalife:ice_shavings']) .addWeightedLoot([4, 6], ['firmalife:ice_shavings'])

View file

@ -251,4 +251,20 @@ global.FISH_INDEX = [
{ id: 'tfc:tropical_fish', item: 'tfc:food/tropical_fish', parent: 'tfc:bucket/tropical_fish', dimension: null }, { id: 'tfc:tropical_fish', item: 'tfc:food/tropical_fish', parent: 'tfc:bucket/tropical_fish', dimension: null },
{ id: 'tfc:pufferfish', item: 'minecraft:pufferfish', parent: 'tfc:bucket/pufferfish', dimension: null }, { id: 'tfc:pufferfish', item: 'minecraft:pufferfish', parent: 'tfc:bucket/pufferfish', dimension: null },
{ id: 'wan_ancient_beasts:toxlacanth', item: 'wan_ancient_beasts:toxlacanth', parent: 'wan_ancient_beasts:toxlacanth_bucket', dimension: 'ad_astra:mars' } { id: 'wan_ancient_beasts:toxlacanth', item: 'wan_ancient_beasts:toxlacanth', parent: 'wan_ancient_beasts:toxlacanth_bucket', dimension: 'ad_astra:mars' }
]; ];
/**
* @type {string[]} - Saws unable to silk harvest ice
*/
global.ICE_SAW_BLACKLIST = [
"gtceu:damascus_steel_saw",
"gtceu:steel_saw",
"gtceu:bronze_saw",
"gtceu:bismuth_bronze_saw",
"gtceu:copper_saw",
"gtceu:cobalt_brass_saw",
"gtceu:black_steel_saw",
"gtceu:black_bronze_saw",
"gtceu:wrought_iron_saw",
"gtceu:invar_saw"
]