Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/actuallyadditions-common.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
#By default, the Vertical Digger mines everything that is in the 'forge:ores' block/item tags. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option only applies if the miner is in Ores Only Mode.
verticalDiggerExtraWhitelist = []
#By default, the Vertical Digger mines everything that is in the 'forge:ores' block/item tags. If there is one that it can mine, but shouldn't be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option will apply in both modes.
verticalDiggerBlacklist = []
verticalDiggerBlacklist = ["craftoria:deepslate_akite_ore"]

#Worldgen Settings
[worldgenSettings]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added kubejs/assets/craftoria/textures/item/akite_dust.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added kubejs/assets/craftoria/textures/item/raw_akite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "neoforge:add_features",
"features": "craftoria:ore_deepslate_akite",
"biomes": "#minecraft:has_structure/ancient_city",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "minecraft:ore",
"config": {
"targets": [
{
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:deepslate_ore_replaceables"
},
"state": {
"Name": "craftoria:deepslate_akite_ore"
}
}
],
"size": 3,
"discard_chance_on_air_exposure": 0.1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"feature": "craftoria:ore_deepslate_akite",
"placement": [
{
"type": "minecraft:count",
"count": 3
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:rarity_filter",
"chance": 3
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:trapezoid",
"max_inclusive": {
"absolute": -35
},
"min_inclusive": {
"absolute": -53
}
}
},
{
"direction_of_search": "down",
"target_condition": {
"type": "minecraft:solid"
},
"allowed_search_condition": {
"blocks": "minecraft:air",
"type": "minecraft:matching_blocks"
},
"max_steps": 12,
"type": "minecraft:environment_scan"
},
{
"xz_spread": 0,
"y_spread": 1,
"type": "minecraft:random_offset"
},
{
"type": "minecraft:biome"
}
]
}
28 changes: 28 additions & 0 deletions kubejs/server_scripts/Mods/Craftoria/CustomOres.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
LootJS.lootTables(event => {
for (let entry in global.customOres) {
for (let oreId of Object.values(getCustomOreVariants(entry))) {
createLootTable(oreId, `raw_${entry}`);
}
}

/**
* Creates a loot table for the specified ore type.
* @param {string} oreId
* @param {string} rawOre
*/
function createLootTable(oreId, rawOre) {
event
.getBlockTable(oreId)
.clear()
.firstPool(pool => {
pool.rolls(1);
pool.addEntry(LootEntry.of(oreId).matchTool(ItemFilter.hasEnchantment('minecraft:silk_touch')));
pool.addEntry(
LootEntry.of(`craftoria:${rawOre}`)
.applyOreBonus('minecraft:fortune')
.matchTool(ItemFilter.hasEnchantment('minecraft:silk_touch').negate())
.survivesExplosion()
);
});
}
});
21 changes: 21 additions & 0 deletions kubejs/server_scripts/Mods/Craftoria/OreProcessing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ServerEvents.recipes(event => {
const { occultism } = event.recipes;
const mekanism = MekanismHelper(event);

for (let entry in global.customOres) {
for (let oreId of Object.values(getCustomOreVariants(entry))) {
occultism.crushing(RecipeResult.of(`craftoria:${entry}_dust`, 4), oreId);

mekanism.enriching(`2x craftoria:${entry}_dust`, oreId);

event.smelting(`craftoria:${entry}_ingot`, oreId);
}
occultism.crushing(RecipeResult.of(`craftoria:${entry}_dust`, 2), `craftoria:raw_${entry}`);

mekanism.crushing(`craftoria:${entry}_dust`, `craftoria:raw_${entry}`);
mekanism.enriching(`4x craftoria:${entry}_dust`, `3x craftoria:raw_${entry}`);

event.smelting('craftoria:akite_ingot', 'craftoria:akite_dust');
event.smelting('craftoria:akite_ingot', 'craftoria:raw_akite');
}
});
8 changes: 8 additions & 0 deletions kubejs/server_scripts/Mods/Craftoria/recipes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
ServerEvents.recipes(e => {
for (let [entry, ore] of Object.entries(global.customOres)) {
const { block } = ore.registry;
if (block)
e.shaped(`craftoria:${entry}_block`, ['AAA', 'AAA', 'AAA'], {
A: `craftoria:${entry}_ingot`,
});
}

e.shaped('craftoria:blaze_block', ['AAA', 'AAA', 'AAA'], {
A: 'minecraft:blaze_rod',
});
Expand Down
18 changes: 18 additions & 0 deletions kubejs/server_scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@ const getServerLevel = levelAccessor => {
return null;
};

/** @param {string} entry A key inside`global.customOres` */
const getCustomOreVariants = entry => {
const oreVariants = {
stone: `craftoria:${entry}_ore`,
deepslate: `craftoria:deepslate_${entry}_ore`,
nether: `craftoria:nether_${entry}_ore`,
end: `craftoria:end_${entry}_ore`,
};

for (const variant in oreVariants) {
if (!global.customOres[entry].worldGen[variant]) {
delete oreVariants[variant];
}
}

return oreVariants;
};

/**
* Used for recipe IDs
* @param {Special.Mod} mod The mod name
Expand Down
27 changes: 27 additions & 0 deletions kubejs/startup_scripts/Globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,31 @@ global.customMIMachines = [
// },
];

const HarvestLevel = {
WOOD: 'neoforge:needs_wood_tool',
STONE: 'minecraft:needs_stone_tool',
IRON: 'minecraft:needs_iron_tool',
DIAMOND: 'minecraft:needs_diamond_tool',
NETHERITE: 'neoforge:needs_netherite_tool',
};

global.HarvestLevel = HarvestLevel;

global.customOres = {
akite: {
name: 'Akite',
worldGen: {
stone: false,
deepslate: true,
nether: false,
end: false,
harvestLevel: HarvestLevel.NETHERITE,
},
registry: {
nugget: false,
block: true,
},
},
};

Platform.setModName('craftoria', 'Craftoria');
95 changes: 95 additions & 0 deletions kubejs/startup_scripts/Ores.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
StartupEvents.registry('block', event => {
for (let [entry, ore] of Object.entries(global.customOres)) {
const { stone, deepslate, nether, end, harvestLevel } = ore.worldGen;
const { block } = ore.registry;

if (stone)
event
.create(`craftoria:${entry}_ore`)
.displayName(`${ore.name} Ore`)
.soundType(SoundType.STONE)
.hardness(20.0)
.resistance(10.0)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:mineable/paxel')
.tagBlock('minecraft:mineable/mattock')
.tagBlock(harvestLevel)
.tagBoth('c:ores')
.tagBoth(`c:ores/${entry}`)
.tagBoth('c:ores_in_ground/stone')
.tagBoth('mekanism:miner_blacklist')
.requiresTool(true);
if (deepslate)
event
.create(`craftoria:deepslate_${entry}_ore`)
.displayName(`Deepslate ${ore.name} Ore`)
.soundType(SoundType.DEEPSLATE)
.hardness(25.0)
.resistance(10.0)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:mineable/paxel')
.tagBlock('minecraft:mineable/mattock')
.tagBlock(harvestLevel)
.tagBoth('c:ores')
.tagBoth(`c:ores/${entry}`)
.tagBoth('c:ores_in_ground/deepslate')
.tagBoth('mekanism:miner_blacklist')
.requiresTool(true);
if (nether)
event
.create(`craftoria:nether_${entry}_ore`)
.displayName(`Nether ${ore.name} Ore`)
.soundType(SoundType.NETHERRACK)
.hardness(15.0)
.resistance(10.0)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:mineable/paxel')
.tagBlock('minecraft:mineable/mattock')
.tagBlock(harvestLevel)
.tagBoth('c:ores')
.tagBoth(`c:ores/${entry}`)
.tagBoth('c:ores_in_ground/netherrack')
.tagBoth('mekanism:miner_blacklist')
.requiresTool(true);
if (end)
event
.create(`craftoria:end_${entry}_ore`)
.displayName(`End ${ore.name} Ore`)
.soundType(SoundType.STONE)
.hardness(20.0)
.resistance(10.0)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:mineable/paxel')
.tagBlock('minecraft:mineable/mattock')
.tagBlock(harvestLevel)
.tagBoth('c:ores')
.tagBoth(`c:ores/${entry}`)
.tagBoth('c:ores_in_ground/end_stone')
.tagBoth('mekanism:miner_blacklist')
.requiresTool(true);

if (block)
event
.create(`craftoria:${entry}_block`)
.displayName(`${ore.name} Block`)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:mineable/paxel')
.tagBlock('minecraft:mineable/mattock')
.tagBlock(harvestLevel)
.tagBoth('c:storage_blocks')
.tagBoth(`c:storage_blocks/${entry}`)
.requiresTool(true);
}
});

StartupEvents.registry('item', event => {
for (let [entry, ore] of Object.entries(global.customOres)) {
if (!Object.values(ore.worldGen).includes(true)) return;
const { nugget } = ore.registry;

event.create(`craftoria:raw_${entry}`).displayName(`Raw ${ore.name}`).tag('c:raw_materials').tag(`c:raw_materials/${entry}`);
event.create(`craftoria:${entry}_dust`).displayName(`${ore.name} Dust`).tag('c:dusts').tag(`c:dusts/${entry}`);
event.create(`craftoria:${entry}_ingot`).displayName(`${ore.name} Ingot`).tag('c:ingots').tag(`c:ingots/${entry}`);
if (nugget) event.create(`craftoria:${entry}_nugget`).displayName(`${ore.name} Nugget`).tag('c:nuggets').tag(`c:nuggets/${entry}`);
}
});
26 changes: 13 additions & 13 deletions kubejs/startup_scripts/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,61 @@ StartupEvents.registry('block', event => {
event
.create('craftoria:blaze_block')
.displayName('Blaze Block')
.soundType('deepslate_bricks')
.soundType(SoundType.DEEPSLATE_BRICKS)
.hardness(3)
.resistance(2)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:needs_iron_tool')
.tagBlock(HarvestLevel.IRON)
.requiresTool(true);

event
.create('craftoria:smokey_bricks')
.displayName('Smokey Brick')
.soundType('deepslate_bricks')
.soundType(SoundType.DEEPSLATE_BRICKS)
.hardness(3)
.resistance(2)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:needs_stone_tool')
.tagBlock(HarvestLevel.STONE)
.requiresTool(true);

event
.create('craftoria:smokey_bricks_slab', 'slab')
.displayName('Smokey Brick Slab')
.soundType('deepslate_bricks')
.soundType(SoundType.DEEPSLATE_BRICKS)
.hardness(3)
.resistance(2)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:needs_stone_tool')
.tagBlock(HarvestLevel.STONE)
.requiresTool(true);

event
.create('craftoria:smokey_bricks_stairs', 'stairs')
.displayName('Smokey Brick Stairs')
.soundType('deepslate_bricks')
.soundType(SoundType.DEEPSLATE_BRICKS)
.hardness(3)
.resistance(2)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:needs_stone_tool')
.tagBlock(HarvestLevel.STONE)
.requiresTool(true);

event
.create('craftoria:smokey_bricks_wall', 'wall')
.displayName('Smokey Brick Wall')
.soundType('deepslate_bricks')
.soundType(SoundType.DEEPSLATE_BRICKS)
.hardness(3)
.resistance(2)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:needs_stone_tool')
.tagBlock(HarvestLevel.STONE)
.requiresTool(true);

event
.create('craftoria:smokey_bricks_button', 'button')
.displayName('Smokey Brick Button')
.soundType('deepslate_bricks')
.soundType(SoundType.DEEPSLATE_BRICKS)
.hardness(3)
.resistance(2)
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:needs_stone_tool')
.tagBlock(HarvestLevel.STONE)
.requiresTool(true);

event
Expand All @@ -72,7 +72,7 @@ StartupEvents.registry('block', event => {
.box(13, 8, 7, 16, 10, 9, true)
.box(0, 8, 7, 3, 10, 9, true)
.box(0, 10, 7, 2, 14, 9, true)
.soundType('metal')
.soundType(SoundType.METAL)
.property(BlockProperties.WATERLOGGED)
.tagBlock('minecraft:mineable/pickaxe')
.tagItem('modern_industrialization:replicator_blacklist')
Expand Down