From 91e3ecce0155daf8fd1078a30783abd53a3ba489 Mon Sep 17 00:00:00 2001 From: Jenny Date: Fri, 10 Jan 2025 09:59:14 +0100 Subject: [PATCH] restructuring --- .../compressedblocks/CompressedBlocks.java | 111 ++++-------------- .../datagen/ModBlockStateProvider.java | 35 +++--- .../datagen/ModBlockTagGenerator.java | 69 +++++------ .../datagen/ModItemModelProvider.java | 2 +- .../compressedblocks/modblocks/ModBlocks.java | 77 ++++++++++++ .../compressedblocks/moditems/ModItems.java | 4 + .../{ => moditems}/ToolTiers.java | 7 +- .../{ => moditems}/Tools.java | 3 +- 8 files changed, 164 insertions(+), 144 deletions(-) create mode 100644 src/main/java/com/jenny/compressedblocks/modblocks/ModBlocks.java create mode 100644 src/main/java/com/jenny/compressedblocks/moditems/ModItems.java rename src/main/java/com/jenny/compressedblocks/{ => moditems}/ToolTiers.java (72%) rename src/main/java/com/jenny/compressedblocks/{ => moditems}/Tools.java (87%) diff --git a/src/main/java/com/jenny/compressedblocks/CompressedBlocks.java b/src/main/java/com/jenny/compressedblocks/CompressedBlocks.java index 88bb72e..cb4d61d 100755 --- a/src/main/java/com/jenny/compressedblocks/CompressedBlocks.java +++ b/src/main/java/com/jenny/compressedblocks/CompressedBlocks.java @@ -1,14 +1,13 @@ package com.jenny.compressedblocks; +import com.jenny.compressedblocks.moditems.Tools; +import com.jenny.compressedblocks.modblocks.ModBlocks; import com.mojang.logging.LogUtils; import net.minecraft.client.Minecraft; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; import net.minecraft.world.item.*; -import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraft.world.level.material.MapColor; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.server.ServerStartingEvent; @@ -33,98 +32,32 @@ public class CompressedBlocks public static final String MODID = "compressedblocks"; // Directly reference a slf4j logger private static final Logger LOGGER = LogUtils.getLogger(); - // Create a Deferred Register to hold Blocks which will all be registered under the "examplemod" namespace - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID); - // Create a Deferred Register to hold Items which will all be registered under the "examplemod" namespace - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID); // Create a Deferred Register to hold CreativeModeTabs which will all be registered under the "examplemod" namespace public static final DeferredRegister CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID); - /* COBBLESTONE */ - - public static final RegistryObject COBBLESTONE_1X = BLOCKS.register("cobblestone_1x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(2.0F, 8.0F).requiresCorrectToolForDrops())); - public static final RegistryObject COBBLESTONE_1X_ITEM = ITEMS.register("cobblestone_1x", () -> new BlockItem(COBBLESTONE_1X.get(), new Item.Properties())); - - public static final RegistryObject COBBLESTONE_2X = BLOCKS.register("cobblestone_2x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(3.0F, 9.0F).requiresCorrectToolForDrops())); - public static final RegistryObject COBBLESTONE_2X_ITEM = ITEMS.register("cobblestone_2x", () -> new BlockItem(COBBLESTONE_2X.get(), new Item.Properties())); - - public static final RegistryObject COBBLESTONE_3X = BLOCKS.register("cobblestone_3x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(4.0F, 10.0F).requiresCorrectToolForDrops())); - public static final RegistryObject COBBLESTONE_3X_ITEM = ITEMS.register("cobblestone_3x", () -> new BlockItem(COBBLESTONE_3X.get(), new Item.Properties())); - - public static final RegistryObject COBBLESTONE_4X = BLOCKS.register("cobblestone_4x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); - public static final RegistryObject COBBLESTONE_4X_ITEM = ITEMS.register("cobblestone_4x", () -> new BlockItem(COBBLESTONE_4X.get(), new Item.Properties())); - - /* ANDESITE */ - - public static final RegistryObject ANDESITE_1X = BLOCKS.register("andesite_1x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(2.0F, 8.0F).requiresCorrectToolForDrops())); - public static final RegistryObject ANDESITE_1X_ITEM = ITEMS.register("andesite_1x", () -> new BlockItem(ANDESITE_1X.get(), new Item.Properties())); - - public static final RegistryObject ANDESITE_2X = BLOCKS.register("andesite_2x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(3.0F, 9.0F).requiresCorrectToolForDrops())); - public static final RegistryObject ANDESITE_2X_ITEM = ITEMS.register("andesite_2x", () -> new BlockItem(ANDESITE_2X.get(), new Item.Properties())); - - public static final RegistryObject ANDESITE_3X = BLOCKS.register("andesite_3x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(4.0F, 10.0F).requiresCorrectToolForDrops())); - public static final RegistryObject ANDESITE_3X_ITEM = ITEMS.register("andesite_3x", () -> new BlockItem(ANDESITE_3X.get(), new Item.Properties())); - - public static final RegistryObject ANDESITE_4X = BLOCKS.register("andesite_4x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); - public static final RegistryObject ANDESITE_4X_ITEM = ITEMS.register("andesite_4x", () -> new BlockItem(ANDESITE_4X.get(), new Item.Properties())); - - - /* DIORITE */ - - public static final RegistryObject DIORITE_1X = BLOCKS.register("diorite_1x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(2.0F, 8.0F).requiresCorrectToolForDrops())); - public static final RegistryObject DIORITE_1X_ITEM = ITEMS.register("diorite_1x", () -> new BlockItem(DIORITE_1X.get(), new Item.Properties())); - - public static final RegistryObject DIORITE_2X = BLOCKS.register("diorite_2x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(3.0F, 9.0F).requiresCorrectToolForDrops())); - public static final RegistryObject DIORITE_2X_ITEM = ITEMS.register("diorite_2x", () -> new BlockItem(DIORITE_2X.get(), new Item.Properties())); - - public static final RegistryObject DIORITE_3X = BLOCKS.register("diorite_3x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(4.0F, 10.0F).requiresCorrectToolForDrops())); - public static final RegistryObject DIORITE_3X_ITEM = ITEMS.register("diorite_3x", () -> new BlockItem(DIORITE_3X.get(), new Item.Properties())); - - public static final RegistryObject DIORITE_4X = BLOCKS.register("diorite_4x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); - public static final RegistryObject DIORITE_4X_ITEM = ITEMS.register("diorite_4x", () -> new BlockItem(DIORITE_4X.get(), new Item.Properties())); - - /* GRANITE */ - - public static final RegistryObject GRANITE_1X = BLOCKS.register("granite_1x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(2.0F, 8.0F).requiresCorrectToolForDrops())); - public static final RegistryObject GRANITE_1X_ITEM = ITEMS.register("granite_1x", () -> new BlockItem(GRANITE_1X.get(), new Item.Properties())); - - public static final RegistryObject GRANITE_2X = BLOCKS.register("granite_2x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(3.0F, 9.0F).requiresCorrectToolForDrops())); - public static final RegistryObject GRANITE_2X_ITEM = ITEMS.register("granite_2x", () -> new BlockItem(GRANITE_2X.get(), new Item.Properties())); - - public static final RegistryObject GRANITE_3X = BLOCKS.register("granite_3x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(4.0F, 10.0F).requiresCorrectToolForDrops())); - public static final RegistryObject GRANITE_3X_ITEM = ITEMS.register("granite_3x", () -> new BlockItem(GRANITE_3X.get(), new Item.Properties())); - - public static final RegistryObject GRANITE_4X = BLOCKS.register("granite_4x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); - public static final RegistryObject GRANITE_4X_ITEM = ITEMS.register("granite_4x", () -> new BlockItem(GRANITE_4X.get(), new Item.Properties())); - - /* COMBINED BLOCKS */ - - public static final RegistryObject CBLOCK_MINING = BLOCKS.register("cblock_mining", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); - public static final RegistryObject CBLOCK_MINING_ITEM = ITEMS.register("cblock_mining", () -> new BlockItem(CBLOCK_MINING.get(), new Item.Properties())); - // Creates a creative tab with the id "examplemod:example_tab" for the example item, that is placed after the combat tab public static final RegistryObject EXAMPLE_TAB = CREATIVE_MODE_TABS.register("compressed_blocks", () -> CreativeModeTab.builder() .withTabsBefore(CreativeModeTabs.COMBAT) - .icon(() -> COBBLESTONE_1X_ITEM.get().getDefaultInstance()) + .icon(() -> ModBlocks.COBBLESTONE_1X_ITEM.get().getDefaultInstance()) .title(Component.translatable("Compressed Blocks")) .displayItems((parameters, output) -> { - output.accept(COBBLESTONE_1X.get()); - output.accept(COBBLESTONE_2X.get()); - output.accept(COBBLESTONE_3X.get()); - output.accept(COBBLESTONE_4X.get()); - output.accept(ANDESITE_1X.get()); - output.accept(ANDESITE_2X.get()); - output.accept(ANDESITE_3X.get()); - output.accept(ANDESITE_4X.get()); - output.accept(DIORITE_1X.get()); - output.accept(DIORITE_2X.get()); - output.accept(DIORITE_3X.get()); - output.accept(DIORITE_4X.get()); - output.accept(GRANITE_1X.get()); - output.accept(GRANITE_2X.get()); - output.accept(GRANITE_3X.get()); - output.accept(GRANITE_4X.get()); - output.accept(CBLOCK_MINING.get()); + output.accept(ModBlocks.COBBLESTONE_1X.get()); + output.accept(ModBlocks.COBBLESTONE_2X.get()); + output.accept(ModBlocks.COBBLESTONE_3X.get()); + output.accept(ModBlocks.COBBLESTONE_4X.get()); + output.accept(ModBlocks.ANDESITE_1X.get()); + output.accept(ModBlocks.ANDESITE_2X.get()); + output.accept(ModBlocks.ANDESITE_3X.get()); + output.accept(ModBlocks.ANDESITE_4X.get()); + output.accept(ModBlocks.DIORITE_1X.get()); + output.accept(ModBlocks.DIORITE_2X.get()); + output.accept(ModBlocks.DIORITE_3X.get()); + output.accept(ModBlocks.DIORITE_4X.get()); + output.accept(ModBlocks.GRANITE_1X.get()); + output.accept(ModBlocks.GRANITE_2X.get()); + output.accept(ModBlocks.GRANITE_3X.get()); + output.accept(ModBlocks.GRANITE_4X.get()); + output.accept(ModBlocks.CBLOCK_MINING.get()); output.accept(Tools.ULTRA_PICKAXE.get()); }).build()); @@ -133,8 +66,8 @@ public class CompressedBlocks IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(this::commonSetup); - BLOCKS.register(modEventBus); - ITEMS.register(modEventBus); + ModBlocks.BLOCKS.register(modEventBus); + ModBlocks.ITEMS.register(modEventBus); Tools.register(modEventBus); CREATIVE_MODE_TABS.register(modEventBus); diff --git a/src/main/java/com/jenny/compressedblocks/datagen/ModBlockStateProvider.java b/src/main/java/com/jenny/compressedblocks/datagen/ModBlockStateProvider.java index ae86416..37f7951 100644 --- a/src/main/java/com/jenny/compressedblocks/datagen/ModBlockStateProvider.java +++ b/src/main/java/com/jenny/compressedblocks/datagen/ModBlockStateProvider.java @@ -1,6 +1,7 @@ package com.jenny.compressedblocks.datagen; import com.jenny.compressedblocks.CompressedBlocks; +import com.jenny.compressedblocks.modblocks.ModBlocks; import net.minecraft.data.PackOutput; import net.minecraft.world.level.block.*; import net.minecraftforge.client.model.generators.BlockStateProvider; @@ -14,27 +15,27 @@ public class ModBlockStateProvider extends BlockStateProvider { @Override protected void registerStatesAndModels() { - blockWithItem(CompressedBlocks.COBBLESTONE_1X); - blockWithItem(CompressedBlocks.COBBLESTONE_2X); - blockWithItem(CompressedBlocks.COBBLESTONE_3X); - blockWithItem(CompressedBlocks.COBBLESTONE_4X); + blockWithItem(ModBlocks.COBBLESTONE_1X); + blockWithItem(ModBlocks.COBBLESTONE_2X); + blockWithItem(ModBlocks.COBBLESTONE_3X); + blockWithItem(ModBlocks.COBBLESTONE_4X); - blockWithItem(CompressedBlocks.ANDESITE_1X); - blockWithItem(CompressedBlocks.ANDESITE_2X); - blockWithItem(CompressedBlocks.ANDESITE_3X); - blockWithItem(CompressedBlocks.ANDESITE_4X); + blockWithItem(ModBlocks.ANDESITE_1X); + blockWithItem(ModBlocks.ANDESITE_2X); + blockWithItem(ModBlocks.ANDESITE_3X); + blockWithItem(ModBlocks.ANDESITE_4X); - blockWithItem(CompressedBlocks.DIORITE_1X); - blockWithItem(CompressedBlocks.DIORITE_2X); - blockWithItem(CompressedBlocks.DIORITE_3X); - blockWithItem(CompressedBlocks.DIORITE_4X); + blockWithItem(ModBlocks.DIORITE_1X); + blockWithItem(ModBlocks.DIORITE_2X); + blockWithItem(ModBlocks.DIORITE_3X); + blockWithItem(ModBlocks.DIORITE_4X); - blockWithItem(CompressedBlocks.GRANITE_1X); - blockWithItem(CompressedBlocks.GRANITE_2X); - blockWithItem(CompressedBlocks.GRANITE_3X); - blockWithItem(CompressedBlocks.GRANITE_4X); + blockWithItem(ModBlocks.GRANITE_1X); + blockWithItem(ModBlocks.GRANITE_2X); + blockWithItem(ModBlocks.GRANITE_3X); + blockWithItem(ModBlocks.GRANITE_4X); - blockWithItem(CompressedBlocks.CBLOCK_MINING); + blockWithItem(ModBlocks.CBLOCK_MINING); } private void blockWithItem(RegistryObject blockRegistryObject) { diff --git a/src/main/java/com/jenny/compressedblocks/datagen/ModBlockTagGenerator.java b/src/main/java/com/jenny/compressedblocks/datagen/ModBlockTagGenerator.java index def7360..8b75846 100644 --- a/src/main/java/com/jenny/compressedblocks/datagen/ModBlockTagGenerator.java +++ b/src/main/java/com/jenny/compressedblocks/datagen/ModBlockTagGenerator.java @@ -1,6 +1,7 @@ package com.jenny.compressedblocks.datagen; import com.jenny.compressedblocks.CompressedBlocks; +import com.jenny.compressedblocks.modblocks.ModBlocks; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.tags.BlockTags; @@ -20,57 +21,57 @@ public class ModBlockTagGenerator extends BlockTagsProvider { protected void addTags(@NotNull HolderLookup.Provider pProvider) { this.tag(BlockTags.MINEABLE_WITH_PICKAXE) .add( - CompressedBlocks.COBBLESTONE_1X.get(), - CompressedBlocks.COBBLESTONE_2X.get(), - CompressedBlocks.COBBLESTONE_3X.get(), - CompressedBlocks.COBBLESTONE_4X.get(), + ModBlocks.COBBLESTONE_1X.get(), + ModBlocks.COBBLESTONE_2X.get(), + ModBlocks.COBBLESTONE_3X.get(), + ModBlocks.COBBLESTONE_4X.get(), - CompressedBlocks.ANDESITE_1X.get(), - CompressedBlocks.ANDESITE_2X.get(), - CompressedBlocks.ANDESITE_3X.get(), - CompressedBlocks.ANDESITE_4X.get(), + ModBlocks.ANDESITE_1X.get(), + ModBlocks.ANDESITE_2X.get(), + ModBlocks.ANDESITE_3X.get(), + ModBlocks.ANDESITE_4X.get(), - CompressedBlocks.DIORITE_1X.get(), - CompressedBlocks.DIORITE_2X.get(), - CompressedBlocks.DIORITE_3X.get(), - CompressedBlocks.DIORITE_4X.get(), + ModBlocks.DIORITE_1X.get(), + ModBlocks.DIORITE_2X.get(), + ModBlocks.DIORITE_3X.get(), + ModBlocks.DIORITE_4X.get(), - CompressedBlocks.GRANITE_1X.get(), - CompressedBlocks.GRANITE_2X.get(), - CompressedBlocks.GRANITE_3X.get(), - CompressedBlocks.GRANITE_4X.get(), + ModBlocks.GRANITE_1X.get(), + ModBlocks.GRANITE_2X.get(), + ModBlocks.GRANITE_3X.get(), + ModBlocks.GRANITE_4X.get(), - CompressedBlocks.CBLOCK_MINING.get() + ModBlocks.CBLOCK_MINING.get() ); this.tag(BlockTags.NEEDS_STONE_TOOL) .add( - CompressedBlocks.COBBLESTONE_1X.get(), - CompressedBlocks.ANDESITE_1X.get(), - CompressedBlocks.DIORITE_1X.get(), - CompressedBlocks.GRANITE_1X.get() + ModBlocks.COBBLESTONE_1X.get(), + ModBlocks.ANDESITE_1X.get(), + ModBlocks.DIORITE_1X.get(), + ModBlocks.GRANITE_1X.get() ); this.tag(BlockTags.NEEDS_IRON_TOOL) .add( - CompressedBlocks.COBBLESTONE_2X.get(), - CompressedBlocks.ANDESITE_2X.get(), - CompressedBlocks.DIORITE_2X.get(), - CompressedBlocks.GRANITE_2X.get(), + ModBlocks.COBBLESTONE_2X.get(), + ModBlocks.ANDESITE_2X.get(), + ModBlocks.DIORITE_2X.get(), + ModBlocks.GRANITE_2X.get(), - CompressedBlocks.COBBLESTONE_3X.get(), - CompressedBlocks.ANDESITE_3X.get(), - CompressedBlocks.DIORITE_3X.get(), - CompressedBlocks.GRANITE_3X.get() + ModBlocks.COBBLESTONE_3X.get(), + ModBlocks.ANDESITE_3X.get(), + ModBlocks.DIORITE_3X.get(), + ModBlocks.GRANITE_3X.get() ); this.tag(BlockTags.NEEDS_DIAMOND_TOOL) .add( - CompressedBlocks.COBBLESTONE_4X.get(), - CompressedBlocks.ANDESITE_4X.get(), - CompressedBlocks.DIORITE_4X.get(), - CompressedBlocks.GRANITE_4X.get(), - CompressedBlocks.CBLOCK_MINING.get() + ModBlocks.COBBLESTONE_4X.get(), + ModBlocks.ANDESITE_4X.get(), + ModBlocks.DIORITE_4X.get(), + ModBlocks.GRANITE_4X.get(), + ModBlocks.CBLOCK_MINING.get() ); } } \ No newline at end of file diff --git a/src/main/java/com/jenny/compressedblocks/datagen/ModItemModelProvider.java b/src/main/java/com/jenny/compressedblocks/datagen/ModItemModelProvider.java index fb4d34c..e11c12b 100644 --- a/src/main/java/com/jenny/compressedblocks/datagen/ModItemModelProvider.java +++ b/src/main/java/com/jenny/compressedblocks/datagen/ModItemModelProvider.java @@ -1,7 +1,7 @@ package com.jenny.compressedblocks.datagen; import com.jenny.compressedblocks.CompressedBlocks; -import com.jenny.compressedblocks.Tools; +import com.jenny.compressedblocks.moditems.Tools; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; diff --git a/src/main/java/com/jenny/compressedblocks/modblocks/ModBlocks.java b/src/main/java/com/jenny/compressedblocks/modblocks/ModBlocks.java new file mode 100644 index 0000000..02b48d9 --- /dev/null +++ b/src/main/java/com/jenny/compressedblocks/modblocks/ModBlocks.java @@ -0,0 +1,77 @@ +package com.jenny.compressedblocks.modblocks; + +import com.jenny.compressedblocks.CompressedBlocks; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.material.MapColor; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.RegistryObject; + +public class ModBlocks { + public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, CompressedBlocks.MODID); + public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, CompressedBlocks.MODID); + + public static final RegistryObject COBBLESTONE_1X = BLOCKS.register("cobblestone_1x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(2.0F, 8.0F).requiresCorrectToolForDrops())); + public static final RegistryObject COBBLESTONE_1X_ITEM = ITEMS.register("cobblestone_1x", () -> new BlockItem(COBBLESTONE_1X.get(), new Item.Properties())); + + public static final RegistryObject COBBLESTONE_2X = BLOCKS.register("cobblestone_2x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(3.0F, 9.0F).requiresCorrectToolForDrops())); + public static final RegistryObject COBBLESTONE_2X_ITEM = ITEMS.register("cobblestone_2x", () -> new BlockItem(COBBLESTONE_2X.get(), new Item.Properties())); + + public static final RegistryObject COBBLESTONE_3X = BLOCKS.register("cobblestone_3x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(4.0F, 10.0F).requiresCorrectToolForDrops())); + public static final RegistryObject COBBLESTONE_3X_ITEM = ITEMS.register("cobblestone_3x", () -> new BlockItem(COBBLESTONE_3X.get(), new Item.Properties())); + + public static final RegistryObject COBBLESTONE_4X = BLOCKS.register("cobblestone_4x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); + public static final RegistryObject COBBLESTONE_4X_ITEM = ITEMS.register("cobblestone_4x", () -> new BlockItem(COBBLESTONE_4X.get(), new Item.Properties())); + + /* ANDESITE */ + + public static final RegistryObject ANDESITE_1X = BLOCKS.register("andesite_1x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(2.0F, 8.0F).requiresCorrectToolForDrops())); + public static final RegistryObject ANDESITE_1X_ITEM = ITEMS.register("andesite_1x", () -> new BlockItem(ANDESITE_1X.get(), new Item.Properties())); + + public static final RegistryObject ANDESITE_2X = BLOCKS.register("andesite_2x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(3.0F, 9.0F).requiresCorrectToolForDrops())); + public static final RegistryObject ANDESITE_2X_ITEM = ITEMS.register("andesite_2x", () -> new BlockItem(ANDESITE_2X.get(), new Item.Properties())); + + public static final RegistryObject ANDESITE_3X = BLOCKS.register("andesite_3x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(4.0F, 10.0F).requiresCorrectToolForDrops())); + public static final RegistryObject ANDESITE_3X_ITEM = ITEMS.register("andesite_3x", () -> new BlockItem(ANDESITE_3X.get(), new Item.Properties())); + + public static final RegistryObject ANDESITE_4X = BLOCKS.register("andesite_4x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); + public static final RegistryObject ANDESITE_4X_ITEM = ITEMS.register("andesite_4x", () -> new BlockItem(ANDESITE_4X.get(), new Item.Properties())); + + + /* DIORITE */ + + public static final RegistryObject DIORITE_1X = BLOCKS.register("diorite_1x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(2.0F, 8.0F).requiresCorrectToolForDrops())); + public static final RegistryObject DIORITE_1X_ITEM = ITEMS.register("diorite_1x", () -> new BlockItem(DIORITE_1X.get(), new Item.Properties())); + + public static final RegistryObject DIORITE_2X = BLOCKS.register("diorite_2x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(3.0F, 9.0F).requiresCorrectToolForDrops())); + public static final RegistryObject DIORITE_2X_ITEM = ITEMS.register("diorite_2x", () -> new BlockItem(DIORITE_2X.get(), new Item.Properties())); + + public static final RegistryObject DIORITE_3X = BLOCKS.register("diorite_3x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(4.0F, 10.0F).requiresCorrectToolForDrops())); + public static final RegistryObject DIORITE_3X_ITEM = ITEMS.register("diorite_3x", () -> new BlockItem(DIORITE_3X.get(), new Item.Properties())); + + public static final RegistryObject DIORITE_4X = BLOCKS.register("diorite_4x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); + public static final RegistryObject DIORITE_4X_ITEM = ITEMS.register("diorite_4x", () -> new BlockItem(DIORITE_4X.get(), new Item.Properties())); + + /* GRANITE */ + + public static final RegistryObject GRANITE_1X = BLOCKS.register("granite_1x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(2.0F, 8.0F).requiresCorrectToolForDrops())); + public static final RegistryObject GRANITE_1X_ITEM = ITEMS.register("granite_1x", () -> new BlockItem(GRANITE_1X.get(), new Item.Properties())); + + public static final RegistryObject GRANITE_2X = BLOCKS.register("granite_2x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(3.0F, 9.0F).requiresCorrectToolForDrops())); + public static final RegistryObject GRANITE_2X_ITEM = ITEMS.register("granite_2x", () -> new BlockItem(GRANITE_2X.get(), new Item.Properties())); + + public static final RegistryObject GRANITE_3X = BLOCKS.register("granite_3x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(4.0F, 10.0F).requiresCorrectToolForDrops())); + public static final RegistryObject GRANITE_3X_ITEM = ITEMS.register("granite_3x", () -> new BlockItem(GRANITE_3X.get(), new Item.Properties())); + + public static final RegistryObject GRANITE_4X = BLOCKS.register("granite_4x", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); + public static final RegistryObject GRANITE_4X_ITEM = ITEMS.register("granite_4x", () -> new BlockItem(GRANITE_4X.get(), new Item.Properties())); + + /* COMBINED BLOCKS */ + + public static final RegistryObject CBLOCK_MINING = BLOCKS.register("cblock_mining", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.NONE).strength(5.0F, 11.0F).requiresCorrectToolForDrops())); + public static final RegistryObject CBLOCK_MINING_ITEM = ITEMS.register("cblock_mining", () -> new BlockItem(CBLOCK_MINING.get(), new Item.Properties())); + +} diff --git a/src/main/java/com/jenny/compressedblocks/moditems/ModItems.java b/src/main/java/com/jenny/compressedblocks/moditems/ModItems.java new file mode 100644 index 0000000..7f2f178 --- /dev/null +++ b/src/main/java/com/jenny/compressedblocks/moditems/ModItems.java @@ -0,0 +1,4 @@ +package com.jenny.compressedblocks.moditems; + +public class ModItems { +} diff --git a/src/main/java/com/jenny/compressedblocks/ToolTiers.java b/src/main/java/com/jenny/compressedblocks/moditems/ToolTiers.java similarity index 72% rename from src/main/java/com/jenny/compressedblocks/ToolTiers.java rename to src/main/java/com/jenny/compressedblocks/moditems/ToolTiers.java index 6fcf64e..2537e46 100644 --- a/src/main/java/com/jenny/compressedblocks/ToolTiers.java +++ b/src/main/java/com/jenny/compressedblocks/moditems/ToolTiers.java @@ -1,5 +1,8 @@ -package com.jenny.compressedblocks; +package com.jenny.compressedblocks.moditems; +import com.jenny.compressedblocks.CompressedBlocks; +import com.jenny.compressedblocks.Tags; +import com.jenny.compressedblocks.modblocks.ModBlocks; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Tier; import net.minecraft.world.item.Tiers; @@ -12,7 +15,7 @@ import java.util.List; public class ToolTiers { public static final Tier ULTRA = TierSortingRegistry.registerTier( new ForgeTier(5, 2560, 20f, 4f, 25, - Tags.Blocks.NEEDS_ULTRA_TOOL, () -> Ingredient.of(CompressedBlocks.CBLOCK_MINING_ITEM.get())), + Tags.Blocks.NEEDS_ULTRA_TOOL, () -> Ingredient.of(ModBlocks.CBLOCK_MINING_ITEM.get())), new ResourceLocation(CompressedBlocks.MODID, "ultra"), List.of(Tiers.NETHERITE), List.of() ); } diff --git a/src/main/java/com/jenny/compressedblocks/Tools.java b/src/main/java/com/jenny/compressedblocks/moditems/Tools.java similarity index 87% rename from src/main/java/com/jenny/compressedblocks/Tools.java rename to src/main/java/com/jenny/compressedblocks/moditems/Tools.java index e4c7f99..c32c18f 100644 --- a/src/main/java/com/jenny/compressedblocks/Tools.java +++ b/src/main/java/com/jenny/compressedblocks/moditems/Tools.java @@ -1,5 +1,6 @@ -package com.jenny.compressedblocks; +package com.jenny.compressedblocks.moditems; +import com.jenny.compressedblocks.CompressedBlocks; import net.minecraft.world.item.*; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister;