diff --git a/build.gradle b/build.gradle index c1f1a0e..7797b76 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,15 @@ plugins { + id 'fabric-loom' version "${loom_version}" id 'maven-publish' - alias(libs.plugins.quilt.loom) - alias(libs.plugins.minotaur) } -archivesBaseName = project.archives_base_name -version = project.version +version = project.mod_version group = project.maven_group +base { + archivesName = project.archives_base_name +} + repositories { exclusiveContent { forRepository { @@ -20,67 +22,59 @@ repositories { includeGroup "maven.modrinth" } } + + + maven { + url = "https://maven.quiltmc.org/repository/release" + } } -// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs." -// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work. dependencies { - minecraft libs.minecraft - mappings variantOf(libs.quilt.mappings) { classifier 'intermediary-v2' } - // Replace the above line with the block below if you want to use Mojang mappings as your primary mappings, falling back on QM for parameters and Javadocs - /* - mappings loom.layered { - mappings "org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:intermediary-v2" - officialMojangMappings() - } - */ - modImplementation libs.quilt.loader + // To change the versions see the gradle.properties file + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "org.quiltmc:quilt-mappings:${project.quilt_mappings}:intermediary-v2" - // QSL is not a complete API; You will need Quilted Fabric API to fill in the gaps. - // Quilted Fabric API will automatically pull in the correct QSL version. - modImplementation libs.quilted.fabric.api - // modImplementation libs.bundles.quilted.fabric.api // If you wish to use Fabric API's deprecated modules, you can replace the above line with this one + // Fabric + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + } processResources { - inputs.property 'version', version + inputs.property "version", project.version - filesMatching('quilt.mod.json') { - expand 'version': version + filesMatching("fabric.mod.json") { + expand "version": inputs.properties.version } } tasks.withType(JavaCompile).configureEach { - it.options.encoding = "UTF-8" - // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. - it.options.release = 17 + it.options.release = 21 } java { - // Still required by IDEs such as Eclipse and Visual Studio Code - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task if it is present. + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. // If you remove this line, sources will not be generated. withSourcesJar() - // If this mod is going to be a library, then it should also generate Javadocs in order to aid with developement. - // Uncomment this line to generate them. - // withJavadocJar() + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } -// If you plan to use a different file for the license, don't forget to change the file name here! jar { + inputs.property "archivesName", project.base.archivesName + from("LICENSE") { - rename { "${it}_${archivesBaseName}" } + rename { "${it}_${inputs.properties.archivesName}"} } } -// Configure the maven publication +// configure the maven publication publishing { publications { - mavenJava(MavenPublication) { + create("mavenJava", MavenPublication) { + artifactId = project.archives_base_name from components.java } } @@ -92,22 +86,4 @@ publishing { // The repositories here will be used for publishing your artifact, not for // retrieving dependencies. } -} - -modrinth { - token = System.getenv("MODRINTH_TOKEN") - projectId = "block-ex" - uploadFile = remapJar - additionalFiles = [sourcesJar] - gameVersions = [libs.versions.minecraft.get()] - loaders = ["quilt"] - def ref = System.getenv("GITHUB_REF") - changelog = System.getenv("CHANGELOG") ?: - (ref != null && ref.startsWith("refs/tags/")) ? - "You may view the changelog at https://github.com/DebuggyTeam/block-extensions/releases/tag/${URLEncoder.encode(ref.substring(10), StandardCharsets.UTF_8)}" : - "No changelog is available. Perhaps poke at https://github.com/DebuggyTeam/block-extensions for a changelog?" - - dependencies { - required.project "qsl" - } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index c9a687c..6c809bf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,18 @@ -# Gradle Properties -org.gradle.jvmargs = -Xmx1G -org.gradle.parallel = true +# Done to increase the memory available to gradle. +org.gradle.jvmargs=-Xmx1G +org.gradle.parallel=true + +# Fabric Properties +# check these on https://fabricmc.net/develop +minecraft_version=1.21.1 +quilt_mappings=1.21.1+build.9 +loader_version=0.17.2 +loom_version=1.11-SNAPSHOT # Mod Properties -version = 1.0.0.beta1+1.20.1 -maven_group = gay.debuggy -archives_base_name = block_extensions +mod_version=1.0.0 +maven_group=gay.debuggy +archives_base_name=block_extensions -# Dependencies are managed at gradle/libs.versions.toml +# Dependencies +fabric_version=0.116.6+1.21.1 \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml deleted file mode 100644 index ee4c5e4..0000000 --- a/gradle/libs.versions.toml +++ /dev/null @@ -1,17 +0,0 @@ -[versions] -# The latest versions are available at https://lambdaurora.dev/tools/import_quilt.html -minecraft = "1.20.1" -quilt_mappings = "1.20.1+build.23" -quilt_loader = "0.20.1" -quilted_fabric_api = "7.1.2+0.87.0-1.20.1" - -[libraries] -minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } -quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" } -quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" } - -quilted_fabric_api = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api", version.ref = "quilted_fabric_api" } - -[plugins] -quilt_loom = { id = "org.quiltmc.loom", version = "1.0.+" } -minotaur = { id = "com.modrinth.minotaur", version = "2.+" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fc..3ae1e2f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/gay/debuggy/block_extensions/BlockExBlocks.java b/src/main/java/gay/debuggy/block_extensions/BlockExBlocks.java index c49b02c..32530a3 100644 --- a/src/main/java/gay/debuggy/block_extensions/BlockExBlocks.java +++ b/src/main/java/gay/debuggy/block_extensions/BlockExBlocks.java @@ -1,16 +1,18 @@ package gay.debuggy.block_extensions; +//import gay.debuggy.block_extensions.blocks.MissingTextureBlock; +import gay.debuggy.block_extensions.blocks.FakeWaterBlock; import gay.debuggy.block_extensions.blocks.MissingTextureBlock; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; +import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; import net.minecraft.item.ItemGroups; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -import org.quiltmc.qsl.block.extensions.api.QuiltBlockSettings; -import org.quiltmc.qsl.item.setting.api.QuiltItemSettings; import java.util.HashMap; @@ -20,61 +22,62 @@ public class BlockExBlocks { public static HashMap blocksToRegister = new HashMap<>(); // General Blocks - public static final Block BUGGED_PISTON = new Block(QuiltBlockSettings.copyOf(Blocks.OAK_PLANKS)); - public static final Block CAST_IRON_BLOCK = new Block(QuiltBlockSettings.copyOf(Blocks.IRON_BLOCK)); - public static final Block COBBLESTONE_TILE = new Block(QuiltBlockSettings.copyOf(Blocks.STONE)); - public static final Block DECO_BARREL = new Block(QuiltBlockSettings.copyOf(Blocks.OAK_PLANKS)); - public static final Block DECO_CHISELED_BOOKSHELF = new Block(QuiltBlockSettings.copyOf(Blocks.OAK_PLANKS)); - public static final Block DECO_DAYLIGHT_DETECTOR = new Block(QuiltBlockSettings.copyOf(Blocks.OAK_PLANKS)); - public static final Block DECO_JIGSAW = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block DECO_OBSERVER = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block DECO_SMITHING_TABLE = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block FAKE_COMMAND_BLOCK = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block FAKE_CHAIN_COMMAND_BLOCK = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block FAKE_NETHER_PORTAL_BLOCK = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block FAKE_REPEATING_COMMAND_BLOCK = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block HONEYED_PLANKS = new Block(QuiltBlockSettings.copyOf(Blocks.OAK_PLANKS)); - public static final MissingTextureBlock MISSING_TEXTURE = new MissingTextureBlock(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block STICKY_BUGGED_PISTON = new Block(QuiltBlockSettings.copyOf(Blocks.OAK_PLANKS)); - public static final Block STONE_TILE = new Block(QuiltBlockSettings.copyOf(Blocks.STONE)); - public static final Block THIRTY_SIX = new Block(QuiltBlockSettings.copyOf(Blocks.GRASS_BLOCK)); - public static final Block WROUGHT_IRON_BLOCK = new Block(QuiltBlockSettings.copyOf(Blocks.IRON_BLOCK)); - - public static final Block RED_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.RED_WOOL)); - public static final Block ORANGE_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.ORANGE_WOOL)); - public static final Block YELLOW_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.YELLOW_WOOL)); - public static final Block LIME_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.LIME_WOOL)); - public static final Block GREEN_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.GREEN_WOOL)); - public static final Block CYAN_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.CYAN_WOOL)); - public static final Block LIGHT_BLUE_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.LIGHT_BLUE_WOOL)); - public static final Block BLUE_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.BLUE_WOOL)); - public static final Block PURPLE_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.PURPLE_WOOL)); - public static final Block MAGENTA_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.MAGENTA_WOOL)); - public static final Block PINK_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.PINK_WOOL)); - public static final Block BROWN_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.BROWN_WOOL)); - public static final Block BLACK_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.BLACK_WOOL)); - public static final Block GRAY_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.GRAY_WOOL)); - public static final Block LIGHT_GRAY_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.LIGHT_GRAY_WOOL)); - public static final Block WHITE_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - - public static final Block AGENDER_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block AROACE_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block AROMANTIC_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block ASEXUAL_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block BISEXUAL_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block DEMIBOY_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block DEMIGIRL_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block DISABILITY_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block GAY_MEN_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block GAY_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block GENDERFAE_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block GENDERQUEER_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block LESBIAN_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block NONBINARY_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block PANSEXUAL_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block PLURAL_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block POLYSEXUAL_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); - public static final Block TRANSGENDER_QUILT_PATCH = new Block(QuiltBlockSettings.copyOf(Blocks.WHITE_WOOL)); + public static final Block BUGGED_PISTON = new Block(AbstractBlock.Settings.copy(Blocks.OAK_PLANKS)); + public static final Block CAST_IRON_BLOCK = new Block(AbstractBlock.Settings.copy(Blocks.IRON_BLOCK)); + public static final Block COBBLESTONE_TILE = new Block(AbstractBlock.Settings.copy(Blocks.STONE)); + public static final Block DECO_BARREL = new Block(AbstractBlock.Settings.copy(Blocks.OAK_PLANKS)); + public static final Block DECO_CHISELED_BOOKSHELF = new Block(AbstractBlock.Settings.copy(Blocks.OAK_PLANKS)); + public static final Block DECO_DAYLIGHT_DETECTOR = new Block(AbstractBlock.Settings.copy(Blocks.OAK_PLANKS)); + public static final Block DECO_JIGSAW = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block DECO_OBSERVER = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block DECO_SMITHING_TABLE = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block FAKE_COMMAND_BLOCK = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block FAKE_CHAIN_COMMAND_BLOCK = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block FAKE_NETHER_PORTAL_BLOCK = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block FAKE_REPEATING_COMMAND_BLOCK = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block HONEYED_PLANKS = new Block(AbstractBlock.Settings.copy(Blocks.OAK_PLANKS)); + public static final MissingTextureBlock MISSING_TEXTURE = new MissingTextureBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block STICKY_BUGGED_PISTON = new Block(AbstractBlock.Settings.copy(Blocks.OAK_PLANKS)); + public static final Block STONE_TILE = new Block(AbstractBlock.Settings.copy(Blocks.STONE)); + public static final Block THIRTY_SIX = new Block(AbstractBlock.Settings.copy(Blocks.GRASS_BLOCK)); + public static final Block WROUGHT_IRON_BLOCK = new Block(AbstractBlock.Settings.copy(Blocks.IRON_BLOCK)); + public static final FakeWaterBlock FAKE_WATER_BLOCK = new FakeWaterBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + + public static final Block RED_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.RED_WOOL)); + public static final Block ORANGE_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.ORANGE_WOOL)); + public static final Block YELLOW_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.YELLOW_WOOL)); + public static final Block LIME_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.LIME_WOOL)); + public static final Block GREEN_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.GREEN_WOOL)); + public static final Block CYAN_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.CYAN_WOOL)); + public static final Block LIGHT_BLUE_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.LIGHT_BLUE_WOOL)); + public static final Block BLUE_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.BLUE_WOOL)); + public static final Block PURPLE_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.PURPLE_WOOL)); + public static final Block MAGENTA_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.MAGENTA_WOOL)); + public static final Block PINK_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.PINK_WOOL)); + public static final Block BROWN_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.BROWN_WOOL)); + public static final Block BLACK_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.BLACK_WOOL)); + public static final Block GRAY_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.GRAY_WOOL)); + public static final Block LIGHT_GRAY_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.LIGHT_GRAY_WOOL)); + public static final Block WHITE_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + + public static final Block AGENDER_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block AROACE_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block AROMANTIC_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block ASEXUAL_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block BISEXUAL_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block DEMIBOY_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block DEMIGIRL_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block DISABILITY_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block GAY_MEN_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block GAY_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block GENDERFAE_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block GENDERQUEER_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block LESBIAN_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block NONBINARY_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block PANSEXUAL_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block PLURAL_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block POLYSEXUAL_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); + public static final Block TRANSGENDER_QUILT_PATCH = new Block(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL)); public static void init() { @@ -97,7 +100,8 @@ public static void init() { blocksToRegister.put("cobblestone_tile", COBBLESTONE_TILE); blocksToRegister.put("thirty_six", THIRTY_SIX); blocksToRegister.put("wrought_iron_block", WROUGHT_IRON_BLOCK); - + blocksToRegister.put("fake_water_block", FAKE_WATER_BLOCK); + blocksToRegister.put("red_quilt_patch", RED_QUILT_PATCH); blocksToRegister.put("orange_quilt_patch", ORANGE_QUILT_PATCH); blocksToRegister.put("yellow_quilt_patch", YELLOW_QUILT_PATCH); @@ -114,7 +118,7 @@ public static void init() { blocksToRegister.put("gray_quilt_patch", GRAY_QUILT_PATCH); blocksToRegister.put("light_gray_quilt_patch", LIGHT_GRAY_QUILT_PATCH); blocksToRegister.put("white_quilt_patch", WHITE_QUILT_PATCH); - + blocksToRegister.put("agender_quilt_patch", AGENDER_QUILT_PATCH); blocksToRegister.put("aroace_quilt_patch", AROACE_QUILT_PATCH); blocksToRegister.put("aromantic_quilt_patch", AROMANTIC_QUILT_PATCH); @@ -141,8 +145,8 @@ public static void init() { } public static void registerBlocks(String blockId, Block block) { - Registry.register(Registries.BLOCK, new Identifier(MOD_ID, blockId), block); - Registry.register(Registries.ITEM, new Identifier(MOD_ID, blockId), new BlockItem(block, new QuiltItemSettings())); + Registry.register(Registries.BLOCK, Identifier.of(MOD_ID, blockId), block); + Registry.register(Registries.ITEM, Identifier.of(MOD_ID, blockId), new BlockItem(block, new Item.Settings())); ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(entries -> entries.addItem(block)); } -} +} \ No newline at end of file diff --git a/src/main/java/gay/debuggy/block_extensions/BlockExtensions.java b/src/main/java/gay/debuggy/block_extensions/BlockExtensions.java index b1125a1..81081af 100644 --- a/src/main/java/gay/debuggy/block_extensions/BlockExtensions.java +++ b/src/main/java/gay/debuggy/block_extensions/BlockExtensions.java @@ -1,17 +1,25 @@ package gay.debuggy.block_extensions; -import org.quiltmc.loader.api.ModContainer; -import org.quiltmc.qsl.base.api.entrypoint.ModInitializer; +import net.fabricmc.api.ModInitializer; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class BlockExtensions implements ModInitializer { - public static final Logger LOGGER = LoggerFactory.getLogger("Block Extensions"); - public static final String MOD_ID = "block_extensions"; + // This logger is used to write text to the console and the log file. + // It is considered best practice to use your mod id as the logger's name. + // That way, it's clear which mod wrote info, warnings, and errors. + public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); + @Override - public void onInitialize(ModContainer mod) { + public void onInitialize() { + // This code runs as soon as Minecraft is in a mod-load-ready state. + // However, some things (like resources) may still be uninitialized. + // Proceed with mild caution. + BlockExBlocks.init(); + LOGGER.info("pineapple"); } -} +} \ No newline at end of file diff --git a/src/main/java/gay/debuggy/block_extensions/blocks/MissingTextureBlock.java b/src/main/java/gay/debuggy/block_extensions/blocks/MissingTextureBlock.java index 3658b7d..e7821ee 100644 --- a/src/main/java/gay/debuggy/block_extensions/blocks/MissingTextureBlock.java +++ b/src/main/java/gay/debuggy/block_extensions/blocks/MissingTextureBlock.java @@ -16,31 +16,31 @@ public class MissingTextureBlock extends Block { public static final EnumProperty COLOR = EnumProperty.of("color", DyeColor.class); - + public MissingTextureBlock(Settings settings) { super(settings); } - + // Thanks falkreon @Override protected void appendProperties(Builder builder) { builder.add(COLOR); } - - @Override + + //@Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { ItemStack stack = player.getStackInHand(hand); if (player.canModifyBlocks() && stack.getItem() instanceof DyeItem dye) { DyeColor dyeColor = dye.getColor(); world.setBlockState(pos, state.with(COLOR, dyeColor), Block.NOTIFY_ALL); - + if (!player.isCreative()) { stack.decrement(1); } - + return ActionResult.SUCCESS; } - + return ActionResult.PASS; } -} +} \ No newline at end of file diff --git a/src/main/java/gay/debuggy/block_extensions/client/BlockExtensionsClient.java b/src/main/java/gay/debuggy/block_extensions/client/BlockExtensionsClient.java index c888d57..861b501 100644 --- a/src/main/java/gay/debuggy/block_extensions/client/BlockExtensionsClient.java +++ b/src/main/java/gay/debuggy/block_extensions/client/BlockExtensionsClient.java @@ -1,18 +1,22 @@ package gay.debuggy.block_extensions.client; import gay.debuggy.block_extensions.BlockExBlocks; +import gay.debuggy.block_extensions.blocks.FakeWaterBlock; import gay.debuggy.block_extensions.blocks.MissingTextureBlock; +import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; -import org.quiltmc.loader.api.ModContainer; -import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer; + public class BlockExtensionsClient implements ClientModInitializer { - + // Thanks falkreon @Override - public void onInitializeClient(ModContainer mod) { + public void onInitializeClient() { ColorProviderRegistry.BLOCK.register((state, view, pos, i) -> { return state.get(MissingTextureBlock.COLOR).getSignColor(); }, BlockExBlocks.MISSING_TEXTURE); + + + ColorProviderRegistry.BLOCK.register((state, view, pos, i) -> 12, BlockExBlocks.THIRTY_SIX); } -} +} \ No newline at end of file diff --git a/src/main/resources/quilt.mod.json b/src/main/resources/_quilt.mod.json similarity index 91% rename from src/main/resources/quilt.mod.json rename to src/main/resources/_quilt.mod.json index 091bd67..cf6f614 100644 --- a/src/main/resources/quilt.mod.json +++ b/src/main/resources/_quilt.mod.json @@ -12,10 +12,10 @@ "woodiertexas": "Original Author" }, "contact": { - "homepage": "https://example.com/", + "homepage": "https://modrinth.com/mod/block-ex", "issues": "https://github.com/debuggyteam/block-extensions/issues", "sources": "https://github.com/debuggyteam/block-extensions", - "discord": "https://debuggy.gay/discord" + "discord": "https://discord.debuggy.gay" }, "icon": "assets/block_extensions/icon.png" }, diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..3c63ec5 --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,34 @@ +{ + "schemaVersion": 1, + "id": "block_extensions", + "version": "${version}", + "name": "Block Extensions", + "description": "A mod adding in some more decorative blocks (usually textures from non-building blocks).", + "authors": [ + "Me!" + ], + "contact": { + "homepage": "https://modrinth.com/mod/block-ex", + "issues": "https://github.com/debuggyteam/block-extensions/issues", + "sources": "https://github.com/debuggyteam/block-extensions", + "discord": "https://discord.debuggy.gay" + }, + "license": "MIT", + "icon": "assets/block_extensions/icon.png", + "environment": "*", + "entrypoints": { + "main": [ + "gay.debuggy.block_extensions.BlockExtensions" + ] + }, + "mixins": [], + "depends": { + "fabricloader": ">=0.17.2", + "minecraft": "~1.21.1", + "java": ">=21", + "fabric-api": "*" + }, + "suggests": { + "another-mod": "*" + } +}