From f3ae7ce389d7a31dcf74812db8d21dffdbedc064 Mon Sep 17 00:00:00 2001 From: SneK152 Date: Sat, 3 Jul 2021 10:51:12 -0700 Subject: [PATCH] Added the stone tiers of the sickles, longsword, and broadsword, as well as model and texture files and recipes Revamped version system in build.gradle, made it more efficient for getting the mod version --- build.gradle | 20 +++++++++++++- .../snek152/swordselection/item/ModItems.java | 25 +++++++++++++++++- src/main/resources/META-INF/mods.toml | 2 +- .../assets/swordselection/lang/en_us.json | 5 +++- .../models/item/stone_broadsword.json | 6 +++++ .../models/item/stone_longsword.json | 6 +++++ .../models/item/stone_sickles.json | 6 +++++ .../textures/item/stone_broadsword.png | Bin 0 -> 279 bytes .../textures/item/stone_longsword.png | Bin 0 -> 440 bytes .../textures/item/stone_sickles.png | Bin 0 -> 327 bytes .../recipes/stone_broadsword.json | 8 ++++++ .../recipes/stone_longsword.json | 8 ++++++ .../swordselection/recipes/stone_sickles.json | 8 ++++++ 13 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/assets/swordselection/models/item/stone_broadsword.json create mode 100644 src/main/resources/assets/swordselection/models/item/stone_longsword.json create mode 100644 src/main/resources/assets/swordselection/models/item/stone_sickles.json create mode 100644 src/main/resources/assets/swordselection/textures/item/stone_broadsword.png create mode 100644 src/main/resources/assets/swordselection/textures/item/stone_longsword.png create mode 100644 src/main/resources/assets/swordselection/textures/item/stone_sickles.png create mode 100644 src/main/resources/data/swordselection/recipes/stone_broadsword.json create mode 100644 src/main/resources/data/swordselection/recipes/stone_longsword.json create mode 100644 src/main/resources/data/swordselection/recipes/stone_sickles.json diff --git a/build.gradle b/build.gradle index b241826..7105851 100644 --- a/build.gradle +++ b/build.gradle @@ -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. @@ -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' + } +} \ No newline at end of file diff --git a/src/main/java/com/snek152/swordselection/item/ModItems.java b/src/main/java/com/snek152/swordselection/item/ModItems.java index 10c12b3..3f20167 100644 --- a/src/main/java/com/snek152/swordselection/item/ModItems.java +++ b/src/main/java/com/snek152/swordselection/item/ModItems.java @@ -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 IRON_BROADSWORD = @@ -38,6 +38,29 @@ public class ModItems { .defaultMaxDamage(250) .group(ItemGroup.COMBAT))); + // Stone sickles + public static final RegistryObject 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 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 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() {} } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 2d8b629..82ee6ee 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -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 diff --git a/src/main/resources/assets/swordselection/lang/en_us.json b/src/main/resources/assets/swordselection/lang/en_us.json index 31d6620..7759c7b 100644 --- a/src/main/resources/assets/swordselection/lang/en_us.json +++ b/src/main/resources/assets/swordselection/lang/en_us.json @@ -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" } \ No newline at end of file diff --git a/src/main/resources/assets/swordselection/models/item/stone_broadsword.json b/src/main/resources/assets/swordselection/models/item/stone_broadsword.json new file mode 100644 index 0000000..2d907eb --- /dev/null +++ b/src/main/resources/assets/swordselection/models/item/stone_broadsword.json @@ -0,0 +1,6 @@ +{ + "parent": "item/handheld", + "textures": { + "layer0": "swordselection:item/stone_broadsword" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/swordselection/models/item/stone_longsword.json b/src/main/resources/assets/swordselection/models/item/stone_longsword.json new file mode 100644 index 0000000..ff5ac56 --- /dev/null +++ b/src/main/resources/assets/swordselection/models/item/stone_longsword.json @@ -0,0 +1,6 @@ +{ + "parent": "item/handheld", + "textures": { + "layer0": "swordselection:item/stone_longsword" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/swordselection/models/item/stone_sickles.json b/src/main/resources/assets/swordselection/models/item/stone_sickles.json new file mode 100644 index 0000000..6247c77 --- /dev/null +++ b/src/main/resources/assets/swordselection/models/item/stone_sickles.json @@ -0,0 +1,6 @@ +{ + "parent": "item/handheld", + "textures":{ + "layer0": "swordselection:item/stone_sickles" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/swordselection/textures/item/stone_broadsword.png b/src/main/resources/assets/swordselection/textures/item/stone_broadsword.png new file mode 100644 index 0000000000000000000000000000000000000000..2736995599c84dfa200bb9a141991b08cbc1000d GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}50G|+7PfyRO6MHMl%OxZvHg8<7sHo`T;*y=6J#E@FPczXBKe^6ybqzUg zpzPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940ZmCnK~y+Tm69<_ z!%z@_?`3GysSzp0L1OBbC8J}OkXR71)t^%Tgo6S9fs5S&MI@TdQ5+l!ok9=^9ZE9U zXRthbk3>v~P5ME|9hdKTxqAe5#Bm%c%d!OH^D`56YOpC!9-ctpl?I^fd0vWfAvXqP zd=CZ#c5{8jR8?gd^I{!UGB0dm7>0;Xo^sZCb2$&ebzNpz*0QmT6b%Yl*Y)Od0XDI1 zn_&~oQMw$BYUR=z8Do?X!sUzM5bnlf2*YseT`3hELzkAVUZVC-!1sMFD~clG<%#3C zlYds?w}GQ~rB$b$9PGE@{`H$`n#Sicolbci1VQCV2>!bSskr)zlT)n=w~rqw6?%u1 z(nJsh*d`;yG)*R~%SWvlJijf{+56{SUIRRS6h$;oE8#;tR{Jn{$>?7hsgn^R%Q9aR iZeTv2R}Sib0Db_OJ*EAGQX2>W0000?66$` literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/swordselection/textures/item/stone_sickles.png b/src/main/resources/assets/swordselection/textures/item/stone_sickles.png new file mode 100644 index 0000000000000000000000000000000000000000..37f48de95ddb19f3eef9e34a09ddb9a628b86a7e GIT binary patch literal 327 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBuf-vKbiP>*~f_FS!978PplNX2>IA!iRa9IDt{)Iawo2Sm> zJA8kCy(AM8Q^%!tMhCXW4{f~C|D0P-FrR2MXmr(JNRd8p<_yoW%-2n4XPf_THZnZ0 z(L4Nri68TwzfAubMGY6VTj+S*UafsFuv2jU^mM}-y}Lpun1f3GJ<()~_|wdACTvF9 z8imN<56{0}W_<9YjqBiJ`BO)E_o%YiPoM4m$NQ?-&-y$o