From 7d23aed599702986837a7b28d6901932a0230b96 Mon Sep 17 00:00:00 2001 From: Stefan Wimmer Date: Sun, 24 Jul 2016 00:18:04 +0200 Subject: [PATCH] Add bread dough, Release 1.2.0 --- build.gradle | 12 +++-- build.sh | 8 ---- gradle/wrapper/gradle-wrapper.properties | 2 +- package.json | 8 ++-- setup.sh | 16 ------- .../java/io/teammion/morefood/Config.java | 25 ++++++++++ .../io/teammion/morefood/CreativeTabs.java | 45 +++--------------- src/main/java/io/teammion/morefood/Items.java | 3 ++ .../java/io/teammion/morefood/MoreFood.java | 19 ++++++++ .../morefood/recipes/ShapelessRecipes.java | 10 ++++ .../morefood/recipes/SmeltingRecipes.java | 5 ++ .../assets/tm-morefood/lang/en_US.lang | 1 + .../tm-morefood/models/item/bread_dough.json | 6 +++ .../textures/items/bread_dough.png | Bin 0 -> 2996 bytes update.sh | 23 --------- 15 files changed, 89 insertions(+), 94 deletions(-) delete mode 100755 build.sh delete mode 100755 setup.sh create mode 100644 src/main/java/io/teammion/morefood/Config.java create mode 100644 src/main/resources/assets/tm-morefood/models/item/bread_dough.json create mode 100644 src/main/resources/assets/tm-morefood/textures/items/bread_dough.png delete mode 100755 update.sh diff --git a/build.gradle b/build.gradle index 656093c..e1375bf 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,7 @@ buildscript { classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } + apply plugin: 'net.minecraftforge.gradle.forge' /* @@ -20,12 +21,15 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.1.0" +version = "1.2.0" group = "io.teammion.morefood" archivesBaseName = "tm-morefood" +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 + minecraft { - version = "1.10.2-12.18.1.2014" + version = "1.10.2-12.18.1.2018" runDir = "run" // the mappings can be changed at any time, and must be in the following format. @@ -40,8 +44,8 @@ minecraft { dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. -group = "io.teammion.morefood" -group = "io.teammion.morefood" + //compile "some.group:artifact:version:classifier" + //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env diff --git a/build.sh b/build.sh deleted file mode 100755 index b75d31b..0000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Update -npm run update - -# Executing gradlew -echo "Executing gradlew..." -./gradlew clean build diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7a0845d..231dfc4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Sat Jul 16 16:09:28 CEST 2016 +#Sat Jul 23 22:21:39 CEST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/package.json b/package.json index 00a54ac..c92c619 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "tm-morefood", - "version": "1.1.0", + "version": "1.2.0", "description": "This Minecraft Mod will add additional food to Mincraft to provide a healthy variety.", "scripts": { - "setup": "./setup.sh", - "build": "./build.sh", - "update": "./update.sh", + "setup": "bin/setup", + "build": "bin/build", + "update": "bin/update", "client": "./gradlew runClient", "server": "./gradlew runServer" }, diff --git a/setup.sh b/setup.sh deleted file mode 100755 index f6e2855..0000000 --- a/setup.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# Update -npm run update - -# IDE to configure for -read -p "IDE to configure for: [idea|eclipse] " ide -if [ ! "${ide,,}" == "idea" ] && [ ! "${ide,,}" == "eclipse" ] -then - ide="" - echo "No valid IDE! No IDE will be configured." -fi - -# Executing gradlew -echo "Executing gradlew..." -JAVA_OPTS="-Xmx2g" ./gradlew setupDecompWorkspace $ide diff --git a/src/main/java/io/teammion/morefood/Config.java b/src/main/java/io/teammion/morefood/Config.java new file mode 100644 index 0000000..74abf2a --- /dev/null +++ b/src/main/java/io/teammion/morefood/Config.java @@ -0,0 +1,25 @@ +package io.teammion.morefood; + +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +import java.io.File; + +/** + * Created by Stefan Wimmer on 19.07.16. + */ +public class Config +{ + public static boolean OVERRIDE_BREAD_RECIPE; + + static void load(FMLPreInitializationEvent e) + { + Configuration config = new Configuration(e.getSuggestedConfigurationFile()); + + config.load(); + + OVERRIDE_BREAD_RECIPE = config.get("food", "override_bread_recipe", false).getBoolean(); + + config.save(); + } +} diff --git a/src/main/java/io/teammion/morefood/CreativeTabs.java b/src/main/java/io/teammion/morefood/CreativeTabs.java index 12fef58..c93b38e 100644 --- a/src/main/java/io/teammion/morefood/CreativeTabs.java +++ b/src/main/java/io/teammion/morefood/CreativeTabs.java @@ -3,53 +3,22 @@ import net.minecraft.item.Item; /** - * Created by Stefan Wimmer on 05.06.16. + * Created by Stefan Wimmer on 23.07.16. */ -public abstract class CreativeTabs extends net.minecraft.creativetab.CreativeTabs +public class CreativeTabs extends net.minecraft.creativetab.CreativeTabs { - // public static final CreativeTabs MOREFOOD_ITEMS = new Impl("morefood_items", Items.COCOA_BEAN_GROUND); - // public static final CreativeTabs MOREFOOD_FOOD = new Impl("morefood_food", Items.CHOCOLATE); + private Item tabIconItem; public CreativeTabs(String label, Item tabIconItem) { super(label); - this.setTabIconItem(tabIconItem); + this.tabIconItem = tabIconItem; } - public CreativeTabs(int index, String label, Item tabIconItem) + @Override + public Item getTabIconItem() { - super(index, label); - - this.setTabIconItem(tabIconItem); - } - - public abstract void setTabIconItem(Item tabIconItem); - - public static class Impl extends CreativeTabs - { - private Item tabIconItem; - - public Impl(String label, Item tabIconItem) - { - super(label, tabIconItem); - } - - public Impl(int index, String label, Item tabIconItem) - { - super(index, label, tabIconItem); - } - - @Override - public void setTabIconItem(Item tabIconItem) - { - this.tabIconItem = tabIconItem; - } - - @Override - public Item getTabIconItem() - { - return this.tabIconItem; - } + return tabIconItem; } } diff --git a/src/main/java/io/teammion/morefood/Items.java b/src/main/java/io/teammion/morefood/Items.java index a931462..d95e294 100644 --- a/src/main/java/io/teammion/morefood/Items.java +++ b/src/main/java/io/teammion/morefood/Items.java @@ -31,6 +31,7 @@ public class Items extends net.minecraft.init.Items public static final ItemFood STRAWBERRY_CHOCOLATE_COATED = new ItemFood("strawberry_chocolate_coated", 8); public static final Item FRENCH_FRIES_RAW = new Item("french_fries_raw"); public static final ItemFood FRENCH_FRIES = new ItemFood("french_fries", 6); + public static final Item BREAD_DOUGH = new Item("bread_dough"); static void register() { @@ -58,6 +59,7 @@ static void register() Registry.register(STRAWBERRY_CHOCOLATE_COATED); Registry.register(FRENCH_FRIES_RAW); Registry.register(FRENCH_FRIES); + Registry.register(BREAD_DOUGH); } static void render() @@ -86,5 +88,6 @@ static void render() Registry.render(STRAWBERRY_CHOCOLATE_COATED); Registry.render(FRENCH_FRIES_RAW); Registry.render(FRENCH_FRIES); + Registry.render(BREAD_DOUGH); } } diff --git a/src/main/java/io/teammion/morefood/MoreFood.java b/src/main/java/io/teammion/morefood/MoreFood.java index 38b5309..a95d763 100644 --- a/src/main/java/io/teammion/morefood/MoreFood.java +++ b/src/main/java/io/teammion/morefood/MoreFood.java @@ -3,6 +3,9 @@ import io.teammion.morefood.recipes.ShapedRecipes; import io.teammion.morefood.recipes.ShapelessRecipes; import io.teammion.morefood.recipes.SmeltingRecipes; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @@ -10,6 +13,8 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.relauncher.Side; +import java.util.Iterator; + /** * Created by Stefan Wimmer on 05.06.16. */ @@ -19,6 +24,8 @@ public class MoreFood @Mod.EventHandler public void preInit(FMLPreInitializationEvent e) { + Config.load(e); + Items.register(); Blocks.register(); } @@ -42,5 +49,17 @@ public void init(FMLInitializationEvent e) @Mod.EventHandler public void postInit(FMLPostInitializationEvent e) { + if (Config.OVERRIDE_BREAD_RECIPE) + { + Iterator itr = CraftingManager.getInstance().getRecipeList().iterator(); + + while (itr.hasNext()) + { + ItemStack itemStack = itr.next().getRecipeOutput(); + + if (itemStack != null && itemStack.getItem() == Items.BREAD) + itr.remove(); + } + } } } diff --git a/src/main/java/io/teammion/morefood/recipes/ShapelessRecipes.java b/src/main/java/io/teammion/morefood/recipes/ShapelessRecipes.java index 7e4e35d..b3aeb5f 100644 --- a/src/main/java/io/teammion/morefood/recipes/ShapelessRecipes.java +++ b/src/main/java/io/teammion/morefood/recipes/ShapelessRecipes.java @@ -1,5 +1,6 @@ package io.teammion.morefood.recipes; +import io.teammion.morefood.Config; import io.teammion.morefood.Items; import io.teammion.morefood.Registry; import net.minecraft.item.ItemStack; @@ -79,5 +80,14 @@ public static void register() Items.POTATO, Items.POTATO ); + + Registry.addShapelessRecipe( + new ItemStack(Items.BREAD_DOUGH, 2), + Items.FLOUR, + Items.FLOUR, + Items.FLOUR, + Items.FLOUR, + Items.WATER_BUCKET + ); } } diff --git a/src/main/java/io/teammion/morefood/recipes/SmeltingRecipes.java b/src/main/java/io/teammion/morefood/recipes/SmeltingRecipes.java index db28c15..3b355d7 100644 --- a/src/main/java/io/teammion/morefood/recipes/SmeltingRecipes.java +++ b/src/main/java/io/teammion/morefood/recipes/SmeltingRecipes.java @@ -45,5 +45,10 @@ public static void register() Items.FRENCH_FRIES_RAW, new ItemStack(Items.FRENCH_FRIES) ); + + Registry.addSmelting( + Items.BREAD_DOUGH, + new ItemStack(Items.BREAD) + ); } } diff --git a/src/main/resources/assets/tm-morefood/lang/en_US.lang b/src/main/resources/assets/tm-morefood/lang/en_US.lang index df04d62..1b25933 100644 --- a/src/main/resources/assets/tm-morefood/lang/en_US.lang +++ b/src/main/resources/assets/tm-morefood/lang/en_US.lang @@ -25,3 +25,4 @@ item.strawberry_chocolate.name=Strawberry + Chocolate item.strawberry_chocolate_coated.name=Chocolate Coated Strawberry item.french_fries_raw.name=Raw French Fries item.french_fries.name=French Fries +item.bread_dough.name=Bread Dough diff --git a/src/main/resources/assets/tm-morefood/models/item/bread_dough.json b/src/main/resources/assets/tm-morefood/models/item/bread_dough.json new file mode 100644 index 0000000..11d1ae9 --- /dev/null +++ b/src/main/resources/assets/tm-morefood/models/item/bread_dough.json @@ -0,0 +1,6 @@ +{ + "parent": "tm-morefood:item/_default", + "textures": { + "layer0": "tm-morefood:items/bread_dough" + } +} diff --git a/src/main/resources/assets/tm-morefood/textures/items/bread_dough.png b/src/main/resources/assets/tm-morefood/textures/items/bread_dough.png new file mode 100644 index 0000000000000000000000000000000000000000..e4f7100f35ef2c819467025df2a91508312367bc GIT binary patch literal 2996 zcmV;l3rqBgP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{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