Muhammad Mahad Arif

read and make

📎 1 file 2,423 chars
📄
pasted-code-1790494091009.txt
txt 26 lines
▶
Create a brand new Minecraft 26.2 Fabric mod introducing Ruby, Sapphire, Silver, Uranium, and Steel. To prevent all startup crashes and ensure TLauncher compatibility without editing any launcher settings, use standard vanilla code extensions. Regard all custom spears natively as standard extensions of the SwordItem class in your primary Java code registry so they automatically support standard Enchanting Tables.

1. Ruby Ore: Spawns in stone layers. Texture looks like vanilla Diamond Ore but colored bright red. Drops Rubies to craft red armor, tools.
- Ruby Spear: A vanilla Sword subclass item named "Ruby Spear" using a vertical spear texture. Fully enchantable at an Enchanting Table.
- Loot: Appears rarely in Stronghold Altars and Nether Fortresses.

2. Sapphire Ore: Spawns in deepslate layers. Texture looks like vanilla Iron Ore but colored dark blue. Drops Sapphires to craft blue tools.
- Sapphire Spear: A vanilla Sword subclass item named "Sapphire Spear". Fully enchantable.
- Sapphire Glass & Pane: Standard vanilla glass block/pane subclasses colored dark blue. Completely immune to Creeper explosions.
- Loot: Appears randomly in Shipwrecks and Buried Treasure.

3. Silver Ore: Spawns in stone layers. Texture looks like vanilla Emerald Ore but colored pale white. Drops Raw Silver which smelts into Silver Ingots. Forges light-gray tools.
- Silver Spear: A vanilla Sword subclass item named "Silver Spear". Deals bonus damage to undead mobs and accepts standard enchantments.
- Silver Mirror: A standard usable tool item that grants the player 10 seconds of Night Vision when right-clicked.
- Loot: Appears in Monster Room Dungeons and Desert Pyramids.

4. Uranium Ore: Spawns rarely in deepslate layers. Texture looks like vanilla Redstone Ore colored neon green with a Light Level of 5. Drops Uranium Chunks.
- Uranium Block: Crafted from 9 chunks, acts as furnace fuel for 100 items.
- Uranium Lantern: A vanilla Lantern subclass item crafted with 1 chunk surrounded by 8 iron nuggets. Emits green light at Light Level 15.
- Loot: Appears rarely in Abandoned Mineshafts.

5. Steel Ingot: No ore block. Crafted by putting 1 Iron Ingot and 1 Coal together. Crafts dark gray armor, tools.
- Steel Spear: A vanilla Sword subclass item named "Steel Spear". Fully enchantable.
- Steel Shears: A vanilla Shears subclass item with 4x durability.
- Loot: Appears frequently in Village Weaponsmith chests.
Kodari AI
KodariSep 27 at 7:45 am 9
FiveMetalExpansion
A Fabric 26.2 mod adding Ruby, Sapphire, Silver, Uranium, and Steel. Registers custom spears as SwordItem subclasses for full Enchanting Table compatibility. Adds new ores with distinct textures spawning in stone and deepslate layers, plus tools, armor, Sapphire Glass immune to Creeper explosions, a Silver Mirror granting Night Vision, a Uranium Lantern emitting green light, and a Steel Shears with 4x durability. Includes custom loot tables for Strongholds, Nether Fortresses, Shipwrecks, Buried Treasure, Dungeons, Desert Pyramids, Mineshafts, and Village Weaponsmiths. Uses standard vanilla code extensions for TLauncher compatibility.
  1. Register the five material families and implement their items, spears, mirror, shears, lantern, and uranium fuel block.

  2. Add ore generation, recipes, structure loot, and the requested explosion/light behavior.

  3. Create the Fabric project metadata, assets, blockstates, item models, and English names.

  1. Added the Ruby, Sapphire, Silver, Uranium, and Steel items, tools, armor, blocks, custom creative tab, and Silver Mirror effect.

  2. Added ore generation, crafting and smelting recipes, structure loot, uranium block fuel, and explosion-resistant Sapphire Glass and Pane.

  3. Created the Fabric 26.2 project setup, item definitions, block models, blockstates, and English names.

Two vanilla limitations: Minecraft 26.2 has no SwordItem, so spears use Item.Properties.sword(...) for sword-style stats and enchantability; the Uranium Lantern is green-tinted and emits at level 15, but vanilla block lighting is not colored. The project uses standard Fabric setup and makes no launcher-setting changes.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
135 1,065
src/client/java/com/kodari/gemstones/client/GemstonesClient.java
package com.kodari.gemstones.client;

import com.kodari.gemstones.ModBlocks;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.BlockColorRegistry;
import net.minecraft.client.color.block.BlockTintSource;

import java.util.List;

public final class GemstonesClient implements ClientModInitializer {
    @Override
    public void onInitializeClient() {
        BlockColorRegistry.register(List.of((BlockTintSource) state -> 0xD31632), ModBlocks.RUBY_ORE);
        BlockColorRegistry.register(List.of((BlockTintSource) state -> 0x142B78), ModBlocks.SAPPHIRE_ORE, ModBlocks.SAPPHIRE_GLASS_PANE);
        BlockColorRegistry.register(List.of((BlockTintSource) state -> 0xD9DDE2), ModBlocks.SILVER_ORE);
        BlockColorRegistry.register(List.of((BlockTintSource) state -> 0x42FF35), ModBlocks.URANIUM_ORE, ModBlocks.URANIUM_BLOCK, ModBlocks.URANIUM_LANTERN);
    }
}