Skip to content

Commit

Permalink
Added items and blocks (rewritten from Forge)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leronus committed Jan 14, 2024
1 parent 615a7bb commit 7dbbf04
Show file tree
Hide file tree
Showing 3,636 changed files with 50,615 additions and 52 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 0 additions & 10 deletions src/client/java/mod/leronus/mores/MoresClient.java

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions src/client/resources/mores.client.mixins.json

This file was deleted.

37 changes: 29 additions & 8 deletions src/main/java/mod/leronus/mores/Mores.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
package mod.leronus.mores;

import mod.leronus.mores.blocks.ModBlocks;
import mod.leronus.mores.item.ModItems;
import net.fabricmc.api.ModInitializer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Mores implements ModInitializer {
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final String MOD_ID = "mores";
public static final Logger LOGGER = LoggerFactory.getLogger("mores");

@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
// ModItemGroups.registerItemGroups();

ModItems.registerModItems();
ModBlocks.registerModBlocks();

// ModLootTableModifiers.modifyLootTables();
// ModCustomTrades.registerCustomTrades();

// ModSounds.registerSounds();

// ModBlockEntities.registerBlockEntities();
// ModScreenHandlers.registerScreenHandlers();

// ModRecipes.registerRecipes();
// ModTrunkPlacerTypes.register();

// FuelRegistry.INSTANCE.add(ModItems.ANTHRACITE, 200);
// FabricDefaultAttributeRegistry.register(ModEntities.ALLOY_BLOCK, AlloyBlockEntity.createAlloyAttributes());

// ModWorldGeneration.generateModWorldGen();

LOGGER.info("Hello mOres!");
// CustomPortalBuilder.beginPortal()
// .frameBlock(ModBlocks.RUBY_BLOCK)
// .lightWithItem(ModItems.ANTHRACITE)
// .destDimID(new Identifier(Mores.MOD_ID, "moresdim"))
// .tintColor(0xc76efa)
// .registerPortal();
}
}
103 changes: 103 additions & 0 deletions src/main/java/mod/leronus/mores/blocks/ModBlocks.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package mod.leronus.mores.blocks;

import mod.leronus.mores.Mores;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.block.MapColor;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.intprovider.UniformIntProvider;


/**
* Class that initialises all blocks from mOres
* @author Leronus
*/
public class ModBlocks {
/**
* Fills the registry with blocks
*/
//.strength(destroyTime, blastResistance)
public static final Block ANTHRACITE_ORE = registerBlock("anthracite_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.COAL_ORE).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(0, 2)));
public static final Block NETHER_ANTHRACITE_ORE = registerBlock("nether_anthracite_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.NETHER_GOLD_ORE).mapColor(MapColor.BLACK).strength(3.0F, 3.0F).sounds(BlockSoundGroup.NETHER_GOLD_ORE).requiresTool(), UniformIntProvider.create(1, 3)));
public static final Block DEEPSLATE_ANTHRACITE_ORE = registerBlock("deepslate_anthracite_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_COAL_ORE).strength(4.5F, 3.0F).sounds(BlockSoundGroup.DEEPSLATE).requiresTool(), UniformIntProvider.create(1, 3)));

public static final Block TIN_ORE = registerBlock("tin_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.COPPER_ORE).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool()));
public static final Block TIN_BLOCK = registerBlock("tin_block", new Block(FabricBlockSettings.copyOf(Blocks.COPPER_BLOCK).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block RAW_TIN_BLOCK = registerBlock("raw_tin_block", new Block(FabricBlockSettings.copyOf(Blocks.RAW_COPPER_BLOCK).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block DEEPSLATE_TIN_ORE = registerBlock("deepslate_tin_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_COPPER_ORE).strength(4.5F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool()));
public static final Block SILVER_ORE = registerBlock("silver_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.IRON_ORE).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool()));
public static final Block SILVER_BLOCK = registerBlock("silver_block", new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block RAW_SILVER_BLOCK = registerBlock("raw_silver_block", new Block(FabricBlockSettings.copyOf(Blocks.RAW_IRON_BLOCK).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block DEEPSLATE_SILVER_ORE = registerBlock("deepslate_silver_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_IRON_ORE).strength(4.5F, 3.0F).sounds(BlockSoundGroup.DEEPSLATE).requiresTool()));
public static final Block NETHER_SILVER_ORE = registerBlock("nether_silver_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.NETHER_GOLD_ORE).mapColor(MapColor.LIGHT_GRAY).strength(3.0F, 3.0F).sounds(BlockSoundGroup.NETHER_GOLD_ORE).requiresTool(), UniformIntProvider.create(0, 2)));

public static final Block COBALT_ORE = registerBlock("cobalt_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.IRON_ORE).mapColor(MapColor.LIGHT_BLUE).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool()));
public static final Block COBALT_BLOCK = registerBlock("cobalt_block", new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).mapColor(MapColor.LIGHT_BLUE).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block RAW_COBALT_BLOCK = registerBlock("raw_cobalt_block", new Block(FabricBlockSettings.copyOf(Blocks.RAW_IRON_BLOCK).mapColor(MapColor.LIGHT_BLUE).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block DEEPSLATE_COBALT_ORE = registerBlock("deepslate_cobalt_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_IRON_ORE).mapColor(MapColor.LIGHT_BLUE).strength(4.5F, 3.0F).sounds(BlockSoundGroup.DEEPSLATE).requiresTool()));

public static final Block BRONZE_BLOCK = registerBlock("bronze_block", new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).mapColor(MapColor.BROWN).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));

public static final Block STERLING_BLOCK = registerBlock("sterling_block", new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).mapColor(MapColor.LIGHT_GRAY).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));

public static final Block AMETHYST_BLOCK = registerBlock("amethyst_block", new Block(FabricBlockSettings.copyOf(Blocks.AMETHYST_BLOCK).strength(5.0F, 6.0F).sounds(BlockSoundGroup.AMETHYST_BLOCK).requiresTool()));

public static final Block STEEL_BLOCK = registerBlock("steel_block", new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).mapColor(MapColor.GRAY).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block TOPAZ_ORE = registerBlock("topaz_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).mapColor(MapColor.LIGHT_BLUE).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(3, 6)));
public static final Block TOPAZ_BLOCK = registerBlock("topaz_block", new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MapColor.LIGHT_BLUE).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block DEEPSLATE_TOPAZ_ORE = registerBlock("deepslate_topaz_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_DIAMOND_ORE).mapColor(MapColor.LIGHT_BLUE).strength(4.5F, 3.0F).sounds(BlockSoundGroup.DEEPSLATE).requiresTool(), UniformIntProvider.create(3, 6)));

public static final Block TOURMALINE_ORE = registerBlock("tourmaline_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).mapColor(MapColor.PINK).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(3, 7)));
public static final Block TOURMALINE_BLOCK = registerBlock("tourmaline_block", new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MapColor.PINK).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block DEEPSLATE_TOURMALINE_ORE = registerBlock("deepslate_tourmaline_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_DIAMOND_ORE).mapColor(MapColor.PINK).strength(4.5F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(3, 7)));

public static final Block NETHER_TANZANITE_ORE = registerBlock("nether_tanzanite_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.NETHER_GOLD_ORE).mapColor(MapColor.PURPLE).strength(3.0F, 3.0F).sounds(BlockSoundGroup.NETHER_ORE).requiresTool(), UniformIntProvider.create(3, 7)));
public static final Block TANZANITE_BLOCK = registerBlock("tanzanite_block", new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MapColor.PURPLE).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));

public static final Block SAPPHIRE_ORE = registerBlock("sapphire_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).mapColor(MapColor.BLUE).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(2, 5)));
public static final Block SAPPHIRE_BLOCK = registerBlock("sapphire_block", new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).mapColor(MapColor.BLUE).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block DEEPSLATE_SAPPHIRE_ORE = registerBlock("deepslate_sapphire_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_DIAMOND_ORE).mapColor(MapColor.BLUE).strength(4.5F, 3.0F).sounds(BlockSoundGroup.DEEPSLATE).requiresTool(), UniformIntProvider.create(3, 8)));
public static final Block NETHER_SAPPHIRE_ORE = registerBlock("nether_sapphire_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.NETHER_GOLD_ORE).mapColor(MapColor.BLUE).strength(4.0F, 3.0F).sounds(BlockSoundGroup.NETHER_ORE).requiresTool(), UniformIntProvider.create(3, 8)));

public static final Block TURQUOISE_ORE = registerBlock("turquoise_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).mapColor(MapColor.CYAN).strength(4.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(3, 9)));
public static final Block TURQUOISE_BLOCK = registerBlock("turquoise_block", new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MapColor.CYAN).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block DEEPSLATE_TURQUOISE_ORE = registerBlock("deepslate_turquoise_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_DIAMOND_ORE).mapColor(MapColor.CYAN).strength(5.5F, 3.0F).sounds(BlockSoundGroup.DEEPSLATE).requiresTool(), UniformIntProvider.create(3, 9)));
public static final Block RUBY_ORE = registerBlock("ruby_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).mapColor(MapColor.RED).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(3, 8)));
public static final Block RUBY_BLOCK = registerBlock("ruby_block", new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MapColor.RED).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block NETHER_RUBY_ORE = registerBlock("nether_ruby_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.NETHER_GOLD_ORE).mapColor(MapColor.RED).strength(4.0F, 3.0F).sounds(BlockSoundGroup.NETHER_ORE).requiresTool(), UniformIntProvider.create(3, 8)));
public static final Block DEEPSLATE_RUBY_ORE = registerBlock("deepslate_ruby_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_DIAMOND_ORE).mapColor(MapColor.RED).strength(4.5F, 3.0F).sounds(BlockSoundGroup.DEEPSLATE).requiresTool(), UniformIntProvider.create(3, 8)));

public static final Block MOISSANITE_ORE = registerBlock("moissanite_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).mapColor(MapColor.LICHEN_GREEN).strength(3.0F, 3.0F).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(3, 8)));
public static final Block MOISSANITE_BLOCK = registerBlock("moissanite_block", new Block(FabricBlockSettings.copyOf(Blocks.DIAMOND_BLOCK).mapColor(MapColor.LICHEN_GREEN).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));
public static final Block NETHER_MOISSANITE_ORE = registerBlock("nether_moissanite_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.NETHER_GOLD_ORE).mapColor(MapColor.LICHEN_GREEN).strength(5.0F, 3.0F).sounds(BlockSoundGroup.NETHER_ORE).requiresTool(), UniformIntProvider.create(2, 8)));
public static final Block DEEPSLATE_MOISSANITE_ORE = registerBlock("deepslate_moissanite_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_DIAMOND_ORE).mapColor(MapColor.LICHEN_GREEN).strength(4.5F, 3.0F).sounds(BlockSoundGroup.DEEPSLATE).requiresTool(), UniformIntProvider.create(2, 8)));
public static final Block ONYX_ORE = registerBlock("onyx_ore", new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.ANCIENT_DEBRIS).mapColor(MapColor.BLACK).sounds(BlockSoundGroup.STONE).requiresTool(), UniformIntProvider.create(4, 10)));
public static final Block ONYX_BLOCK = registerBlock("onyx_block", new Block(FabricBlockSettings.copyOf(Blocks.NETHERITE_BLOCK).mapColor(MapColor.BLACK).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));

public static final Block GRAPHENE_BLOCK = registerBlock("graphene_block", new Block(FabricBlockSettings.copyOf(Blocks.NETHERITE_BLOCK).mapColor(MapColor.GREEN).strength(5.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool()));

// public static final AlloyFurnaceBlock ALLOY_FURNACE = registerBlock("alloy_furnace", new AlloyFurnaceBlock(FabricBlockSettings.copyOf(Blocks.FURNACE).mapColor(MapColor.LIGHT_GRAY).strength(4.0F, 6.0F).sounds(BlockSoundGroup.METAL).requiresTool().lightLevel(LightUtils.setSwitchedLight(BlockStateProperties.LIT, 13))));

private static Block registerBlock(String name, Block block) {
registerBlockItem(name, block);
return Registry.register(Registries.BLOCK, new Identifier(Mores.MOD_ID, name), block);
}

private static Item registerBlockItem(String name, Block block) {
return Registry.register(Registries.ITEM, new Identifier(Mores.MOD_ID, name),
new BlockItem(block, new FabricItemSettings()));
}

public static void registerModBlocks() {
Mores.LOGGER.info("Registering ModBlocks for " + Mores.MOD_ID);
}
}

Loading

0 comments on commit 7dbbf04

Please sign in to comment.