Skip to content

Commit

Permalink
basic mod structure
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoLezury committed Jul 15, 2024
1 parent dde673d commit 989b6e9
Show file tree
Hide file tree
Showing 35 changed files with 549 additions and 269 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*.java]
insert_final_newline = false
trim_trailing_whitespace = true
indent_style = tab
charset = utf-8
max_line_length = off
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
build:
Expand Down
25 changes: 0 additions & 25 deletions README.md

This file was deleted.

17 changes: 7 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true

#read more on this at https://github.com/neoforged/ModDevGradle?tab=readme-ov-file#better-minecraft-parameter-names--javadoc-parchment
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
parchment_minecraft_version=1.20.6
parchment_mappings_version=2024.06.02
parchment_minecraft_version=1.21
parchment_mappings_version=2024.07.07
# Environment Properties
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
# The Minecraft version must agree with the Neo version to get a valid artifact
Expand All @@ -23,23 +22,21 @@ neo_version=21.0.83-beta
neo_version_range=[21.0.0-beta,)
# The loader version range can only use the major version of FML as bounds
loader_version_range=[4,)

## Mod Properties

# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod.
mod_id=examplemod
mod_id=assorted_armaments
# The human-readable display name for the mod.
mod_name=Example Mod
mod_name=Assorted Armaments
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=1.0.0
# 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.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=com.example.examplemod
mod_group_id=team.leomc.assortedarmaments
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=YourNameHere, OtherNameHere
mod_authors=PHVictor, LeoLezury
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.
mod_description=A minecraft mod that adds more types of weapons
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// 1.21 2024-07-15T18:04:26.8729482 Languages: en_us for mod: assorted_armaments
72c40f83ddc6d5b45a2604e128477116e191ef35 assets/assorted_armaments/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// 1.21 2024-07-15T17:50:38.496693 Item Models: assorted_armaments
d32d27cad84bb99311ff41f5e5a23d04e00f7b0c assets/assorted_armaments/models/item/wooden_claymore.json
7769febb5b9173a3405449255fcfb26b53ad50f9 assets/assorted_armaments/models/item/wooden_claymore_inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// 1.21 2024-07-15T17:27:31.0404021 Tags for minecraft:block mod id assorted_armaments
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// 1.21 2024-07-15T17:27:31.0374041 Tags for minecraft:item mod id assorted_armaments
4232a79b0abae6cba29e1551051988d2cc83bcb8 data/assorted_armaments/tags/item/claymores.json
d500bd43e88c70df0ec4054b266d05b7df7e221e data/minecraft/tags/item/swords.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// 1.21 2024-07-15T18:04:26.8709471 Languages: zh_cn for mod: assorted_armaments
7051fcbe197c4c53cb96a9c74c46adc41994475a assets/assorted_armaments/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"item.assorted_armaments.wooden_claymore": "Wooden Claymore"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"item.assorted_armaments.wooden_claymore": "木大剑"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "assorted_armaments:item/large_handheld",
"textures": {
"layer0": "assorted_armaments:item/wooden_claymore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "assorted_armaments:item/wooden_claymore_inventory"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"assorted_armaments:wooden_claymore"
]
}
5 changes: 5 additions & 0 deletions src/generated/resources/data/minecraft/tags/item/swords.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#assorted_armaments:claymores"
]
}
63 changes: 0 additions & 63 deletions src/main/java/com/example/examplemod/Config.java

This file was deleted.

136 changes: 0 additions & 136 deletions src/main/java/com/example/examplemod/ExampleMod.java

This file was deleted.

26 changes: 26 additions & 0 deletions src/main/java/team/leomc/assortedarmaments/AssortedArmaments.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package team.leomc.assortedarmaments;

import net.minecraft.resources.ResourceLocation;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.config.ModConfig;
import team.leomc.assortedarmaments.registry.AAItems;

@Mod(AssortedArmaments.ID)
public class AssortedArmaments {
public static final String ID = "assorted_armaments";

public AssortedArmaments(IEventBus modBus, ModContainer container) {
AAItems.ITEMS.register(modBus);
container.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
}

public static ResourceLocation id(String string) {
return ResourceLocation.fromNamespaceAndPath(ID, string);
}

public static String strId(String string) {
return ID + ":" + string;
}
}
24 changes: 24 additions & 0 deletions src/main/java/team/leomc/assortedarmaments/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package team.leomc.assortedarmaments;

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;

@EventBusSubscriber(modid = AssortedArmaments.ID, bus = EventBusSubscriber.Bus.MOD)
public class Config {
private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder();

private static final ModConfigSpec.DoubleValue CLAYMORE_BLOCK_WALK_SPEED_MODIFIER = BUILDER
.comment("Player's walk speed when blocking using a claymore = claymoreBlockWalkSpeedModifier * originalSpeed")
.defineInRange("claymoreBlockWalkSpeedModifier", 0.75, 0, Integer.MAX_VALUE);

public static final ModConfigSpec SPEC = BUILDER.build();

public static double claymoreBlockWalkSpeedModifier;

@SubscribeEvent
private static void onLoad(final ModConfigEvent event) {
claymoreBlockWalkSpeedModifier = CLAYMORE_BLOCK_WALK_SPEED_MODIFIER.get();
}
}
Loading

0 comments on commit 989b6e9

Please sign in to comment.