Skip to content

Commit

Permalink
✨ blue and white porcelain tools and weapon
Browse files Browse the repository at this point in the history
  • Loading branch information
LocusAzzurro committed Jul 12, 2024
1 parent 0fecf99 commit 606bff6
Show file tree
Hide file tree
Showing 19 changed files with 318 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/generated/resources/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -2472,11 +2472,15 @@ a5002951d770f8dea1bb78a4f6a11f65a57325ea assets/ultramarine/models/item/blue_and
9b6dcf40855087d8c69443b92f0923b594d4096d assets/ultramarine/models/item/blue_and_red_carved_wood.json
e3898bd955e9c1341ee63d9883a37e32af0845c6 assets/ultramarine/models/item/blue_and_white_fangxin.json
ed817e3f654eda46bbf2f2528e7fbbde2875be59 assets/ultramarine/models/item/blue_and_white_glaze_powder.json
97d5ff6dd5ea290196af8f654d7ce21fdef2f9bd assets/ultramarine/models/item/blue_and_white_porcelain_axe.json
ec08c555331e93add9665c5fb8e500f58a9a518a assets/ultramarine/models/item/blue_and_white_porcelain_bowl.json
3bc4f1439d4930f561a5b6583e103899aa08fff6 assets/ultramarine/models/item/blue_and_white_porcelain_flowerpot.json
9398c0b777551771f6faa90b6849d7a9c663f968 assets/ultramarine/models/item/blue_and_white_porcelain_pickaxe.json
fc7ccd42d55aeacc62dde0920a0b0fbeb6ca3ead assets/ultramarine/models/item/blue_and_white_porcelain_piece.json
1af7a0119f4e3ef09557aa78b1cf937bf0ed9d9c assets/ultramarine/models/item/blue_and_white_porcelain_plate.json
2a05b31742faf1e24ff06a63448c1d2fc0b0904b assets/ultramarine/models/item/blue_and_white_porcelain_shards.json
a70fe5e3215f7e297eebe02d4b8f351bfbf566e6 assets/ultramarine/models/item/blue_and_white_porcelain_shovel.json
ef079595cf563c0340d5fecbae435d565203f694 assets/ultramarine/models/item/blue_and_white_porcelain_sword.json
421013edae4cf2f5a64cc70e3a00d26329cf99fe assets/ultramarine/models/item/blue_and_white_porcelain_vase.json
d3d1a23e920a82433921e2140768598382906bd5 assets/ultramarine/models/item/blue_and_yellow_carved_wood_variant_1.json
2362d55a645b68766b1088fc2311296de32da3c3 assets/ultramarine/models/item/blue_and_yellow_carved_wood_variant_2.json
Expand Down Expand Up @@ -3383,7 +3387,15 @@ b73cc45e816c59d3eb8735f91a00095e314e7732 assets/ultramarine/textures/block/yello
841c956b19f2d7c26e77bc434d5779f164394106 data/minecraft/advancements/recipes/misc/porcelain_piece_grinding.json
f2c8a6059de17cca8acca1db9f2b248e80568e4a data/minecraft/advancements/recipes/ultramarine.materials/porcelain_parts_from_blue_and_white_porcelain_piece.json
dbcca1526736e406b67feafce0e7e2ee6444eab8 data/minecraft/advancements/recipes/ultramarine.materials/porcelain_parts_from_porcelain_piece.json
b1567f5db2fcef57ff2919dc482d125d450d3b44 data/minecraft/advancements/recipes/ultramarine.tools/blue_and_white_porcelain_axe.json
34378475ef7dd43b618fffd5901fdcdd8e67707e data/minecraft/advancements/recipes/ultramarine.tools/blue_and_white_porcelain_pickaxe.json
2eb0a03bcdd01b6d4b9cae22f6d9dba8a6d8244d data/minecraft/advancements/recipes/ultramarine.tools/blue_and_white_porcelain_shovel.json
d374d2cb9cacad9182273ca72c8f33433be200ed data/minecraft/advancements/recipes/ultramarine.tools/blue_and_white_porcelain_sword.json
8d3ac4b9a1a1607ba21a258016f59afb26d98141 data/minecraft/recipes/blue_and_white_porcelain_axe.json
a7072b33366696e640297e9e8f12530a8854c581 data/minecraft/recipes/blue_and_white_porcelain_pickaxe.json
0ef8ac764e5f1c3925ff452b7511ace57d5bbd36 data/minecraft/recipes/blue_and_white_porcelain_piece_grinding.json
14d3bc91aa60c7bf7af04f280917ce42b2c59b35 data/minecraft/recipes/blue_and_white_porcelain_shovel.json
7654f7b965a2a38997274dcb40512a0b4ba49955 data/minecraft/recipes/blue_and_white_porcelain_sword.json
56f8f8c5910dcd2dcfffa47ef0433a7e49195dfc data/minecraft/recipes/brick.json
0e63aaae7fd95166eb8c6586d0f5ddbbd914a702 data/minecraft/recipes/porcelain_parts_from_blue_and_white_porcelain_piece.json
f0bbfefb142bfb2742443ec649da63b2e81824fd data/minecraft/recipes/porcelain_parts_from_porcelain_piece.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "ultramarine:item/blue_and_white_porcelain_axe"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "ultramarine:item/blue_and_white_porcelain_pickaxe"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "ultramarine:item/blue_and_white_porcelain_shovel"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "ultramarine:item/blue_and_white_porcelain_sword"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"minecraft:blue_and_white_porcelain_axe"
]
},
"criteria": {
"has_blue_and_white_porcelain_piece": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"ultramarine:blue_and_white_porcelain_piece"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:blue_and_white_porcelain_axe"
}
}
},
"requirements": [
[
"has_blue_and_white_porcelain_piece",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"minecraft:blue_and_white_porcelain_pickaxe"
]
},
"criteria": {
"has_blue_and_white_porcelain_piece": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"ultramarine:blue_and_white_porcelain_piece"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:blue_and_white_porcelain_pickaxe"
}
}
},
"requirements": [
[
"has_blue_and_white_porcelain_piece",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"minecraft:blue_and_white_porcelain_shovel"
]
},
"criteria": {
"has_blue_and_white_porcelain_piece": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"ultramarine:blue_and_white_porcelain_piece"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:blue_and_white_porcelain_shovel"
}
}
},
"requirements": [
[
"has_blue_and_white_porcelain_piece",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"minecraft:blue_and_white_porcelain_sword"
]
},
"criteria": {
"has_blue_and_white_porcelain_piece": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"ultramarine:blue_and_white_porcelain_piece"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:blue_and_white_porcelain_sword"
}
}
},
"requirements": [
[
"has_blue_and_white_porcelain_piece",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "minecraft:smithing",
"base": {
"item": "minecraft:golden_axe"
},
"addition": {
"item": "ultramarine:blue_and_white_porcelain_piece"
},
"result": {
"item": "ultramarine:blue_and_white_porcelain_axe"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "minecraft:smithing",
"base": {
"item": "minecraft:golden_pickaxe"
},
"addition": {
"item": "ultramarine:blue_and_white_porcelain_piece"
},
"result": {
"item": "ultramarine:blue_and_white_porcelain_pickaxe"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "minecraft:smithing",
"base": {
"item": "minecraft:golden_shovel"
},
"addition": {
"item": "ultramarine:blue_and_white_porcelain_piece"
},
"result": {
"item": "ultramarine:blue_and_white_porcelain_shovel"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "minecraft:smithing",
"base": {
"item": "minecraft:golden_sword"
},
"addition": {
"item": "ultramarine:blue_and_white_porcelain_piece"
},
"result": {
"item": "ultramarine:blue_and_white_porcelain_sword"
}
}
59 changes: 59 additions & 0 deletions src/main/java/com/voxelutopia/ultramarine/data/ModTiers.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.voxelutopia.ultramarine.data;

import com.voxelutopia.ultramarine.data.registry.ItemRegistry;
import net.minecraft.util.LazyLoadedValue;
import net.minecraft.world.item.Tier;
import net.minecraft.world.item.crafting.Ingredient;

import java.util.function.Supplier;

public enum ModTiers implements Tier {
BLUE_AND_WHITE_PORCELAIN(3, 16, 14.0F, 5.0F, 24, () -> Ingredient.of(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE.get()))
;

private final int level;
private final int uses;
private final float speed;
private final float damage;
private final int enchantmentValue;
private final LazyLoadedValue<Ingredient> repairIngredient;

private ModTiers(int pLevel, int pUses, float pSpeed, float pDamage, int pEnchantmentValue, Supplier<Ingredient> pRepairIngredient) {
this.level = pLevel;
this.uses = pUses;
this.speed = pSpeed;
this.damage = pDamage;
this.enchantmentValue = pEnchantmentValue;
this.repairIngredient = new LazyLoadedValue<>(pRepairIngredient);
}

@Override
public int getUses() {
return uses;
}

@Override
public float getSpeed() {
return speed;
}

@Override
public float getAttackDamageBonus() {
return damage;
}

@Override
public int getLevel() {
return level;
}

@Override
public int getEnchantmentValue() {
return enchantmentValue;
}

@Override
public Ingredient getRepairIngredient() {
return repairIngredient.get();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import com.voxelutopia.ultramarine.Ultramarine;
import com.voxelutopia.ultramarine.data.ModCreativeTab;
import com.voxelutopia.ultramarine.data.ModFoods;
import com.voxelutopia.ultramarine.data.ModTiers;
import com.voxelutopia.ultramarine.world.item.*;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.*;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
Expand Down Expand Up @@ -826,6 +825,14 @@ public class ItemRegistry {
*/

public static final RegistryObject<Item> WOODEN_MALLET = ITEMS.register("wooden_mallet", WoodenMallet::new);
public static final RegistryObject<Item> BLUE_AND_WHITE_PORCELAIN_SWORD = ITEMS.register("blue_and_white_porcelain_sword",
() -> new SwordItem(ModTiers.BLUE_AND_WHITE_PORCELAIN, 3, -2.4F, new Item.Properties().tab(ModCreativeTab.TOOLS.getTab())));
public static final RegistryObject<Item> BLUE_AND_WHITE_PORCELAIN_SHOVEL = ITEMS.register("blue_and_white_porcelain_shovel",
() -> new ShovelItem(ModTiers.BLUE_AND_WHITE_PORCELAIN, 1.5F, -3.0F, new Item.Properties().tab(ModCreativeTab.TOOLS.getTab())));
public static final RegistryObject<Item> BLUE_AND_WHITE_PORCELAIN_PICKAXE = ITEMS.register("blue_and_white_porcelain_pickaxe",
() -> new PickaxeItem(ModTiers.BLUE_AND_WHITE_PORCELAIN, 1, -2.8F, new Item.Properties().tab(ModCreativeTab.TOOLS.getTab())));
public static final RegistryObject<Item> BLUE_AND_WHITE_PORCELAIN_AXE = ITEMS.register("blue_and_white_porcelain_axe",
() -> new AxeItem(ModTiers.BLUE_AND_WHITE_PORCELAIN, 6.0F, -3.0F, new Item.Properties().tab(ModCreativeTab.TOOLS.getTab())));
public static final RegistryObject<Item> WOODWORKING_WORKBENCH = fromBlock(BlockRegistry.WOODWORKING_WORKBENCH, ModCreativeTab.TOOLS);
public static final RegistryObject<Item> BRICK_KILN = fromBlock(BlockRegistry.BRICK_KILN, ModCreativeTab.TOOLS);
public static final RegistryObject<Item> CHISEL_TABLE = fromBlock(BlockRegistry.CHISEL_TABLE, ModCreativeTab.TOOLS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.data.DataGenerator;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.DiggerItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.client.model.generators.ItemModelBuilder;
Expand All @@ -31,6 +32,9 @@ public class ModItemModelProvider extends ItemModelProvider {
blockRegistryObject.get() instanceof BaseFence
))
.forEach(NON_SIMPLE_BLOCKS::add);
ItemRegistry.ITEMS.getEntries().stream()
.filter(itemRegistryObject -> itemRegistryObject.get() instanceof DiggerItem)
.forEach(NON_SIMPLE_ITEMS::add);
}

public ModItemModelProvider(DataGenerator generator, ExistingFileHelper existingFileHelper) {
Expand All @@ -52,13 +56,21 @@ protected void registerModels() {
.filter(blockRegistryObject -> !NON_SIMPLE_ITEMS.contains(blockRegistryObject))
.filter(blockRegistryObject -> !(blockRegistryObject.get() instanceof BlockItem))
.forEach(this::generatedItem);
handheldItem(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SWORD);
handheldItem(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHOVEL);
handheldItem(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PICKAXE);
handheldItem(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_AXE);

}

private ItemModelBuilder generatedItem(RegistryObject<Item> item){
return singleTexture(item.get().getRegistryName().getPath(), mcLoc("item/generated"), "layer0", modLoc("item/" + item.get().getRegistryName().getPath()));
}

private ItemModelBuilder handheldItem(RegistryObject<Item> item){
return singleTexture(item.get().getRegistryName().getPath(), mcLoc("item/handheld"), "layer0", modLoc("item/" + item.get().getRegistryName().getPath()));
}

private ItemModelBuilder blockItem(RegistryObject<Block> block){
return withExistingParent(block.get().getRegistryName().getPath(), modLoc("block/" + block.get().getRegistryName().getPath()));
}
Expand Down
Loading

0 comments on commit 606bff6

Please sign in to comment.