From cc57843d712237b422bcb36d31f714fb8c4dd6fd Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 15:32:40 +0530 Subject: [PATCH 01/58] Updated version json. Now uses pre3 --- src/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin.json b/src/plugin.json index 04a47b36..cabac7f1 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -3,7 +3,7 @@ "minversion": 202000322116, "info": { "name": "Minecraft Fabric 1.15.2 Generator", - "version": "0.6.0+pre2", + "version": "0.6.0+pre3", "description": "A Fabric Generator", "author": "Goldorion with the help of CrispyChips and BoogieMonster1O1" } From 82df2c164176bb51388ef2ecfd7b310d7e45e21f Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 16:37:10 +0530 Subject: [PATCH 02/58] Removed gradle.properties --- src/fabric-1.15.2/loottable.definition.yaml | 2 +- .../templates/function.mcfunction.ftl | 2 +- .../workspacebase/gradle.properties | 16 ---------------- 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 src/fabric-1.15.2/workspacebase/gradle.properties diff --git a/src/fabric-1.15.2/loottable.definition.yaml b/src/fabric-1.15.2/loottable.definition.yaml index c446390e..61041750 100644 --- a/src/fabric-1.15.2/loottable.definition.yaml +++ b/src/fabric-1.15.2/loottable.definition.yaml @@ -1,4 +1,4 @@ templates: - template: json/loottable.json.ftl writer: json - name: "@RESROOT/data/@[getNamespace()]/loot_tables/@[getName()].json" \ No newline at end of file + name: "@RESROOT/data/@[getNamespace()]/loot_tables/@[getName()].json" diff --git a/src/fabric-1.15.2/templates/function.mcfunction.ftl b/src/fabric-1.15.2/templates/function.mcfunction.ftl index 3b0f6b34..d9c02760 100644 --- a/src/fabric-1.15.2/templates/function.mcfunction.ftl +++ b/src/fabric-1.15.2/templates/function.mcfunction.ftl @@ -1 +1 @@ -${data.code} \ No newline at end of file +${data.code} diff --git a/src/fabric-1.15.2/workspacebase/gradle.properties b/src/fabric-1.15.2/workspacebase/gradle.properties deleted file mode 100644 index cc96bf4b..00000000 --- a/src/fabric-1.15.2/workspacebase/gradle.properties +++ /dev/null @@ -1,16 +0,0 @@ -# Done to increase the memory available to gradle -org.gradle.jvmargs=-Xmx1G - -# Fabric Properties -minecraft_version=1.15.2 -yarn_mappings=1.15.2+build.17 -loader_version=0.8.7+build.201 - - mod_version = 1.0.0 - maven_group = net.fabricmc - archives_base_name = modid - -# Dependencies - # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - #Fabric api - fabric_version=0.12.0+build.313-1.15 From 6c065cc485edc513ad2b818cbb835ae28784f420 Mon Sep 17 00:00:00 2001 From: CrispyTheChips Date: Mon, 15 Jun 2020 12:18:48 +0000 Subject: [PATCH 03/58] Add mod menu --- src/fabric-1.15.2/workspacebase/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fabric-1.15.2/workspacebase/build.gradle b/src/fabric-1.15.2/workspacebase/build.gradle index eaf93a3e..2409a48e 100644 --- a/src/fabric-1.15.2/workspacebase/build.gradle +++ b/src/fabric-1.15.2/workspacebase/build.gradle @@ -17,6 +17,9 @@ dependencies { //Fabric api modImplementation "net.fabricmc.fabric-api:fabric-api:0.12.0+build.313-1.15" + + //Mod Menu + modImplementation "io.github.prospector:modmenu:1.10.2+build.32" } processResources { From 4882aaeac12e3cab89d94cdf843709f3351d40b8 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 18:31:02 +0530 Subject: [PATCH 04/58] Implement food eating time method --- src/fabric-1.15.2/templates/food.java.ftl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fabric-1.15.2/templates/food.java.ftl b/src/fabric-1.15.2/templates/food.java.ftl index c0c3af2d..c70c4159 100644 --- a/src/fabric-1.15.2/templates/food.java.ftl +++ b/src/fabric-1.15.2/templates/food.java.ftl @@ -36,5 +36,12 @@ public class ${name} extends Item{ public UseAction getUseAction(ItemStack stack) { return UseAction.${data.animation?upper_case}; } + + <#if data.eatingSpeed != 32> + @Override + public int getMaxUseTime(ItemStack stack) { + return ${data.eatingSpeed}; + } + } <#-- @formatter:on --> From 45f4849283cf99423e37c44daac50be4f347d717 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 19:10:21 +0530 Subject: [PATCH 05/58] Removed some stuff from partial support --- src/fabric-1.15.2/generator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/generator.yaml b/src/fabric-1.15.2/generator.yaml index 1bcab8a9..1b249867 100644 --- a/src/fabric-1.15.2/generator.yaml +++ b/src/fabric-1.15.2/generator.yaml @@ -1,6 +1,6 @@ name: Minecraft Fabric for 1.15.2 (@buildfileversion) basefeatures: [model_json,model_obj] -partial_support: [block,item,food,armor,biome,tab,sounds,fuel] +partial_support: [block,item,food,armor,biome,sounds] status: dev buildfileversion: 0.8.7+build.201 From 5905db0f9c112315da5d51820e29432ebd8d505e Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 21:16:30 +0530 Subject: [PATCH 06/58] Fix jsons --- .../{ => mappings}/jsontriggers/_mcitemblock.json.ftl | 0 .../{ => mappings}/jsontriggers/biome_entered.json.ftl | 0 .../{ => mappings}/jsontriggers/block_placed.json.ftl | 0 .../{ => mappings}/jsontriggers/custom_trigger.json.ftl | 0 .../{ => mappings}/jsontriggers/dimension_entered.json.ftl | 0 .../{ => mappings}/jsontriggers/dimension_left.json.ftl | 0 .../{ => mappings}/jsontriggers/item_consumed.json.ftl | 0 .../{ => mappings}/jsontriggers/item_damaged.json.ftl | 0 .../{ => mappings}/jsontriggers/item_in_inventory.json.ftl | 0 src/fabric-1.15.2/{ => mappings}/jsontriggers/tick.json.ftl | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/_mcitemblock.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/biome_entered.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/block_placed.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/custom_trigger.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/dimension_entered.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/dimension_left.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/item_consumed.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/item_damaged.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/item_in_inventory.json.ftl (100%) rename src/fabric-1.15.2/{ => mappings}/jsontriggers/tick.json.ftl (100%) diff --git a/src/fabric-1.15.2/jsontriggers/_mcitemblock.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/_mcitemblock.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/_mcitemblock.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/_mcitemblock.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/biome_entered.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/biome_entered.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/biome_entered.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/biome_entered.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/block_placed.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/block_placed.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/block_placed.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/block_placed.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/custom_trigger.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/custom_trigger.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/custom_trigger.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/custom_trigger.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/dimension_entered.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/dimension_entered.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/dimension_entered.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/dimension_entered.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/dimension_left.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/dimension_left.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/dimension_left.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/dimension_left.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/item_consumed.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/item_consumed.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/item_consumed.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/item_consumed.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/item_damaged.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/item_damaged.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/item_damaged.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/item_damaged.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/item_in_inventory.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/item_in_inventory.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/item_in_inventory.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/item_in_inventory.json.ftl diff --git a/src/fabric-1.15.2/jsontriggers/tick.json.ftl b/src/fabric-1.15.2/mappings/jsontriggers/tick.json.ftl similarity index 100% rename from src/fabric-1.15.2/jsontriggers/tick.json.ftl rename to src/fabric-1.15.2/mappings/jsontriggers/tick.json.ftl From 59117b4c8d455d28f46e83894cd3fcc6e84abda7 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 21:17:52 +0530 Subject: [PATCH 07/58] Fixed accidental json moves --- .../{mappings => }/jsontriggers/_mcitemblock.json.ftl | 0 .../{mappings => }/jsontriggers/biome_entered.json.ftl | 0 .../{mappings => }/jsontriggers/block_placed.json.ftl | 0 .../{mappings => }/jsontriggers/custom_trigger.json.ftl | 0 .../{mappings => }/jsontriggers/dimension_entered.json.ftl | 0 .../{mappings => }/jsontriggers/dimension_left.json.ftl | 0 .../{mappings => }/jsontriggers/item_consumed.json.ftl | 0 .../{mappings => }/jsontriggers/item_damaged.json.ftl | 0 .../{mappings => }/jsontriggers/item_in_inventory.json.ftl | 0 src/fabric-1.15.2/{mappings => }/jsontriggers/tick.json.ftl | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename src/fabric-1.15.2/{mappings => }/jsontriggers/_mcitemblock.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/biome_entered.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/block_placed.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/custom_trigger.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/dimension_entered.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/dimension_left.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/item_consumed.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/item_damaged.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/item_in_inventory.json.ftl (100%) rename src/fabric-1.15.2/{mappings => }/jsontriggers/tick.json.ftl (100%) diff --git a/src/fabric-1.15.2/mappings/jsontriggers/_mcitemblock.json.ftl b/src/fabric-1.15.2/jsontriggers/_mcitemblock.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/_mcitemblock.json.ftl rename to src/fabric-1.15.2/jsontriggers/_mcitemblock.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/biome_entered.json.ftl b/src/fabric-1.15.2/jsontriggers/biome_entered.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/biome_entered.json.ftl rename to src/fabric-1.15.2/jsontriggers/biome_entered.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/block_placed.json.ftl b/src/fabric-1.15.2/jsontriggers/block_placed.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/block_placed.json.ftl rename to src/fabric-1.15.2/jsontriggers/block_placed.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/custom_trigger.json.ftl b/src/fabric-1.15.2/jsontriggers/custom_trigger.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/custom_trigger.json.ftl rename to src/fabric-1.15.2/jsontriggers/custom_trigger.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/dimension_entered.json.ftl b/src/fabric-1.15.2/jsontriggers/dimension_entered.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/dimension_entered.json.ftl rename to src/fabric-1.15.2/jsontriggers/dimension_entered.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/dimension_left.json.ftl b/src/fabric-1.15.2/jsontriggers/dimension_left.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/dimension_left.json.ftl rename to src/fabric-1.15.2/jsontriggers/dimension_left.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/item_consumed.json.ftl b/src/fabric-1.15.2/jsontriggers/item_consumed.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/item_consumed.json.ftl rename to src/fabric-1.15.2/jsontriggers/item_consumed.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/item_damaged.json.ftl b/src/fabric-1.15.2/jsontriggers/item_damaged.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/item_damaged.json.ftl rename to src/fabric-1.15.2/jsontriggers/item_damaged.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/item_in_inventory.json.ftl b/src/fabric-1.15.2/jsontriggers/item_in_inventory.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/item_in_inventory.json.ftl rename to src/fabric-1.15.2/jsontriggers/item_in_inventory.json.ftl diff --git a/src/fabric-1.15.2/mappings/jsontriggers/tick.json.ftl b/src/fabric-1.15.2/jsontriggers/tick.json.ftl similarity index 100% rename from src/fabric-1.15.2/mappings/jsontriggers/tick.json.ftl rename to src/fabric-1.15.2/jsontriggers/tick.json.ftl From 0451e4e41a6944cb2399210ba844321afd7805a8 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 21:21:59 +0530 Subject: [PATCH 08/58] Fix bug with soundevent --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 7876b50f..16834333 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -22,7 +22,7 @@ public class ${JavaModName} implements ModInitializer { <#list sounds as sound> public static final Identifier ${sound} = new Identifier("${modid}:${sound}"); - public static SoundEvent ${sound} = new SoundEvent(${sound}); + public static SoundEvent ${sound}Event = new SoundEvent(${sound}); <#list w.getElementsOfType("ITEM") as item> From 3b36b737f692115d40c664a66ba97e7a1729999e Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 21:25:06 +0530 Subject: [PATCH 09/58] Replace names --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 16834333..a71d811f 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -21,8 +21,8 @@ import net.fabricmc.fabric.api.biomes.v1.OverworldClimate; public class ${JavaModName} implements ModInitializer { <#list sounds as sound> - public static final Identifier ${sound} = new Identifier("${modid}:${sound}"); - public static SoundEvent ${sound}Event = new SoundEvent(${sound}); + public static final Identifier ${sound}Event = new Identifier("${modid}:${sound}"); + public static SoundEvent ${sound} = new SoundEvent(${sound}Event); <#list w.getElementsOfType("ITEM") as item> From 1fa2cf46f094830ebb616f12a98033ba1df57172 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 21:43:03 +0530 Subject: [PATCH 10/58] Fixed a bug where incorrect scope would be given --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index a71d811f..c24617ad 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -49,7 +49,7 @@ public class ${JavaModName} implements ModInitializer { public void onInitialize() { <#list sounds as sound> - Registry.register(Registry.${sound}, ${JavaModName}.${sound}, ${sound}); + Registry.register(Registry.SOUND_EVENT, ${JavaModName}.${sound}Event, ${sound}); <#list w.getElementsOfType("ITEM") as item> From 1f3d8cfbeebc21ab376d53ba06ab7599ae26931f Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Mon, 15 Jun 2020 22:01:07 +0530 Subject: [PATCH 11/58] Fixed bug with custom sounds --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index c24617ad..823949b8 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -21,8 +21,8 @@ import net.fabricmc.fabric.api.biomes.v1.OverworldClimate; public class ${JavaModName} implements ModInitializer { <#list sounds as sound> - public static final Identifier ${sound}Event = new Identifier("${modid}:${sound}"); - public static SoundEvent ${sound} = new SoundEvent(${sound}Event); + public static final Identifier ${sound} = new Identifier("${modid}:${sound}"); + public static SoundEvent ${sound}Event = new SoundEvent(${sound}); <#list w.getElementsOfType("ITEM") as item> @@ -49,7 +49,7 @@ public class ${JavaModName} implements ModInitializer { public void onInitialize() { <#list sounds as sound> - Registry.register(Registry.SOUND_EVENT, ${JavaModName}.${sound}Event, ${sound}); + Registry.register(Registry.SOUND_EVENT, ${JavaModName}.${sound}, ${JavaModName}.${sound}Event); <#list w.getElementsOfType("ITEM") as item> From 9bffe7072ce03c7b11b856c26b98b3f67ddbe2e5 Mon Sep 17 00:00:00 2001 From: crispy_chips1234 <2222080225@qq.com> Date: Tue, 16 Jun 2020 09:34:38 +0800 Subject: [PATCH 12/58] edited README.md and CONTRIBUTING.md --- CONTRIBUTING.md | 13 ++++++++++--- README.md | 9 +++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index be22d09c..a9e9ca8f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,12 +2,19 @@ Since we have limited time, we would love to accept pull requests to get things done. We've also put a few ground rules so that pull requests can be maintained easily and follow the same codestyle. -## Rules +## Contributing Code * Use the `this` keyword everywhere for instance variables * Create a single commit for each feature, rather than making a huge commit for everything -* Keep minor changes like bug fixes and spelling errors a seperate commit +* Keep minor changes like bug fixes and spelling errors a separate commit * State all your changes * Do *not* use newline brackets * Do not send a huge pull request with multiple large and untraceable commits. Instead, create a single pull request for each major change. -You must also follow the code of conduct. +## Reporting Issues +* Please describe your issue in detail. +* Provide your mcreator.log file, located in /.mcreator/logs. You might need to enable hidden folders to see this file. +* If your issue is a build error or occurs in-game, please provide the full contents of the "console" tab in MCreator in text format. +* Please share long logs in paste websites like [Github Gists](https://gist.github.com/) or [Pastebin](https://pastebin.com/). +* We do not provide support for outdated versions. + +You must also follow the [Code Of Conduct](https://github.com/ClothCreators/MCreatorFabricGenerator/blob/1.15.2/CODE_OF_CONDUCT.md). diff --git a/README.md b/README.md index 53ca872c..41f19866 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # MCreatorFabricGenerator -An unofficial plugin for [MCreator](https://mcreator.net/), a highly advanced Minecraft mod maker. Adds a [Fabric](https://fabricmc.net/) mod generator type. Currently this is very WIP, and most features are incomplete. +An unofficial plugin for [MCreator](https://mcreator.net/), a highly advanced Minecraft mod maker. Adds a [Fabric](https://fabricmc.net/) mod generator type. Currently, this tool is very incomplete. ## Disclaimer This project is not official. Not affiliated with the respective owners and maintainers of Fabric, Minecraft, or MCreator. Do not expect any official support from their respective communities. ## Features * Advancement (Mostly complete) -* Armor (Mostly complete) **To don't get an error, you have to select a sound.** (Not all sounds are included because mappings are not finished. Any help is welcome.) +* Armor (Mostly complete) **To not get an error, you have to select an equip sound.** * Block (Mostly complete) * Food (Mostly complete) * Fuel (Complete) @@ -14,10 +14,10 @@ This project is not official. Not affiliated with the respective owners and main * Loot table (Complete) * Recipe (Complete) * Tag (Complete) -* Tool (Pickaxe, Axe, Shovel, Hoe and Sword) +* Tool (Supports Pickaxe, Axe, Shovel, Hoe and Sword) * Biome (Not complete) * Ore generation (Nether and Overworld, Netherrack and Stone Respectively) -* Itemgroups (Complete) +* Itemgroups("Creative Tabs") (Complete) ## Downloads/Install Instructions @@ -27,6 +27,7 @@ The plugin's MCreator forum page is [here](https://mcreator.net/forum/60201/fabr Install like any other plugin: Launch MCreator -> Open preferences -> Manage plugins -> Load Plugin -> Find your downloaded zip file -> **Restart MCreator**. ## Important Information + - If you have created a workspace with a version older than 0.4.0, you need to create a new one since the workspace format has been changed. - To use the latest version of the plugin, you need to have the latest version of MCreator. From e6f9141f83383e7466fa4211cfb114523ac302de Mon Sep 17 00:00:00 2001 From: Goldorion <38427877+Goldorion@users.noreply.github.com> Date: Mon, 15 Jun 2020 21:41:17 -0400 Subject: [PATCH 13/58] Update README.md --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 41f19866..e9124081 100644 --- a/README.md +++ b/README.md @@ -6,28 +6,26 @@ This project is not official. Not affiliated with the respective owners and main ## Features * Advancement (Mostly complete) * Armor (Mostly complete) **To not get an error, you have to select an equip sound.** +* Biome (Not complete) * Block (Mostly complete) + - Ore generation (Nether and Overworld, Netherrack and Stone Respectively) * Food (Mostly complete) * Fuel (Complete) * Function (Complete) * Item (Mostly Complete) +* Itemgroups("Creative Tabs") (Complete) * Loot table (Complete) * Recipe (Complete) * Tag (Complete) * Tool (Supports Pickaxe, Axe, Shovel, Hoe and Sword) -* Biome (Not complete) -* Ore generation (Nether and Overworld, Netherrack and Stone Respectively) -* Itemgroups("Creative Tabs") (Complete) ## Downloads/Install Instructions - Downloads can be found on the [Release page of this repo](https://github.com/Goldorion/MCreatorFabricGenerator/releases). The plugin's MCreator forum page is [here](https://mcreator.net/forum/60201/fabric-generator-plugin). Install like any other plugin: Launch MCreator -> Open preferences -> Manage plugins -> Load Plugin -> Find your downloaded zip file -> **Restart MCreator**. ## Important Information - - If you have created a workspace with a version older than 0.4.0, you need to create a new one since the workspace format has been changed. - To use the latest version of the plugin, you need to have the latest version of MCreator. From 7c6acd056600ebc09c9018226f54451b0daf58fc Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 08:25:38 +0530 Subject: [PATCH 14/58] Fixed mapping name --- src/fabric-1.15.2/mappings/sounds.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/mappings/sounds.yaml b/src/fabric-1.15.2/mappings/sounds.yaml index f2d65b58..f26552bf 100644 --- a/src/fabric-1.15.2/mappings/sounds.yaml +++ b/src/fabric-1.15.2/mappings/sounds.yaml @@ -19,7 +19,7 @@ item.armor.equip_chain: ITEM_ARMOR_EQUIP_CHAIN item.armor.equip_diamond: ITEM_ARMOR_EQUIP_DIAMOND item.armor.equip_elytra: ITEM_ARMOR_EQUIP_ELYTRA item.armor.equip_generic: ITEM_ARMOR_EQUIP_GENERIC -item.armor.equip_gold: ITEM_ARMOR_EQUIPE_GOLD +item.armor.equip_gold: ITEM_ARMOR_EQUIP_GOLD item.armor.equip_iron: ITEM_ARMOR_EQUIP_IRON item.armor.equip_leather: ITEM_ARMOR_EQUIP_LEATHER item.armor.equip_turtle: ITEM_ARMOR_EQUIP_TURTLE From ca13ed35169d4d13b6d52ec74f926e2e7070d92e Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 08:36:28 +0530 Subject: [PATCH 15/58] Fixed custom sound bug --- src/fabric-1.15.2/templates/armorMaterial.java.ftl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/armorMaterial.java.ftl b/src/fabric-1.15.2/templates/armorMaterial.java.ftl index 19d6ba95..41f5399e 100644 --- a/src/fabric-1.15.2/templates/armorMaterial.java.ftl +++ b/src/fabric-1.15.2/templates/armorMaterial.java.ftl @@ -8,7 +8,10 @@ import net.fabricmc.api.Environment; public enum ${name}Material implements ArmorMaterial { - ${name}("${registryname}", ${data.maxDamage}, new int[]{${data.damageValueBoots}, ${data.damageValueLeggings}, ${data.damageValueBody}, ${data.damageValueHelmet}}, ${data.enchantability}, SoundEvents.${data.equipSound}, ${data.toughness}F, () -> { + ${name}("${registryname}", ${data.maxDamage}, new int[]{${data.damageValueBoots}, ${data.damageValueLeggings}, ${data.damageValueBody}, ${data.damageValueHelmet}}, ${data.enchantability}, + <#if data.equipSound?contains(modid)>Registry.SOUND_EVENT.get(new Identifier(data.equipSound))<#else> + SoundEvents.${data.equipSound}, + ${data.toughness}F, () -> { return Ingredient.ofItems(<#if data.repairItems?has_content><#list data.repairItems as repairItem>${mappedMCItemToItemStackCode(repairItem)?replace("Blocks.", "Items.")}<#if repairItem?has_next>,<#else>Items.AIR); }); From 1f77a61f05ddc3611a201aefcc0bcac65e6b9ee2 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 08:40:00 +0530 Subject: [PATCH 16/58] Fixed incorrect template --- src/fabric-1.15.2/templates/armorMaterial.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/armorMaterial.java.ftl b/src/fabric-1.15.2/templates/armorMaterial.java.ftl index 41f5399e..848074f5 100644 --- a/src/fabric-1.15.2/templates/armorMaterial.java.ftl +++ b/src/fabric-1.15.2/templates/armorMaterial.java.ftl @@ -9,7 +9,7 @@ import net.fabricmc.api.Environment; public enum ${name}Material implements ArmorMaterial { ${name}("${registryname}", ${data.maxDamage}, new int[]{${data.damageValueBoots}, ${data.damageValueLeggings}, ${data.damageValueBody}, ${data.damageValueHelmet}}, ${data.enchantability}, - <#if data.equipSound?contains(modid)>Registry.SOUND_EVENT.get(new Identifier(data.equipSound))<#else> + <#if data.equipSound?contains(modid)>Registry.SOUND_EVENT.get(new Identifier("${data.equipSound}"))<#else> SoundEvents.${data.equipSound}, ${data.toughness}F, () -> { return Ingredient.ofItems(<#if data.repairItems?has_content><#list data.repairItems as repairItem>${mappedMCItemToItemStackCode(repairItem)?replace("Blocks.", "Items.")}<#if repairItem?has_next>,<#else>Items.AIR); From d18a319b4d0c56b33aaf4fc9e45e30936615514b Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 08:54:08 +0530 Subject: [PATCH 17/58] Fix incorrect identifier --- src/fabric-1.15.2/templates/armorMaterial.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/armorMaterial.java.ftl b/src/fabric-1.15.2/templates/armorMaterial.java.ftl index 848074f5..a9222a84 100644 --- a/src/fabric-1.15.2/templates/armorMaterial.java.ftl +++ b/src/fabric-1.15.2/templates/armorMaterial.java.ftl @@ -9,7 +9,7 @@ import net.fabricmc.api.Environment; public enum ${name}Material implements ArmorMaterial { ${name}("${registryname}", ${data.maxDamage}, new int[]{${data.damageValueBoots}, ${data.damageValueLeggings}, ${data.damageValueBody}, ${data.damageValueHelmet}}, ${data.enchantability}, - <#if data.equipSound?contains(modid)>Registry.SOUND_EVENT.get(new Identifier("${data.equipSound}"))<#else> + <#if data.equipSound?contains(modid)>${JavaModName}.${data.equipSound?remove_beginning(modid + ":")}(new Identifier("${data.equipSound}"))<#else> SoundEvents.${data.equipSound}, ${data.toughness}F, () -> { return Ingredient.ofItems(<#if data.repairItems?has_content><#list data.repairItems as repairItem>${mappedMCItemToItemStackCode(repairItem)?replace("Blocks.", "Items.")}<#if repairItem?has_next>,<#else>Items.AIR); From 7f3f627c1bba03759936d0f5ecbfcc4880aa5016 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 08:56:37 +0530 Subject: [PATCH 18/58] Fix wrong import --- src/fabric-1.15.2/templates/armorMaterial.java.ftl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fabric-1.15.2/templates/armorMaterial.java.ftl b/src/fabric-1.15.2/templates/armorMaterial.java.ftl index a9222a84..000b579d 100644 --- a/src/fabric-1.15.2/templates/armorMaterial.java.ftl +++ b/src/fabric-1.15.2/templates/armorMaterial.java.ftl @@ -5,11 +5,12 @@ package ${package}.item; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import ${package}.${JavaModName}; - public enum ${name}Material implements ArmorMaterial { +public enum ${name}Material implements ArmorMaterial { ${name}("${registryname}", ${data.maxDamage}, new int[]{${data.damageValueBoots}, ${data.damageValueLeggings}, ${data.damageValueBody}, ${data.damageValueHelmet}}, ${data.enchantability}, - <#if data.equipSound?contains(modid)>${JavaModName}.${data.equipSound?remove_beginning(modid + ":")}(new Identifier("${data.equipSound}"))<#else> + <#if data.equipSound?contains(modid)>${JavaModName}.${data.equipSound?remove_beginning(modid + ":")}<#else> SoundEvents.${data.equipSound}, ${data.toughness}F, () -> { return Ingredient.ofItems(<#if data.repairItems?has_content><#list data.repairItems as repairItem>${mappedMCItemToItemStackCode(repairItem)?replace("Blocks.", "Items.")}<#if repairItem?has_next>,<#else>Items.AIR); From 4cefd06bedf519f7d17bde624099148ef098359c Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 08:59:25 +0530 Subject: [PATCH 19/58] Fix class cast --- src/fabric-1.15.2/templates/armorMaterial.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/armorMaterial.java.ftl b/src/fabric-1.15.2/templates/armorMaterial.java.ftl index 000b579d..90bc7a37 100644 --- a/src/fabric-1.15.2/templates/armorMaterial.java.ftl +++ b/src/fabric-1.15.2/templates/armorMaterial.java.ftl @@ -10,7 +10,7 @@ import ${package}.${JavaModName}; public enum ${name}Material implements ArmorMaterial { ${name}("${registryname}", ${data.maxDamage}, new int[]{${data.damageValueBoots}, ${data.damageValueLeggings}, ${data.damageValueBody}, ${data.damageValueHelmet}}, ${data.enchantability}, - <#if data.equipSound?contains(modid)>${JavaModName}.${data.equipSound?remove_beginning(modid + ":")}<#else> + <#if data.equipSound?contains(modid)>${JavaModName}.${data.equipSound?remove_beginning(modid + ":")}Event<#else> SoundEvents.${data.equipSound}, ${data.toughness}F, () -> { return Ingredient.ofItems(<#if data.repairItems?has_content><#list data.repairItems as repairItem>${mappedMCItemToItemStackCode(repairItem)?replace("Blocks.", "Items.")}<#if repairItem?has_next>,<#else>Items.AIR); From b0951b63add52b524528d3062be92e939dc408a1 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 09:06:20 +0530 Subject: [PATCH 20/58] Added sounds to readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e9124081..2f668544 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This project is not official. Not affiliated with the respective owners and main ## Features * Advancement (Mostly complete) -* Armor (Mostly complete) **To not get an error, you have to select an equip sound.** +* Armor (Mostly complete) **To not get an error, you have to select an equip sound.** * Biome (Not complete) * Block (Mostly complete) - Ore generation (Nether and Overworld, Netherrack and Stone Respectively) @@ -18,6 +18,7 @@ This project is not official. Not affiliated with the respective owners and main * Recipe (Complete) * Tag (Complete) * Tool (Supports Pickaxe, Axe, Shovel, Hoe and Sword) +* Sounds (Only useful for Armor. **Sound names can not have any special charecters.**) ## Downloads/Install Instructions Downloads can be found on the [Release page of this repo](https://github.com/Goldorion/MCreatorFabricGenerator/releases). @@ -48,4 +49,3 @@ Licensed under the GNU Lesser General Public License, version 3.0 * Forked versions of this software must be distributed under the same license as this with attribution, if distributed. * Changes must be stated if any modified works are to be distributed. * Under no circumstances can you state that modified works are endorsed by the original creators. - From b2045cdc3cfd48e6bb8cd31b1257a251e8b0196c Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 09:11:23 +0530 Subject: [PATCH 21/58] Add Client Initializer --- src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl | 5 ++++- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl index 1dd3226a..a81f453b 100644 --- a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl +++ b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl @@ -26,6 +26,9 @@ "entrypoints": { "main": [ "${package}.${JavaModName}" + ], + "client":[ + "${package}.${JavaModName}$ClientInit" ] }, @@ -38,4 +41,4 @@ "flamingo": "*" } } -<#-- @formatter:on --> \ No newline at end of file +<#-- @formatter:on --> diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 823949b8..53600c4e 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -17,6 +17,7 @@ package ${package}; import ${package}.item; import net.fabricmc.fabric.api.biomes.v1.OverworldBiomes; import net.fabricmc.fabric.api.biomes.v1.OverworldClimate; +import net.fabricmc.api.ClientModInitializer; public class ${JavaModName} implements ModInitializer { @@ -89,5 +90,12 @@ ${JavaModName}Biomes.registerBiomes(); ${fuel}Fuel.initialize(); } + + public static class ClientInit implements ClientModInitializer{ + @Override + public void onInitializeClient() { + System.out.println("Detected Client"); + } + } } <#-- @formatter:on --> From a59f0b6d4aae09fde90f9615988ad2b47cb9ec51 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 09:17:27 +0530 Subject: [PATCH 22/58] Fixed inner class --- .../templates/modbase/fabric.mod.json.ftl | 4 ++-- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl index a81f453b..1d1e051f 100644 --- a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl +++ b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl @@ -26,9 +26,9 @@ "entrypoints": { "main": [ "${package}.${JavaModName}" - ], + ], "client":[ - "${package}.${JavaModName}$ClientInit" + "${package}.ClientInit" ] }, diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 53600c4e..8f2269ca 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -90,12 +90,11 @@ ${JavaModName}Biomes.registerBiomes(); ${fuel}Fuel.initialize(); } - - public static class ClientInit implements ClientModInitializer{ - @Override - public void onInitializeClient() { - System.out.println("Detected Client"); - } - } +} +class ClientInit implements ClientModInitializer{ + @Override + public void onInitializeClient() { + System.out.println("Detected Client"); + } } <#-- @formatter:on --> From e9f059d2862ddfd689b0c0f1365f24d2450a1b45 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 09:21:50 +0530 Subject: [PATCH 23/58] Removed client initializer for now --- src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl | 3 --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 6 ------ 2 files changed, 9 deletions(-) diff --git a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl index 1d1e051f..5511fe0a 100644 --- a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl +++ b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl @@ -26,9 +26,6 @@ "entrypoints": { "main": [ "${package}.${JavaModName}" - ], - "client":[ - "${package}.ClientInit" ] }, diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 8f2269ca..6534bcd6 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -91,10 +91,4 @@ ${JavaModName}Biomes.registerBiomes(); } } -class ClientInit implements ClientModInitializer{ - @Override - public void onInitializeClient() { - System.out.println("Detected Client"); - } -} <#-- @formatter:on --> From 29577be00f03b97092a5d8f3d94d9a6f13a02f57 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 09:40:04 +0530 Subject: [PATCH 24/58] Block with entity --- src/fabric-1.15.2/templates/block.java.ftl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/block.java.ftl b/src/fabric-1.15.2/templates/block.java.ftl index 2f1e5266..354d0d3b 100644 --- a/src/fabric-1.15.2/templates/block.java.ftl +++ b/src/fabric-1.15.2/templates/block.java.ftl @@ -9,7 +9,12 @@ import net.fabricmc.api.Environment; import net.minecraft.block.HorizontalFacingBlock; import net.minecraft.util.math.Direction; -public class ${name} extends <#if data.hasGravity>FallingBlock<#else>Block { +public class ${name} extends +<#if data.hasInventory> +BlockWithEntity +<#else> +<#if data.hasGravity>FallingBlock<#else>Block +<#if> { public ${name}(){ super(FabricBlockSettings.of(Material.${data.material})<#if data.destroyTool != "Not specified">.breakByTool(FabricToolTags.${data.destroyTool?upper_case}S, ${data.breakHarvestLevel})<#else> From 00dbd2f443d7cc7db99db236f640b4d93a2f5372 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 09:52:28 +0530 Subject: [PATCH 25/58] Add block entities --- src/fabric-1.15.2/templates/block.java.ftl | 14 ++++++++++++++ src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/fabric-1.15.2/templates/block.java.ftl b/src/fabric-1.15.2/templates/block.java.ftl index 354d0d3b..0524048a 100644 --- a/src/fabric-1.15.2/templates/block.java.ftl +++ b/src/fabric-1.15.2/templates/block.java.ftl @@ -291,6 +291,20 @@ BlockWithEntity } + public static boolean hasBE = <#if data.hasInventory>true<#else>false; + + <#if data.hasInventory> + @Override + public BlockEntity createBlockEntity(BlockView view) { + return new ${name}BlockEntity(); + } + + public static class ${name}BlockEntity extends BlockEntity{ + public TestBE() { + super(${JavaModName}.${name}BE); + } + } + } diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 6534bcd6..83994b1e 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -44,6 +44,7 @@ public class ${JavaModName} implements ModInitializer { <#list w.getElementsOfType("BLOCK") as block> public static final ${block} ${block} = new ${block}(); + public static final BlockEntityType<${block}.${block}BlockEntity> ${block}BE; @Override @@ -80,6 +81,7 @@ ${JavaModName}Biomes.registerBiomes(); <#list w.getElementsOfType("BLOCK") as block> <#assign ge = block.getGeneratableElement()> + BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block}be"),BlockEntityType.Builder.create(${block}.${block}BE::new).build(null)); Registry.register(Registry.BLOCK, new Identifier("${modid}", "${block.getRegistryName()}"), ${block}); Registry.BIOME.forEach(this.${block}::genBlock); RegistryEntryAddedCallback.event(Registry.BIOME).register((i, identifier, biome) -> { this.${block}.genBlock(biome); }); From dbd03c20e343f850456218adaa638ab921b9dec7 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 09:58:13 +0530 Subject: [PATCH 26/58] Fixed incorrect template --- src/fabric-1.15.2/templates/block.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/block.java.ftl b/src/fabric-1.15.2/templates/block.java.ftl index 0524048a..b5b7855a 100644 --- a/src/fabric-1.15.2/templates/block.java.ftl +++ b/src/fabric-1.15.2/templates/block.java.ftl @@ -14,7 +14,7 @@ public class ${name} extends BlockWithEntity <#else> <#if data.hasGravity>FallingBlock<#else>Block -<#if> { + { public ${name}(){ super(FabricBlockSettings.of(Material.${data.material})<#if data.destroyTool != "Not specified">.breakByTool(FabricToolTags.${data.destroyTool?upper_case}S, ${data.breakHarvestLevel})<#else> From d0cbbf89e895e641c2959eaea9a126887bc3437e Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:00:40 +0530 Subject: [PATCH 27/58] Fixed incorrect constructor --- src/fabric-1.15.2/templates/block.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/block.java.ftl b/src/fabric-1.15.2/templates/block.java.ftl index b5b7855a..21247544 100644 --- a/src/fabric-1.15.2/templates/block.java.ftl +++ b/src/fabric-1.15.2/templates/block.java.ftl @@ -300,7 +300,7 @@ BlockWithEntity } public static class ${name}BlockEntity extends BlockEntity{ - public TestBE() { + public ${name}BlockEntity() { super(${JavaModName}.${name}BE); } } From 91d33315ec749569de617d1315acded028a2f87a Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:04:17 +0530 Subject: [PATCH 28/58] Fixed variable names --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 83994b1e..f2a28b49 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -81,7 +81,7 @@ ${JavaModName}Biomes.registerBiomes(); <#list w.getElementsOfType("BLOCK") as block> <#assign ge = block.getGeneratableElement()> - BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block}be"),BlockEntityType.Builder.create(${block}.${block}BE::new).build(null)); + if(${block}.hasBE) ${block}BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block}be"),BlockEntityType.Builder.create(${block}.${block}BE::new).build(null)); Registry.register(Registry.BLOCK, new Identifier("${modid}", "${block.getRegistryName()}"), ${block}); Registry.BIOME.forEach(this.${block}::genBlock); RegistryEntryAddedCallback.event(Registry.BIOME).register((i, identifier, biome) -> { this.${block}.genBlock(biome); }); From 48e187794f2ed1f3e00725a3b0d9ab40fa0c18fe Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:16:29 +0530 Subject: [PATCH 29/58] Muted variable --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index f2a28b49..ca58f758 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -44,7 +44,7 @@ public class ${JavaModName} implements ModInitializer { <#list w.getElementsOfType("BLOCK") as block> public static final ${block} ${block} = new ${block}(); - public static final BlockEntityType<${block}.${block}BlockEntity> ${block}BE; + public static BlockEntityType<${block}.${block}BlockEntity> ${block}BE; @Override From 7b8c969c7a92f87cae40a126991ed124131dea2b Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:19:40 +0530 Subject: [PATCH 30/58] Fix class --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index ca58f758..6146b138 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -81,7 +81,7 @@ ${JavaModName}Biomes.registerBiomes(); <#list w.getElementsOfType("BLOCK") as block> <#assign ge = block.getGeneratableElement()> - if(${block}.hasBE) ${block}BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block}be"),BlockEntityType.Builder.create(${block}.${block}BE::new).build(null)); + if(${block}.hasBE) ${block}BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block}be"),BlockEntityType.Builder.create(${package}.block.${block}.${block}BE::new).build(null)); Registry.register(Registry.BLOCK, new Identifier("${modid}", "${block.getRegistryName()}"), ${block}); Registry.BIOME.forEach(this.${block}::genBlock); RegistryEntryAddedCallback.event(Registry.BIOME).register((i, identifier, biome) -> { this.${block}.genBlock(biome); }); From aa0a4daf3d6bc79f818a9c0172dce4c64a56257a Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:23:41 +0530 Subject: [PATCH 31/58] Fixed method reference --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 6146b138..ee864b0f 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -81,7 +81,7 @@ ${JavaModName}Biomes.registerBiomes(); <#list w.getElementsOfType("BLOCK") as block> <#assign ge = block.getGeneratableElement()> - if(${block}.hasBE) ${block}BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block}be"),BlockEntityType.Builder.create(${package}.block.${block}.${block}BE::new).build(null)); + if(${block}.hasBE) ${block}BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block}be"),BlockEntityType.Builder.create(${block}.${block}BlockEntity::new).build(null)); Registry.register(Registry.BLOCK, new Identifier("${modid}", "${block.getRegistryName()}"), ${block}); Registry.BIOME.forEach(this.${block}::genBlock); RegistryEntryAddedCallback.event(Registry.BIOME).register((i, identifier, biome) -> { this.${block}.genBlock(biome); }); From 431dd689ccd8c6c7238f4091fa5cb4c312304f6a Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:24:19 +0530 Subject: [PATCH 32/58] Added commit guidelines --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a9e9ca8f..704d9413 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,12 +2,13 @@ Since we have limited time, we would love to accept pull requests to get things done. We've also put a few ground rules so that pull requests can be maintained easily and follow the same codestyle. -## Contributing Code +## Contributing Code * Use the `this` keyword everywhere for instance variables * Create a single commit for each feature, rather than making a huge commit for everything * Keep minor changes like bug fixes and spelling errors a separate commit * State all your changes * Do *not* use newline brackets +* Always commit in past tense * Do not send a huge pull request with multiple large and untraceable commits. Instead, create a single pull request for each major change. ## Reporting Issues From 36662dc5c0b35aae4c1fca134e8ed70793bdc8bb Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:25:11 +0530 Subject: [PATCH 33/58] Removed unnecessary guideline --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 704d9413..7e79725b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,6 @@ Since we have limited time, we would love to accept pull requests to get things done. We've also put a few ground rules so that pull requests can be maintained easily and follow the same codestyle. ## Contributing Code -* Use the `this` keyword everywhere for instance variables * Create a single commit for each feature, rather than making a huge commit for everything * Keep minor changes like bug fixes and spelling errors a separate commit * State all your changes From 42f76a0c2db2ca06f529273db63ff574d76f83b7 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:45:47 +0530 Subject: [PATCH 34/58] Fixed upper case letter --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index ee864b0f..45b88980 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -81,7 +81,7 @@ ${JavaModName}Biomes.registerBiomes(); <#list w.getElementsOfType("BLOCK") as block> <#assign ge = block.getGeneratableElement()> - if(${block}.hasBE) ${block}BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block}be"),BlockEntityType.Builder.create(${block}.${block}BlockEntity::new).build(null)); + if(${block}.hasBE) ${block}BE = Registry.register(Registry.BLOCK_ENTITY_TYPE,new Identifier("${modid}","${block?lower_case}be"),BlockEntityType.Builder.create(${block}.${block}BlockEntity::new).build(null)); Registry.register(Registry.BLOCK, new Identifier("${modid}", "${block.getRegistryName()}"), ${block}); Registry.BIOME.forEach(this.${block}::genBlock); RegistryEntryAddedCallback.event(Registry.BIOME).register((i, identifier, biome) -> { this.${block}.genBlock(biome); }); From 43b3bfca4915db642e8a6450abada0ae51042700 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 10:52:07 +0530 Subject: [PATCH 35/58] Replaced class with interface --- src/fabric-1.15.2/templates/block.java.ftl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fabric-1.15.2/templates/block.java.ftl b/src/fabric-1.15.2/templates/block.java.ftl index 21247544..ff77d82c 100644 --- a/src/fabric-1.15.2/templates/block.java.ftl +++ b/src/fabric-1.15.2/templates/block.java.ftl @@ -10,11 +10,11 @@ import net.minecraft.block.HorizontalFacingBlock; import net.minecraft.util.math.Direction; public class ${name} extends -<#if data.hasInventory> -BlockWithEntity -<#else> <#if data.hasGravity>FallingBlock<#else>Block - { +<#if data.hasInventory> +implements BlockEntityProvider + +{ public ${name}(){ super(FabricBlockSettings.of(Material.${data.material})<#if data.destroyTool != "Not specified">.breakByTool(FabricToolTags.${data.destroyTool?upper_case}S, ${data.breakHarvestLevel})<#else> From 206b955ea7c7503e403d27692addd84695873137 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 11:18:13 +0530 Subject: [PATCH 36/58] Fixed block entity invisibility --- src/fabric-1.15.2/templates/block.java.ftl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fabric-1.15.2/templates/block.java.ftl b/src/fabric-1.15.2/templates/block.java.ftl index ff77d82c..a4326060 100644 --- a/src/fabric-1.15.2/templates/block.java.ftl +++ b/src/fabric-1.15.2/templates/block.java.ftl @@ -298,6 +298,11 @@ implements BlockEntityProvider public BlockEntity createBlockEntity(BlockView view) { return new ${name}BlockEntity(); } + + @Override + public BlockRenderType getRenderType(BlockState state) { + return BlockRenderType.MODEL; + } public static class ${name}BlockEntity extends BlockEntity{ public ${name}BlockEntity() { From 76c18081ffec899b62ba0a5f3545de4835ab7fd5 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 11:32:48 +0530 Subject: [PATCH 37/58] Reverted interface implementation --- src/fabric-1.15.2/templates/block.java.ftl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fabric-1.15.2/templates/block.java.ftl b/src/fabric-1.15.2/templates/block.java.ftl index a4326060..74472d01 100644 --- a/src/fabric-1.15.2/templates/block.java.ftl +++ b/src/fabric-1.15.2/templates/block.java.ftl @@ -10,9 +10,8 @@ import net.minecraft.block.HorizontalFacingBlock; import net.minecraft.util.math.Direction; public class ${name} extends +<#if data.hasInventory>BlockWithEntity<#else> <#if data.hasGravity>FallingBlock<#else>Block -<#if data.hasInventory> -implements BlockEntityProvider { From 946bd516c9608257461ab22281f7153cd9709f89 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 11:46:34 +0530 Subject: [PATCH 38/58] Moved overriden method --- src/fabric-1.15.2/templates/block.java.ftl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fabric-1.15.2/templates/block.java.ftl b/src/fabric-1.15.2/templates/block.java.ftl index 74472d01..db056ddf 100644 --- a/src/fabric-1.15.2/templates/block.java.ftl +++ b/src/fabric-1.15.2/templates/block.java.ftl @@ -290,6 +290,11 @@ public class ${name} extends } + @Override + public BlockRenderType getRenderType(BlockState state) { + return BlockRenderType.MODEL; + } + public static boolean hasBE = <#if data.hasInventory>true<#else>false; <#if data.hasInventory> @@ -297,11 +302,6 @@ public class ${name} extends public BlockEntity createBlockEntity(BlockView view) { return new ${name}BlockEntity(); } - - @Override - public BlockRenderType getRenderType(BlockState state) { - return BlockRenderType.MODEL; - } public static class ${name}BlockEntity extends BlockEntity{ public ${name}BlockEntity() { From ca83191c7cf3b2d2d4bedc38aaa2e93c5f30341a Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 12:17:10 +0530 Subject: [PATCH 39/58] Added plant definition and item model --- src/fabric-1.15.2/plant.definition.yaml | 30 +++++++++++++++++++ .../templates/json/plant_item.json.ftl | 6 ++++ 2 files changed, 36 insertions(+) create mode 100644 src/fabric-1.15.2/plant.definition.yaml create mode 100644 src/fabric-1.15.2/templates/json/plant_item.json.ftl diff --git a/src/fabric-1.15.2/plant.definition.yaml b/src/fabric-1.15.2/plant.definition.yaml new file mode 100644 index 00000000..e66918c3 --- /dev/null +++ b/src/fabric-1.15.2/plant.definition.yaml @@ -0,0 +1,30 @@ +templates: + - template: plant.java.ftl + name: "@SRCROOT/@BASEPACKAGEPATH/block/@NAMEBlock.java" + - template: json/plant_item.json.ftl + writer: json + name: "@MODASSETSROOT/models/item/@registryname.json" + + - template: json/block.json.ftl + condition: "renderType #= 12" + writer: json + variables: "model=cross;txname=cross" + name: "@MODASSETSROOT/models/block/@registryname.json" + - template: json/block_cmodel.json.ftl + condition: "renderType #= 2" + writer: json + name: "@MODASSETSROOT/models/block/@registryname.json" + - template: json/block_cmodel_obj.json.ftl + condition: "renderType #= 3" + writer: json + name: "@MODASSETSROOT/models/block/@registryname.json" + - template: json/block_states.json.ftl + writer: json + condition: "plantType %= normal" + variables: "variant= " + name: "@MODASSETSROOT/blockstates/@registryname.json" + + +localizationkeys: + - key: block.@modid.@registryname + mapto: name diff --git a/src/fabric-1.15.2/templates/json/plant_item.json.ftl b/src/fabric-1.15.2/templates/json/plant_item.json.ftl new file mode 100644 index 00000000..bfab80e6 --- /dev/null +++ b/src/fabric-1.15.2/templates/json/plant_item.json.ftl @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "${modid}:blocks/${data.texture}" + } +} From 006978759f1a786210c93757e6b3b8bd9c1d1334 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 12:19:42 +0530 Subject: [PATCH 40/58] Removed extra gradle task --- src/fabric-1.15.2/generator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/generator.yaml b/src/fabric-1.15.2/generator.yaml index 1b249867..449a0154 100644 --- a/src/fabric-1.15.2/generator.yaml +++ b/src/fabric-1.15.2/generator.yaml @@ -5,7 +5,7 @@ status: dev buildfileversion: 0.8.7+build.201 gradle: - setup_task: genSources downloadAssets + setup_task: genSources run_client: runClient run_server: runServer export_file: "build/libs/sources.jar" From e3edff384af4d4e6718f8fe0f301c85c5b056682 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 13:17:45 +0530 Subject: [PATCH 41/58] Created plant template --- src/fabric-1.15.2/templates/plant.java.ftl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/fabric-1.15.2/templates/plant.java.ftl diff --git a/src/fabric-1.15.2/templates/plant.java.ftl b/src/fabric-1.15.2/templates/plant.java.ftl new file mode 100644 index 00000000..28b16d73 --- /dev/null +++ b/src/fabric-1.15.2/templates/plant.java.ftl @@ -0,0 +1,16 @@ +<#-- @formatter:off --> + +package ${package}.block; + +public class ${name} extends PlantBlock{ + public TestBlock(Settings settings) { + super(settings); + } + + @Override + public OffsetType getOffsetType() { + return OffsetType.XZ; + } +} + +<#-- @formatter:on --> From c09929ddca3f61787779405a1a72734c194e0f94 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 13:25:40 +0530 Subject: [PATCH 42/58] Overrode three more methods --- src/fabric-1.15.2/templates/plant.java.ftl | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/plant.java.ftl b/src/fabric-1.15.2/templates/plant.java.ftl index 28b16d73..8f6f6cc7 100644 --- a/src/fabric-1.15.2/templates/plant.java.ftl +++ b/src/fabric-1.15.2/templates/plant.java.ftl @@ -9,8 +9,39 @@ public class ${name} extends PlantBlock{ @Override public OffsetType getOffsetType() { - return OffsetType.XZ; + return OffsetType.${data.offsetType}; } + + <#if data.isReplaceable> + @Override + public boolean canReplace(BlockState state, ItemPlacementContext ctx) { + return true; + } + + + <#if data.creativePickItem?? && !data.creativePickItem.isEmpty()> + @Override + public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) { + return ${mappedMCItemToItemStackCode(data.creativePickItem, 1)}; + } + + + <#if data.dropAmount != 1 && !(data.customDrop?? && !data.customDrop.isEmpty())> + @Override + public List getDroppedStacks(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDroppedStacks(state, builder); + if(!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, ${data.dropAmount})); + } + <#else> + @Override + public List getDroppedStacks(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDroppedStacks(state, builder); + if(!dropsOriginal.isEmpty())return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } <#-- @formatter:on --> From 6c6b385f4cbe630876879de87169f465fc15550e Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 13:28:49 +0530 Subject: [PATCH 43/58] Changed inheritance class --- src/fabric-1.15.2/templates/plant.java.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fabric-1.15.2/templates/plant.java.ftl b/src/fabric-1.15.2/templates/plant.java.ftl index 8f6f6cc7..99f1e7af 100644 --- a/src/fabric-1.15.2/templates/plant.java.ftl +++ b/src/fabric-1.15.2/templates/plant.java.ftl @@ -2,9 +2,9 @@ package ${package}.block; -public class ${name} extends PlantBlock{ +public class ${name} extends FlowerBlock{ public TestBlock(Settings settings) { - super(settings); + super(StatusEffect.byRawId(23),1,settings); } @Override From dd39736b22a53cab5cc2d5671bcf4dcbbbfc950d Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 14:53:59 +0530 Subject: [PATCH 44/58] Added client sided initializer --- src/fabric-1.15.2/generator.yaml | 3 +++ .../templates/modbase/client.java.ftl | 16 ++++++++++++++++ .../templates/modbase/fabric.mod.json.ftl | 11 +++++------ src/fabric-1.15.2/templates/modbase/mod.java.ftl | 1 - 4 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 src/fabric-1.15.2/templates/modbase/client.java.ftl diff --git a/src/fabric-1.15.2/generator.yaml b/src/fabric-1.15.2/generator.yaml index 449a0154..08ba38e4 100644 --- a/src/fabric-1.15.2/generator.yaml +++ b/src/fabric-1.15.2/generator.yaml @@ -30,6 +30,9 @@ base_templates: - template: modbase/biomeRegistry.java.ftl name: "@SRCROOT/@BASEPACKAGEPATH/registry/@JavaModNameBiomes.java" canLock: true +- template: modbase/client.java.ftl + name: "@SRCROOT/@BASEPACKAGEPATH/ClientInit.java" + canLock: true - template: modbase/fabric.mod.json.ftl writer: json name: "@RESROOT/fabric.mod.json" diff --git a/src/fabric-1.15.2/templates/modbase/client.java.ftl b/src/fabric-1.15.2/templates/modbase/client.java.ftl new file mode 100644 index 00000000..70366458 --- /dev/null +++ b/src/fabric-1.15.2/templates/modbase/client.java.ftl @@ -0,0 +1,16 @@ +package ${package}; + +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.minecraft.client.render.RenderLayer; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +public class ClientInit implements ClientModInitializer{ + @Override + public void onInitializeClient(){ + <#list w.getElementsOfType("BLOCK") as block> + BlockRenderLayerMap.INSTANCE.putBlock(${JavaModName}.${block}, RenderLayer.getCutout()); + + } +} diff --git a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl index 5511fe0a..381374ff 100644 --- a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl +++ b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl @@ -26,16 +26,15 @@ "entrypoints": { "main": [ "${package}.${JavaModName}" + ], + "client":[ + "${package}.ClientInit" ] }, "depends": { - "fabricloader": ">=0.8.3", - "fabric": "*", - "minecraft": "1.15.x" - }, - "suggests": { - "flamingo": "*" + "fabricloader": ">=0.8.2", + "fabric": "*" } } <#-- @formatter:on --> diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 45b88980..03515372 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -17,7 +17,6 @@ package ${package}; import ${package}.item; import net.fabricmc.fabric.api.biomes.v1.OverworldBiomes; import net.fabricmc.fabric.api.biomes.v1.OverworldClimate; -import net.fabricmc.api.ClientModInitializer; public class ${JavaModName} implements ModInitializer { From ec03d76d421ad21f5e79d92e20df44289be17207 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 14:55:21 +0530 Subject: [PATCH 45/58] Added Plant tooltips --- src/fabric-1.15.2/templates/plant.java.ftl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/fabric-1.15.2/templates/plant.java.ftl b/src/fabric-1.15.2/templates/plant.java.ftl index 99f1e7af..d60236c3 100644 --- a/src/fabric-1.15.2/templates/plant.java.ftl +++ b/src/fabric-1.15.2/templates/plant.java.ftl @@ -2,6 +2,9 @@ package ${package}.block; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + public class ${name} extends FlowerBlock{ public TestBlock(Settings settings) { super(StatusEffect.byRawId(23),1,settings); @@ -42,6 +45,16 @@ public class ${name} extends FlowerBlock{ return Collections.singletonList(new ItemStack(this, 1)); } + + <#if data.specialInfo?has_content> + @Environment(EnvType.CLIENT) + @Override + public void buildTooltip(ItemStack stack, BlockView view, List tooltip, TooltipContext options) { + <#list data.specialInfo as entry> + tooltip.add(new LiteralText("${JavaConventions.escapeStringForJava(entry)}")); + + } + } <#-- @formatter:on --> From 23ac6143439b49edcf3e119914451bc653d74c9a Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:20:22 +0530 Subject: [PATCH 46/58] Added plant constructor methods --- .../templates/modbase/client.java.ftl | 4 ++-- src/fabric-1.15.2/templates/plant.java.ftl | 21 +++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/fabric-1.15.2/templates/modbase/client.java.ftl b/src/fabric-1.15.2/templates/modbase/client.java.ftl index 70366458..e34a7498 100644 --- a/src/fabric-1.15.2/templates/modbase/client.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/client.java.ftl @@ -9,8 +9,8 @@ import net.fabricmc.api.Environment; public class ClientInit implements ClientModInitializer{ @Override public void onInitializeClient(){ - <#list w.getElementsOfType("BLOCK") as block> - BlockRenderLayerMap.INSTANCE.putBlock(${JavaModName}.${block}, RenderLayer.getCutout()); + <#list w.getElementsOfType("PLANT") as plant> + BlockRenderLayerMap.INSTANCE.putBlock(${JavaModName}.${plant}, RenderLayer.getCutout()); } } diff --git a/src/fabric-1.15.2/templates/plant.java.ftl b/src/fabric-1.15.2/templates/plant.java.ftl index d60236c3..53776770 100644 --- a/src/fabric-1.15.2/templates/plant.java.ftl +++ b/src/fabric-1.15.2/templates/plant.java.ftl @@ -4,10 +4,27 @@ package ${package}.block; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; public class ${name} extends FlowerBlock{ - public TestBlock(Settings settings) { - super(StatusEffect.byRawId(23),1,settings); + public TestBlock() { + super(StatusEffect.byRawId(23),1,FabricBlockSettings.of( + <#if data.colorOnMap != "DEFAULT"> + Material.PLANT + <#else> + Material.PLANT,MaterialColor.${data.colorOnMap} + + ) + .noCollision() + <#if data.unbreakable> + .hardness(-1) + .resistance(3600000) + <#else> + .hardness(${data.hardness}f) + .resistance(${data.resistance}f) + + .lightLevel(${(data.luminance * 15)?round}) + ); } @Override From 4c6bf1a60ad0dd287bf3ba4d39ff3fe924fa9fd0 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:25:58 +0530 Subject: [PATCH 47/58] Fixed invalid constructor --- src/fabric-1.15.2/templates/plant.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/plant.java.ftl b/src/fabric-1.15.2/templates/plant.java.ftl index 53776770..2055b100 100644 --- a/src/fabric-1.15.2/templates/plant.java.ftl +++ b/src/fabric-1.15.2/templates/plant.java.ftl @@ -7,7 +7,7 @@ import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; public class ${name} extends FlowerBlock{ - public TestBlock() { + public ${name}() { super(StatusEffect.byRawId(23),1,FabricBlockSettings.of( <#if data.colorOnMap != "DEFAULT"> Material.PLANT From 2185160329725091759034d28815aaca492878cc Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:30:25 +0530 Subject: [PATCH 48/58] Added plant registration --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 03515372..9abc8542 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -29,6 +29,10 @@ public class ${JavaModName} implements ModInitializer { public static final Item ${item} = new ${item}(); +<#list w.getElementsOfType("PLANT") as plant> + public static final PlantBlock ${plant}Plant = new ${plant}(); + + <#list w.getElementsOfType("ARMOR") as armor> <#assign ge = armor.getGeneratableElement()> public static final Item ${armor}_HELMET = new ${armor}ArmorItem(${armor}Material.${armor}, EquipmentSlot.HEAD, (new Item.Settings().group(${ge.creativeTab}))); @@ -70,6 +74,10 @@ ${JavaModName}Biomes.registerBiomes(); OverworldBiomes.addContinentalBiome(${JavaModName}Biomes.${biome?upper_case},OverworldClimate.TEMPERATE,${biome}.WEIGHT); +<#list w.getElementsOfType("PLANT") as plant> + Registry.register(Registry.BLOCK,new Identifier("${modid}","${plant.getRegistryName}"),${food}Plant); + + <#list w.getElementsOfType("FOOD") as food> Registry.register(Registry.ITEM, new Identifier("${modid}", "${food.getRegistryName()}"), ${food}); From 7a0fb69de06a874682468d73b1edf93b142fecac Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:35:48 +0530 Subject: [PATCH 49/58] Fix bad render layer --- src/fabric-1.15.2/templates/modbase/client.java.ftl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fabric-1.15.2/templates/modbase/client.java.ftl b/src/fabric-1.15.2/templates/modbase/client.java.ftl index e34a7498..6faacb62 100644 --- a/src/fabric-1.15.2/templates/modbase/client.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/client.java.ftl @@ -9,8 +9,10 @@ import net.fabricmc.api.Environment; public class ClientInit implements ClientModInitializer{ @Override public void onInitializeClient(){ + <#list w.getElementsOfType("PLANT") as plant> BlockRenderLayerMap.INSTANCE.putBlock(${JavaModName}.${plant}, RenderLayer.getCutout()); + } } From 652e2c2d90f34a1e147c174cfff477680b64788b Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:42:28 +0530 Subject: [PATCH 50/58] Fixed bug where incorrect class names exists --- src/fabric-1.15.2/plant.definition.yaml | 2 +- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fabric-1.15.2/plant.definition.yaml b/src/fabric-1.15.2/plant.definition.yaml index e66918c3..5f585762 100644 --- a/src/fabric-1.15.2/plant.definition.yaml +++ b/src/fabric-1.15.2/plant.definition.yaml @@ -1,6 +1,6 @@ templates: - template: plant.java.ftl - name: "@SRCROOT/@BASEPACKAGEPATH/block/@NAMEBlock.java" + name: "@SRCROOT/@BASEPACKAGEPATH/block/@NAME.java" - template: json/plant_item.json.ftl writer: json name: "@MODASSETSROOT/models/item/@registryname.json" diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 9abc8542..fe7d5cbd 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -75,7 +75,7 @@ ${JavaModName}Biomes.registerBiomes(); <#list w.getElementsOfType("PLANT") as plant> - Registry.register(Registry.BLOCK,new Identifier("${modid}","${plant.getRegistryName}"),${food}Plant); + Registry.register(Registry.BLOCK,new Identifier("${modid}","${plant.getRegistryName}"),${plant}Plant); <#list w.getElementsOfType("FOOD") as food> From 015a50e3c27a76175f46ba96ea8ecb3815063c89 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:44:24 +0530 Subject: [PATCH 51/58] Updated loom version --- src/fabric-1.15.2/workspacebase/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/workspacebase/build.gradle b/src/fabric-1.15.2/workspacebase/build.gradle index 2409a48e..6569b945 100644 --- a/src/fabric-1.15.2/workspacebase/build.gradle +++ b/src/fabric-1.15.2/workspacebase/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.4.25' + id 'fabric-loom' version '0.4.26' id 'maven-publish' } From 5e8b20d4ba0efcba4628bf3184c691e960ff4f96 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:45:40 +0530 Subject: [PATCH 52/58] Fixed incorrect freemarker method --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index fe7d5cbd..90a6ceca 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -75,7 +75,7 @@ ${JavaModName}Biomes.registerBiomes(); <#list w.getElementsOfType("PLANT") as plant> - Registry.register(Registry.BLOCK,new Identifier("${modid}","${plant.getRegistryName}"),${plant}Plant); + Registry.register(Registry.BLOCK,new Identifier("${modid}","${plant.getRegistryName()}"),${plant}Plant); <#list w.getElementsOfType("FOOD") as food> From 5b0423646d96300dbc2e577e3d3c703578ce27e5 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:46:40 +0530 Subject: [PATCH 53/58] Set source url --- src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl index 381374ff..c2461c51 100644 --- a/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl +++ b/src/fabric-1.15.2/templates/modbase/fabric.mod.json.ftl @@ -15,7 +15,7 @@ "contact": { "homepage": "${settings.getWebsiteURL()}", - "sources": "" + "sources": "https://github.com/ClothCreators/MCreatorFabricGenerator" }, <#if settings.getModPicture()?has_content> From 1d1765d2a6d07fa62c3d099f798b46e648df4e9c Mon Sep 17 00:00:00 2001 From: SD <62552372+BoogieMonster1O1@users.noreply.github.com> Date: Tue, 16 Jun 2020 15:49:14 +0530 Subject: [PATCH 54/58] Fix gitignore --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 8277c60b..712bf019 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,10 @@ out # Mac OS Garbage .DS_Store + +# VSCode +.vscode +*.code-workspace + +# BBedit +*.bbproject From f4fb44718f50f50da32a83598656cd1db4c3bf4e Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 15:51:49 +0530 Subject: [PATCH 55/58] Fixed incorrect naming in variables --- src/fabric-1.15.2/templates/modbase/client.java.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fabric-1.15.2/templates/modbase/client.java.ftl b/src/fabric-1.15.2/templates/modbase/client.java.ftl index 6faacb62..623c67e0 100644 --- a/src/fabric-1.15.2/templates/modbase/client.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/client.java.ftl @@ -11,7 +11,7 @@ public class ClientInit implements ClientModInitializer{ public void onInitializeClient(){ <#list w.getElementsOfType("PLANT") as plant> - BlockRenderLayerMap.INSTANCE.putBlock(${JavaModName}.${plant}, RenderLayer.getCutout()); + BlockRenderLayerMap.INSTANCE.putBlock(${JavaModName}.${plant}Plant, RenderLayer.getCutout()); } From cef17eb8095a50d8f0be460a4a52ce19c4ca4a4f Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 16:55:39 +0530 Subject: [PATCH 56/58] Added plant blockitems --- src/fabric-1.15.2/templates/modbase/mod.java.ftl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fabric-1.15.2/templates/modbase/mod.java.ftl b/src/fabric-1.15.2/templates/modbase/mod.java.ftl index 90a6ceca..ab1d3310 100644 --- a/src/fabric-1.15.2/templates/modbase/mod.java.ftl +++ b/src/fabric-1.15.2/templates/modbase/mod.java.ftl @@ -75,7 +75,9 @@ ${JavaModName}Biomes.registerBiomes(); <#list w.getElementsOfType("PLANT") as plant> +<#assign ge = plant.getGeneratableElement()> Registry.register(Registry.BLOCK,new Identifier("${modid}","${plant.getRegistryName()}"),${plant}Plant); + Registry.register(Registry.ITEM,new Identifier("${modid}","${plant.getRegistryName()}"),new BlockItem(${plant}Plant, new Item.Settings().group(${ge.creativeTab}))); <#list w.getElementsOfType("FOOD") as food> From 66c9501ed749fd6c09db7d0bc5e5bc348cd36069 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 17:32:06 +0530 Subject: [PATCH 57/58] Added message to readme --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e79725b..0efb09d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,6 +8,7 @@ Since we have limited time, we would love to accept pull requests to get things * State all your changes * Do *not* use newline brackets * Always commit in past tense +* Report to us if an automatic merge can not be performed. If there are conflicts, it is at our discretion to decide. * Do not send a huge pull request with multiple large and untraceable commits. Instead, create a single pull request for each major change. ## Reporting Issues From d05dff0c28415dc64875c46e8005824955061a13 Mon Sep 17 00:00:00 2001 From: BoogieMonster1O1 Date: Tue, 16 Jun 2020 17:42:09 +0530 Subject: [PATCH 58/58] Updated readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2f668544..9fb7eae5 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ This project is not official. Not affiliated with the respective owners and main * Biome (Not complete) * Block (Mostly complete) - Ore generation (Nether and Overworld, Netherrack and Stone Respectively) + - Block entities (Non pushable) + - Custom plants * Food (Mostly complete) * Fuel (Complete) * Function (Complete)