Hide a lot of unused ores

This commit is contained in:
SpeeeDCraft 2023-10-27 08:04:52 +07:00
parent b64e81fb87
commit b1be5e0971
6 changed files with 115 additions and 17 deletions

View file

@ -0,0 +1 @@
// priority: 0

View file

@ -1,6 +0,0 @@
// priority: 0
// Visit the wiki for more info - https://kubejs.com/
console.info('Hello, World! (Loaded client scripts)')

View file

@ -0,0 +1,27 @@
// priority: 0
const stoneTypesToHide = [
"sand",
"red_sand",
"gravel",
"ore",
"deepslate",
"basalt",
"endstone",
"netherrack",
"andesite",
"diorite",
"granite",
"tuff"
]
REIEvents.hide('item', event => {
// Hide unused GT ores
GTRegistries.MATERIALS.forEach(material => {
global.stoneTypesToHide.forEach(stoneTypeName => {
event.hide(`#forge:ores/${stoneTypeName}/${material}`)
})
})
})

View file

@ -0,0 +1,67 @@
// priority: 0
const tfcSimpleMaterials = [
"gypsum",
"cinnabar",
"cryolite",
"saltpeter",
"sylvite",
"borax",
"halite",
"amethyst",
"opal",
"pyrite",
"topaz"
]
const tfcOreTypes = [
"poor",
"normal",
"rich"
]
const tfcOreMaterials = [
"bismuthinite",
"cassiterite",
"garnierite",
"hematite",
"limonite",
"magnetite",
"malachite",
"native_copper",
"native_gold",
"native_silver",
"sphalerite",
"tetrahedrite"
]
const tfcDepositeMaterials = [
"cassiterite",
"native_copper",
"native_gold",
"native_silver"
]
REIEvents.hide('item', event => {
// Hide unused TFC ores
global.allTFCStoneTypeNames.forEach(stoneTypeName => {
tfcSimpleMaterials.forEach(material => {
event.hide(`tfc:ore/${material}/${stoneTypeName}`)
})
tfcOreTypes.forEach(oreTypeName => {
tfcOreMaterials.forEach(oreMaterialName => {
event.hide(`tfc:ore/${oreTypeName}_${oreMaterialName}/${stoneTypeName}`)
})
})
tfcDepositeMaterials.forEach(depositeMaterialName => {
event.hide(`tfc:deposit/${depositeMaterialName}/${stoneTypeName}`)
})
})
})

View file

@ -26,24 +26,18 @@ const doesMaterialUseNormalFurnace = (material) => {
const generateRecipesForRawOres = (event, material) => { const generateRecipesForRawOres = (event, material) => {
const materialOreProperty = material.getProperty($PropertyKey.ORE) const materialOreProperty = material.getProperty($PropertyKey.ORE)
const crushedStack = ChemicalHelper.get(TagPrefix.crushed, material, 1);
const ingotPrefix = TagPrefix.getPrefix('ingot')
const gemPrefix = TagPrefix.getPrefix('gem')
const dustPrefix = TagPrefix.getPrefix('dust')
const crushedOrePrefix = TagPrefix.getPrefix('crushedOre')
const crushedStack = ChemicalHelper.get(crushedOrePrefix, material, 1);
let ingotStack; let ingotStack;
const smeltingMaterial = materialOreProperty.getDirectSmeltResult() == null ? material : materialOreProperty.getDirectSmeltResult(); const smeltingMaterial = materialOreProperty.getDirectSmeltResult() == null ? material : materialOreProperty.getDirectSmeltResult();
const amountOfCrushedOre = materialOreProperty.getOreMultiplier(); const amountOfCrushedOre = materialOreProperty.getOreMultiplier();
if (smeltingMaterial.hasProperty($PropertyKey.INGOT)) { if (smeltingMaterial.hasProperty($PropertyKey.INGOT)) {
ingotStack = ChemicalHelper.get(ingotPrefix, smeltingMaterial, 1); ingotStack = ChemicalHelper.get(TagPrefix.ingot, smeltingMaterial, 1);
} else if (smeltingMaterial.hasProperty($PropertyKey.GEM)) { } else if (smeltingMaterial.hasProperty($PropertyKey.GEM)) {
ingotStack = ChemicalHelper.get(gemPrefix, smeltingMaterial, 1); ingotStack = ChemicalHelper.get(TagPrefix.gem, smeltingMaterial, 1);
} else { } else {
ingotStack = ChemicalHelper.get(dustPrefix, smeltingMaterial, 1); ingotStack = ChemicalHelper.get(TagPrefix.dust, smeltingMaterial, 1);
} }
ingotStack.setCount(ingotStack.getCount() * materialOreProperty.getOreMultiplier()); ingotStack.setCount(ingotStack.getCount() * materialOreProperty.getOreMultiplier());
crushedStack.setCount(crushedStack.getCount() * materialOreProperty.getOreMultiplier()); crushedStack.setCount(crushedStack.getCount() * materialOreProperty.getOreMultiplier());
@ -53,7 +47,7 @@ const generateRecipesForRawOres = (event, material) => {
const generateRecipes = (tagPrefixWithMaterial, tagPrefix, multiplier) => { const generateRecipes = (tagPrefixWithMaterial, tagPrefix, multiplier) => {
let outputItems; let outputItems;
if (material.hasProperty($PropertyKey.GEM) && !gemPrefix.isIgnored(material)) { if (material.hasProperty($PropertyKey.GEM) && !TagPrefix.gem.isIgnored(material)) {
outputItems = `${amountOfCrushedOre * multiplier}x #forge:gems/${material}` outputItems = `${amountOfCrushedOre * multiplier}x #forge:gems/${material}`
} else { } else {
outputItems = `${amountOfCrushedOre * multiplier}x #forge:crushed_ores/${material}` outputItems = `${amountOfCrushedOre * multiplier}x #forge:crushed_ores/${material}`

View file

@ -1,5 +1,20 @@
// priority: 1000 // priority: 1000
global.stoneTypesToHide = [
"sand",
"red_sand",
"gravel",
"ore",
"deepslate",
"basalt",
"endstone",
"netherrack",
"andesite",
"diorite",
"granite",
"tuff"
]
global.allTFCStoneTypeNames = [ global.allTFCStoneTypeNames = [
'gabbro', 'gabbro',
'shale', 'shale',