diff --git a/common/src/main/java/quaedam/mixin/MixinTitleScreen.java b/common/src/main/java/quaedam/mixin/MixinTitleScreen.java deleted file mode 100644 index 0ff6524..0000000 --- a/common/src/main/java/quaedam/mixin/MixinTitleScreen.java +++ /dev/null @@ -1,15 +0,0 @@ -package quaedam.mixin; - -import net.minecraft.client.gui.screens.TitleScreen; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(TitleScreen.class) -public class MixinTitleScreen { - @Inject(at = @At("HEAD"), method = "init()V") - private void init(CallbackInfo info) { - System.out.println("Hello from example architectury common mixin!"); - } -} \ No newline at end of file diff --git a/common/src/main/kotlin/quaedam/Projector.kt b/common/src/main/kotlin/quaedam/Projector.kt new file mode 100644 index 0000000..c84a7b4 --- /dev/null +++ b/common/src/main/kotlin/quaedam/Projector.kt @@ -0,0 +1,50 @@ +package quaedam + +import net.minecraft.core.BlockPos +import net.minecraft.world.InteractionHand +import net.minecraft.world.InteractionResult +import net.minecraft.world.entity.player.Player +import net.minecraft.world.item.BlockItem +import net.minecraft.world.item.Item +import net.minecraft.world.level.Level +import net.minecraft.world.level.block.Block +import net.minecraft.world.level.block.state.BlockState +import net.minecraft.world.level.material.MapColor +import net.minecraft.world.phys.BlockHitResult + +object Projector { + + const val ID = "projector" + + val block = Quaedam.blocks.register(ID) { ProjectorBlock } + + val item = Quaedam.items.register(ID) { + BlockItem( + ProjectorBlock, Item.Properties() + .stacksTo(1) + .`arch$tab`(Quaedam.creativeModeTab) + ) + }!! + +} + +object ProjectorBlock : Block(Properties.of() + .jumpFactor(0.8f) + .lightLevel { 3 } + .mapColor(MapColor.COLOR_BLACK) + .randomTicks() + .destroyTime(4.0f) + .requiresCorrectToolForDrops()) { + + override fun use( + blockState: BlockState, + level: Level, + blockPos: BlockPos, + player: Player, + interactionHand: InteractionHand, + blockHitResult: BlockHitResult + ): InteractionResult { + return InteractionResult.SUCCESS + } + +} diff --git a/common/src/main/kotlin/quaedam/Quaedam.kt b/common/src/main/kotlin/quaedam/Quaedam.kt index f0987de..50f96e0 100644 --- a/common/src/main/kotlin/quaedam/Quaedam.kt +++ b/common/src/main/kotlin/quaedam/Quaedam.kt @@ -8,31 +8,27 @@ import net.minecraft.network.chat.Component import net.minecraft.world.item.CreativeModeTab import net.minecraft.world.item.Item import net.minecraft.world.item.ItemStack -import quaedam.QuaedamExpectPlatform.getConfigDirectory +import net.minecraft.world.item.Items object Quaedam { - const val MOD_ID = "quaedam" - private val createModeTabs = DeferredRegister.create(MOD_ID, Registries.CREATIVE_MODE_TAB) - val exampleTab: RegistrySupplier = createModeTabs.register("example_tab") { + const val ID = "quaedam" + + val creativeModeTabs = DeferredRegister.create(ID, Registries.CREATIVE_MODE_TAB)!! + val items = DeferredRegister.create(ID, Registries.ITEM)!! + val blocks = DeferredRegister.create(ID, Registries.BLOCK)!! + + val creativeModeTab: RegistrySupplier = creativeModeTabs.register("quaedam") { CreativeTabRegistry.create(Component.translatable("category.quaedam")) { - ItemStack(exampleItem.get()) + ItemStack(Items.TORCH) } } - private val items = DeferredRegister.create(MOD_ID, Registries.ITEM) - val exampleItem: RegistrySupplier = items.register( - "example_item" - ) { - Item( - Item.Properties().`arch$tab`(exampleTab) // DON'T CALL GET ON exampleTab HERE - ) - } - fun init() { - createModeTabs.register() + Projector + creativeModeTabs.register() items.register() - - println("CONFIG DIR: ${getConfigDirectory().toAbsolutePath().normalize()}") + blocks.register() } + } \ No newline at end of file diff --git a/common/src/main/kotlin/quaedam/QuaedamExpectPlatform.kt b/common/src/main/kotlin/quaedam/QuaedamExpectPlatform.kt deleted file mode 100644 index f136b88..0000000 --- a/common/src/main/kotlin/quaedam/QuaedamExpectPlatform.kt +++ /dev/null @@ -1,13 +0,0 @@ -package quaedam - -import dev.architectury.injectables.annotations.ExpectPlatform -import java.nio.file.Path - -object QuaedamExpectPlatform { - @JvmStatic // Make sure its Jvm Static - @ExpectPlatform - fun getConfigDirectory(): Path { - // Just throw an error, the content should get replaced at runtime. - throw AssertionError() - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/quaedam/blockstates/projector.json b/common/src/main/resources/assets/quaedam/blockstates/projector.json new file mode 100644 index 0000000..e9adc7d --- /dev/null +++ b/common/src/main/resources/assets/quaedam/blockstates/projector.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "quaedam:block/projector" + } + } +} diff --git a/common/src/main/resources/assets/quaedam/lang/en_us.json b/common/src/main/resources/assets/quaedam/lang/en_us.json index ae9d060..ab70053 100644 --- a/common/src/main/resources/assets/quaedam/lang/en_us.json +++ b/common/src/main/resources/assets/quaedam/lang/en_us.json @@ -1,3 +1,4 @@ { - "item.quaedam.example_item": "Example Item" + "category.quaedam": "Quaedam", + "block.quaedam.projector": "Projector" } \ No newline at end of file diff --git a/common/src/main/resources/assets/quaedam/loot_tables/blocks/projector.json b/common/src/main/resources/assets/quaedam/loot_tables/blocks/projector.json new file mode 100644 index 0000000..e3db0d6 --- /dev/null +++ b/common/src/main/resources/assets/quaedam/loot_tables/blocks/projector.json @@ -0,0 +1,9 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [] + } + ] +} diff --git a/common/src/main/resources/assets/quaedam/models/block/projector.json b/common/src/main/resources/assets/quaedam/models/block/projector.json new file mode 100644 index 0000000..347fd68 --- /dev/null +++ b/common/src/main/resources/assets/quaedam/models/block/projector.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "quaedam:block/projector" + } +} diff --git a/common/src/main/resources/assets/quaedam/models/item/projector.json b/common/src/main/resources/assets/quaedam/models/item/projector.json new file mode 100644 index 0000000..2623f24 --- /dev/null +++ b/common/src/main/resources/assets/quaedam/models/item/projector.json @@ -0,0 +1,3 @@ +{ + "parent": "quaedam:block/projector" +} \ No newline at end of file diff --git a/common/src/main/resources/assets/quaedam/textures/block/projector.png b/common/src/main/resources/assets/quaedam/textures/block/projector.png new file mode 100644 index 0000000..253cb90 Binary files /dev/null and b/common/src/main/resources/assets/quaedam/textures/block/projector.png differ diff --git a/common/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/common/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json new file mode 100644 index 0000000..0dc913c --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "quaedam:projector" + ] +} \ No newline at end of file diff --git a/common/src/main/resources/data/minecraft/tags/blocks/needs_iron_tool.json b/common/src/main/resources/data/minecraft/tags/blocks/needs_iron_tool.json new file mode 100644 index 0000000..0dc913c --- /dev/null +++ b/common/src/main/resources/data/minecraft/tags/blocks/needs_iron_tool.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "quaedam:projector" + ] +} \ No newline at end of file diff --git a/common/src/main/resources/quaedam-common.mixins.json b/common/src/main/resources/quaedam-common.mixins.json index 12c14ea..93e28e7 100644 --- a/common/src/main/resources/quaedam-common.mixins.json +++ b/common/src/main/resources/quaedam-common.mixins.json @@ -3,7 +3,6 @@ "package": "quaedam.mixin", "compatibilityLevel": "JAVA_17", "client": [ - "MixinTitleScreen" ], "mixins": [ ], diff --git a/forge/src/main/kotlin/quaedam/forge/QuaedamExpectPlatformImpl.kt b/forge/src/main/kotlin/quaedam/forge/QuaedamExpectPlatformImpl.kt deleted file mode 100644 index c87f2b4..0000000 --- a/forge/src/main/kotlin/quaedam/forge/QuaedamExpectPlatformImpl.kt +++ /dev/null @@ -1,14 +0,0 @@ -package quaedam.forge - -import net.minecraftforge.fml.loading.FMLPaths -import java.nio.file.Path - -object QuaedamExpectPlatformImpl { - /** - * This is our actual method to [ExampleExpectPlatform.getConfigDirectory]. - */ - @JvmStatic // Jvm Static is required so that java can access it - fun getConfigDirectory(): Path { - return FMLPaths.CONFIGDIR.get() - } -} \ No newline at end of file diff --git a/forge/src/main/kotlin/quaedam/forge/QuaedamForge.kt b/forge/src/main/kotlin/quaedam/forge/QuaedamForge.kt index f7d51be..72b4225 100644 --- a/forge/src/main/kotlin/quaedam/forge/QuaedamForge.kt +++ b/forge/src/main/kotlin/quaedam/forge/QuaedamForge.kt @@ -5,11 +5,12 @@ import net.minecraftforge.fml.common.Mod import quaedam.Quaedam import thedarkcolour.kotlinforforge.forge.MOD_BUS -@Mod(Quaedam.MOD_ID) +@Mod(Quaedam.ID) object QuaedamForge { + init { - // Submit our event bus to let architectury register our content on the right time - EventBuses.registerModEventBus(Quaedam.MOD_ID, MOD_BUS) + EventBuses.registerModEventBus(Quaedam.ID, MOD_BUS) Quaedam.init() } + } \ No newline at end of file