added blaze- gun- green birch block and dirt sword
|
@ -1,5 +1,8 @@
|
|||
package me.jonasjones.nec;
|
||||
|
||||
import me.jonasjones.nec.block.ModBlocks;
|
||||
import me.jonasjones.nec.item.ModItems;
|
||||
import me.jonasjones.nec.util.ModRegistries;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -8,13 +11,16 @@ public class NotEnoughCursedness 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 Logger LOGGER = LoggerFactory.getLogger("nec");
|
||||
public static String MOD_ID = "nec";
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||
|
||||
@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.
|
||||
//register blocks
|
||||
ModBlocks.register();
|
||||
ModItems.register();
|
||||
ModRegistries.registerModStuffs();
|
||||
|
||||
|
||||
LOGGER.info("Your game is now cursed!");
|
||||
}
|
||||
|
|
41
src/main/java/me/jonasjones/nec/block/ModBlocks.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package me.jonasjones.nec.block;
|
||||
|
||||
import me.jonasjones.nec.util.ModRegistries;
|
||||
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.Material;
|
||||
import net.minecraft.block.PillarBlock;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModBlocks {
|
||||
public static final Block GREEN_BIRCH_LOG = new PillarBlock(FabricBlockSettings.of(Material.WOOD).strength(4.0f));
|
||||
public static final Block BLAZE_BLOCK = new Block(FabricBlockSettings.of(Material.STONE).strength(4.0F));
|
||||
public static final Block GUN_BLOCK = new Block(FabricBlockSettings.of(Material.STONE).strength(4.0F));
|
||||
private static BlockItem GUN_BLOCK_ITEM;
|
||||
private static Block GUN_BLOCK_BLOCK;
|
||||
private static BlockItem BLAZE_BLOCK_ITEM;
|
||||
private static Block BLAZE_BLOCK_BLOCK;
|
||||
public static Block GREEEN_BIRCH_LOG_BLOCK;
|
||||
public static BlockItem GREEN_BIRCH_LOG_ITEM;
|
||||
//public static final Block GREEN_BIRCH_WOOD = new PillarBlock(FabricBlockSettings.of(Material.WOOD).strength(4.0f));
|
||||
//public static final Block STRIPPED_GREEN_BIRCH_LOG = new PillarBlock(FabricBlockSettings.of(Material.WOOD).strength(4.0f));
|
||||
//public static final Block STRIPPED_GREEN_BIRCH_WOOD = new PillarBlock(FabricBlockSettings.of(Material.WOOD).strength(4.0f));
|
||||
|
||||
public static void register() {
|
||||
BLAZE_BLOCK_BLOCK = Registry.register(Registries.BLOCK, new Identifier("nec", "blaze_block"), BLAZE_BLOCK);
|
||||
BLAZE_BLOCK_ITEM = Registry.register(Registries.ITEM, new Identifier("nec", "blaze_block"), new BlockItem(BLAZE_BLOCK, new FabricItemSettings()));
|
||||
ModRegistries.register_item(BLAZE_BLOCK_ITEM);
|
||||
|
||||
GREEEN_BIRCH_LOG_BLOCK = Registry.register(Registries.BLOCK, new Identifier("nec", "green_birch_log"), GREEN_BIRCH_LOG);
|
||||
GREEN_BIRCH_LOG_ITEM = Registry.register(Registries.ITEM, new Identifier("nec", "green_birch_log"), new BlockItem(GREEN_BIRCH_LOG, new FabricItemSettings()));
|
||||
ModRegistries.register_item(GREEN_BIRCH_LOG_ITEM);
|
||||
|
||||
GUN_BLOCK_BLOCK = Registry.register(Registries.BLOCK, new Identifier("nec", "gun_block"), GUN_BLOCK);
|
||||
GUN_BLOCK_ITEM = Registry.register(Registries.ITEM, new Identifier("nec", "gun_block"), new BlockItem(GUN_BLOCK, new FabricItemSettings()));
|
||||
ModRegistries.register_item(GUN_BLOCK_ITEM);
|
||||
}
|
||||
}
|
19
src/main/java/me/jonasjones/nec/item/ModItems.java
Normal file
|
@ -0,0 +1,19 @@
|
|||
package me.jonasjones.nec.item;
|
||||
|
||||
import me.jonasjones.nec.item.materials.DirtToolMaterial;
|
||||
import me.jonasjones.nec.util.ModRegistries;
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModItems {
|
||||
private static ToolItem DIRT_SWORD_ITEM;
|
||||
|
||||
public static void register() {
|
||||
ToolItem DIRT_SWORD = new SwordItem(DirtToolMaterial.INSTANCE, 1, -3.0F, new Item.Settings());
|
||||
DIRT_SWORD_ITEM = Registry.register(Registries.ITEM, new Identifier("nec", "dirt_sword"), DIRT_SWORD);
|
||||
ModRegistries.register_item(DIRT_SWORD_ITEM);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package me.jonasjones.nec.item.materials;
|
||||
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
|
||||
public class DirtToolMaterial implements ToolMaterial {
|
||||
|
||||
public static final DirtToolMaterial INSTANCE = new DirtToolMaterial();
|
||||
@Override
|
||||
public int getDurability() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMiningSpeedMultiplier() {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getAttackDamage() {
|
||||
return 2.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMiningLevel() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnchantability() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ingredient getRepairIngredient() {
|
||||
return Ingredient.ofItems(Items.DIRT, Items.COARSE_DIRT, Items.DIRT_PATH, Items.ROOTED_DIRT);
|
||||
}
|
||||
}
|
58
src/main/java/me/jonasjones/nec/util/ModRegistries.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
package me.jonasjones.nec.util;
|
||||
|
||||
import me.jonasjones.nec.block.ModBlocks;
|
||||
import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents;
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
|
||||
import net.fabricmc.fabric.api.registry.FuelRegistry;
|
||||
import net.fabricmc.fabric.api.registry.StrippableBlockRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModRegistries {
|
||||
|
||||
static final ItemGroup ITEM_GROUP = FabricItemGroup.builder(new Identifier("nec", "not_enough_cursedness"))
|
||||
.icon(() -> ModBlocks.GREEN_BIRCH_LOG_ITEM.getDefaultStack())
|
||||
.build();
|
||||
public static void registerModStuffs() {
|
||||
registerFuels();
|
||||
registerCommands();
|
||||
registerEvents();
|
||||
registerStrippables();
|
||||
registerFlammableBlock();
|
||||
}
|
||||
|
||||
private static void registerFuels() {
|
||||
FuelRegistry registry = FuelRegistry.INSTANCE;
|
||||
|
||||
//registry.add(ModItems.LILAC_FLOWER_BULB, 200);
|
||||
}
|
||||
|
||||
private static void registerCommands() {
|
||||
//CommandRegistrationCallback.EVENT.register(SetHomeCommand::register);
|
||||
//CommandRegistrationCallback.EVENT.register(ReturnHomeCommand::register);
|
||||
}
|
||||
|
||||
private static void registerStrippables() {
|
||||
//StrippableBlockRegistry.register(ModBlocks.GREEEN_BIRCH_LOG_BLOCK, ModBlocks.STRIPPED_JACARANDA_LOG);
|
||||
StrippableBlockRegistry.register(ModBlocks.GREEEN_BIRCH_LOG_BLOCK, ModBlocks.GREEEN_BIRCH_LOG_BLOCK);
|
||||
}
|
||||
|
||||
private static void registerFlammableBlock() {
|
||||
FlammableBlockRegistry instance = FlammableBlockRegistry.getDefaultInstance();
|
||||
|
||||
instance.add(ModBlocks.GREEN_BIRCH_LOG, 5, 5);
|
||||
}
|
||||
|
||||
private static void registerEvents() {
|
||||
//ServerPlayerEvents.COPY_FROM.register(new ModPlayerEventCopyFrom());
|
||||
}
|
||||
|
||||
public static void register_item(Item CUSTOM_ITEM) {
|
||||
ItemGroupEvents.modifyEntriesEvent(ITEM_GROUP).register(content -> {
|
||||
content.add(CUSTOM_ITEM);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "nec:block/blaze_block"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"variants": {
|
||||
"axis=x": {
|
||||
"model": "nec:block/green_birch_log_horizontal",
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"axis=y": {
|
||||
"model": "nec:block/green_birch_log"
|
||||
},
|
||||
"axis=z": {
|
||||
"model": "nec:block/green_birch_log_horizontal",
|
||||
"x": 90
|
||||
}
|
||||
}
|
||||
}
|
7
src/main/resources/assets/nec/blockstates/gun_block.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "nec:block/gun_block"
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 453 B After Width: | Height: | Size: 3.5 KiB |
10
src/main/resources/assets/nec/lang/en_us.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"block.nec.blaze_block": "Blaze Block",
|
||||
"block.nec.cursed_dirt_stairs": "Cursed Dirt Stairs",
|
||||
"block.nec.cursed_dirt_slab": "Cursed Dirt Slab",
|
||||
"block.nec.cursed_dirt": "Cursed Dirt",
|
||||
"block.nec.green_birch_log": "Green Birch Log",
|
||||
"block.nec.gun_block": "Gun Block",
|
||||
"item.nec.dirt_sword": "Dirt Sword",
|
||||
"itemGroup.nec.not_enough_cursedness": "Not Enough Cursedness"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "nec:block/blaze_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube_column",
|
||||
"textures": {
|
||||
"end": "nec:block/green_birch_log_top",
|
||||
"side": "nec:block/green_birch_log"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube_column_horizontal",
|
||||
"textures": {
|
||||
"end": "nec:block/green_birch_log_top",
|
||||
"side": "nec:block/green_birch_log"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/cube_all",
|
||||
"textures": {
|
||||
"all": "nec:block/gun_block"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "nec:block/blaze_block"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "nec:item/dirt_sword"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "nec:block/green_birch_log"
|
||||
}
|
3
src/main/resources/assets/nec/models/item/gun_block.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "nec:block/gun_block"
|
||||
}
|
BIN
src/main/resources/assets/nec/textures/block/blaze_block.png
Normal file
After Width: | Height: | Size: 225 B |
BIN
src/main/resources/assets/nec/textures/block/green_birch_log.png
Normal file
After Width: | Height: | Size: 158 B |
After Width: | Height: | Size: 463 B |
BIN
src/main/resources/assets/nec/textures/block/gun_block.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
src/main/resources/assets/nec/textures/item/dirt_sword.png
Normal file
After Width: | Height: | Size: 373 B |
7
src/main/resources/data/minecraft/tags/blocks/axe.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"nec:green_birch_log"
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "nec:green_birch_log"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
18
src/main/resources/data/nec/recipes/blaze_block.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "building",
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "minecraft:blaze_powder"
|
||||
}
|
||||
},
|
||||
"pattern": [
|
||||
"###",
|
||||
"###",
|
||||
"###"
|
||||
],
|
||||
"result": {
|
||||
"item": "nec:blaze_block"
|
||||
},
|
||||
"show_notification": true
|
||||
}
|
12
src/main/resources/data/nec/recipes/blaze_rod.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "nec:blaze_block"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "minecraft:blaze_powder",
|
||||
"count": 9
|
||||
}
|
||||
}
|
22
src/main/resources/data/nec/recipes/crossbow.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"ABA",
|
||||
" C ",
|
||||
" "
|
||||
],
|
||||
"key": {
|
||||
"A": {
|
||||
"item": "minecraft:tripwire_hook"
|
||||
},
|
||||
"B": {
|
||||
"item": "minecraft:string"
|
||||
},
|
||||
"C": {
|
||||
"item": "minecraft:bow"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "minecraft:crossbow"
|
||||
}
|
||||
}
|
19
src/main/resources/data/nec/recipes/diamond_ore.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"AAA",
|
||||
"ABA",
|
||||
"AAA"
|
||||
],
|
||||
"key": {
|
||||
"A": {
|
||||
"item": "minecraft:stone"
|
||||
},
|
||||
"B": {
|
||||
"item": "minecraft:diamond"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "minecraft:diamond_ore"
|
||||
}
|
||||
}
|
19
src/main/resources/data/nec/recipes/dirt_sword.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" A ",
|
||||
" A ",
|
||||
" B "
|
||||
],
|
||||
"key": {
|
||||
"A": {
|
||||
"item": "minecraft:dirt"
|
||||
},
|
||||
"B": {
|
||||
"item": "minecraft:stick"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "nec:dirt_sword"
|
||||
}
|
||||
}
|
14
src/main/resources/data/nec/recipes/green_birch.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:green_dye"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:birch_log"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "nec:green_birch_log"
|
||||
}
|
||||
}
|
18
src/main/resources/data/nec/recipes/gun_block.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "building",
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "minecraft:gunpowder"
|
||||
}
|
||||
},
|
||||
"pattern": [
|
||||
"###",
|
||||
"###",
|
||||
"###"
|
||||
],
|
||||
"result": {
|
||||
"item": "nec:gun_block"
|
||||
},
|
||||
"show_notification": true
|
||||
}
|
12
src/main/resources/data/nec/recipes/gunpowder.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "nec:gun_block"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "minecraft:gunpowder",
|
||||
"count": 9
|
||||
}
|
||||
}
|
14
src/main/resources/data/nec/recipes/zombie_spawn_egg.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:zombie_head"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:egg"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "minecraft:zombie_spawn_egg"
|
||||
}
|
||||
}
|