User: joe Date: 01 Jan 25 11:47 Revision: 75c524ec36d0ceb58d3e53b7183967feacada8ab Summary: update copyright to 2025 for templates TeamCity URL: http://ci.mcdev.io:80/viewModification.html?tab=vcsModificationFiles&modId=9803&personal=false Index: templates/bukkit/paper.mcdev.template.json =================================================================== --- templates/bukkit/paper.mcdev.template.json (revision 4e38af203e9835985fde91a85fc3a1579df4bce2) +++ templates/bukkit/paper.mcdev.template.json (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) @@ -28,6 +28,7 @@ "type": "semantic_version", "forceDropdown": true, "options": [ + "1.21.3", "1.21.1", "1.21", "1.20.6", @@ -83,7 +84,7 @@ { "name": "USE_PAPER_MANIFEST", "type": "boolean", - "default": true + "default": false }, { "label": "creator.ui.optional_settings.label", Index: templates/bukkit/spigot.mcdev.template.json =================================================================== --- templates/bukkit/spigot.mcdev.template.json (revision 4e38af203e9835985fde91a85fc3a1579df4bce2) +++ templates/bukkit/spigot.mcdev.template.json (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) @@ -28,6 +28,9 @@ "type": "semantic_version", "forceDropdown": true, "options": [ + "1.21.4", + "1.21.3", + "1.21.2", "1.21.1", "1.21", "1.20.6", Index: templates/fabric/.mcdev.template.json =================================================================== --- templates/fabric/.mcdev.template.json (revision 4e38af203e9835985fde91a85fc3a1579df4bce2) +++ templates/fabric/.mcdev.template.json (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) @@ -178,7 +178,7 @@ "template": "../gradle-wrapper.properties.ft", "destination": "gradle/wrapper/gradle-wrapper.properties", "properties": { - "GRADLE_VERSION": "8.10.2" + "GRADLE_VERSION": "8.11.1" } }, { Index: templates/neoforge/.mcdev.template.json =================================================================== --- templates/neoforge/.mcdev.template.json (revision 4e38af203e9835985fde91a85fc3a1579df4bce2) +++ templates/neoforge/.mcdev.template.json (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) @@ -206,9 +206,14 @@ { "template": "Config (1.21+).java.ft", "destination": "src/main/java/${MAIN_CLASS.packagePath}/Config.java", - "condition": "$LANGUAGE=='Java' && $VERSIONS.minecraft.compareTo($mcver.MC1_21) >= 0" + "condition": "$LANGUAGE=='Java' && $VERSIONS.minecraft.compareTo($mcver.MC1_21) >= 0 && $VERSIONS.minecraft.compareTo($semver.parse('1.21.3')) < 0" }, { + "template": "Config (1.21.3+).java.ft", + "destination": "src/main/java/${MAIN_CLASS.packagePath}/Config.java", + "condition": "$LANGUAGE=='Java' && $VERSIONS.minecraft.compareTo($semver.parse('1.21.3')) >= 0" + }, + { "template": "MainClass.kt.ft", "destination": "src/main/kotlin/${MAIN_CLASS.path}.kt", "condition": "$LANGUAGE=='Kotlin'", Index: templates/neoforge/Config (1.21.3+).java.ft =================================================================== --- templates/neoforge/Config (1.21.3+).java.ft (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) +++ templates/neoforge/Config (1.21.3+).java.ft (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) @@ -0,0 +1,63 @@ +package ${MAIN_CLASS.packageName}; + +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.fml.event.config.ModConfigEvent; +import net.neoforged.neoforge.common.ModConfigSpec; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +// An example config class. This is not required, but it's a good idea to have one to keep your config organized. +// Demonstrates how to use Neo's config APIs +@EventBusSubscriber(modid = ${MAIN_CLASS.className}.MODID, bus = EventBusSubscriber.Bus.MOD) +public class Config +{ + private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); + + private static final ModConfigSpec.BooleanValue LOG_DIRT_BLOCK = BUILDER + .comment("Whether to log the dirt block on common setup") + .define("logDirtBlock", true); + + private static final ModConfigSpec.IntValue MAGIC_NUMBER = BUILDER + .comment("A magic number") + .defineInRange("magicNumber", 42, 0, Integer.MAX_VALUE); + + public static final ModConfigSpec.ConfigValue MAGIC_NUMBER_INTRODUCTION = BUILDER + .comment("What you want the introduction message to be for the magic number") + .define("magicNumberIntroduction", "The magic number is... "); + + // a list of strings that are treated as resource locations for items + private static final ModConfigSpec.ConfigValue> ITEM_STRINGS = BUILDER + .comment("A list of items to log on common setup.") + .defineListAllowEmpty("items", List.of("minecraft:iron_ingot"), Config::validateItemName); + + static final ModConfigSpec SPEC = BUILDER.build(); + + public static boolean logDirtBlock; + public static int magicNumber; + public static String magicNumberIntroduction; + public static Set items; + + private static boolean validateItemName(final Object obj) + { + return obj instanceof String itemName && BuiltInRegistries.ITEM.containsKey(ResourceLocation.parse(itemName)); + } + + @SubscribeEvent + static void onLoad(final ModConfigEvent event) + { + logDirtBlock = LOG_DIRT_BLOCK.get(); + magicNumber = MAGIC_NUMBER.get(); + magicNumberIntroduction = MAGIC_NUMBER_INTRODUCTION.get(); + + // convert the list of strings into a set of items + items = ITEM_STRINGS.get().stream() + .map(itemName -> BuiltInRegistries.ITEM.getValue(ResourceLocation.parse(itemName))) + .collect(Collectors.toSet()); + } +} Index: templates/neoforge/build.gradle.ft =================================================================== --- templates/neoforge/build.gradle.ft (revision 4e38af203e9835985fde91a85fc3a1579df4bce2) +++ templates/neoforge/build.gradle.ft (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'maven-publish' + id 'idea' #if (${VERSIONS.minecraft.compareTo($mcver.MC1_21)} >= 0) id 'net.neoforged.moddev' version '${VERSIONS.moddev}' #else @@ -74,7 +75,11 @@ } data { + #if ($VERSIONS.minecraft.compareTo($semver.parse("1.21.4")) < 0) - data() + data() + #else + clientData() + #end // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it // gameDirectory = project.file('run-data') Index: templates/sponge/.mcdev.template.json =================================================================== --- templates/sponge/.mcdev.template.json (revision 4e38af203e9835985fde91a85fc3a1579df4bce2) +++ templates/sponge/.mcdev.template.json (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) @@ -28,7 +28,8 @@ "type": "semantic_version", "forceDropdown": true, "options": [ - "12.0.0-SNAPSHOT", + "12.1.0-SNAPSHOT", + "12.0.0", "11.0.0-SNAPSHOT", "11.0.0", "10.1.0-SNAPSHOT", Index: templates/velocity/.mcdev.template.json =================================================================== --- templates/velocity/.mcdev.template.json (revision 4e38af203e9835985fde91a85fc3a1579df4bce2) +++ templates/velocity/.mcdev.template.json (revision 75c524ec36d0ceb58d3e53b7183967feacada8ab) @@ -28,6 +28,7 @@ "type": "semantic_version", "forceDropdown": true, "options": [ + "3.4.0-SNAPSHOT", "3.3.0-SNAPSHOT", "3.2.0-SNAPSHOT", "3.1.2-SNAPSHOT",