improve codestyle

This commit is contained in:
SpeeeDCraft
2023-10-27 08:26:25 +07:00
parent 1526ffcf07
commit 96a4ae16d3
6 changed files with 119 additions and 97 deletions

View File

@@ -1 +1,88 @@
// priority: 0
// priority: 0
global.itemsToHide = [
"minecraft:coal_ore",
"minecraft:deepslate_coal_ore",
"minecraft:iron_ore",
"minecraft:deepslate_iron_ore",
"minecraft:copper_ore",
"minecraft:deepslate_copper_ore",
"minecraft:gold_ore",
"minecraft:deepslate_gold_ore",
"minecraft:redstone_ore",
"minecraft:deepslate_redstone_ore",
"minecraft:emerald_ore",
"minecraft:deepslate_emerald_ore",
"minecraft:lapis_ore",
"minecraft:deepslate_lapis_ore",
"minecraft:diamond_ore",
"minecraft:deepslate_diamond_ore",
"minecraft:nether_gold_ore",
"minecraft:nether_quartz_ore"
]
global.stoneTypesToHide = [
"sand",
"red_sand",
"gravel",
"ore",
"deepslate",
"basalt",
"endstone",
"netherrack",
"andesite",
"diorite",
"granite",
"tuff"
]
global.tfcSimpleMaterials = [
"gypsum",
"cinnabar",
"cryolite",
"saltpeter",
"sylvite",
"borax",
"halite",
"amethyst",
"opal",
"pyrite",
"topaz",
"bituminous_coal",
"lignite",
"graphite",
"sulfur",
"diamond",
"emerald",
"lapis_lazuli",
"ruby",
"sapphire"
]
global.tfcOreTypes = [
"poor",
"normal",
"rich"
]
global.tfcOreMaterials = [
"bismuthinite",
"cassiterite",
"garnierite",
"hematite",
"limonite",
"magnetite",
"malachite",
"native_copper",
"native_gold",
"native_silver",
"sphalerite",
"tetrahedrite"
]
global.tfcDepositeMaterials = [
"cassiterite",
"native_copper",
"native_gold",
"native_silver"
]

View File

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

View File

@@ -0,0 +1,12 @@
// priority: 0
REIEvents.hide('item', event => {
hideGTStuff(event)
hideTFCStuff(event)
hideMinecraftStuff(event)
})
REIEvents.groupEntries(event => {
groupGTStuff(event)
})

View File

@@ -0,0 +1,7 @@
// priority: 0
const hideMinecraftStuff = (event) => {
global.itemsToHide.forEach(itemToHide => {
event.hide(itemToHide)
})
}

View File

@@ -1,76 +1,20 @@
// priority: 0
const tfcSimpleMaterials = [
"gypsum",
"cinnabar",
"cryolite",
"saltpeter",
"sylvite",
"borax",
"halite",
"amethyst",
"opal",
"pyrite",
"topaz",
"bituminous_coal",
"lignite",
"graphite",
"sulfur",
"diamond",
"emerald",
"lapis_lazuli",
"ruby",
"sapphire"
]
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 => {
const hideTFCStuff = (event) => {
// Hide unused TFC ores
global.allTFCStoneTypeNames.forEach(stoneTypeName => {
tfcSimpleMaterials.forEach(material => {
global.tfcSimpleMaterials.forEach(material => {
event.hide(`tfc:ore/${material}/${stoneTypeName}`)
})
tfcOreTypes.forEach(oreTypeName => {
tfcOreMaterials.forEach(oreMaterialName => {
global.tfcOreTypes.forEach(oreTypeName => {
global.tfcOreMaterials.forEach(oreMaterialName => {
event.hide(`tfc:ore/${oreTypeName}_${oreMaterialName}/${stoneTypeName}`)
})
})
tfcDepositeMaterials.forEach(depositeMaterialName => {
global.tfcDepositeMaterials.forEach(depositeMaterialName => {
event.hide(`tfc:deposit/${depositeMaterialName}/${stoneTypeName}`)
})
})
})
}

View File

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