Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
DavidDGTNT | f2a8d1f88a | |
DavidDGTNT | ed20f5d6b4 |
15
build.gradle
15
build.gradle
|
@ -26,7 +26,7 @@ minecraft {
|
||||||
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
|
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
|
||||||
//
|
//
|
||||||
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
|
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
|
||||||
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
|
// Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
|
||||||
//
|
//
|
||||||
// Use non-default mappings at your own risk. They may not always work.
|
// Use non-default mappings at your own risk. They may not always work.
|
||||||
// Simply re-run your setup task after changing the mappings to update your workspace.
|
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||||
|
@ -118,7 +118,8 @@ repositories {
|
||||||
// Put repositories for dependencies here
|
// Put repositories for dependencies here
|
||||||
// ForgeGradle automatically adds the Forge maven and Maven Central for you
|
// ForgeGradle automatically adds the Forge maven and Maven Central for you
|
||||||
|
|
||||||
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
|
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
|
||||||
|
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
|
||||||
// flatDir {
|
// flatDir {
|
||||||
// dir 'libs'
|
// dir 'libs'
|
||||||
// }
|
// }
|
||||||
|
@ -132,10 +133,11 @@ dependencies {
|
||||||
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
|
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
|
||||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
// Real mod deobf dependency examples - these get remapped to your current mappings
|
// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
|
||||||
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
|
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
|
||||||
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
|
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
|
||||||
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
|
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
|
||||||
|
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
|
||||||
|
|
||||||
// Example mod dependency using a mod jar from ./libs with a flat dir repository
|
// Example mod dependency using a mod jar from ./libs with a flat dir repository
|
||||||
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
|
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
|
||||||
|
@ -189,6 +191,7 @@ tasks.named('jar', Jar).configure {
|
||||||
// dependsOn 'reobfJar'
|
// dependsOn 'reobfJar'
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// Example configuration to allow publishing using the maven-publish plugin
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
register('mavenJava', MavenPublication) {
|
register('mavenJava', MavenPublication) {
|
||||||
|
|
|
@ -7,17 +7,17 @@ org.gradle.daemon=false
|
||||||
## Environment Properties
|
## Environment Properties
|
||||||
|
|
||||||
# The Minecraft version must agree with the Forge version to get a valid artifact
|
# The Minecraft version must agree with the Forge version to get a valid artifact
|
||||||
minecraft_version=1.19.2
|
minecraft_version=1.19.4
|
||||||
# The Minecraft version range can use any release version of Minecraft as bounds.
|
# The Minecraft version range can use any release version of Minecraft as bounds.
|
||||||
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
|
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
|
||||||
# as they do not follow standard versioning conventions.
|
# as they do not follow standard versioning conventions.
|
||||||
minecraft_version_range=[1.19.2,1.20)
|
minecraft_version_range=[1.19.4,1.20)
|
||||||
# The Forge version must agree with the Minecraft version to get a valid artifact
|
# The Forge version must agree with the Minecraft version to get a valid artifact
|
||||||
forge_version=43.4.0
|
forge_version=45.3.0
|
||||||
# The Forge version range can use any version of Forge as bounds or match the loader version range
|
# The Forge version range can use any version of Forge as bounds or match the loader version range
|
||||||
forge_version_range=[43,)
|
forge_version_range=[45,)
|
||||||
# The loader version range can only use the major version of Forge/FML as bounds
|
# The loader version range can only use the major version of Forge/FML as bounds
|
||||||
loader_version_range=[43,)
|
loader_version_range=[45,)
|
||||||
# The mapping channel to use for mappings.
|
# The mapping channel to use for mappings.
|
||||||
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
|
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
|
||||||
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
|
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
|
||||||
|
@ -35,7 +35,7 @@ loader_version_range=[43,)
|
||||||
mapping_channel=official
|
mapping_channel=official
|
||||||
# The mapping version to query from the mapping channel.
|
# The mapping version to query from the mapping channel.
|
||||||
# This must match the format required by the mapping channel.
|
# This must match the format required by the mapping channel.
|
||||||
mapping_version=1.19.2
|
mapping_version=1.19.4
|
||||||
|
|
||||||
|
|
||||||
## Mod Properties
|
## Mod Properties
|
||||||
|
@ -48,7 +48,7 @@ mod_name=String Tools
|
||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=GNU GPLv3
|
mod_license=GNU GPLv3
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=1.0.0-1.19.2
|
mod_version=1.0.0-1.19.4
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|
|
@ -2,7 +2,9 @@ package me.daviddgtnt.stringtools;
|
||||||
|
|
||||||
import net.minecraft.world.item.*;
|
import net.minecraft.world.item.*;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.event.CreativeModeTabEvent;
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||||
import net.minecraftforge.registries.DeferredRegister;
|
import net.minecraftforge.registries.DeferredRegister;
|
||||||
|
@ -17,12 +19,12 @@ public class Main
|
||||||
|
|
||||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
|
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
|
||||||
|
|
||||||
public static final RegistryObject<Item> STRING_STICK = ITEMS.register("string_stick", () -> new Item(new Item.Properties().tab(CreativeModeTab.TAB_MATERIALS)));
|
public static final RegistryObject<Item> STRING_STICK = ITEMS.register("string_stick", () -> new Item(new Item.Properties()));
|
||||||
public static final RegistryObject<Item> STRING_SWORD = ITEMS.register("string_sword", () -> new SwordItem(StringToolMaterial.INSTANCE, 4, 1.6F, new Item.Properties().tab(CreativeModeTab.TAB_COMBAT)));
|
public static final RegistryObject<Item> STRING_SWORD = ITEMS.register("string_sword", () -> new SwordItem(StringToolMaterial.INSTANCE, 4, 1.6F, new Item.Properties()));
|
||||||
public static final RegistryObject<Item> STRING_PICKAXE = ITEMS.register("string_pickaxe", () -> new PickaxeItem(StringToolMaterial.INSTANCE, 2, 2.4F, new Item.Properties().tab(CreativeModeTab.TAB_TOOLS)));
|
public static final RegistryObject<Item> STRING_PICKAXE = ITEMS.register("string_pickaxe", () -> new PickaxeItem(StringToolMaterial.INSTANCE, 2, 2.4F, new Item.Properties()));
|
||||||
public static final RegistryObject<Item> STRING_AXE = ITEMS.register("string_axe", () -> new AxeItem(StringToolMaterial.INSTANCE, 7.0F, 0.8F, new Item.Properties().tab(CreativeModeTab.TAB_TOOLS)));
|
public static final RegistryObject<Item> STRING_AXE = ITEMS.register("string_axe", () -> new AxeItem(StringToolMaterial.INSTANCE, 7.0F, 0.8F, new Item.Properties()));
|
||||||
public static final RegistryObject<Item> STRING_SHOVEL = ITEMS.register("string_shovel", () -> new ShovelItem(StringToolMaterial.INSTANCE, 2.5F, 1.0F, new Item.Properties().tab(CreativeModeTab.TAB_TOOLS)));
|
public static final RegistryObject<Item> STRING_SHOVEL = ITEMS.register("string_shovel", () -> new ShovelItem(StringToolMaterial.INSTANCE, 2.5F, 1.0F, new Item.Properties()));
|
||||||
public static final RegistryObject<Item> STRING_HOE = ITEMS.register("string_hoe", () -> new HoeItem(StringToolMaterial.INSTANCE, 1, 1.0F, new Item.Properties().tab(CreativeModeTab.TAB_TOOLS)));
|
public static final RegistryObject<Item> STRING_HOE = ITEMS.register("string_hoe", () -> new HoeItem(StringToolMaterial.INSTANCE, 1, 1.0F, new Item.Properties()));
|
||||||
|
|
||||||
public Main()
|
public Main()
|
||||||
{
|
{
|
||||||
|
@ -31,7 +33,25 @@ public class Main
|
||||||
// Register the Deferred Register to the mod event bus so items get registered
|
// Register the Deferred Register to the mod event bus so items get registered
|
||||||
ITEMS.register(modEventBus);
|
ITEMS.register(modEventBus);
|
||||||
|
|
||||||
|
modEventBus.addListener(this::buildContents);
|
||||||
|
|
||||||
// Register ourselves for server and other game events we are interested in
|
// Register ourselves for server and other game events we are interested in
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
@SubscribeEvent
|
||||||
|
public void buildContents(CreativeModeTabEvent.BuildContents event) {
|
||||||
|
if (event.getTab() == CreativeModeTabs.INGREDIENTS) {
|
||||||
|
event.accept(STRING_STICK);
|
||||||
|
}
|
||||||
|
if (event.getTab() == CreativeModeTabs.COMBAT) {
|
||||||
|
event.accept(STRING_SWORD);
|
||||||
|
event.accept(STRING_AXE);
|
||||||
|
}
|
||||||
|
if (event.getTab() == CreativeModeTabs.TOOLS_AND_UTILITIES) {
|
||||||
|
event.accept(STRING_PICKAXE);
|
||||||
|
event.accept(STRING_AXE);
|
||||||
|
event.accept(STRING_SHOVEL);
|
||||||
|
event.accept(STRING_HOE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
{
|
{
|
||||||
"pack": {
|
"pack": {
|
||||||
"description": "${mod_id} resources",
|
"description": {
|
||||||
"pack_format": 9,
|
"text": "${mod_id} resources"
|
||||||
"forge:resource_pack_format": 9,
|
},
|
||||||
"forge:data_pack_format": 10
|
"forge:server_data_pack_format": 12,
|
||||||
}
|
"pack_format": 13
|
||||||
}
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue