Skip to content

Commit

Permalink
Added the stone tiers of the sickles, longsword, and broadsword, as w…
Browse files Browse the repository at this point in the history
…ell as model and texture files and recipes

Revamped version system in build.gradle, made it more efficient for getting the mod version
  • Loading branch information
snek152 committed Jul 3, 2021
1 parent 2e0afd7 commit f3ae7ce
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 4 deletions.
20 changes: 19 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle'

group = 'com.snek152.swordselection'
version = '0.2.0-1.16.5'
version = '1.16.5-0.2.1'
archivesBaseName = 'swordselection'

java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
Expand Down Expand Up @@ -151,3 +151,21 @@ jar {
}

jar.finalizedBy('reobfJar')

processResources {
// This will ensure that this task is redone when the versions change.
inputs.property 'version', project.version

// Replace stuff in mods.toml, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'META-INF/mods.toml'

// Replace version
expand 'version':project.version
}

// Copy everything else except the mods.toml
from(sourceSets.main.resources.srcDirs) {
exclude 'META-INF/mods.toml'
}
}
25 changes: 24 additions & 1 deletion src/main/java/com/snek152/swordselection/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ModItems {
new Item.Properties()
.defaultMaxDamage(210)
.group(ItemGroup.COMBAT)
.addToolType(ToolType.PICKAXE,0)));
.addToolType(ToolType.HOE,0)));

// Iron broadsword
public static final RegistryObject<Item> IRON_BROADSWORD =
Expand All @@ -38,6 +38,29 @@ public class ModItems {
.defaultMaxDamage(250)
.group(ItemGroup.COMBAT)));

// Stone sickles
public static final RegistryObject<Item> STONE_SICKLES =
Registration.ITEMS.register("stone_sickles",
() -> new SwordItem(ItemTier.STONE, 0,-1.2f,
new Item.Properties()
.defaultMaxDamage(91)
.group(ItemGroup.COMBAT)
.addToolType(ToolType.HOE,0)));

// Stone broadsword
public static final RegistryObject<Item> STONE_BROADSWORD =
Registration.ITEMS.register("stone_broadsword",
() -> new BroadSword(ItemTier.STONE, 5,-3.4f,
new Item.Properties()
.defaultMaxDamage(142)
.group(ItemGroup.COMBAT)));

// Stone longsword
public static final RegistryObject<Item> STONE_LONGSWORD =
Registration.ITEMS.register("stone_longsword",
() -> new Longsword(ItemTier.STONE, 4,-2.4f,
new Item.Properties()
.defaultMaxDamage(131)
.group(ItemGroup.COMBAT)));
public static void register() {}
}
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ logoFile="swordselection.png" #optional
[[mods]] #mandatory

modId="swordselection" #mandatory
version="0.2.0" #mandatory
version="${version}" #mandatory
displayName="Sword Selection" #mandatory
#updateJSONURL="http://myurl.me/" #optional
#displayURL="http://example.com/" #optional
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/assets/swordselection/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"item.swordselection.iron_sickles": "Iron Sickles",
"item.swordselection.iron_broadsword": "Iron Broadsword",
"item.swordselection.iron_longsword": "Iron Longsword"
"item.swordselection.iron_longsword": "Iron Longsword",
"item.swordselection.stone_sickles": "Stone Sickles",
"item.swordselection.stone_broadsword": "Stone Broadsword",
"item.swordselection.stone_longsword": "Stone Longsword"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "swordselection:item/stone_broadsword"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "swordselection:item/stone_longsword"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/handheld",
"textures":{
"layer0": "swordselection:item/stone_sickles"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "minecraft:stone_sword"
},
"result": "swordselection:stone_broadsword",
"count": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "minecraft:stone_sword"
},
"result": "swordselection:stone_longsword",
"count": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "minecraft:stone_sword"
},
"result": "swordselection:stone_sickles",
"count": 1
}

0 comments on commit f3ae7ce

Please sign in to comment.