Skip to content

Commit

Permalink
Change charcoal to firewood
Browse files Browse the repository at this point in the history
  • Loading branch information
Badtz committed Oct 16, 2023
1 parent ab25485 commit a765223
Show file tree
Hide file tree
Showing 18 changed files with 234 additions and 60 deletions.
8 changes: 4 additions & 4 deletions src/main/java/me/woach/bone/block/BlocksRegistry.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package me.woach.bone.block;

import java.util.function.Supplier;

import me.woach.bone.Bone;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.BlockSoundGroup;

import java.util.function.Supplier;

public enum BlocksRegistry {
BONE_FORGE_BLOCK("bone_forge", BoneForgeBlock::new),
BONE_FIRE_BLOCK("bone_fire", BoneFireBlock::new),
CHARCOAL_BLOCK("charcoal_block", () -> new Block(
FabricBlockSettings.create().requiresTool().strength(3.0f).sounds(BlockSoundGroup.STONE).burnable()));
FIREWOOD_BLOCK("firewood_block", () -> new Block(
FabricBlockSettings.create().strength(1.5f).sounds(BlockSoundGroup.WOOD).burnable()));

private final String path;
private final Supplier<Block> blockSupplier;
Expand Down
46 changes: 24 additions & 22 deletions src/main/java/me/woach/bone/items/ItemsRegistry.java
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
package me.woach.bone.items;

import java.util.Arrays;
import java.util.function.Supplier;

import me.woach.bone.Bone;
import me.woach.bone.block.BlocksRegistry;
import me.woach.bone.material.BonesteelArmorMaterial;
import me.woach.bone.material.BonesteelToolMaterial;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.data.client.BlockStateVariantMap.QuadFunction;
import net.minecraft.item.*;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorItem.Type;
import net.minecraft.item.AxeItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.HoeItem;
import net.minecraft.item.Item;
import net.minecraft.item.PickaxeItem;
import net.minecraft.item.ShovelItem;
import net.minecraft.item.ToolMaterial;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Rarity;

import java.util.Arrays;
import java.util.function.Supplier;

public enum ItemsRegistry {
BONE_ITEM("bone", BoneItem::new),
BONE_FORGE_BLOCK_ITEM("bone_forge", () -> new BlockItem(BlocksRegistry.BONE_FORGE_BLOCK.get(),
new FabricItemSettings())),
CHARCOAL_BLOCK_ITEM("charcoal_block", () -> new BlockItem(BlocksRegistry.CHARCOAL_BLOCK.get(),
FIREWOOD_BLOCK_BLOCK_ITEM("firewood_block", () -> new BlockItem(BlocksRegistry.FIREWOOD_BLOCK.get(),
new FabricItemSettings())),
BONESTEEL_HELMET("bonesteel_helmet", () -> ItemBuilder.newItemArmor(Type.HELMET)),
BONESTEEL_CHESTPLATE("bonesteel_chestplate", () -> ItemBuilder.newItemArmor(Type.CHESTPLATE)),
BONESTEEL_LEGGINGS("bonesteel_leggings", () -> ItemBuilder.newItemArmor(Type.LEGGINGS)),
BONESTEEL_BOOTS("bonesteel_boots", () -> ItemBuilder.newItemArmor(Type.BOOTS)),
BONESTEEL_PICKAXE("bonesteel_pickaxe", () ->
ItemBuilder.newToolItem(PickaxeItem::new, 1, -2.4f)),
BONESTEEL_AXE("bonesteel_axe", () ->
ItemBuilder.newToolItem(AxeItem::new, 6.0f, -2.9f)),
BONESTEEL_SHOVEL("bonesteel_shovel", () ->
ItemBuilder.newToolItem(ShovelItem::new, 1.5F, -3.0F)),
BONESTEEL_HOE("bonesteel_hoe", () ->
ItemBuilder.newToolItem(HoeItem::new, -1, -1.0F)),
BONESTEEL_SWORD("bonesteel_sword", () ->
ItemBuilder.newToolItem(HoeItem::new, 3, -2.2F)),
BONESTEEL_PICKAXE("bonesteel_pickaxe", () -> ItemBuilder.newToolItem(PickaxeItem::new, 1, -2.4f)),
BONESTEEL_AXE("bonesteel_axe", () -> ItemBuilder.newToolItem(AxeItem::new, 6.0f, -2.9f)),
BONESTEEL_SHOVEL("bonesteel_shovel", () -> ItemBuilder.newToolItem(ShovelItem::new, 1.5F, -3.0F)),
BONESTEEL_HOE("bonesteel_hoe", () -> ItemBuilder.newToolItem(HoeItem::new, -1, -1.0F)),
BONESTEEL_SWORD("bonesteel_sword", () -> ItemBuilder.newToolItem(HoeItem::new, 3, -2.2F)),
AMETHYST_DUST("amethyst_dust", ItemBuilder::newItemDust),
LAPIS_DUST("lapis_dust", ItemBuilder::newItemDust),
EMERALD_DUST("emerald_dust", ItemBuilder::newItemDust),
Expand Down Expand Up @@ -64,9 +66,8 @@ public static void registerAll() {
register(item.path, item.get());
}
ItemGroupEvents.modifyEntriesEvent(Bone.ITEM_GROUP).register(entries -> entries.addAll(
Arrays.stream(values()).filter(item -> item.addToItemGroup).map(item ->
item.get().getDefaultStack()).toList())
);
Arrays.stream(values()).filter(item -> item.addToItemGroup).map(item -> item.get().getDefaultStack())
.toList()));
}

public Item get() {
Expand All @@ -88,13 +89,14 @@ protected static Item newItemArmor(Type armorType) {
return new ArmorItem(new BonesteelArmorMaterial(), armorType, new FabricItemSettings().rarity(Rarity.EPIC));
}

protected static Item newToolItem(QuadFunction<ToolMaterial,Integer,Float,Item.Settings,Item> toolCreator,
int damage, float attackspeed) {
protected static Item newToolItem(QuadFunction<ToolMaterial, Integer, Float, Item.Settings, Item> toolCreator,
int damage, float attackspeed) {
return toolCreator.apply(BonesteelToolMaterial.INSTANCE, damage, attackspeed,
new FabricItemSettings().rarity(Rarity.EPIC));
}
protected static Item newToolItem(QuadFunction<ToolMaterial,Float,Float,Item.Settings,Item> toolCreator,
float damage, float attackspeed) {

protected static Item newToolItem(QuadFunction<ToolMaterial, Float, Float, Item.Settings, Item> toolCreator,
float damage, float attackspeed) {
return toolCreator.apply(BonesteelToolMaterial.INSTANCE, damage, attackspeed,
new FabricItemSettings().rarity(Rarity.EPIC));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"variants": {
"": {
"model": "bone:block/charcoal_block"
"model": "bone:block/firewood_block"
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/assets/bone/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"block.bone.bone_forge": "Bone Forge",
"block.bone.charcoal_block": "Block of Charcoal",
"block.bone.firewood_block": "Bundle of Firewood",
"block.bone.bone_fire": "Bone Fire",
"block.bone.bone_fire.type=jord": "Jord Fire",
"block.bone.bone_fire.type=aegir": "Aegir Fire",
Expand Down

This file was deleted.

81 changes: 81 additions & 0 deletions src/main/resources/assets/bone/models/block/firewood_block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"credit": "Made with Blockbench",
"texture_size": [
64,
64
],
"textures": {
"1": "bone:block/firewood_block",
"particle": "bone:block/firewood_block"
},
"elements": [
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"north": {
"uv": [
0,
0,
4,
4
],
"texture": "#1"
},
"east": {
"uv": [
0,
4,
4,
8
],
"texture": "#1"
},
"south": {
"uv": [
4,
0,
8,
4
],
"texture": "#1"
},
"west": {
"uv": [
4,
4,
8,
8
],
"texture": "#1"
},
"up": {
"uv": [
4,
12,
0,
8
],
"texture": "#1"
},
"down": {
"uv": [
12,
0,
8,
4
],
"texture": "#1"
}
}
}
]
}

This file was deleted.

85 changes: 85 additions & 0 deletions src/main/resources/assets/bone/models/item/firewood_block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"parent": "bone:block/firewood_block",
"display": {
"ground": {
"translation": [
0,
2,
0
],
"scale": [
0.3,
0.3,
0.3
]
},
"gui": {
"rotation": [
30,
225,
0
],
"translation": [
0,
0,
0
],
"scale": [
0.625,
0.625,
0.625
]
},
"thirdperson_righthand": {
"rotation": [
10,
-45,
0
],
"translation": [
0,
1.5,
-2.75
],
"scale": [
0.375,
0.375,
0.375
]
},
"firstperson_righthand": {
"rotation": [
0,
-135,
25
],
"translation": [
0,
4,
2
],
"scale": [
0.4,
0.4,
0.4
]
},
"fixed": {
"rotation": [
0,
0,
0
],
"translation": [
0,
0,
0
],
"scale": [
0.5,
0.5,
0.5
]
}
}
}
Binary file not shown.
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
Expand Up @@ -6,7 +6,7 @@
"entries": [
{
"type": "minecraft:item",
"name": "bone:charcoal_block"
"name": "bone:firewood_block"
}
],
"conditions": [
Expand Down
12 changes: 0 additions & 12 deletions src/main/resources/data/bone/recipes/charcoal.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"###",
"###"
"LLL",
"CCC",
"LLL"
],
"key": {
"#": {
"L": {
"tag": "c:logs"
},
"C": {
"item": "minecraft:charcoal"
}
},
"result": {
"item": "bone:charcoal_block"
"item": "bone:firewood_block"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"replace": false,
"values": [
"bone:charcoal_block"
"bone:firewood_block"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"bone:firewood_block"
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"replace": false,
"values": [
"bone:bone_forge",
"bone:charcoal_block"
"bone:bone_forge"
]
}
Loading

0 comments on commit a765223

Please sign in to comment.