Version 2.1.5 - Major update with armor, creative tab, KubeJS integration
Features: - Added Diamond Shard armor set (helmet, chestplate, leggings, boots) - Added Diamond Shard tools (pickaxe, shovel, axe, paxel) - Created custom creative tab "Custom Ore Gen" with all mod items - Fixed armor texture loading with proper ArmorMaterial implementation - Updated diamond shard item texture to 32x32 - Fixed diamond shard ore textures (swapped surface/deepslate) - Disabled surface diamond shard ore generation (only deepslate remains) - Added KubeJS as mandatory dependency - Auto-create KubeJS startup script to remove vanilla ores Technical changes: - Created ShardDiamondArmorMaterial class with proper getName() format - Created KubeJSIntegration class for automatic script creation - Updated mods.toml with KubeJS dependency and version 2.1.5 - Removed ModArmorMaterials enum (replaced by class-based approach) - Updated CreativeTab to include all mod items in custom tab Textures: - New armor textures from new_armor folder - New diamond shard item texture - Fixed armor layer textures for proper rendering 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ plugins {
|
||||
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
|
||||
}
|
||||
|
||||
version = '2.1.0'
|
||||
version = '2.1.5'
|
||||
group = 'com.aulyrius.custom_ore_gen'
|
||||
archivesBaseName = 'custom_ore_gen'
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package net.mcreator.customoregen;
|
||||
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.event.level.LevelEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.storage.LevelResource;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = CustomOreGenMod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE)
|
||||
public class KubeJSIntegration {
|
||||
|
||||
private static final String SCRIPT_FILE_NAME = "custom_ore_gen_remove_vanilla_ores.js";
|
||||
private static boolean hasCreatedScript = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onServerLoad(LevelEvent.Load event) {
|
||||
// Only run on server side and only once
|
||||
if (event.getLevel().isClientSide() || hasCreatedScript) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(event.getLevel() instanceof ServerLevel serverLevel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
hasCreatedScript = true;
|
||||
|
||||
// Get the server's kubejs directory
|
||||
File kubeJsDir = new File(serverLevel.getServer().getServerDirectory(), "kubejs/startup_scripts");
|
||||
|
||||
if (!kubeJsDir.exists()) {
|
||||
CustomOreGenMod.LOGGER.info("KubeJS directory not found. Skipping script creation.");
|
||||
return;
|
||||
}
|
||||
|
||||
File scriptFile = new File(kubeJsDir, SCRIPT_FILE_NAME);
|
||||
|
||||
// Only create if it doesn't exist
|
||||
if (scriptFile.exists()) {
|
||||
CustomOreGenMod.LOGGER.info("KubeJS script already exists: " + scriptFile.getPath());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
createKubeJSScript(scriptFile.toPath());
|
||||
CustomOreGenMod.LOGGER.info("Successfully created KubeJS script: " + scriptFile.getPath());
|
||||
} catch (IOException e) {
|
||||
CustomOreGenMod.LOGGER.error("Failed to create KubeJS script", e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void createKubeJSScript(Path scriptPath) throws IOException {
|
||||
String scriptContent = """
|
||||
// priority: 0
|
||||
|
||||
WorldgenEvents.remove(event => {
|
||||
var minecraftOreList = [
|
||||
'minecraft:coal_ore',
|
||||
'minecraft:deepslate_coal_ore',
|
||||
'minecraft:copper_ore',
|
||||
'minecraft:deepslate_copper_ore',
|
||||
'minecraft:iron_ore',
|
||||
'minecraft:deepslate_iron_ore',
|
||||
'minecraft:gold_ore',
|
||||
'minecraft:deepslate_gold_ore',
|
||||
'minecraft:redstone_ore',
|
||||
'minecraft:deepslate_redstone_ore',
|
||||
'minecraft:emerald_ore',
|
||||
'minecraft:deepslate_emerald_ore',
|
||||
'minecraft:diamond_ore',
|
||||
'minecraft:deepslate_diamond_ore',
|
||||
'minecraft:lapis_ore',
|
||||
'minecraft:deepslate_lapis_ore'
|
||||
];
|
||||
|
||||
event.removeOres(props => {
|
||||
props.blocks = minecraftOreList
|
||||
});
|
||||
});
|
||||
""";
|
||||
|
||||
Files.writeString(scriptPath, scriptContent, StandardOpenOption.CREATE_NEW);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ license="Not specified"
|
||||
|
||||
[[mods]]
|
||||
modId="custom_ore_gen"
|
||||
version="2.0.8-forge"
|
||||
displayName="Custom Ore Gem"
|
||||
version="2.1.5-forge"
|
||||
displayName="Custom Ore Gen"
|
||||
displayURL="https://lanro.eu"
|
||||
credits="Created using mod maker MCreator - https://mcreator.net/about"
|
||||
authors="Aulyrius cr\u00E9e via MCreator"
|
||||
@@ -21,7 +21,12 @@ description="Changement de la distribution des ressources sur Minecraft, ne pas
|
||||
ordering="AFTER"
|
||||
side="BOTH"
|
||||
|
||||
|
||||
[[dependencies.custom_ore_gen]]
|
||||
modId="kubejs"
|
||||
mandatory=true
|
||||
versionRange="[1902.6.2-build.359,)"
|
||||
ordering="AFTER"
|
||||
side="BOTH"
|
||||
|
||||
|
||||
# Start of user code block dependencies configuration
|
||||
|
||||
Reference in New Issue
Block a user