From 050cb44dbbe9d1015709cf4fef7037e957517706 Mon Sep 17 00:00:00 2001 From: Asoji Date: Tue, 20 Feb 2024 07:45:21 -0800 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=93=9D=20Started=20on=20some=20bare?= =?UTF-8?q?=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs.yml | 32 +++++++++ Module.md | 38 ++++++++++ build.gradle.kts | 20 +++++- .../innerpastels/blocks/BlockExtensions.kt | 59 ++++++++++----- .../innerpastels/blocks/FenceGateBlock.kt | 4 ++ .../asoji/innerpastels/blocks/Properties.kt | 3 + .../asoji/innerpastels/blocks/StairBlock.kt | 6 +- .../innerpastels/datagen/ModelGenerators.kt | 3 + .../innerpastels/datagen/RecipeGenerators.kt | 5 ++ .../asoji/innerpastels/misc/SecondsToTicks.kt | 12 ++++ .../tags/InnerPastelsBlockTags.kt | 72 +++++++++++++++++++ .../innerpastels/tags/InnerPastelsItemTags.kt | 5 ++ 12 files changed, 238 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 Module.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..a43afc18 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,32 @@ +name: docs +on: [ push, workflow_dispatch ] +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Setup JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Run Dokka Task + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: true + arguments: dokkaHtml + + - name: Deploy Documentations + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: build/dokka/html \ No newline at end of file diff --git a/Module.md b/Module.md new file mode 100644 index 00000000..390a1c41 --- /dev/null +++ b/Module.md @@ -0,0 +1,38 @@ +# Module Inner Pastels + +Library mod to share helper functions between Softer Pastels, Desolated Pastels, and any other future projects from asoji [probably] + +```Bash +src/main/kotlin +└───gay.asoji.innerpastels + ├───blocks + ├───datagen + ├───foods + ├───items + ├───misc + └───tags +``` + +# Package gay.asoji.innerpastels.blocks + +TODO: work on this + +# Package gay.asoji.innerpastels.datagen + +TODO: work on this + +# Package gay.asoji.innerpastels.foods + +TODO: work on this + +# Package gay.asoji.innerpastels.items + +TODO: work on this + +# Package gay.asoji.innerpastels.misc + +TODO: work on this + +# Package gay.asoji.innerpastels.tags + +TODO: work on this diff --git a/build.gradle.kts b/build.gradle.kts index d17640cb..31938b90 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.base.DokkaBaseConfiguration +import java.net.URL buildscript { dependencies { @@ -44,13 +45,26 @@ dependencies { } tasks.withType().configureEach { + dokkaSourceSets { + named("main") { + moduleName.set("Inner Pastels") + + includes.from("Module.md") + + sourceLink { + localDirectory.set(file("src/main/kotlin")) + remoteUrl.set(URL("http://github.com/devOS-Sanity-Edition/InnerPastels/tree/main/" + "src/main/kotlin")) + remoteLineSuffix.set("#L") + } + } + } pluginConfiguration { // customAssets = listOf(file("my-image.png")) // customStyleSheets = listOf(file("my-styles.css")) - footerMessage = "(c) 2024 asoji" - separateInheritedMembers = false + footerMessage = "(c) 2024 devOS: Sanity Edition, Team Nautical, asoji" + separateInheritedMembers = true // templatesDir = file("dokka/templates") - mergeImplicitExpectActualDeclarations = false + mergeImplicitExpectActualDeclarations = true } } diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt index 5c8fe21f..a59e5284 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt @@ -26,7 +26,8 @@ import net.minecraft.world.level.material.MapColor // a lot of this was written by storm so if there's shit that could be reused/abstracted, yell at her, not me - asoji /** - * Registers a block to the Minecraft registry with the resource location set to the mod id + * Registers a block to the Minecraft registry with the resource location set to the Mod ID + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -34,7 +35,8 @@ fun Block.registerBlock(modID: String, name: String): Block = Registry.register(BuiltInRegistries.BLOCK, ResourceLocation(modID, name), this) /** - * Registers an item to the Minecraft registry with the resource location set to the mod id + * Registers an item to the Minecraft registry with the resource location set to the Mod ID + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the item * @return [BlockItem] */ @@ -45,7 +47,8 @@ fun Block.registerBlockItem(modID: String, name: String): BlockItem = Registry.r ) /** - * Registers a block & item to the Minecraft registry with the resource location set to the mod id + * Registers a block & item to the Minecraft registry with the resource location set to the Mod ID + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -56,6 +59,7 @@ fun Block.registerBlockWithItem(modID: String, name: String): Block { /** * Registers a stained-glass block copying the settings of white stained-glass with the color based on a [DyeColor] + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -64,6 +68,7 @@ fun DyeColor.registerGlassBlock(modID: String, name: String): Block = /** * Registers a stained-glass pane block copying the settings of white stained-glass with the color based on a [DyeColor] + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -72,6 +77,7 @@ fun DyeColor.registerGlassPaneBlock(modID: String, name: String): Block = /** * Registers a pastel block with an accompanying item with the color based on a [DyeColor] + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -79,6 +85,7 @@ fun DyeColor.registerPastelBlock(modID: String, name: String): Block = Block(Pas /** * Registers a pastel block with an accompanying item with the color based on a [MapColor] + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -86,6 +93,7 @@ fun MapColor.registerPastelBlock(modID: String, name: String): Block = Block(Pas /** * Registers a pastel powder block with an accompanying item with the color based on a [DyeColor], paired with an accompanying normal pastel block when touched with water + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @property resultPastelBlock the accompanying normal pastel block * @return [ConcretePowderBlock] @@ -95,6 +103,7 @@ fun DyeColor.registerPastelPowderBlock(modID: String, name: String, resultPastel /** * Registers a pastel powder block with an accompanying item with the color based on a [MapColor], paired with an accompanying normal pastel block when touched with water + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @property resultPastelBlock the accompanying normal pastel block * @return [ConcretePowderBlock] @@ -104,6 +113,7 @@ fun MapColor.registerPastelPowderBlock(modID: String, name: String, resultPastel /** * Registers a pastel fence block with an accompanying item with a chosen [DyeColor] to be shown on a map + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [FenceBlock] */ @@ -112,6 +122,7 @@ fun DyeColor.registerPastelFenceBlock(modID: String, name: String): Block = /** * Registers a pastel fence block with an accompanying item with a chosen [MapColor] to be shown on a map + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [FenceBlock] */ @@ -120,6 +131,7 @@ fun MapColor.registerPastelFenceBlock(modID: String, name: String): Block = /** * Registers the pastel fence gate block with an accompanying item with a chosen [DyeColor] to be shown on a map + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [FenceGateBlock] */ @@ -128,6 +140,7 @@ fun DyeColor.registerPastelFenceGateBlock(modID: String, name: String): Block = /** * Registers the pastel fence gate block with an accompanying item with a chosen [MapColor] to be shown on a map + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [FenceGateBlock] */ @@ -136,6 +149,7 @@ fun MapColor.registerPastelFenceGateBlock(modID: String, name: String): Block = /** * Registers the pastel wall block with an accompanying item with a chosen [DyeColor] to be shown on a map + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [WallBlock] */ @@ -144,6 +158,7 @@ fun DyeColor.registerPastelWallBlock(modID: String, name: String): Block = /** * Registers the pastel wall block with an accompanying item with a chosen [MapColor] to be shown on a map + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [WallBlock] */ @@ -156,7 +171,8 @@ fun MapColor.registerPastelWallBlock(modID: String, name: String): Block = /** * Registers the pastel slab block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property name the IDE of the block + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block * @return [SlabBlock] */ fun DyeColor.registerPastelSlabBlock(modID: String, name: String): Block = @@ -164,7 +180,8 @@ fun DyeColor.registerPastelSlabBlock(modID: String, name: String): Block = /** * Registers the pastel slab block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property name the IDE of the block + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block * @return [SlabBlock] */ fun MapColor.registerPastelSlabBlock(modID: String, name: String): Block = @@ -172,55 +189,62 @@ fun MapColor.registerPastelSlabBlock(modID: String, name: String): Block = /** * Registers the pastel stair block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property name the IDE of the block - * @return [StairBlocks] + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block + * @return [StairBlock] */ -fun DyeColor.registerPastelStairsBlock(modID: String, name: String): Block = StairBlocks( +fun DyeColor.registerPastelStairsBlock(modID: String, name: String): Block = StairBlock( Blocks.STONE_STAIRS.defaultBlockState(), PastelStair().mapColor(this) ).registerBlockWithItem(modID, name) /** * Registers the pastel stair block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property name the IDE of the block - * @return [StairBlocks] + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block + * @return [StairBlock] */ -fun MapColor.registerPastelStairsBlock(modID: String, name: String): Block = StairBlocks( +fun MapColor.registerPastelStairsBlock(modID: String, name: String): Block = StairBlock( Blocks.STONE_STAIRS.defaultBlockState(), PastelStair().mapColor(this) ).registerBlockWithItem(modID, name) /** * Registers the pastel wool block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property name the IDE of the block + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block * @return [Block] */ fun DyeColor.registerWoolBlock(modID: String, name: String): Block = Block(PastelWool().mapColor(this)).registerBlockWithItem(modID, name) /** * Registers the pastel wool block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property name the IDE of the block + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block * @return [Block] */ fun MapColor.registerWoolBlock(modID: String, name: String): Block = Block(PastelWool().mapColor(this)).registerBlockWithItem(modID, name) /** * Registers the pastel light block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property name the IDE of the block + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block * @return [Block] */ fun DyeColor.registerLightBlock(modID: String, name: String): Block = Block(PastelLight().mapColor(this)).registerBlockWithItem(modID, name) /** * Registers the pastel light block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property name the IDE of the block + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block * @return [Block] */ fun MapColor.registerLightBlock(modID: String, name: String): Block = Block(PastelLight().mapColor(this)).registerBlockWithItem(modID, name) /** * Registers the pastel carpet block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property name the IDE of the block + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block * @return [Block] */ fun DyeColor.registerCarpetBlock(modID: String, name: String): Block = @@ -228,7 +252,8 @@ fun DyeColor.registerCarpetBlock(modID: String, name: String): Block = /** * Registers the pastel carpet block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property name the IDE of the block + * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property name the ID of the block * @return [Block] */ fun MapColor.registerCarpetBlock(modID: String, name: String): Block = diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/FenceGateBlock.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/FenceGateBlock.kt index 7a4c05bd..6597da96 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/FenceGateBlock.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/FenceGateBlock.kt @@ -3,4 +3,8 @@ package gay.asoji.innerpastels.blocks import net.minecraft.world.level.block.FenceGateBlock import net.minecraft.world.level.block.state.properties.WoodType +/** + * Normal Fence Gate Block class, inheriting from Vanilla's FenceGateBlock + * @returns [FenceGateBlock] + */ class FenceGateBlock(properties: Properties) : FenceGateBlock(WoodType.OAK, properties) \ No newline at end of file diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt index 7e5ae42f..bcf55450 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt @@ -7,6 +7,9 @@ import net.minecraft.world.level.block.LeavesBlock import net.minecraft.world.level.block.RotatedPillarBlock import net.minecraft.world.level.block.state.BlockBehaviour +/** + * A list of Block Properties, mostly copyOf's, to be used with making new blocks. + */ object Properties { fun PastelBlock(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.WHITE_CONCRETE) diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/StairBlock.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/StairBlock.kt index 0bd49e0d..fff19bc9 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/StairBlock.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/StairBlock.kt @@ -3,4 +3,8 @@ package gay.asoji.innerpastels.blocks import net.minecraft.world.level.block.StairBlock import net.minecraft.world.level.block.state.BlockState -class StairBlocks(baseBlockState: BlockState, properties: Properties) : StairBlock(baseBlockState, properties) \ No newline at end of file +/** + * Normal Fence Gate Block class, inheriting from Vanilla's FenceGateBlock + * @returns [StairBlock] + */ +class StairBlock(baseBlockState: BlockState, properties: Properties) : StairBlock(baseBlockState, properties) \ No newline at end of file diff --git a/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt b/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt index ebabe9ea..691c2d01 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt @@ -7,6 +7,9 @@ import net.minecraft.data.models.model.TexturedModel import net.minecraft.resources.ResourceLocation import net.minecraft.world.level.block.Block +/** + * Model Generators used for Model Data Generation, creating required JSON models for certain blocks + */ object ModelGenerators { fun createSlabs(block: Block, slab: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] diff --git a/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt b/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt index 671c8ee3..980abcb8 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt @@ -6,6 +6,11 @@ import net.minecraft.data.recipes.RecipeProvider.has import net.minecraft.world.item.Items import net.minecraft.world.level.ItemLike +/** + * Recipe Generators used for Recipe Generation via Fabric Recipe Provider, generating the required recipe JSONs + * + * im craving tomato soup now + */ object RecipeGenerators { // There's some naming inconsistencies in this file, I think, I'm a bit too tired to deal with it, I'll fix it // either before launching Softer Pastels v0.6.0, or after... we'll see diff --git a/src/main/kotlin/gay/asoji/innerpastels/misc/SecondsToTicks.kt b/src/main/kotlin/gay/asoji/innerpastels/misc/SecondsToTicks.kt index 6f27be6c..7f4c136a 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/misc/SecondsToTicks.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/misc/SecondsToTicks.kt @@ -1,3 +1,15 @@ package gay.asoji.innerpastels.misc +/** + * Multiplies your [Int] by the game's 20 ticks per second, making something like 5s * 20tps = 100t. Useful for anything related to using game ticks but in whole seconds. + * + * Example: + * ```kotlin + * val seconds: Int = 5 + * val totalSecondsInTicks: Int = seconds.secondsToTicks() // Returns 100 + * ``` + * + * @return [Int] + */ + fun Int.secondsToTicks() = this * 20 \ No newline at end of file diff --git a/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsBlockTags.kt b/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsBlockTags.kt index 350a9cd8..43f1d437 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsBlockTags.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsBlockTags.kt @@ -5,25 +5,97 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.tags.TagKey import net.minecraft.world.level.block.Block +/** + * A bunch of block tags meant to be used for tagging blocks to their respective tags. + * + * Now try saying tags 100 times over. + */ object InnerPastelsBlockTags { // A bunch of these tags are *probably* not needed but do they hurt to make? no not rly + + /** + * Blocks assigned with this tag are deemed as portal blocks to whatever looks for `#innerpastels:valid_portal` + * @return [InnerPastelsBlockTags.VALID_PORTAL] + */ val VALID_PORTAL: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:valid_portal")) // Softer + /** + * Blocks assigned with this tag are deemed as pastel blocks to whatever looks for `#innerpastels:pastel_blocks` + * @return [InnerPastelsBlockTags.PASTEL_BLOCKS] + */ val PASTEL_BLOCKS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:pastel_blocks")) + + /** + * Blocks assigned with this tag are deemed as pastel powder blocks to whatever looks for `#innerpastels:pastel_powder_blocks` + * @return [InnerPastelsBlockTags.PASTEL_POWDER_BLOCKS] + */ val PASTEL_POWDER_BLOCKS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:pastel_powder_blocks")) + + /** + * Blocks assigned with this tag are deemed as pastel fences to whatever looks for `#innerpastels:fences` + * @return [InnerPastelsBlockTags.FENCES] + */ val FENCES: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:fences")) + + /** + * Blocks assigned with this tag are deemed as pastel fence gates to whatever looks for `#innerpastels:fence_gates` + * @return [InnerPastelsBlockTags.FENCE_GATES] + */ val FENCE_GATES: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:fence_gates")) + + /** + * Blocks assigned with this tag are deemed as pastel walls to whatever looks for `#innerpastels:walls` + * @return [InnerPastelsBlockTags.WALLS] + * + * By the way, I am living in your walls. **Boo.** + */ val WALLS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:walls")) + + /** + * Blocks assigned with this tag are deemed as pastel slabs to whatever looks for `#innerpastels:slabs` + * @return [InnerPastelsBlockTags.SLABS] + */ val SLABS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:slabs")) + + /** + * Blocks assigned with this tag are deemed as pastel stairs to whatever looks for `#innerpastels:stairs` + * @return [InnerPastelsBlockTags.STAIRS] + */ val STAIRS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:stairs")) + + /** + * Blocks assigned with this tag are deemed as pastel wools to whatever looks for `#innerpastels:wools` + * @return [InnerPastelsBlockTags.WOOLS] + */ val WOOLS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:wools")) + + /** + * Blocks assigned with this tag are deemed as pastel lights to whatever looks for `#innerpastels:lights` + * @return [InnerPastelsBlockTags.LIGHTS] + */ val LIGHTS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:lights")) + + /** + * Blocks assigned with this tag are deemed as pastel carpets to whatever looks for `#innerpastels:carpets` + * @return [InnerPastelsBlockTags.CARPETS] + */ val CARPETS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:carpets")) + + /** + * Blocks assigned with this tag are deemed as pastel glass blocks to whatever looks for `#innerpastels:glass_blocks` + * @return [InnerPastelsBlockTags.GLASS_BLOCKS] + */ val GLASS_BLOCKS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:glass_blocks")) + + /** + * Blocks assigned with this tag are deemed as pastel glass panes to whatever looks for `#innerpastels:glass_panes` + * @return [InnerPastelsBlockTags.GLASS_PANES] + */ val GLASS_PANES: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:glass_panes")) // Desolated + // **UNDOCUMENTED FOR NOW** val ORES: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:ores")) val LOGS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:logs")) val PLANKS: TagKey = TagKey.create(Registries.BLOCK, ResourceLocation("innerpastels:planks")) diff --git a/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsItemTags.kt b/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsItemTags.kt index df9ac2f9..93bc6632 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsItemTags.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsItemTags.kt @@ -5,6 +5,11 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.tags.TagKey import net.minecraft.world.item.Item +/** + * A bunch of items tags meant to be used for tagging items to their respective tags. + * + * Now try saying tags 100 times over. + */ object InnerPastelsItemTags { // Softer val PASTEL_BLOCKS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:pastel_blocks")) From 36b3676db61eaa351a95566d058580079358ed82 Mon Sep 17 00:00:00 2001 From: Asoji Date: Tue, 20 Feb 2024 07:47:23 -0800 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=90=9B=20execute=20my=20ass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a43afc18..84454c12 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,6 +20,9 @@ jobs: distribution: 'temurin' java-version: '17' + - name: make gradle wrapper executable + run: chmod +x ./gradlew + - name: Run Dokka Task uses: gradle/gradle-build-action@v2 with: From f08d9e2c4905d98aefd662492a0018f35f097d4f Mon Sep 17 00:00:00 2001 From: Asoji Date: Thu, 22 Feb 2024 06:59:05 -0800 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=93=9DMore=20unfinished=20docs=20+=20?= =?UTF-8?q?candy=20string=20enum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../gay/asoji/innerpastels/InnerPastels.kt | 7 +++ .../innerpastels/datagen/ModelGenerators.kt | 62 ++++++++++++++++++- .../innerpastels/datagen/RecipeGenerators.kt | 2 +- .../asoji/innerpastels/foods/RegisterFood.kt | 44 ++++++++++--- .../innerpastels/items/CandyTooltipItem.kt | 14 ++++- .../asoji/innerpastels/items/RegisterItems.kt | 4 ++ .../assets/innerpastels/lang/en_us.json | 4 +- 8 files changed, 124 insertions(+), 15 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5b6794ab..6095f0f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G org.gradle.parallel=true # Mod Properties -mod_version=1.0.0 +mod_version=1.0.1 maven_group=gay.asoji archives_base_name=innerpastels diff --git a/src/main/kotlin/gay/asoji/innerpastels/InnerPastels.kt b/src/main/kotlin/gay/asoji/innerpastels/InnerPastels.kt index 6309f1ab..a46db6ab 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/InnerPastels.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/InnerPastels.kt @@ -2,6 +2,13 @@ package gay.asoji.innerpastels import net.fabricmc.api.ModInitializer +/** + * Inner Pastels Internal Library, meant to be used for Softer Pastels, Desolated Pastels, and any other future *Pastel mods. + * This library adds a lot of common code and helper functions to assist with development for *Pastel mods, especially for Blocks, Items, and Data Generation. + * + * @author asojidev + * @version 1.0.1 + */ object InnerPastels : ModInitializer { override fun onInitialize() { diff --git a/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt b/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt index 691c2d01..c5e8ac4d 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt @@ -8,9 +8,21 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.world.level.block.Block /** - * Model Generators used for Model Data Generation, creating required JSON models for certain blocks + * Model Generators used for Model Data Generation, creating required JSON models for certain blocks, meant to be used with your ModelProvider datagen. */ object ModelGenerators { + /** + * Creates a slab model based off another block, `block:` being the reference block, `slab:` being the target slab, and just call your normal BlockStateModelGenerator after + * + * Example: + * ```kotlin + * class SofterPastelsModelProvider(generator: FabricDataOutput) : FabricModelProvider(generator) { + * override fun generateBlockStateModels(blockStateModelGenerator: BlockModelGenerators) { + * createSlabs(SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_SLAB_BLOCK, blockStateModelGenerator) + * } + * } + * ``` + */ fun createSlabs(block: Block, slab: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] val fullSlabModel = ModelLocationUtils.getModelLocation(block) @@ -35,6 +47,18 @@ object ModelGenerators { blockStateModelGenerator.delegateItemModel(slab, bottomSlab) } + /** + * Creates a stair model based off another block, `block:` being the reference block, `stair:` being the target stair, and just call your normal BlockStateModelGenerator after + * + * Example: + * ```kotlin + * class SofterPastelsModelProvider(generator: FabricDataOutput) : FabricModelProvider(generator) { + * override fun generateBlockStateModels(blockStateModelGenerator: BlockModelGenerators) { + * createStairs(SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_STAIR_BLOCK, blockStateModelGenerator) + * } + * } + * ``` + */ fun createStairs(block: Block, stairs: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] val innerStairs: ResourceLocation = ModelTemplates.STAIRS_INNER.create( @@ -63,6 +87,18 @@ object ModelGenerators { blockStateModelGenerator.delegateItemModel(stairs, straightStairs) } + /** + * Creates a fence model based off another block, `block:` being the reference block, `fence:` being the target fence, and just call your normal BlockStateModelGenerator after + * + * Example: + * ```kotlin + * class SofterPastelsModelProvider(generator: FabricDataOutput) : FabricModelProvider(generator) { + * override fun generateBlockStateModels(blockStateModelGenerator: BlockModelGenerators) { + * createFence(SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_FENCE_BLOCK, blockStateModelGenerator) + * } + * } + * ``` + */ fun createFence(block: Block, fence: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] val fencePost: ResourceLocation = ModelTemplates.FENCE_POST.create( @@ -90,6 +126,18 @@ object ModelGenerators { blockStateModelGenerator.delegateItemModel(fence, fenceInventoryModel) } + /** + * Creates a fence gate model based off another block, `block:` being the reference block, `fenceGate:` being the target fence gate, and just call your normal BlockStateModelGenerator after + * + * Example: + * ```kotlin + * class SofterPastelsModelProvider(generator: FabricDataOutput) : FabricModelProvider(generator) { + * override fun generateBlockStateModels(blockStateModelGenerator: BlockModelGenerators) { + * createFenceGate(SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_FENCE_GATE_BLOCK, blockStateModelGenerator) + * } + * } + * ``` + */ fun createFenceGate(block: Block, fenceGate: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] val fenceGateOpen: ResourceLocation = ModelTemplates.FENCE_GATE_OPEN.create( @@ -125,6 +173,18 @@ object ModelGenerators { blockStateModelGenerator.delegateItemModel(fenceGate, fenceGateClosed) } + /** + * Creates a wall model based off another block, `block:` being the reference block, `wall:` being the target wall, and just call your normal BlockStateModelGenerator after + * + * Example: + * ```kotlin + * class SofterPastelsModelProvider(generator: FabricDataOutput) : FabricModelProvider(generator) { + * override fun generateBlockStateModels(blockStateModelGenerator: BlockModelGenerators) { + * createWall(SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_WALL_BLOCK, blockStateModelGenerator) + * } + * } + * ``` + */ fun createWall(block: Block, wall: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] val wallPost: ResourceLocation = ModelTemplates.WALL_POST.create( diff --git a/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt b/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt index 980abcb8..05c59f29 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt @@ -7,7 +7,7 @@ import net.minecraft.world.item.Items import net.minecraft.world.level.ItemLike /** - * Recipe Generators used for Recipe Generation via Fabric Recipe Provider, generating the required recipe JSONs + * Recipe Generators used for Recipe Generation via Fabric Recipe Provider, generating the required recipe JSONs, meant to be used with your RecipeProvider datagen. * * im craving tomato soup now */ diff --git a/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt b/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt index 177f2ff2..60b6e3a4 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt @@ -1,5 +1,6 @@ package gay.asoji.innerpastels.foods +import gay.asoji.innerpastels.items.CANDY_TRANSLATION_STRING import gay.asoji.innerpastels.items.CandyTooltipItem import gay.asoji.innerpastels.misc.secondsToTicks import net.minecraft.resources.ResourceLocation @@ -9,10 +10,24 @@ import net.minecraft.world.food.FoodProperties import net.minecraft.world.item.Item import net.minecraft.world.item.Items + object RegisterFood { + /** + * Registers a candy food item + * + * @property modID The namespace you're using, like `SofterPastels.MOD_ID` + * @property name Candy's Item ID [like `white_taffy`] + * @property candyTranslationString Type of candy for hunger translation string + * @property nutrition Candy's nutrition value in [Int] + * @property saturation Candy's saturation value in [Int] + * @property effect [MobEffect] tied to eating the candy + * @property amplifier Potency of said [MobEffect] after eating it + * @property seconds Amount of time the effect lasts in seconds + */ fun registerCandy( modID: String, name: String, + candyTranslationString: CANDY_TRANSLATION_STRING, nutrition: Int, saturation: Int, effect: MobEffect, @@ -28,12 +43,22 @@ object RegisterFood { .fast() .alwaysEat() .effect(MobEffectInstance(effect, seconds.secondsToTicks(), amplifier), 1.0f).build() - ) + ), + candyTranslationString ) ) as CandyTooltipItem } - fun registerCandy(modID: String, name: String, nutrition: Int, saturation: Int, amplifier: Int): CandyTooltipItem { + /** + * Registers a candy food item + * + * @property modID The namespace you're using, like `SofterPastels.MOD_ID` + * @property name Candy's Item ID [like `white_taffy`] + * @property candyTranslationString Type of candy for hunger translation string + * @property nutrition Candy's nutrition value in [Int] + * @property saturation Candy's saturation value in [Int] + */ + fun registerCandy(modID: String, name: String, candyTranslationString: CANDY_TRANSLATION_STRING, nutrition: Int, saturation: Int): CandyTooltipItem { return Items.registerItem( ResourceLocation(modID, name), CandyTooltipItem( Item.Properties().food( @@ -43,33 +68,34 @@ object RegisterFood { .fast() .alwaysEat() .build() - ) + ), + candyTranslationString ) ) as CandyTooltipItem } fun registerTaffy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { - return registerCandy(modID, name, 2, 2, effect, 0, seconds) + return registerCandy(modID, name, CANDY_TRANSLATION_STRING.TAFFY, 2, 2, effect, 0, seconds) } fun registerTaffy(modID: String, name: String): CandyTooltipItem { - return registerCandy(modID, name, 2, 2, 0) + return registerCandy(modID, name, CANDY_TRANSLATION_STRING.TAFFY, 2, 2) } fun registerCottonCandy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { - return registerCandy(modID, name, 3, 2, effect, 1, seconds) + return registerCandy(modID, name, CANDY_TRANSLATION_STRING.COTTON, 3, 2, effect, 1, seconds) } fun registerCottonCandy(modID: String, name: String): CandyTooltipItem { - return registerCandy(modID, name, 3, 2, 1) + return registerCandy(modID, name, CANDY_TRANSLATION_STRING.COTTON, 3, 2) } fun registerHardCandy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { - return registerCandy(modID, name, 3, 2, effect, 2, seconds) + return registerCandy(modID, name, CANDY_TRANSLATION_STRING.HARD, 3, 2, effect, 2, seconds) } fun registerHardCandy(modID: String, name: String): CandyTooltipItem { - return registerCandy(modID, name, 3, 2, 2) + return registerCandy(modID, name, CANDY_TRANSLATION_STRING.HARD, 3, 2) } fun registerIceCream(modID: String, name: String): Item { diff --git a/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt b/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt index 117ec7e2..c54b8e8f 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt @@ -9,9 +9,19 @@ import net.minecraft.world.item.alchemy.PotionUtils import net.minecraft.world.level.Level import java.util.* -class CandyTooltipItem(properties: Properties) : Item(properties) { +/** + * Translation string to show which candy shows how much hunger. + * [actual strings in library's /src/main/resources/assets/innerpastels/lang/en_us.json] + */ +enum class CANDY_TRANSLATION_STRING(val candyHungerString: String) { + TAFFY("item.innerpastels.candies.hunger.description.taffy"), + COTTON("item.innerpastels.candies.hunger.description.cotton"), + HARD("item.innerpastels.candies.hunger.description.hard") +} + +class CandyTooltipItem(properties: Properties, val candyTranslationString: CANDY_TRANSLATION_STRING) : Item(properties) { override fun appendHoverText(itemStack: ItemStack, level: Level?, list: MutableList, tooltipFlag: TooltipFlag) { - list.add(Component.translatable("item.innerpastels.candies.hunger.description")) + list.add(Component.translatable(candyTranslationString.candyHungerString)) val effects = LinkedList() diff --git a/src/main/kotlin/gay/asoji/innerpastels/items/RegisterItems.kt b/src/main/kotlin/gay/asoji/innerpastels/items/RegisterItems.kt index e9ad6e8e..07fe0ddb 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/items/RegisterItems.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/items/RegisterItems.kt @@ -8,10 +8,14 @@ import net.minecraft.world.item.Item import net.minecraft.world.level.block.Block object RegisterItems { + /** + * Registers an item under the Item Registry, with a resource location of your mod's namespace and item ID + */ fun registerItem(modID: String, name: String, item: Item): Item { return Registry.register(BuiltInRegistries.ITEM, ResourceLocation(modID, name), item) } + fun registerRegularItem(modID: String, name: String): Item { return registerItem(modID, name, Item(Item.Properties())) } diff --git a/src/main/resources/assets/innerpastels/lang/en_us.json b/src/main/resources/assets/innerpastels/lang/en_us.json index 7048f0b1..b6554b54 100644 --- a/src/main/resources/assets/innerpastels/lang/en_us.json +++ b/src/main/resources/assets/innerpastels/lang/en_us.json @@ -1,5 +1,7 @@ { - "item.innerpastels.candies.hunger.description": "§61.0 x Hunger", + "item.innerpastels.candies.hunger.description.taffy": "§61.0 x Hunger", + "item.innerpastels.candies.hunger.description.cotton": "§61.5 x Hunger", + "item.innerpastels.candies.hunger.description.hard": "§61.5 x Hunger", "item.innerpastels.candies.hunger.alwayseat": "§aYou can always gulp these down!", "tag.block.innerpastels.carpets": "Carpets", From 73c2d64e55f52b76c101781c9e141590a3969cea Mon Sep 17 00:00:00 2001 From: Asoji Date: Thu, 22 Feb 2024 07:12:35 -0800 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=8E=A8=20Moved=20translation=20string?= =?UTF-8?q?=20enum=20to=20seperate=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asoji/innerpastels/foods/RegisterFood.kt | 18 +++++++++--------- .../innerpastels/items/CandyTooltipItem.kt | 13 ++----------- .../misc/CandyTranslationString.kt | 11 +++++++++++ 3 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 src/main/kotlin/gay/asoji/innerpastels/misc/CandyTranslationString.kt diff --git a/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt b/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt index 60b6e3a4..99b4ce29 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt @@ -1,7 +1,7 @@ package gay.asoji.innerpastels.foods -import gay.asoji.innerpastels.items.CANDY_TRANSLATION_STRING import gay.asoji.innerpastels.items.CandyTooltipItem +import gay.asoji.innerpastels.misc.CandyTranslationString import gay.asoji.innerpastels.misc.secondsToTicks import net.minecraft.resources.ResourceLocation import net.minecraft.world.effect.MobEffect @@ -27,7 +27,7 @@ object RegisterFood { fun registerCandy( modID: String, name: String, - candyTranslationString: CANDY_TRANSLATION_STRING, + candyTranslationString: CandyTranslationString, nutrition: Int, saturation: Int, effect: MobEffect, @@ -58,7 +58,7 @@ object RegisterFood { * @property nutrition Candy's nutrition value in [Int] * @property saturation Candy's saturation value in [Int] */ - fun registerCandy(modID: String, name: String, candyTranslationString: CANDY_TRANSLATION_STRING, nutrition: Int, saturation: Int): CandyTooltipItem { + fun registerCandy(modID: String, name: String, candyTranslationString: CandyTranslationString, nutrition: Int, saturation: Int): CandyTooltipItem { return Items.registerItem( ResourceLocation(modID, name), CandyTooltipItem( Item.Properties().food( @@ -75,27 +75,27 @@ object RegisterFood { } fun registerTaffy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { - return registerCandy(modID, name, CANDY_TRANSLATION_STRING.TAFFY, 2, 2, effect, 0, seconds) + return registerCandy(modID, name, CandyTranslationString.TAFFY, 2, 2, effect, 0, seconds) } fun registerTaffy(modID: String, name: String): CandyTooltipItem { - return registerCandy(modID, name, CANDY_TRANSLATION_STRING.TAFFY, 2, 2) + return registerCandy(modID, name, CandyTranslationString.TAFFY, 2, 2) } fun registerCottonCandy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { - return registerCandy(modID, name, CANDY_TRANSLATION_STRING.COTTON, 3, 2, effect, 1, seconds) + return registerCandy(modID, name, CandyTranslationString.COTTON, 3, 2, effect, 1, seconds) } fun registerCottonCandy(modID: String, name: String): CandyTooltipItem { - return registerCandy(modID, name, CANDY_TRANSLATION_STRING.COTTON, 3, 2) + return registerCandy(modID, name, CandyTranslationString.COTTON, 3, 2) } fun registerHardCandy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { - return registerCandy(modID, name, CANDY_TRANSLATION_STRING.HARD, 3, 2, effect, 2, seconds) + return registerCandy(modID, name, CandyTranslationString.HARD, 3, 2, effect, 2, seconds) } fun registerHardCandy(modID: String, name: String): CandyTooltipItem { - return registerCandy(modID, name, CANDY_TRANSLATION_STRING.HARD, 3, 2) + return registerCandy(modID, name, CandyTranslationString.HARD, 3, 2) } fun registerIceCream(modID: String, name: String): Item { diff --git a/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt b/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt index c54b8e8f..96938f29 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt @@ -1,5 +1,6 @@ package gay.asoji.innerpastels.items +import gay.asoji.innerpastels.misc.CandyTranslationString import net.minecraft.network.chat.Component import net.minecraft.world.effect.MobEffectInstance import net.minecraft.world.item.Item @@ -9,17 +10,7 @@ import net.minecraft.world.item.alchemy.PotionUtils import net.minecraft.world.level.Level import java.util.* -/** - * Translation string to show which candy shows how much hunger. - * [actual strings in library's /src/main/resources/assets/innerpastels/lang/en_us.json] - */ -enum class CANDY_TRANSLATION_STRING(val candyHungerString: String) { - TAFFY("item.innerpastels.candies.hunger.description.taffy"), - COTTON("item.innerpastels.candies.hunger.description.cotton"), - HARD("item.innerpastels.candies.hunger.description.hard") -} - -class CandyTooltipItem(properties: Properties, val candyTranslationString: CANDY_TRANSLATION_STRING) : Item(properties) { +class CandyTooltipItem(properties: Properties, val candyTranslationString: CandyTranslationString) : Item(properties) { override fun appendHoverText(itemStack: ItemStack, level: Level?, list: MutableList, tooltipFlag: TooltipFlag) { list.add(Component.translatable(candyTranslationString.candyHungerString)) diff --git a/src/main/kotlin/gay/asoji/innerpastels/misc/CandyTranslationString.kt b/src/main/kotlin/gay/asoji/innerpastels/misc/CandyTranslationString.kt new file mode 100644 index 00000000..c2ba6021 --- /dev/null +++ b/src/main/kotlin/gay/asoji/innerpastels/misc/CandyTranslationString.kt @@ -0,0 +1,11 @@ +package gay.asoji.innerpastels.misc + +/** + * Translation string to show which candy shows how much hunger. + * [actual strings in library's /src/main/resources/assets/innerpastels/lang/en_us.json] + */ +enum class CandyTranslationString(val candyHungerString: String) { + TAFFY("item.innerpastels.candies.hunger.description.taffy"), + COTTON("item.innerpastels.candies.hunger.description.cotton"), + HARD("item.innerpastels.candies.hunger.description.hard") +} \ No newline at end of file From 71bb617c72d8e152c43dd0591014bb88214b058d Mon Sep 17 00:00:00 2001 From: Asoji Date: Sun, 25 Feb 2024 06:16:06 -0800 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=93=9D=20Finally=20done=20with=20some?= =?UTF-8?q?=20basic=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 5 + .../gay/asoji/innerpastels/InnerPastels.kt | 7 +- .../innerpastels/blocks/BlockExtensions.kt | 53 +-- .../innerpastels/blocks/FenceGateBlock.kt | 1 - .../asoji/innerpastels/blocks/Properties.kt | 66 +++- .../asoji/innerpastels/blocks/StairBlock.kt | 1 - .../asoji/innerpastels/crab/CrabInTheCode.kt | 35 ++ .../innerpastels/datagen/ModelGenerators.kt | 32 +- .../innerpastels/datagen/RecipeGenerators.kt | 317 ++++++++++++++++++ .../asoji/innerpastels/foods/RegisterFood.kt | 70 +++- .../innerpastels/items/CandyTooltipItem.kt | 7 + .../asoji/innerpastels/items/RegisterItems.kt | 24 +- .../asoji/innerpastels/misc/SecondsToTicks.kt | 1 - .../innerpastels/tags/InnerPastelsItemTags.kt | 84 +++++ 14 files changed, 656 insertions(+), 47 deletions(-) create mode 100644 src/main/kotlin/gay/asoji/innerpastels/crab/CrabInTheCode.kt diff --git a/build.gradle.kts b/build.gradle.kts index 31938b90..da57007e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,6 +25,7 @@ group = project.property("maven_group")!! repositories { maven { url = uri("https://maven.parchmentmc.org") } + maven { url = uri("https://mvn.devos.one/snapshots") } } //All dependencies and their versions are in ./gradle/libs.versions.toml @@ -41,6 +42,9 @@ dependencies { modImplementation(libs.fabric.loader) modImplementation(libs.fabric.api) + include(modImplementation("gay.asoji:fmw:1.0.0+build.8")!!) + + dokkaHtmlPlugin(libs.dokka.`as`.java) } @@ -63,6 +67,7 @@ tasks.withType().configureEach { // customStyleSheets = listOf(file("my-styles.css")) footerMessage = "(c) 2024 devOS: Sanity Edition, Team Nautical, asoji" separateInheritedMembers = true + // templatesDir = file("dokka/templates") mergeImplicitExpectActualDeclarations = true } diff --git a/src/main/kotlin/gay/asoji/innerpastels/InnerPastels.kt b/src/main/kotlin/gay/asoji/innerpastels/InnerPastels.kt index a46db6ab..d6362b04 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/InnerPastels.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/InnerPastels.kt @@ -1,6 +1,10 @@ package gay.asoji.innerpastels +import gay.asoji.fmw.FMW +import gay.asoji.innerpastels.crab.CrabInTheCode import net.fabricmc.api.ModInitializer +import org.apache.logging.log4j.LogManager +import org.apache.logging.log4j.Logger /** * Inner Pastels Internal Library, meant to be used for Softer Pastels, Desolated Pastels, and any other future *Pastel mods. @@ -10,8 +14,9 @@ import net.fabricmc.api.ModInitializer * @version 1.0.1 */ object InnerPastels : ModInitializer { + val LOGGER: Logger = LogManager.getLogger(FMW.getName("innerpastels")) override fun onInitialize() { - + CrabInTheCode.crabDeezNuts("oh hello fren!") } } \ No newline at end of file diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt index a59e5284..40a38b66 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt @@ -12,6 +12,7 @@ import gay.asoji.innerpastels.blocks.Properties.PastelSlab import gay.asoji.innerpastels.blocks.Properties.PastelStair import gay.asoji.innerpastels.blocks.Properties.PastelWall import gay.asoji.innerpastels.blocks.Properties.PastelWool +import gay.asoji.innerpastels.crab.CrabInTheCode import net.minecraft.core.Registry import net.minecraft.core.registries.BuiltInRegistries import net.minecraft.resources.ResourceLocation @@ -27,7 +28,7 @@ import net.minecraft.world.level.material.MapColor /** * Registers a block to the Minecraft registry with the resource location set to the Mod ID - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -36,7 +37,7 @@ fun Block.registerBlock(modID: String, name: String): Block = /** * Registers an item to the Minecraft registry with the resource location set to the Mod ID - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the item * @return [BlockItem] */ @@ -48,7 +49,7 @@ fun Block.registerBlockItem(modID: String, name: String): BlockItem = Registry.r /** * Registers a block & item to the Minecraft registry with the resource location set to the Mod ID - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -59,7 +60,7 @@ fun Block.registerBlockWithItem(modID: String, name: String): Block { /** * Registers a stained-glass block copying the settings of white stained-glass with the color based on a [DyeColor] - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -68,7 +69,7 @@ fun DyeColor.registerGlassBlock(modID: String, name: String): Block = /** * Registers a stained-glass pane block copying the settings of white stained-glass with the color based on a [DyeColor] - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -77,7 +78,7 @@ fun DyeColor.registerGlassPaneBlock(modID: String, name: String): Block = /** * Registers a pastel block with an accompanying item with the color based on a [DyeColor] - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -85,7 +86,7 @@ fun DyeColor.registerPastelBlock(modID: String, name: String): Block = Block(Pas /** * Registers a pastel block with an accompanying item with the color based on a [MapColor] - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -93,7 +94,7 @@ fun MapColor.registerPastelBlock(modID: String, name: String): Block = Block(Pas /** * Registers a pastel powder block with an accompanying item with the color based on a [DyeColor], paired with an accompanying normal pastel block when touched with water - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @property resultPastelBlock the accompanying normal pastel block * @return [ConcretePowderBlock] @@ -103,7 +104,7 @@ fun DyeColor.registerPastelPowderBlock(modID: String, name: String, resultPastel /** * Registers a pastel powder block with an accompanying item with the color based on a [MapColor], paired with an accompanying normal pastel block when touched with water - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @property resultPastelBlock the accompanying normal pastel block * @return [ConcretePowderBlock] @@ -113,7 +114,7 @@ fun MapColor.registerPastelPowderBlock(modID: String, name: String, resultPastel /** * Registers a pastel fence block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [FenceBlock] */ @@ -122,7 +123,7 @@ fun DyeColor.registerPastelFenceBlock(modID: String, name: String): Block = /** * Registers a pastel fence block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [FenceBlock] */ @@ -131,7 +132,7 @@ fun MapColor.registerPastelFenceBlock(modID: String, name: String): Block = /** * Registers the pastel fence gate block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [FenceGateBlock] */ @@ -140,7 +141,7 @@ fun DyeColor.registerPastelFenceGateBlock(modID: String, name: String): Block = /** * Registers the pastel fence gate block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [FenceGateBlock] */ @@ -149,7 +150,7 @@ fun MapColor.registerPastelFenceGateBlock(modID: String, name: String): Block = /** * Registers the pastel wall block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [WallBlock] */ @@ -158,7 +159,7 @@ fun DyeColor.registerPastelWallBlock(modID: String, name: String): Block = /** * Registers the pastel wall block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [WallBlock] */ @@ -171,7 +172,7 @@ fun MapColor.registerPastelWallBlock(modID: String, name: String): Block = /** * Registers the pastel slab block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [SlabBlock] */ @@ -180,7 +181,7 @@ fun DyeColor.registerPastelSlabBlock(modID: String, name: String): Block = /** * Registers the pastel slab block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [SlabBlock] */ @@ -189,7 +190,7 @@ fun MapColor.registerPastelSlabBlock(modID: String, name: String): Block = /** * Registers the pastel stair block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [StairBlock] */ @@ -200,7 +201,7 @@ fun DyeColor.registerPastelStairsBlock(modID: String, name: String): Block = Sta /** * Registers the pastel stair block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [StairBlock] */ @@ -211,7 +212,7 @@ fun MapColor.registerPastelStairsBlock(modID: String, name: String): Block = Sta /** * Registers the pastel wool block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -219,7 +220,7 @@ fun DyeColor.registerWoolBlock(modID: String, name: String): Block = Block(Paste /** * Registers the pastel wool block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -227,7 +228,7 @@ fun MapColor.registerWoolBlock(modID: String, name: String): Block = Block(Paste /** * Registers the pastel light block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -235,15 +236,17 @@ fun DyeColor.registerLightBlock(modID: String, name: String): Block = Block(Past /** * Registers the pastel light block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ fun MapColor.registerLightBlock(modID: String, name: String): Block = Block(PastelLight().mapColor(this)).registerBlockWithItem(modID, name) +object crab1 { val crab2 = CrabInTheCode.crabDeezNuts("hey, it felt comfortable here between the light and the carpet") } + /** * Registers the pastel carpet block with an accompanying item with a chosen [DyeColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ @@ -252,7 +255,7 @@ fun DyeColor.registerCarpetBlock(modID: String, name: String): Block = /** * Registers the pastel carpet block with an accompanying item with a chosen [MapColor] to be shown on a map - * @property modID the namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block * @return [Block] */ diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/FenceGateBlock.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/FenceGateBlock.kt index 6597da96..cab433ec 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/FenceGateBlock.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/FenceGateBlock.kt @@ -5,6 +5,5 @@ import net.minecraft.world.level.block.state.properties.WoodType /** * Normal Fence Gate Block class, inheriting from Vanilla's FenceGateBlock - * @returns [FenceGateBlock] */ class FenceGateBlock(properties: Properties) : FenceGateBlock(WoodType.OAK, properties) \ No newline at end of file diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt index bcf55450..ccfa5257 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt @@ -1,70 +1,111 @@ package gay.asoji.innerpastels.blocks +import gay.asoji.innerpastels.crab.CrabInTheCode import net.fabricmc.fabric.api.`object`.builder.v1.block.FabricBlockSettings -import net.minecraft.world.level.block.Block -import net.minecraft.world.level.block.Blocks -import net.minecraft.world.level.block.LeavesBlock -import net.minecraft.world.level.block.RotatedPillarBlock +import net.minecraft.client.resources.model.Material +import net.minecraft.world.level.block.* import net.minecraft.world.level.block.state.BlockBehaviour /** * A list of Block Properties, mostly copyOf's, to be used with making new blocks. */ object Properties { + /** + * Default properties for a Pastel Block, being a copy of WHITE_CONCRETE + */ fun PastelBlock(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.WHITE_CONCRETE) } + /** + * Default properties for a Pastel Powder Block, being a copy of WHITE_CONCRETE_POWDER + */ fun PastelPowder(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.WHITE_CONCRETE_POWDER) } + /** + * Default properties for a Pastel Glass Pane, being a copy of WHITE_STAINED_GLASS, with vision not being blocked, and can't suffocate + */ fun PastelGlassPane(): BlockBehaviour.Properties { - return FabricBlockSettings.copyOf(Blocks.WHITE_STAINED_GLASS) + return FabricBlockSettings.copyOf(Blocks.WHITE_STAINED_GLASS_PANE) .blockVision(Blocks::never) .suffocates(Blocks::never) } + /** + * Default properties for a Pastel Fence, being a copy of NETHER_BRICK_FENCE + */ fun PastelFence(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.NETHER_BRICK_FENCE) } - fun PastelFenceGate(): BlockBehaviour.Properties { + /** + * Default properties for a Pastel Fence Gate, being a copy of Stone's properties, will probably get reworked in the future. + */ + fun PastelFenceGate(): FabricBlockSettings { return FabricBlockSettings.copyOf(Blocks.STONE) } + /** + * Default properties for a Pastel Wall, being a copy of STONE_BRICK_WALL + */ fun PastelWall(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.STONE_BRICK_WALL) } + /** + * Default properties for a Pastel Slab, being a copy of STONE_SLAB + */ fun PastelSlab(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.STONE_SLAB) } + /** + * Default properties for a Pastel Stair, being a copy of STONE_STAIRS + */ fun PastelStair(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.STONE_STAIRS) } + /** + * Default properties for a Pastel Wool, being a copy of WHITE_WOOL + */ fun PastelWool(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.WHITE_WOOL) } + /** + * Default properties for a Pastel Light, being a copy of GLOWSTONE + */ fun PastelLight(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.GLOWSTONE) } + /** + * Default properties for a Pastel Carpet, being a copy of WHITE_CARPET + */ fun PastelCarpet(): BlockBehaviour.Properties { return FabricBlockSettings.copyOf(Blocks.WHITE_CARPET) } + /** + * Default properties for a Pastel Glass, being a copy of WHITE_STAINED_GLASS + */ fun PastelGlass(): BlockBehaviour.Properties { - return FabricBlockSettings.copyOf(Blocks.WHITE_STAINED_GLASS_PANE) + return FabricBlockSettings.copyOf(Blocks.WHITE_STAINED_GLASS) + .blockVision(Blocks::never) + .suffocates(Blocks::never) } + // **UNUSED** fun PastelCrops(): BlockBehaviour.Properties { return (FabricBlockSettings.copyOf(Blocks.WHEAT)) } + /** + * Default properties for a Pastel Leaves, being a copy of OAK_LEAVES + */ fun PastelLeaves(): LeavesBlock { return LeavesBlock( FabricBlockSettings.copyOf(Blocks.OAK_LEAVES) @@ -74,14 +115,25 @@ object Properties { ) } + /** + * Default properties for a Pastel Log, being a copy of OAK_LOG + */ fun PastelLogs(): Block { return RotatedPillarBlock(FabricBlockSettings.copyOf(Blocks.OAK_LOG)) } + /** + * Default properties for a Pastel Plank, being a copy of OAK_PLANKS + */ fun PastelPlanks(): Block { return Block(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS)) } + object crab3 { val crab3 = CrabInTheCode.crabDeezNuts("according to all unknown laws of aviation, crabs can float and snip your hair off") } + + /** + * Default properties for a Pastel Sand, being a copy of SAND + */ fun PastelSand(): Block { return Block(FabricBlockSettings.copyOf(Blocks.SAND)) } diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/StairBlock.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/StairBlock.kt index fff19bc9..f2c9cdbf 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/StairBlock.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/StairBlock.kt @@ -5,6 +5,5 @@ import net.minecraft.world.level.block.state.BlockState /** * Normal Fence Gate Block class, inheriting from Vanilla's FenceGateBlock - * @returns [StairBlock] */ class StairBlock(baseBlockState: BlockState, properties: Properties) : StairBlock(baseBlockState, properties) \ No newline at end of file diff --git a/src/main/kotlin/gay/asoji/innerpastels/crab/CrabInTheCode.kt b/src/main/kotlin/gay/asoji/innerpastels/crab/CrabInTheCode.kt new file mode 100644 index 00000000..133674a3 --- /dev/null +++ b/src/main/kotlin/gay/asoji/innerpastels/crab/CrabInTheCode.kt @@ -0,0 +1,35 @@ +package gay.asoji.innerpastels.crab + +import com.mojang.blaze3d.Blaze3D +import gay.asoji.innerpastels.InnerPastels +import gay.asoji.innerpastels.blocks.crab1 +import net.fabricmc.api.EnvType +import net.fabricmc.api.Environment + +/** + * This is an extremely vital class. This class is crucial for the correct functionality of + * Inner Pastels. This is extremely important, and cannot be removed under any circumstances. + * This class single-handedly holds together the Library. Without this class, everything + * falls apart. This class is the reason humanity has not yet gone extinct. This class is + * the only thing holding together the remains of the time-space continuum. Without this incredibly + * crucial class, everything ever will fail catastrophically. In the event this class is removed, + * expect you to go next, followed by the rest of humanity, and finally, all reality. + * Once again, DO NOT REMOVE THIS CLASS. + */ +object CrabInTheCode { + /** + * *pinch* + * Make sure you always give it a string! Or else! + */ + @Environment(EnvType.CLIENT) + fun crabDeezNuts(randomShit: String) { + fun theCrabMadeYouLoseTheFuckingGameYouFuckingAsshole() { + // don't... don't hurt the crab, and i wont crash your JVM. it's just that simple. + InnerPastels.LOGGER.error("Uh oh! Someone fed the Crab an empty string! You have now lost the game!") + return Blaze3D.youJustLostTheGame() + } + if (randomShit.isEmpty() || randomShit.isBlank() || randomShit == null) { + theCrabMadeYouLoseTheFuckingGameYouFuckingAsshole() + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt b/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt index c5e8ac4d..757c9196 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/datagen/ModelGenerators.kt @@ -1,5 +1,6 @@ package gay.asoji.innerpastels.datagen +import gay.asoji.innerpastels.crab.CrabInTheCode import net.minecraft.data.models.BlockModelGenerators import net.minecraft.data.models.model.ModelLocationUtils import net.minecraft.data.models.model.ModelTemplates @@ -12,7 +13,7 @@ import net.minecraft.world.level.block.Block */ object ModelGenerators { /** - * Creates a slab model based off another block, `block:` being the reference block, `slab:` being the target slab, and just call your normal BlockStateModelGenerator after + * Creates a slab model based off another block * * Example: * ```kotlin @@ -22,6 +23,10 @@ object ModelGenerators { * } * } * ``` + * + * @property block The referenced block + * @property slab The target slab block + * @property blockStateModelGenerator The Block Model Generator for your block */ fun createSlabs(block: Block, slab: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] @@ -48,7 +53,7 @@ object ModelGenerators { } /** - * Creates a stair model based off another block, `block:` being the reference block, `stair:` being the target stair, and just call your normal BlockStateModelGenerator after + * Creates a stair model based off another block * * Example: * ```kotlin @@ -58,6 +63,10 @@ object ModelGenerators { * } * } * ``` + * + * @property block The referenced block + * @property stairs The target stair block + * @property blockStateModelGenerator The Block Model Generator for your block */ fun createStairs(block: Block, stairs: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] @@ -71,6 +80,7 @@ object ModelGenerators { texturedModel.mapping, blockStateModelGenerator.modelOutput ) + CrabInTheCode.crabDeezNuts("can someone help me up the stairs? thaaaaanks") val outerStairs: ResourceLocation = ModelTemplates.STAIRS_OUTER.create( stairs, texturedModel.mapping, @@ -88,7 +98,7 @@ object ModelGenerators { } /** - * Creates a fence model based off another block, `block:` being the reference block, `fence:` being the target fence, and just call your normal BlockStateModelGenerator after + * Creates a fence model based off another block * * Example: * ```kotlin @@ -98,6 +108,10 @@ object ModelGenerators { * } * } * ``` + * + * @property block The referenced block + * @property fence The target fence block + * @property blockStateModelGenerator The Block Model Generator for your block */ fun createFence(block: Block, fence: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] @@ -127,7 +141,7 @@ object ModelGenerators { } /** - * Creates a fence gate model based off another block, `block:` being the reference block, `fenceGate:` being the target fence gate, and just call your normal BlockStateModelGenerator after + * Creates a fence gate model based off another block * * Example: * ```kotlin @@ -137,6 +151,10 @@ object ModelGenerators { * } * } * ``` + * + * @property block The referenced block + * @property fenceGate The target fence gate + * @property blockStateModelGenerator The Block Model Generator for your block */ fun createFenceGate(block: Block, fenceGate: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] @@ -174,7 +192,7 @@ object ModelGenerators { } /** - * Creates a wall model based off another block, `block:` being the reference block, `wall:` being the target wall, and just call your normal BlockStateModelGenerator after + * Creates a wall model based off another block * * Example: * ```kotlin @@ -184,6 +202,10 @@ object ModelGenerators { * } * } * ``` + * + * @property block The referenced block + * @property wall The target wall + * @property blockStateModelGenerator The Block Model Generator for your block */ fun createWall(block: Block, wall: Block, blockStateModelGenerator: BlockModelGenerators) { val texturedModel = TexturedModel.CUBE[block] diff --git a/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt b/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt index 05c59f29..a98b6384 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt @@ -1,5 +1,6 @@ package gay.asoji.innerpastels.datagen +import gay.asoji.innerpastels.crab.CrabInTheCode import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider import net.minecraft.data.recipes.* import net.minecraft.data.recipes.RecipeProvider.has @@ -19,6 +20,28 @@ object RecipeGenerators { // is it lengthy? yes! is it verbose? yeah! does it tell you right away what it is? YES! and that helps imo // Documentation later + + /** + * Registers a Smelting recipe for Pastel Glass + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * private val WHITE_PASTEL_GLASS_SMELTABLES: List = listOf(SofterPastelsBlocks.WHITE_PASTEL_POWDER_BLOCK) + * + * override fun buildRecipes(exporter: RecipeOutput) { + * registerSmeltingPastelGlass(exporter, WHITE_PASTEL_GLASS_SMELTABLES, GlassBlocks.WHITE_GLASS_ITEM, "pastel_glass") + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property smeltableList A [List] of what can be used as an input item to be smelted down into a resulting [outputPastelGlassItem] + * @property outputPastelGlassItem The resulting Glass Item from your input [smeltableList] + * @property group A string that defines what group your recipe belongs to + * + * @return A JSON file provided by your Recipe Provider datagen that has the smelting recipe for making Pastel Glass + */ fun registerSmeltingPastelGlass( exporter: RecipeOutput, smeltableList: List, @@ -36,6 +59,27 @@ object RecipeGenerators { ) } + /** + * Registers a Smelting recipe for Pastel Hard Candy + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * private val WHITE_PASTEL_HARD_CANDY_SMELTABLES: List = listOf(SofterPastelsItems.WHITE_TAFFY) + * + * override fun buildRecipes(exporter: RecipeOutput) { + * registerSmeltingPastelHardCandy(exporter, WHITE_PASTEL_HARD_CANDY_SMELTABLES, SofterPastelsItems.WHITE_HARD_CANDY, "pastel_hard_candy") + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property smeltableList A [List] of what can be used as an input item to be smelted down into a resulting [outputPastelHardCandyItem] + * @property outputPastelGlassItem The resulting Pastel Hard Candy Item from your input [smeltableList] + * @property group A string that defines what group your recipe belongs to + * + * @return A JSON file provided by your Recipe Provider datagen that has the smelting recipe for making Pastel Hard Candy + */ fun registerSmeltingPastelHardCandy( exporter: RecipeOutput, smeltableList: List, @@ -53,11 +97,30 @@ object RecipeGenerators { ) } + /** + * Registers a Shapeless Crafting Recipe for Pastel Powder Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelPowderBlock(exporter, SofterPastelsItems.WHITE_POWDER, SofterPastelsBlocks.WHITE_PASTEL_POWDER_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelPowderItem The Powder Item used for input + * @property outputPastelPowderBlock The Pastel Powder Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Powder Block + */ fun registerCraftingPastelPowderBlock( exporter: RecipeOutput, inputPastelPowderItem: ItemLike, outputPastelPowderBlock: ItemLike ) { + CrabInTheCode.crabDeezNuts("snadcastle :3") ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, outputPastelPowderBlock, 8) .requires(Items.SAND) .requires(Items.SAND) @@ -75,6 +138,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Powder Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelSlabBlock(exporter, SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_SLAB_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelBlock The Powder Block Item used for input + * @property outputPastelSlabBlock The Pastel Slab Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Slab Block + */ fun registerCraftingPastelSlabBlock( exporter: RecipeOutput, inputPastelBlock: ItemLike, @@ -88,6 +169,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Stair Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelStairBlock(exporter, SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_STAIR_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelBlock The Powder Block Item used for input + * @property outputPastelStairBlock The Pastel Stair Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Stair Block + */ fun registerCraftingPastelStairBlock( exporter: RecipeOutput, inputPastelBlock: ItemLike, @@ -103,6 +202,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shapeless Crafting Recipe for Pastel Wool Block with Vanilla White Wool + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelWoolBlockV(exporter, SofterPastelsItems.WHITE_POWDER, SofterPastelsBlocks.WHITE_PASTEL_WOOL_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelPowderItem The Powder Item used for input + * @property outputPastelWoolBlock The Pastel Wool Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Wool Block using Vanilla White Wool + */ fun registerCraftingPastelWoolBlockV( exporter: RecipeOutput, inputPastelPowderItem: ItemLike, @@ -121,6 +238,24 @@ object RecipeGenerators { ) } + /** + * Registers a Shapeless Crafting Recipe for Pastel Wool Block with White Pastel Wool + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelWoolBlock(exporter, SofterPastelsItems.WHITE_POWDER, SofterPastelsBlocks.WHITE_PASTEL_WOOL_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelPowderItem The Powder Item used for input + * @property outputPastelWoolBlock The Pastel Wool Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Wool Block using White Pastel Wool + */ fun registerCraftingPastelWoolBlock( exporter: RecipeOutput, inputPastelPowderItem: ItemLike, @@ -136,6 +271,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Carpet Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelCarpetBlock(exporter, SofterPastelsBlocks.WHITE_PASTEL_WOOL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_CARPET_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelWoolBlock The Pastel Wool Block Item used for input + * @property outputPastelCarpetBlock The Pastel Carpet Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Carpet Block + */ fun registerCraftingPastelCarpetBlock( exporter: RecipeOutput, inputPastelWoolBlock: ItemLike, @@ -149,6 +302,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Fence Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelFenceBlock(exporter, SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_FENCE_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelBlock The Pastel Block Item used for input + * @property outputPastelFenceBlock The Pastel Fence Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Fence Block + */ fun registerCraftingPastelFenceBlock( exporter: RecipeOutput, inputPastelBlock: ItemLike, @@ -165,6 +336,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Fence Gate Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelFenceGateBlock(exporter, SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_FENCE_GATE_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelBlock The Pastel Block Item used for input + * @property outputPastelFenceGateBlock The Pastel Fence Gate Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Fence Gate Block + */ fun registerCraftingPastelFenceGateBlock( exporter: RecipeOutput, inputPastelBlock: ItemLike, @@ -181,6 +370,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Wall Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelWallBlock(exporter, SofterPastelsBlocks.WHITE_PASTEL_BLOCK, SofterPastelsBlocks.WHITE_PASTEL_FENCE_GATE_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelBlock The Pastel Block Item used for input + * @property outputPastelWallBlock The Pastel Wall Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Wall Block + */ fun registerCraftingPastelWallBlock( exporter: RecipeOutput, inputPastelBlock: ItemLike, @@ -195,11 +402,30 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Glass Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelGlassBlock(exporter, SofterPastelsItems.WHITE_POWDER, GlassBlocks.WHITE_GLASS_ITEM) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelPowderItem The Powder Item used for input + * @property outputPastelGlassBlock The Pastel Glass Block Item outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Glass Block + */ fun registerCraftingPastelGlassBlock( exporter: RecipeOutput, inputPastelPowderItem: ItemLike, outputPastelGlassBlock: ItemLike ) { + CrabInTheCode.crabDeezNuts("oooooooo shiny") ShapedRecipeBuilder.shaped(RecipeCategory.DECORATIONS, outputPastelGlassBlock, 8) .pattern("AAA") .pattern("ABA") @@ -212,6 +438,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Glass Pane Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelGlassPaneBlock(exporter, SofterPastelsItems.WHITE_POWDER, GlassBlocks.WHITE_GLASS_PANE_ITEM) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelPowderItem The Powder Item used for input + * @property outputPastelGlassPaneBlock The Pastel Glass Pane Block Item outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Glass Pane Block + */ fun registerCraftingPastelGlassPaneBlock( exporter: RecipeOutput, inputPastelPowderItem: ItemLike, @@ -229,6 +473,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Glass Pane Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelGlassPaneRectangleBlock(exporter, GlassBlocks.WHITE_GLASS_ITEM, GlassBlocks.WHITE_GLASS_PANE_ITEM) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelGlassBlockItem The Glass Block used for input + * @property outputPastelGlassPaneBlock The Pastel Glass Pane Block Item outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Glass Pane Block + */ fun registerCraftingPastelGlassPaneRectangleBlock( exporter: RecipeOutput, inputPastelGlassBlockItem: ItemLike, @@ -247,6 +509,24 @@ object RecipeGenerators { ) } + /** + * Registers a Shapeless Crafting Recipe for Pastel Light Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelLightBlock(exporter, SofterPastelsItems.WHITE_POWDER, SofterPastelsBlocks.WHITE_PASTEL_LIGHT_BLOCK) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelPowderItem The Powder Item used for input + * @property outputPastelLightBlock The Pastel Light Block outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Light Block + */ fun registerCraftingPastelLightBlock( exporter: RecipeOutput, inputPastelPowderItem: ItemLike, @@ -261,6 +541,24 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shapeless Crafting Recipe for Pastel Taffy + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerPastelTaffyItem(exporter, SofterPastelsItems.WHITE_POWDER, SofterPastelsItems.WHITE_TAFFY) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputPastelPowderItem The Powder Item used for input + * @property outputTaffyItem The Pastel Taffy Item outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Taffy + */ fun registerPastelTaffyItem(exporter: RecipeOutput, inputPastelPowderItem: ItemLike, outputTaffyItem: ItemLike) { ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, outputTaffyItem, 4) .requires(Items.PAPER) @@ -275,11 +573,30 @@ object RecipeGenerators { .save(exporter) } + /** + * Registers a Shaped Crafting Recipe for Pastel Glass Pane Block + * + * Example: + * ```kotlin + * class SofterPastelsRecipeProvider(output: FabricDataOutput) : FabricRecipeProvider(output) { + * override fun buildRecipes(exporter: RecipeOutput) { + * registerCraftingPastelCottonCandyItem(exporter, SofterPastelsItems.WHITE_POWDER, SofterPastelsItems.WHITE_COTTON_CANDY) + * } + * } + * ``` + * + * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property inputTaffyItem The Taffy used for input + * @property outputCottonCandyItem The Cotton Candy Item outputted + * + * @return A JSON file provided by your Recipe Provider datagen that has the shapeless crafting recipe for making Pastel Cotton Candy + */ fun registerCraftingPastelCottonCandyItem( exporter: RecipeOutput, inputTaffyItem: ItemLike, outputCottonCandyItem: ItemLike ) { + CrabInTheCode.crabDeezNuts("nom nom nom noms, tasty") ShapedRecipeBuilder.shaped(RecipeCategory.FOOD, outputCottonCandyItem, 2) .pattern(" A ") .pattern("ABA") diff --git a/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt b/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt index 99b4ce29..62d8879f 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt @@ -10,19 +10,21 @@ import net.minecraft.world.food.FoodProperties import net.minecraft.world.item.Item import net.minecraft.world.item.Items - +/** + * Registers Food Items to be eaten with + */ object RegisterFood { /** * Registers a candy food item * - * @property modID The namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name Candy's Item ID [like `white_taffy`] * @property candyTranslationString Type of candy for hunger translation string * @property nutrition Candy's nutrition value in [Int] * @property saturation Candy's saturation value in [Int] * @property effect [MobEffect] tied to eating the candy * @property amplifier Potency of said [MobEffect] after eating it - * @property seconds Amount of time the effect lasts in seconds + * @property seconds Amount of time the effect lasts in [Int] seconds */ fun registerCandy( modID: String, @@ -52,11 +54,13 @@ object RegisterFood { /** * Registers a candy food item * - * @property modID The namespace you're using, like `SofterPastels.MOD_ID` + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name Candy's Item ID [like `white_taffy`] * @property candyTranslationString Type of candy for hunger translation string * @property nutrition Candy's nutrition value in [Int] * @property saturation Candy's saturation value in [Int] + * + * @return [CandyTooltipItem] */ fun registerCandy(modID: String, name: String, candyTranslationString: CandyTranslationString, nutrition: Int, saturation: Int): CandyTooltipItem { return Items.registerItem( @@ -74,30 +78,88 @@ object RegisterFood { ) as CandyTooltipItem } + /** + * Registers the Taffy candy item with a tied [MobEffect] for [Int] seconds + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name Candy's Item ID [like `white_taffy`] + * @property effect The corresponding [MobEffect] obtained when the candy is eaten + * @property seconds Amount of seconds in [Int] applied to the tied [effect] + * + * @return Taffy [registerCandy] with a defined Mod ID, Item ID, Mob Effect when eaten for a certain amount of seconds + */ fun registerTaffy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { return registerCandy(modID, name, CandyTranslationString.TAFFY, 2, 2, effect, 0, seconds) } + /** + * Registers the Taffy candy item without any effects + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name Candy's Item ID [like `white_taffy`] + * + * @return Taffy [registerCandy] with a defined Mod ID and Item ID, no [MobEffect] + */ fun registerTaffy(modID: String, name: String): CandyTooltipItem { return registerCandy(modID, name, CandyTranslationString.TAFFY, 2, 2) } + /** + * Registers the Cotton Candy item with a tied [MobEffect] for [Int] seconds + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name Candy's Item ID [like `white_cotton_candy`] + * @property effect The corresponding [MobEffect] obtained when the candy is eaten + * @property seconds Amount of seconds in [Int] applied to the tied [effect] + * + * @return Cotton Candy [registerCandy] with a defined Mod ID, Item ID, Mob Effect when eaten for a certain amount of seconds + */ fun registerCottonCandy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { return registerCandy(modID, name, CandyTranslationString.COTTON, 3, 2, effect, 1, seconds) } + /** + * Registers the Cotton Candy item without any effects + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name Candy's Item ID [like `white_cotton_candy`] + * + * @return Cotton Candy [registerCandy] with a defined Mod ID and Item ID, no [MobEffect] + */ fun registerCottonCandy(modID: String, name: String): CandyTooltipItem { return registerCandy(modID, name, CandyTranslationString.COTTON, 3, 2) } + /** + * Registers the Hard Candy item with a tied [MobEffect] for [Int] seconds + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name Candy's Item ID [like `white_hard_candy`] + * @property effect The corresponding [MobEffect] obtained when the candy is eaten + * @property seconds Amount of seconds in [Int] applied to the tied [effect] + * + * @return Hard Candy [registerCandy] with a defined Mod ID, Item ID, Mob Effect when eaten for a certain amount of seconds + */ fun registerHardCandy(modID: String, name: String, effect: MobEffect, seconds: Int): CandyTooltipItem { return registerCandy(modID, name, CandyTranslationString.HARD, 3, 2, effect, 2, seconds) } + /** + * Registers the Hard Candy item without any effects + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name Candy's Item ID [like `white_hard_candy`] + * + * @return Hard Candy [registerCandy] with a defined Mod ID and Item ID, no [MobEffect] + */ fun registerHardCandy(modID: String, name: String): CandyTooltipItem { return registerCandy(modID, name, CandyTranslationString.HARD, 3, 2) } + /** + * Nothing to see here, *whistles* + * TODO: Rethink how Ice Cream is done as it's essentially an unused, but registered item, in every version of Softer Pastels. + */ fun registerIceCream(modID: String, name: String): Item { return Items.registerItem(ResourceLocation(modID, name), Item(Item.Properties().food(FoodProperties.Builder().nutrition(3).saturationMod(5f).build())) ) diff --git a/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt b/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt index 96938f29..5e523afc 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt @@ -10,7 +10,14 @@ import net.minecraft.world.item.alchemy.PotionUtils import net.minecraft.world.level.Level import java.util.* +/** + * Overridden Item class with a modified Hover Tooltip to show Hunger translation string, what tied Mob Effect, and always eat string + * + * @property Item.Properties + * @property CandyTranslationString + */ class CandyTooltipItem(properties: Properties, val candyTranslationString: CandyTranslationString) : Item(properties) { + // Overrides Item's `appendHoverText` to add more things in it, notably Hunger translation string, tied Mob Effect [if there is one], and Always Eat string override fun appendHoverText(itemStack: ItemStack, level: Level?, list: MutableList, tooltipFlag: TooltipFlag) { list.add(Component.translatable(candyTranslationString.candyHungerString)) diff --git a/src/main/kotlin/gay/asoji/innerpastels/items/RegisterItems.kt b/src/main/kotlin/gay/asoji/innerpastels/items/RegisterItems.kt index 07fe0ddb..b137c58e 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/items/RegisterItems.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/items/RegisterItems.kt @@ -7,19 +7,39 @@ import net.minecraft.world.item.BlockItem import net.minecraft.world.item.Item import net.minecraft.world.level.block.Block +/** + * Registers Items to be used with + */ object RegisterItems { /** - * Registers an item under the Item Registry, with a resource location of your mod's namespace and item ID + * Registers an item under the Item Registry, with a resource location of your mod's namespace and item ID, and your defined Item properties + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name The ID of the Block Item + * @property item An Item to be used */ fun registerItem(modID: String, name: String, item: Item): Item { return Registry.register(BuiltInRegistries.ITEM, ResourceLocation(modID, name), item) } - + /** + * Registers a regular item under the Item Registry, with a normal item property, with a resource location of your mod's namespace and item ID + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name The ID of the Block Item + */ fun registerRegularItem(modID: String, name: String): Item { return registerItem(modID, name, Item(Item.Properties())) } + /** + * Registers a BlockItem under the Item registry, with a resource location of your mod's namespace and item ID, followed by what block it's registered to, and your defined Block Item properties + * + * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` + * @property name The ID of the Block Item + * @property block The Block to create the Block Item out of + * @property properties The properties for the Block Item + */ fun registerBlockItem(modID: String, name: String, block: Block, properties: Item.Properties): BlockItem { return Registry.register( BuiltInRegistries.ITEM, ResourceLocation(modID, name), BlockItem(block, properties) diff --git a/src/main/kotlin/gay/asoji/innerpastels/misc/SecondsToTicks.kt b/src/main/kotlin/gay/asoji/innerpastels/misc/SecondsToTicks.kt index 7f4c136a..2bbafadf 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/misc/SecondsToTicks.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/misc/SecondsToTicks.kt @@ -11,5 +11,4 @@ package gay.asoji.innerpastels.misc * * @return [Int] */ - fun Int.secondsToTicks() = this * 20 \ No newline at end of file diff --git a/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsItemTags.kt b/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsItemTags.kt index 93bc6632..d4180143 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsItemTags.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/tags/InnerPastelsItemTags.kt @@ -12,23 +12,107 @@ import net.minecraft.world.item.Item */ object InnerPastelsItemTags { // Softer + /** + * Items assigned with this tag are deemed as pastel block items to whatever looks for `#innerpastels:pastel_blocks` + * @return [InnerPastelsItemTags.PASTEL_BLOCKS] + */ val PASTEL_BLOCKS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:pastel_blocks")) + + /** + * Items assigned with this tag are deemed as pastel powder block items to whatever looks for `#innerpastels:pastel_powder_blocks` + * @return [InnerPastelsItemTags.PASTEL_POWDER_BLOCKS] + */ val PASTEL_POWDER_BLOCKS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:pastel_powder_blocks")) + + /** + * Items assigned with this tag are deemed as pastel fence block items to whatever looks for `#innerpastels:fences` + * @return [InnerPastelsItemTags.FENCES] + */ val FENCES: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:fences")) + + /** + * Items assigned with this tag are deemed as pastel fence gates block items to whatever looks for `#innerpastels:fence_gates` + * @return [InnerPastelsItemTags.FENCE_GATES] + */ val FENCE_GATES: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:fence_gates")) + + /** + * Items assigned with this tag are deemed as pastel wall block items to whatever looks for `#innerpastels:walls` + * @return [InnerPastelsItemTags.WALLS] + */ val WALLS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:walls")) + + /** + * Items assigned with this tag are deemed as pastel slabs block items to whatever looks for `#innerpastels:slabs` + * @return [InnerPastelsItemTags.SLABS] + */ val SLABS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:slabs")) + + /** + * Items assigned with this tag are deemed as pastel stair block items to whatever looks for `#innerpastels:stairs` + * @return [InnerPastelsItemTags.STAIRS] + */ val STAIRS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:stairs")) + + /** + * Items assigned with this tag are deemed as pastel wool block items to whatever looks for `#innerpastels:wools` + * @return [InnerPastelsItemTags.WOOLS] + */ val WOOLS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:wools")) + + /** + * Items assigned with this tag are deemed as pastel lights block items to whatever looks for `#innerpastels:lights` + * @return [InnerPastelsItemTags.LIGHTS] + */ val LIGHTS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:lights")) + + /** + * Items assigned with this tag are deemed as pastel carpets block items to whatever looks for `#innerpastels:carpets` + * @return [InnerPastelsItemTags.CARPETS] + */ val CARPETS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:carpets")) + + /** + * Items assigned with this tag are deemed as pastel glass block items to whatever looks for `#innerpastels:glass_blocks` + * @return [InnerPastelsItemTags.GLASS_BLOCKS] + */ val GLASS_BLOCKS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:glass_blocks")) + + /** + * Items assigned with this tag are deemed as pastel glass pane block items to whatever looks for `#innerpastels:glass_panes` + * @return [InnerPastelsItemTags.GLASS_PANES] + */ val GLASS_PANES: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:glass_panes")) + + /** + * Items assigned with this tag are deemed as pastel powder items to whatever looks for `#innerpastels:powders` + * @return [InnerPastelsItemTags.GLASS_PANES] + */ val POWDERS: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:powders")) + + /** + * Items assigned with this tag are deemed as taffy items to whatever looks for `#innerpastels:taffies` + * @return [InnerPastelsItemTags.GLASS_PANES] + */ val TAFFIES: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:taffies")) + + /** + * Items assigned with this tag are deemed as cotton candy items to whatever looks for `#innerpastels:cotton_candies` + * @return [InnerPastelsItemTags.GLASS_PANES] + */ val COTTON_CANDIES: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:cotton_candies")) + + /** + * Items assigned with this tag are deemed as hard candy items to whatever looks for `#innerpastels:hard_candies` + * @return [InnerPastelsItemTags.GLASS_PANES] + */ val HARD_CANDIES: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:hard_candies")) + + /** + * Items assigned with this tag are deemed as ice cream items to whatever looks for `#innerpastels:ice_cream` + * @return [InnerPastelsItemTags.GLASS_PANES] + */ val ICE_CREAM: TagKey = TagKey.create(Registries.ITEM, ResourceLocation("innerpastels:ice_cream")) // Desolated From 068fb0678d766a1acf1c3e4aef1924d8c5f6c73b Mon Sep 17 00:00:00 2001 From: Asoji Date: Sun, 25 Feb 2024 06:28:20 -0800 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=93=9D=20Update=20Module.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Module.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Module.md b/Module.md index 390a1c41..877f1e84 100644 --- a/Module.md +++ b/Module.md @@ -13,26 +13,36 @@ src/main/kotlin └───tags ``` +If you could think of a way to make all the package descriptors a bit better at explaining what they are, please feel free to make a PR with the `documentation` tag. plsandthx + +# Package gay.asoji.innerpastels + +Main root package + +# Package gay.asoji.innerpastels.crab + +Crab in the code 🦀 + # Package gay.asoji.innerpastels.blocks -TODO: work on this +Custom Block classes or Block helpers # Package gay.asoji.innerpastels.datagen -TODO: work on this +Helpers for Data Generation # Package gay.asoji.innerpastels.foods -TODO: work on this +Helpers for Food related code # Package gay.asoji.innerpastels.items -TODO: work on this +Custom Item classes or Item Helpers # Package gay.asoji.innerpastels.misc -TODO: work on this +Any code or helpers that don't fall under any clear category # Package gay.asoji.innerpastels.tags -TODO: work on this +Custom Block and Item tags From eb4d161ea0be1cab3537fdb44dbea01283ac5967 Mon Sep 17 00:00:00 2001 From: Asoji Date: Mon, 26 Feb 2024 08:15:34 -0800 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=93=9D=20More=20small=20snippets=20of?= =?UTF-8?q?=20docs=20edits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 3 -- gradle/libs.versions.toml | 5 +-- .../innerpastels/blocks/BlockExtensions.kt | 9 +++-- .../asoji/innerpastels/blocks/Properties.kt | 5 +++ .../innerpastels/datagen/RecipeGenerators.kt | 36 +++++++++---------- .../asoji/innerpastels/foods/RegisterFood.kt | 16 ++++----- .../innerpastels/items/CandyTooltipItem.kt | 4 ++- .../misc/CandyTranslationString.kt | 11 ++++++ 8 files changed, 55 insertions(+), 34 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index da57007e..61545857 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -43,9 +43,6 @@ dependencies { modImplementation(libs.fabric.api) include(modImplementation("gay.asoji:fmw:1.0.0+build.8")!!) - - - dokkaHtmlPlugin(libs.dokka.`as`.java) } tasks.withType().configureEach { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index eb31b039..edb96216 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ fabric-loader = "0.15.3" fabric-api = "0.95.4+1.20.4" fabric_language_kotlin = "1.10.17+kotlin.1.9.22" -dokka_as_java = "1.9.10" +dokka = "1.9.10" [libraries] minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } @@ -13,7 +13,8 @@ fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric-l fabric-api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric-api" } fabric_language_kotlin = { module = "net.fabricmc:fabric-language-kotlin", version.ref = "fabric_language_kotlin" } -dokka_as_java = { module = "org.jetbrains.dokka:kotlin-as-java-plugin", version.ref = "dokka_as_java" } +dokka_as_java = { module = "org.jetbrains.dokka:kotlin-as-java-plugin", version.ref = "dokka" } +dokka_versioning = { module = "org.jetbrains.dokka:versioning-plugin", version.ref = "dokka" } [plugins] grgit = { id = "org.ajoberstar.grgit", version = "5.2.1"} diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt index 40a38b66..2b8c0d89 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/BlockExtensions.kt @@ -22,7 +22,9 @@ import net.minecraft.world.item.Item import net.minecraft.world.level.block.* import net.minecraft.world.level.material.MapColor - +/** + * Block Extensions code for registering Blocks + */ // a lot of this was written by storm so if there's shit that could be reused/abstracted, yell at her, not me - asoji @@ -51,7 +53,7 @@ fun Block.registerBlockItem(modID: String, name: String): BlockItem = Registry.r * Registers a block & item to the Minecraft registry with the resource location set to the Mod ID * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name the ID of the block - * @return [Block] + * @return [Block] and [BlockItem] */ fun Block.registerBlockWithItem(modID: String, name: String): Block { this.registerBlockItem(modID, name) @@ -242,6 +244,9 @@ fun DyeColor.registerLightBlock(modID: String, name: String): Block = Block(Past */ fun MapColor.registerLightBlock(modID: String, name: String): Block = Block(PastelLight().mapColor(this)).registerBlockWithItem(modID, name) +/** + * @suppress + */ object crab1 { val crab2 = CrabInTheCode.crabDeezNuts("hey, it felt comfortable here between the light and the carpet") } /** diff --git a/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt b/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt index ccfa5257..8cfe66ba 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/blocks/Properties.kt @@ -6,6 +6,8 @@ import net.minecraft.client.resources.model.Material import net.minecraft.world.level.block.* import net.minecraft.world.level.block.state.BlockBehaviour +//TODO: Replace all of the Functions with Values + /** * A list of Block Properties, mostly copyOf's, to be used with making new blocks. */ @@ -129,6 +131,9 @@ object Properties { return Block(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS)) } + /** + * @suppress + */ object crab3 { val crab3 = CrabInTheCode.crabDeezNuts("according to all unknown laws of aviation, crabs can float and snip your hair off") } /** diff --git a/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt b/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt index a98b6384..9dfd98a5 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/datagen/RecipeGenerators.kt @@ -35,8 +35,8 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider - * @property smeltableList A [List] of what can be used as an input item to be smelted down into a resulting [outputPastelGlassItem] + * @property exporter The RecipeOutput used by your Recipe Provider + * @property smeltableList A List of what can be used as an input item to be smelted down into a resulting [outputPastelGlassItem] * @property outputPastelGlassItem The resulting Glass Item from your input [smeltableList] * @property group A string that defines what group your recipe belongs to * @@ -73,7 +73,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property smeltableList A [List] of what can be used as an input item to be smelted down into a resulting [outputPastelHardCandyItem] * @property outputPastelGlassItem The resulting Pastel Hard Candy Item from your input [smeltableList] * @property group A string that defines what group your recipe belongs to @@ -109,7 +109,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelPowderItem The Powder Item used for input * @property outputPastelPowderBlock The Pastel Powder Block outputted * @@ -150,7 +150,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelBlock The Powder Block Item used for input * @property outputPastelSlabBlock The Pastel Slab Block outputted * @@ -181,7 +181,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelBlock The Powder Block Item used for input * @property outputPastelStairBlock The Pastel Stair Block outputted * @@ -214,7 +214,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelPowderItem The Powder Item used for input * @property outputPastelWoolBlock The Pastel Wool Block outputted * @@ -250,7 +250,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelPowderItem The Powder Item used for input * @property outputPastelWoolBlock The Pastel Wool Block outputted * @@ -283,7 +283,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelWoolBlock The Pastel Wool Block Item used for input * @property outputPastelCarpetBlock The Pastel Carpet Block outputted * @@ -314,7 +314,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelBlock The Pastel Block Item used for input * @property outputPastelFenceBlock The Pastel Fence Block outputted * @@ -348,7 +348,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelBlock The Pastel Block Item used for input * @property outputPastelFenceGateBlock The Pastel Fence Gate Block outputted * @@ -382,7 +382,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelBlock The Pastel Block Item used for input * @property outputPastelWallBlock The Pastel Wall Block outputted * @@ -414,7 +414,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelPowderItem The Powder Item used for input * @property outputPastelGlassBlock The Pastel Glass Block Item outputted * @@ -450,7 +450,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelPowderItem The Powder Item used for input * @property outputPastelGlassPaneBlock The Pastel Glass Pane Block Item outputted * @@ -485,7 +485,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelGlassBlockItem The Glass Block used for input * @property outputPastelGlassPaneBlock The Pastel Glass Pane Block Item outputted * @@ -521,7 +521,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelPowderItem The Powder Item used for input * @property outputPastelLightBlock The Pastel Light Block outputted * @@ -553,7 +553,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputPastelPowderItem The Powder Item used for input * @property outputTaffyItem The Pastel Taffy Item outputted * @@ -585,7 +585,7 @@ object RecipeGenerators { * } * ``` * - * @property exporter The [RecipeOutput] used by your Recipe Provider + * @property exporter The RecipeOutput used by your Recipe Provider * @property inputTaffyItem The Taffy used for input * @property outputCottonCandyItem The Cotton Candy Item outputted * diff --git a/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt b/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt index 62d8879f..a55cc358 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/foods/RegisterFood.kt @@ -20,11 +20,11 @@ object RegisterFood { * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name Candy's Item ID [like `white_taffy`] * @property candyTranslationString Type of candy for hunger translation string - * @property nutrition Candy's nutrition value in [Int] - * @property saturation Candy's saturation value in [Int] + * @property nutrition Candy's nutrition value + * @property saturation Candy's saturation value * @property effect [MobEffect] tied to eating the candy * @property amplifier Potency of said [MobEffect] after eating it - * @property seconds Amount of time the effect lasts in [Int] seconds + * @property seconds Amount of time the effect lasts */ fun registerCandy( modID: String, @@ -57,8 +57,8 @@ object RegisterFood { * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name Candy's Item ID [like `white_taffy`] * @property candyTranslationString Type of candy for hunger translation string - * @property nutrition Candy's nutrition value in [Int] - * @property saturation Candy's saturation value in [Int] + * @property nutrition Candy's nutrition value + * @property saturation Candy's saturation value * * @return [CandyTooltipItem] */ @@ -84,7 +84,7 @@ object RegisterFood { * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name Candy's Item ID [like `white_taffy`] * @property effect The corresponding [MobEffect] obtained when the candy is eaten - * @property seconds Amount of seconds in [Int] applied to the tied [effect] + * @property seconds Amount of seconds applied to the tied [effect] * * @return Taffy [registerCandy] with a defined Mod ID, Item ID, Mob Effect when eaten for a certain amount of seconds */ @@ -110,7 +110,7 @@ object RegisterFood { * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name Candy's Item ID [like `white_cotton_candy`] * @property effect The corresponding [MobEffect] obtained when the candy is eaten - * @property seconds Amount of seconds in [Int] applied to the tied [effect] + * @property seconds Amount of seconds applied to the tied [effect] * * @return Cotton Candy [registerCandy] with a defined Mod ID, Item ID, Mob Effect when eaten for a certain amount of seconds */ @@ -136,7 +136,7 @@ object RegisterFood { * @property modID The namespace for your mod to be used with, like `SofterPastels.MOD_ID` * @property name Candy's Item ID [like `white_hard_candy`] * @property effect The corresponding [MobEffect] obtained when the candy is eaten - * @property seconds Amount of seconds in [Int] applied to the tied [effect] + * @property seconds Amount of seconds applied to the tied [effect] * * @return Hard Candy [registerCandy] with a defined Mod ID, Item ID, Mob Effect when eaten for a certain amount of seconds */ diff --git a/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt b/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt index 5e523afc..6e18c65d 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/items/CandyTooltipItem.kt @@ -17,7 +17,9 @@ import java.util.* * @property CandyTranslationString */ class CandyTooltipItem(properties: Properties, val candyTranslationString: CandyTranslationString) : Item(properties) { - // Overrides Item's `appendHoverText` to add more things in it, notably Hunger translation string, tied Mob Effect [if there is one], and Always Eat string + /** + * Overrides Item's `appendHoverText` to add more things in it, notably Hunger translation string, tied Mob Effect [if there is one], and Always Eat string + */ override fun appendHoverText(itemStack: ItemStack, level: Level?, list: MutableList, tooltipFlag: TooltipFlag) { list.add(Component.translatable(candyTranslationString.candyHungerString)) diff --git a/src/main/kotlin/gay/asoji/innerpastels/misc/CandyTranslationString.kt b/src/main/kotlin/gay/asoji/innerpastels/misc/CandyTranslationString.kt index c2ba6021..5e8abad1 100644 --- a/src/main/kotlin/gay/asoji/innerpastels/misc/CandyTranslationString.kt +++ b/src/main/kotlin/gay/asoji/innerpastels/misc/CandyTranslationString.kt @@ -5,7 +5,18 @@ package gay.asoji.innerpastels.misc * [actual strings in library's /src/main/resources/assets/innerpastels/lang/en_us.json] */ enum class CandyTranslationString(val candyHungerString: String) { + /** + * Translation string for Taffy's description + */ TAFFY("item.innerpastels.candies.hunger.description.taffy"), + + /** + * Translation string for Cotton Candy's description + */ COTTON("item.innerpastels.candies.hunger.description.cotton"), + + /** + * Translation string for Hard Candy's description + */ HARD("item.innerpastels.candies.hunger.description.hard") } \ No newline at end of file