Skip to content

Commit

Permalink
Add gold painted door item and comment out moditems class
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinaisslaying committed Jan 21, 2025
1 parent f4580ff commit 711a047
Show file tree
Hide file tree
Showing 21 changed files with 271 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package icu.carolinainthe.carolinastweaks;

import icu.carolinainthe.carolinastweaks.blocks.ModBlocks;
import icu.carolinainthe.carolinastweaks.items.ModItems;
import icu.carolinainthe.carolinastweaks.items.ModItemsGroups;
import net.fabricmc.api.ModInitializer;

Expand All @@ -23,7 +22,6 @@ public void onInitialize() {
// Proceed with mild caution.

LOGGER.info("Loading " + MOD_ID + ", created by Carolina Mitchell (carolina_slays)");
ModItems.registerModItems();
ModBlocks.registerModBlocks();
ModItemsGroups.registerItemGroups();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import icu.carolinainthe.carolinastweaks.CarolinasTweaks;
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.PillarBlock;
import net.minecraft.block.*;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.registry.Registries;
Expand All @@ -21,9 +19,13 @@ public class ModBlocks {
.strength(0.5f, 0.2f)
));

public static final Block CONDENSED_COCOA = registerBlock("condensed_cocoa", new Block((FabricBlockSettings.copyOf(Blocks.COCOA)
.strength(0.8f, 3.0f)
)));
public static final Block CONDENSED_COCOA = registerBlock("condensed_cocoa",
new Block(FabricBlockSettings.copyOf(Blocks.COCOA)
.strength(0.8f, 3.0f)
));

public static final Block GOLD_PAINTED_DOOR = registerBlock("gold_painted_door",
new DoorBlock(FabricBlockSettings.copyOf(Blocks.OAK_DOOR), BlockSetType.OAK));

// Register block function.
private static Block registerBlock(String name, Block block) {
Expand Down
57 changes: 27 additions & 30 deletions src/main/java/icu/carolinainthe/carolinastweaks/items/ModItems.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
package icu.carolinainthe.carolinastweaks.items;

import icu.carolinainthe.carolinastweaks.CarolinasTweaks;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroups;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

import static icu.carolinainthe.carolinastweaks.CarolinasTweaks.MOD_ID;

public class ModItems {


// Registers mod items.
//package icu.carolinainthe.carolinastweaks.items;
//
//import icu.carolinainthe.carolinastweaks.CarolinasTweaks;
//import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
//import net.minecraft.item.Item;
//import net.minecraft.registry.Registries;
//import net.minecraft.registry.Registry;
//import net.minecraft.util.Identifier;
//
//import static icu.carolinainthe.carolinastweaks.CarolinasTweaks.MOD_ID;
//
//public class ModItems {
//
//
// // Registers mod items.
// public static final Item EXAMPLE = registerItem("example", new Item(new FabricItemSettings()));

// Register individual item function.
private static Item registerItem(String name, Item item) {
return Registry.register(Registries.ITEM, Identifier.of(MOD_ID, name), item);
}

// Main function to register all items, called in the main class.
public static void registerModItems() {
CarolinasTweaks.LOGGER.info("Registering mod items for " + MOD_ID + ", created by Carolina Mitchell (carolina_slays)");

}
}
//
// // Register individual item function.
// private static Item registerItem(String name, Item item) {
// return Registry.register(Registries.ITEM, Identifier.of(MOD_ID, name), item);
// }
//
// // Main function to register all items, called in the main class.
// public static void registerModItems() {
// CarolinasTweaks.LOGGER.info("Registering mod items for " + MOD_ID + ", created by Carolina Mitchell (carolina_slays)");
//
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class ModItemsGroups {
.icon(() -> new ItemStack(ModBlocks.CONDENSED_COCOA)).entries((displayContext, entries) -> {
entries.add(ModBlocks.BUNDLE_OF_STICKS);
entries.add(ModBlocks.CONDENSED_COCOA);
entries.add(ModBlocks.GOLD_PAINTED_DOOR);
}).build());

// Adds items to the ingredients item group in the creative mode menu.
Expand All @@ -35,13 +36,17 @@ private static void addItemsToNaturalBlocksItemGroup(FabricItemGroupEntries entr
entries.add(ModBlocks.CONDENSED_COCOA);
}

// Add items to the building blocks item group in the creative mode menu.
private static void addItemsToBuildingBlocksItemGroup(FabricItemGroupEntries entries) {
entries.add(ModBlocks.GOLD_PAINTED_DOOR);
}

// Registers all mod items into their respective groups, called by the main class.
public static void registerItemGroups() {
CarolinasTweaks.LOGGER.info("Registering mod item groups for " + MOD_ID + ", created by Carolina Mitchell (carolina_slays)");

ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(ModItemsGroups::addItemsToIngredientsItemGroup);
ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(ModItemsGroups::addItemsToNaturalBlocksItemGroup);
ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(ModItemsGroups::addItemsToBuildingBlocksItemGroup);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"variants": {
"facing=east,half=lower,hinge=left,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_left"
},
"facing=east,half=lower,hinge=left,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_left_open",
"y": 90
},
"facing=east,half=lower,hinge=right,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_right"
},
"facing=east,half=lower,hinge=right,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_right_open",
"y": 270
},
"facing=east,half=upper,hinge=left,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_left"
},
"facing=east,half=upper,hinge=left,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_left_open",
"y": 90
},
"facing=east,half=upper,hinge=right,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_right"
},
"facing=east,half=upper,hinge=right,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_right_open",
"y": 270
},
"facing=north,half=lower,hinge=left,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_left",
"y": 270
},
"facing=north,half=lower,hinge=left,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_left_open"
},
"facing=north,half=lower,hinge=right,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_right",
"y": 270
},
"facing=north,half=lower,hinge=right,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_right_open",
"y": 180
},
"facing=north,half=upper,hinge=left,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_left",
"y": 270
},
"facing=north,half=upper,hinge=left,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_left_open"
},
"facing=north,half=upper,hinge=right,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_right",
"y": 270
},
"facing=north,half=upper,hinge=right,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_right_open",
"y": 180
},
"facing=south,half=lower,hinge=left,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_left",
"y": 90
},
"facing=south,half=lower,hinge=left,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_left_open",
"y": 180
},
"facing=south,half=lower,hinge=right,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_right",
"y": 90
},
"facing=south,half=lower,hinge=right,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_right_open"
},
"facing=south,half=upper,hinge=left,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_left",
"y": 90
},
"facing=south,half=upper,hinge=left,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_left_open",
"y": 180
},
"facing=south,half=upper,hinge=right,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_right",
"y": 90
},
"facing=south,half=upper,hinge=right,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_right_open"
},
"facing=west,half=lower,hinge=left,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_left",
"y": 180
},
"facing=west,half=lower,hinge=left,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_left_open",
"y": 270
},
"facing=west,half=lower,hinge=right,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_right",
"y": 180
},
"facing=west,half=lower,hinge=right,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_bottom_right_open",
"y": 90
},
"facing=west,half=upper,hinge=left,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_left",
"y": 180
},
"facing=west,half=upper,hinge=left,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_left_open",
"y": 270
},
"facing=west,half=upper,hinge=right,open=false": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_right",
"y": 180
},
"facing=west,half=upper,hinge=right,open=true": {
"model": "carolinas-tweaks:block/gold_painted_doors/gold_painted_door_top_right_open",
"y": 90
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/carolinas-tweaks/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"block.carolinas-tweaks.bundle_of_sticks": "Bundle of Sticks",
"block.carolinas-tweaks.condensed_cocoa": "Condensed Cocoa",
"block.carolinas-tweaks.gold_painted_door": "Gold Painted Door",
"itemGroup.items": "Carolina's Tweaks"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left",
"textures": {
"top": "carolinas-tweaks:block/gold_painted_door_top",
"bottom": "carolinas-tweaks:block/gold_painted_door_bottom"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_left_open",
"textures": {
"top": "carolinas-tweaks:block/gold_painted_door_top",
"bottom": "carolinas-tweaks:block/gold_painted_door_bottom"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right",
"textures": {
"top": "carolinas-tweaks:block/gold_painted_door_top",
"bottom": "carolinas-tweaks:block/gold_painted_door_bottom"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_bottom_right_open",
"textures": {
"top": "carolinas-tweaks:block/gold_painted_door_top",
"bottom": "carolinas-tweaks:block/gold_painted_door_bottom"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left",
"textures": {
"top": "carolinas-tweaks:block/gold_painted_door_top",
"bottom": "carolinas-tweaks:block/gold_painted_door_bottom"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_left_open",
"textures": {
"top": "carolinas-tweaks:block/gold_painted_door_top",
"bottom": "carolinas-tweaks:block/gold_painted_door_bottom"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right",
"textures": {
"top": "carolinas-tweaks:block/gold_painted_door_top",
"bottom": "carolinas-tweaks:block/gold_painted_door_bottom"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/door_top_right_open",
"textures": {
"top": "carolinas-tweaks:block/gold_painted_door_top",
"bottom": "carolinas-tweaks:block/gold_painted_door_bottom"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "carolinas-tweaks:item/gold_painted_door"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
@@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "carolinas-tweaks:gold_painted_door"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "minecraft:crafting_shaped",
"key": {
"#": {
"item": "minecraft:gold_nugget"
},
"D": {
"tag": "minecraft:wooden_doors"
}
},
"pattern": [
"###",
"#D#",
"###"
],
"result": {
"item": "carolinas-tweaks:gold_painted_door"
},
"show_notification": false
}
Loading

0 comments on commit 711a047

Please sign in to comment.