Stone dust rework (#2782)
* geology * starting some loot table stuff * more stuff * swap some rocks * refactor * phew * drive-by fix * all done I think * remove sylvite * oh yeah baby it's all coming together * cleaned up some lines that didn't do anything, added more comments, removed log spam * blah blah * fix drying mat * fix ladders * tfc, beneath, and moon stuff done...? this is gonna take 5ever * a * some sand stuff, more stone types * wrong way around * unifying various brick block recipes * remove shaped create deco brick recipes * some progress on block creation * we got into the create world screen! * getting somewhere * Reloaded with no KubeJS errors! * new assets * I thiiiink that's about everything * fix some stonecutting * recipe declared but never used
This commit is contained in:
parent
72226deac0
commit
89030d3564
73 changed files with 2894 additions and 5936 deletions
|
|
@ -1,58 +1,68 @@
|
|||
// priority: 10
|
||||
"use strict";
|
||||
const STONE_TYPES_TO_COBBLE = {
|
||||
gabbro: 'tfc:rock/cobble/gabbro',
|
||||
shale: 'tfc:rock/cobble/shale',
|
||||
claystone: 'tfc:rock/cobble/claystone',
|
||||
limestone: 'tfc:rock/cobble/limestone',
|
||||
conglomerate: 'tfc:rock/cobble/conglomerate',
|
||||
dolomite: 'tfc:rock/cobble/dolomite',
|
||||
chert: 'tfc:rock/cobble/chert',
|
||||
chalk: 'tfc:rock/cobble/chalk',
|
||||
rhyolite: 'tfc:rock/cobble/rhyolite',
|
||||
dacite: 'tfc:rock/cobble/dacite',
|
||||
quartzite: 'tfc:rock/cobble/quartzite',
|
||||
slate: 'tfc:rock/cobble/slate',
|
||||
phyllite: 'tfc:rock/cobble/phyllite',
|
||||
schist: 'tfc:rock/cobble/schist',
|
||||
gneiss: 'tfc:rock/cobble/gneiss',
|
||||
marble: 'tfc:rock/cobble/marble',
|
||||
basalt: 'tfc:rock/cobble/basalt',
|
||||
diorite: 'tfc:rock/cobble/diorite',
|
||||
andesite: 'tfc:rock/cobble/andesite',
|
||||
granite: 'tfc:rock/cobble/granite',
|
||||
deepslate: 'minecraft:cobbled_deepslate',
|
||||
pyroxenite: 'tfg:rock/cobble_blackstone',
|
||||
dripstone: 'tfg:rock/cobble_dripstone',
|
||||
keratophyre: 'tfg:rock/cobble_crackrack',
|
||||
moon_stone: 'ad_astra:moon_cobblestone',
|
||||
moon_deepslate: 'tfg:rock/cobble_moon_deepslate',
|
||||
mars_stone: 'ad_astra:mars_cobblestone',
|
||||
venus_stone: 'ad_astra:venus_cobblestone',
|
||||
mercury_stone: 'ad_astra:mercury_cobblestone',
|
||||
glacio_stone: 'ad_astra:glacio_cobblestone',
|
||||
permafrost: 'tfg:rock/cobble_permafrost'
|
||||
}
|
||||
|
||||
const registerTFGOreLoots = (event) => {
|
||||
// Have to define these here because normal loot table jsons don't support checking for hammers
|
||||
const registerTFGOreLoots = (event) => {
|
||||
// Rock to cobble, cobble to gravel
|
||||
for (let [rockId, rock] of Object.entries(global.BIG_ROCK_TABLE)) {
|
||||
if (rock.raw != null && rock.cobble != null) {
|
||||
event.addBlockLootModifier(rock.raw.block)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(rock.cobble.block)
|
||||
}
|
||||
|
||||
// Crush raw rock into cobble
|
||||
global.TFC_STONE_TYPES.forEach(stoneType => {
|
||||
event.addBlockLootModifier(`tfc:rock/raw/${stoneType}`)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(STONE_TYPES_TO_COBBLE[stoneType]);
|
||||
if (rock.hardened != null && rock.cobble != null) {
|
||||
event.addBlockLootModifier(rock.hardened)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(rock.cobble.block)
|
||||
}
|
||||
|
||||
if (rock.cobble != null && rock.gravel != null) {
|
||||
event.addBlockLootModifier(rock.cobble.block)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(rock.gravel)
|
||||
|
||||
if (rock.cobble.mossy != null) {
|
||||
event.addBlockLootModifier(rock.cobble.mossy.block)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(rock.gravel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sand
|
||||
global.SAND_COLORS.forEach(sandColor => {
|
||||
let tag_array = Ingredient.of(`#tfc:${sandColor}_gravel`).itemIds.toArray().map(String);
|
||||
tag_array.forEach(item => {
|
||||
event.addBlockLootModifier(item)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(`tfc:sand/${sandColor}`)
|
||||
})
|
||||
})
|
||||
|
||||
// Defined in kubejs/startup_scripts/tfg/constants.js
|
||||
global.HAMMERING.forEach(x => {
|
||||
event.addBlockLootModifier(x.raw)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(x.hammered)
|
||||
if (x.raw.startsWith('#')) {
|
||||
let tag_array = Ingredient.of(x.raw).itemIds.toArray().map(String);
|
||||
tag_array.forEach(item => {
|
||||
event.addBlockLootModifier(item)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(x.hammered)
|
||||
})
|
||||
}
|
||||
else {
|
||||
event.addBlockLootModifier(x.raw)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addLoot(x.hammered)
|
||||
}
|
||||
})
|
||||
|
||||
// Other rocks
|
||||
event.addBlockLootModifier('minecraft:gilded_blackstone')
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
|
|
@ -61,6 +71,16 @@ const registerTFGOreLoots = (event) => {
|
|||
LootEntry.of('tfc:powder/native_gold')
|
||||
)
|
||||
|
||||
event.addBlockLootModifier('beneath:ore/blackstone_sylvite')
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addWeightedLoot([
|
||||
Item.of('gtceu:rich_raw_rock_salt').withChance(0.2),
|
||||
Item.of('gtceu:raw_rock_salt').withChance(0.6),
|
||||
Item.of('gtceu:poor_raw_rock_salt').withChance(0.2)
|
||||
])
|
||||
.addLoot(LootEntry.of('tfg:igneous_ultramafic_dust').when((c) => c.randomChance(0.2)))
|
||||
.addLoot(LootEntry.of('gtceu:tiny_rock_salt_dust').when(c => c.randomChance(0.05)));
|
||||
|
||||
// Go through all materials
|
||||
const $GreateMaterials = Java.loadClass("electrolyte.greate.registry.GreateMaterials")
|
||||
|
||||
|
|
@ -83,30 +103,23 @@ const registerTFGOreLoots = (event) => {
|
|||
let richRawOre = ChemicalHelper.get(TFGTagPrefix.richRawOre, material, 1)
|
||||
let normalRawOre = ChemicalHelper.get(TagPrefix.rawOre, material, 1)
|
||||
let poorRawOre = ChemicalHelper.get(TFGTagPrefix.poorRawOre, material, 1)
|
||||
let dustOre = ChemicalHelper.get(TagPrefix.dustTiny, material, 1)
|
||||
|
||||
let rawOreBlock = ChemicalHelper.get(TagPrefix.rawOreBlock, material, 1).getItem().id;
|
||||
event.addBlockLootModifier(rawOreBlock)
|
||||
.removeLoot(ItemFilter.ALWAYS_TRUE)
|
||||
.addWeightedLoot([4, 6],
|
||||
[
|
||||
richRawOre.withChance(0.2),
|
||||
normalRawOre.withChance(0.6),
|
||||
poorRawOre.withChance(0.2)
|
||||
]);
|
||||
.addWeightedLoot([4, 6], [
|
||||
richRawOre.withChance(0.2),
|
||||
normalRawOre.withChance(0.6),
|
||||
poorRawOre.withChance(0.2)
|
||||
])
|
||||
.addLoot(LootEntry.of(dustOre).when(c => c.randomChance(0.2)));
|
||||
|
||||
// Stone ores
|
||||
global.ORE_BEARING_STONES.forEach(stoneType => {
|
||||
|
||||
let stoneTypeMaterial = TFGHelpers.getMaterial(stoneType)
|
||||
|
||||
// Material doesn't work here because of reasons
|
||||
if (stoneTypeMaterial === null) {
|
||||
if (stoneType === "pyroxenite")
|
||||
stoneTypeMaterial = GTMaterials.Blackstone;
|
||||
else if (stoneType === "deepslate")
|
||||
stoneTypeMaterial = GTMaterials.Deepslate;
|
||||
}
|
||||
|
||||
let stoneTypeMaterial = GTMaterials.get(global.BIG_ROCK_TABLE[stoneType === "pyroxenite" ? "blackstone" : stoneType].material);
|
||||
|
||||
let stoneTypeDust = ChemicalHelper.get(TagPrefix.dust, stoneTypeMaterial, 1)
|
||||
let namespace = material === $GreateMaterials.RoseQuartz ? 'greate' : 'gtceu';
|
||||
|
||||
|
|
@ -118,14 +131,13 @@ const registerTFGOreLoots = (event) => {
|
|||
normalRawOre.withChance(0.6),
|
||||
poorRawOre.withChance(0.2)
|
||||
])
|
||||
.addLoot(
|
||||
LootEntry.of(stoneTypeDust).when((c) => c.randomChance(0.25))
|
||||
)
|
||||
.addLoot(LootEntry.of(stoneTypeDust).when((c) => c.randomChance(0.2)))
|
||||
.addLoot(LootEntry.of(dustOre).when(c => c.randomChance(0.05)));
|
||||
|
||||
// break with hammer
|
||||
event.addBlockLootModifier(`${namespace}:${stoneType}_${material.getName()}_ore`)
|
||||
.matchMainHand('#forge:tools/hammers')
|
||||
.addLoot(STONE_TYPES_TO_COBBLE[stoneType]);
|
||||
.addLoot(LootEntry.of(GTBlocks.COBBLE_BLOCKS.get(TagPrefix.get(stoneType)).get().getBlock().id));
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue