recreate veins for kjs

This commit is contained in:
SpeeeDCraft 2023-10-23 21:25:35 +07:00
parent 35f66e252b
commit a3305f8dec
11 changed files with 1573 additions and 156 deletions

View file

@ -1,15 +0,0 @@
Find out more info on the website: https://kubejs.com/
Directory information:
assets - Acts as a resource pack, you can put any client resources in here, like textures, models, etc. Example: assets/kubejs/textures/item/test_item.png
data - Acts as a datapack, you can put any server resources in here, like loot tables, functions, etc. Example: data/kubejs/loot_tables/blocks/test_block.json
startup_scripts - Scripts that get loaded once during game startup - Used for adding items and other things that can only happen while the game is loading (Can be reloaded with /kubejs reload_startup_scripts, but it may not work!)
server_scripts - Scripts that get loaded every time server resources reload - Used for modifying recipes, tags, loot tables, and handling server events (Can be reloaded with /reload)
client_scripts - Scripts that get loaded every time client resources reload - Used for JEI events, tooltips and other client side things (Can be reloaded with F3+T)
config - KubeJS config storage. This is also the only directory that scripts can access other than world directory
exported - Data dumps like texture atlases end up here
You can find type-specific logs in logs/kubejs/ directory

View file

@ -1,3 +0,0 @@
// priority: 0
// script..

View file

@ -0,0 +1,5 @@
// priority: 0
ServerEvents.highPriorityData(event => {
addOreVeins(event);
})

View file

@ -1,7 +1,6 @@
// priority: 0
ServerEvents.highPriorityData(event => {
const addOreVeins = (event) => {
const veinsJson = {
replace: true,
values: []
@ -12,7 +11,7 @@ ServerEvents.highPriorityData(event => {
const placedFeatureVeinJson = {
feature: `tfc:vein/${vein.random_name}`,
placement: []
}
}
const configuredFeatureVeinJson = {
type: vein.veinType,
@ -27,8 +26,21 @@ ServerEvents.highPriorityData(event => {
size: vein.size,
density: vein.density,
blocks: [],
random_name: vein.random_name,
// may be empty
indicator: vein.indicator,
random_name: vein.random_name
biomes: vein.biomes, // not work (maybe tfc bug)
// disc vein stuff
height: vein.height,
// pipe vein stuff
radius: vein.radius,
minSkew: vein.minSkew,
maxSkew: vein.maxSkew,
minSlant: vein.minSlant,
maxSlant: vein.maxSlant
}
}
@ -51,10 +63,10 @@ ServerEvents.highPriorityData(event => {
})
veinsJson.values.push(`tfc:vein/${vein.random_name}`)
console.log(configuredFeatureVeinJson)
event.addJson(`tfc:worldgen/configured_feature/vein/${vein.random_name}`, configuredFeatureVeinJson)
event.addJson(`tfc:worldgen/placed_feature/vein/${vein.random_name}`, placedFeatureVeinJson)
})
event.addJson(`tfc:tags/worldgen/placed_feature/in_biome/veins`, veinsJson)
})
}

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,9 @@
const $OreProperty = Java.loadClass("com.gregtechceu.gtceu.api.data.chemical.material.properties.OreProperty")
const $OrePropertyKey = Java.loadClass("com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey")
GTCEuStartupEvents.registry('gtceu:material', event => {
const registerMaterials = (event) => {
//GTMaterials.Bismuth.setProperty($OrePropertyKey.ORE, new $OreProperty());
})
//GTMaterials.Gypsum.setProperty($OrePropertyKey.ORE, new $OreProperty());
//GTMaterials.Borax.setProperty($OrePropertyKey.ORE, new $OreProperty());
//GTMaterials.Sylvite.setProperty($OrePropertyKey.ORE, new $OreProperty());
}

View file

@ -1,7 +1,6 @@
// priority: 0
// Replace
GTCEuStartupEvents.registry('gtceu:tag_prefix', event => {
const registerStoneTypes = (event) => {
global.allTFCStoneTypeNames.forEach(stoneTypeName => {
event.create("tfc_" + stoneTypeName, 'ore')
.stateSupplier(() => Block.getBlock('tfc:rock/raw/' + stoneTypeName).defaultBlockState())
@ -10,5 +9,5 @@ GTCEuStartupEvents.registry('gtceu:tag_prefix', event => {
.materialIconType(GTMaterialIconType.ore)
.generationCondition(ItemGenerationCondition.hasOreProperty)
});
})
}

View file

@ -0,0 +1,17 @@
// priority: 0
const registerTagPrefixes = (event) => {
event.create('poor_raw_ore')
.unificationEnabled(true)
.generateItem(true)
.materialIconType(GTMaterialIconType.rawOre)
.generationCondition(ItemGenerationCondition.hasOreProperty)
.register();
event.create('rich_raw_ore')
.unificationEnabled(true)
.generateItem(true)
.materialIconType(GTMaterialIconType.rawOre)
.generationCondition(ItemGenerationCondition.hasOreProperty)
.register();
}

View file

@ -0,0 +1,10 @@
// priority: 0
GTCEuStartupEvents.registry('gtceu:material', event => {
registerMaterials(event);
})
GTCEuStartupEvents.registry('gtceu:tag_prefix', event => {
registerStoneTypes(event);
registerTagPrefixes(event);
})

View file

@ -1,125 +0,0 @@
// priority: 1000
global.allTFCStoneTypeNames = [
'gabbro',
'shale',
'claystone',
'limestone',
'conglomerate',
'dolomite',
'chert',
'chalk',
'rhyolite',
'dacite',
'quartzite',
'slate',
'phyllite',
'schist',
'gneiss',
'marble',
'basalt',
'diorite',
'andesite',
'granite'
];
global.allTFCStoneTypeNamesWithoutDups = [
'gabbro',
'shale',
'claystone',
'limestone',
'conglomerate',
'dolomite',
'chert',
'chalk',
'rhyolite',
'dacite',
'quartzite',
'slate',
'phyllite',
'schist',
'gneiss',
'marble'
];
global.allTFCStoneTypeNamesOnlyDups = [
'basalt',
'diorite',
'andesite',
'granite'
];
global.veins = [
{
random_name: "normal_gold",
veinType: "tfc:disc_vein",
rarity: 70,
maxY: 60,
minY: -32,
size: 35,
density: 0.6,
stoneTypes: ["rhyolite", "basalt", "andesite", "dacite", "granite", "diorite", "gabbro"],
ores: [
{
weight: 5,
material: "goethite"
},
{
weight: 20,
material: "yellow_limonite"
},
{
weight: 20,
material: "hematite"
},
{
weight: 55,
material: "gold"
}
],
indicator: {
rarity: 12,
blocks: [
{
block: "tfc:ore/small_native_gold"
}
]
}
}
/*,
{
name: "",
veinType: "tfc:disc_vein",
rarity: "",
maxY: 0,
minY: 0,
size: 0,
density: 0.0,
stoneTypes: ["marble", "diorite"],
ores: [
{
weight: 0,
ore: ""
}
],
customOreRules: [
{
stoneType: "",
ores: [
{
weight: 0,
ore: ""
}
]
}
],
indicator: {
rarity: 12,
blocks: [
{
block: "tfc:ore/small_native_gold"
}
]
}
}*/
]