From 5ba8230943c6b9a497dd06b8bbc98c4a0f8a19c9 Mon Sep 17 00:00:00 2001 From: Stefan Wimmer Date: Mon, 25 Jul 2016 13:33:54 +0200 Subject: [PATCH] Minor changes, Release 2.1.0 --- README.md | 2 +- build.gradle | 34 ++++--- .../scala/io/teammion/morefood/Items.scala | 96 +++++++++---------- .../scala/io/teammion/morefood/MoreFood.scala | 23 +++++ .../teammion/morefood/proxy/CommonProxy.scala | 2 +- .../morefood/recipes/ShapedRecipes.scala | 16 ++-- .../morefood/recipes/ShapelessRecipes.scala | 76 +++++++-------- .../morefood/recipes/SmeltingRecipes.scala | 28 +++--- 8 files changed, 155 insertions(+), 122 deletions(-) diff --git a/README.md b/README.md index 171b4ca..83a77e3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # MoreFood -This Minecraft Mod will add additional food to Mincraft to provide a healthy variety. +This Minecraft Mod will add additional food to Minecraft to provide a healthy variety. More information can be found on [Curse](http://minecraft.curseforge.com/projects/tm-morefood) diff --git a/build.gradle b/build.gradle index dd2b84a..bd0a458 100644 --- a/build.gradle +++ b/build.gradle @@ -1,34 +1,41 @@ -buildscript { - repositories { +buildscript +{ + repositories + { jcenter() + maven { name = "forge" url = "http://files.minecraftforge.net/maven" } } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + + dependencies + { + classpath "net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT" } } apply plugin: "scala" apply plugin: "net.minecraftforge.gradle.forge" -version = "2.0.0" +version = "2.1.0" group = "io.teammion.morefood" archivesBaseName = "tm-morefood" sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 -minecraft { +minecraft +{ version = "1.10.2-12.18.1.2020" runDir = "run" mappings = "snapshot_20160518" } -dependencies { +dependencies +{ } processResources @@ -36,13 +43,16 @@ processResources inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' + from(sourceSets.main.resources.srcDirs) + { + include "mcmod.info" - expand 'version':project.version, 'mcversion':project.minecraft.version + expand "version": project.version, + "mcversion": project.minecraft.version } - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + from(sourceSets.main.resources.srcDirs) + { + exclude "mcmod.info" } } diff --git a/src/main/scala/io/teammion/morefood/Items.scala b/src/main/scala/io/teammion/morefood/Items.scala index 699c42d..629802e 100644 --- a/src/main/scala/io/teammion/morefood/Items.scala +++ b/src/main/scala/io/teammion/morefood/Items.scala @@ -24,87 +24,87 @@ object Items val WATER_BUCKET : minecraft.item.Item = minecraft.init.Items.WATER_BUCKET val WHEAT : minecraft.item.Item = minecraft.init.Items.WHEAT - val MILK_BOTTLE : ItemMilkBottle = new ItemMilkBottle - val COCOA_BEAN_ROASTED : Item = new Item("cocoa_bean_roasted") - val COCOA_BEAN_GROUND : Item = new Item("cocoa_bean_ground") + val APPLE_CHOCOLATE : Item = new Item("apple_chocolate") + val APPLE_CHOCOLATE_COATED : ItemFood = new ItemFood("apple_chocolate_coated", 8) + val BREAD_DOUGH : Item = new Item("bread_dough") + val BREAD_SLICE : Item = new Item("bread_slice") val CHOCOLATE : ItemFood = new ItemFood("chocolate", 8) - val CHOCOLATE_PIECE : ItemFood = new ItemFood("chocolate_piece", 1) val CHOCOLATE_DRINK : ItemDrink = new ItemDrink("chocolate_drink", 4) - val FLOUR : Item = new Item("flour") - val SCHNITZEL_RAW : Item = new Item("schnitzel_raw") - val SCHNITZEL : ItemFood = new ItemFood("schnitzel", 4) + val CHOCOLATE_PIECE : ItemFood = new ItemFood("chocolate_piece", 1) + val COCOA_BEAN_GROUND : Item = new Item("cocoa_bean_ground") + val COCOA_BEAN_ROASTED : Item = new Item("cocoa_bean_roasted") val EGG_BOILED : ItemFood = new ItemFood("egg_boiled", 3) - val APPLE_CHOCOLATE : Item = new Item("apple_chocolate") - val APPLE_CHOCOLATE_COATED : ItemFood = new ItemFood("apple_chocolate_coated", 8) - val FISH_STICK_RAW : Item = new Item("fish_stick_raw") val FISH_STICK : ItemFood = new ItemFood("fish_stick", 6) - val BREAD_SLICE : Item = new Item("bread_slice") - val SANDWICH_SCHNITZEL : ItemFood = new ItemFood("sandwich_schnitzel", 5) - val SANDWICH_PORKCHOP : ItemFood = new ItemFood("sandwich_porkchop", 5) + val FISH_STICK_RAW : Item = new Item("fish_stick_raw") + val FLOUR : Item = new Item("flour") + val FRENCH_FRIES : ItemFood = new ItemFood("french_fries", 6) + val FRENCH_FRIES_RAW : Item = new Item("french_fries_raw") + val MILK_BOTTLE : ItemMilkBottle = new ItemMilkBottle val SANDWICH_CHICKEN : ItemFood = new ItemFood("sandwich_chicken", 5) val SANDWICH_FISH : ItemFood = new ItemFood("sandwich_fish", 5) + val SANDWICH_PORKCHOP : ItemFood = new ItemFood("sandwich_porkchop", 5) + val SANDWICH_SCHNITZEL : ItemFood = new ItemFood("sandwich_schnitzel", 5) + val SCHNITZEL : ItemFood = new ItemFood("schnitzel", 4) + val SCHNITZEL_RAW : Item = new Item("schnitzel_raw") val STRAWBERRY : ItemStrawberry = new ItemStrawberry val STRAWBERRY_CHOCOLATE : Item = new Item("strawberry_chocolate") val STRAWBERRY_CHOCOLATE_COATED : ItemFood = new ItemFood("strawberry_chocolate_coated", 8) - val FRENCH_FRIES_RAW : Item = new Item("french_fries_raw") - val FRENCH_FRIES : ItemFood = new ItemFood("french_fries", 6) - val BREAD_DOUGH : Item = new Item("bread_dough") def register() : Unit = { - Registry.register(MILK_BOTTLE) - Registry.register(COCOA_BEAN_ROASTED) - Registry.register(COCOA_BEAN_GROUND) + Registry.register(APPLE_CHOCOLATE) + Registry.register(APPLE_CHOCOLATE_COATED) + Registry.register(BREAD_DOUGH) + Registry.register(BREAD_SLICE) Registry.register(CHOCOLATE) - Registry.register(CHOCOLATE_PIECE) Registry.register(CHOCOLATE_DRINK) - Registry.register(FLOUR) - Registry.register(SCHNITZEL_RAW) - Registry.register(SCHNITZEL) + Registry.register(CHOCOLATE_PIECE) + Registry.register(COCOA_BEAN_GROUND) + Registry.register(COCOA_BEAN_ROASTED) Registry.register(EGG_BOILED) - Registry.register(APPLE_CHOCOLATE) - Registry.register(APPLE_CHOCOLATE_COATED) - Registry.register(FISH_STICK_RAW) Registry.register(FISH_STICK) - Registry.register(BREAD_SLICE) - Registry.register(SANDWICH_SCHNITZEL) - Registry.register(SANDWICH_PORKCHOP) + Registry.register(FISH_STICK_RAW) + Registry.register(FLOUR) + Registry.register(FRENCH_FRIES) + Registry.register(FRENCH_FRIES_RAW) + Registry.register(MILK_BOTTLE) Registry.register(SANDWICH_CHICKEN) Registry.register(SANDWICH_FISH) + Registry.register(SANDWICH_PORKCHOP) + Registry.register(SANDWICH_SCHNITZEL) + Registry.register(SCHNITZEL) + Registry.register(SCHNITZEL_RAW) Registry.register(STRAWBERRY) Registry.register(STRAWBERRY_CHOCOLATE) Registry.register(STRAWBERRY_CHOCOLATE_COATED) - Registry.register(FRENCH_FRIES_RAW) - Registry.register(FRENCH_FRIES) - Registry.register(BREAD_DOUGH) } def render() : Unit = { - Registry.render(MILK_BOTTLE) - Registry.render(COCOA_BEAN_ROASTED) - Registry.render(COCOA_BEAN_GROUND) + Registry.render(APPLE_CHOCOLATE) + Registry.render(APPLE_CHOCOLATE_COATED) + Registry.render(BREAD_DOUGH) + Registry.render(BREAD_SLICE) Registry.render(CHOCOLATE) - Registry.render(CHOCOLATE_PIECE) Registry.render(CHOCOLATE_DRINK) - Registry.render(FLOUR) - Registry.render(SCHNITZEL_RAW) - Registry.render(SCHNITZEL) + Registry.render(CHOCOLATE_PIECE) + Registry.render(COCOA_BEAN_GROUND) + Registry.render(COCOA_BEAN_ROASTED) Registry.render(EGG_BOILED) - Registry.render(APPLE_CHOCOLATE) - Registry.render(APPLE_CHOCOLATE_COATED) - Registry.render(FISH_STICK_RAW) Registry.render(FISH_STICK) - Registry.render(BREAD_SLICE) - Registry.render(SANDWICH_SCHNITZEL) - Registry.render(SANDWICH_PORKCHOP) + Registry.render(FISH_STICK_RAW) + Registry.render(FLOUR) + Registry.render(FRENCH_FRIES) + Registry.render(FRENCH_FRIES_RAW) + Registry.render(MILK_BOTTLE) Registry.render(SANDWICH_CHICKEN) Registry.render(SANDWICH_FISH) + Registry.render(SANDWICH_PORKCHOP) + Registry.render(SANDWICH_SCHNITZEL) + Registry.render(SCHNITZEL) + Registry.render(SCHNITZEL_RAW) Registry.render(STRAWBERRY) Registry.render(STRAWBERRY_CHOCOLATE) Registry.render(STRAWBERRY_CHOCOLATE_COATED) - Registry.render(FRENCH_FRIES_RAW) - Registry.render(FRENCH_FRIES) - Registry.render(BREAD_DOUGH) } } diff --git a/src/main/scala/io/teammion/morefood/MoreFood.scala b/src/main/scala/io/teammion/morefood/MoreFood.scala index 4a5843e..c601d2a 100644 --- a/src/main/scala/io/teammion/morefood/MoreFood.scala +++ b/src/main/scala/io/teammion/morefood/MoreFood.scala @@ -3,6 +3,7 @@ package io.teammion.morefood import io.teammion.morefood.proxy.CommonProxy import net.minecraftforge.fml.common.{Mod, SidedProxy} import net.minecraftforge.fml.common.event.{FMLInitializationEvent, FMLPostInitializationEvent, FMLPreInitializationEvent} +import org.apache.logging.log4j.Logger /** * Created by Stefan Wimmer on 24.07.16. @@ -16,15 +17,37 @@ object MoreFood ) var proxy : CommonProxy = _ + var logger : Logger = _ + @Mod.EventHandler def preInit(e : FMLPreInitializationEvent) : Unit = + { + logger = e.getModLog + + logger.info ("MoreFood preinitializing...") + proxy.preInit(e) + + logger.info("MoreFood preinitialized") + } @Mod.EventHandler def init(e : FMLInitializationEvent) : Unit = + { + logger.info("MoreFood initializing...") + proxy.init(e) + + logger.info("MoreFood initialized") + } @Mod.EventHandler def postInit(e : FMLPostInitializationEvent) : Unit = + { + logger.info("MoreFood postinitializing...") + proxy.postInit(e) + + logger.info("MoreFood postinitialized") + } } diff --git a/src/main/scala/io/teammion/morefood/proxy/CommonProxy.scala b/src/main/scala/io/teammion/morefood/proxy/CommonProxy.scala index 19962b0..d1497e7 100644 --- a/src/main/scala/io/teammion/morefood/proxy/CommonProxy.scala +++ b/src/main/scala/io/teammion/morefood/proxy/CommonProxy.scala @@ -3,7 +3,7 @@ package io.teammion.morefood.proxy import java.util import io.teammion.morefood.recipes.{ShapedRecipes, ShapelessRecipes, SmeltingRecipes} -import io.teammion.morefood.{Config, EventHandler, Items} +import io.teammion.morefood.{Config, EventHandler, Items, MoreFood} import net.minecraft import net.minecraft.item.ItemStack import net.minecraft.item.crafting.{CraftingManager, IRecipe} diff --git a/src/main/scala/io/teammion/morefood/recipes/ShapedRecipes.scala b/src/main/scala/io/teammion/morefood/recipes/ShapedRecipes.scala index 9b48554..7cc6450 100644 --- a/src/main/scala/io/teammion/morefood/recipes/ShapedRecipes.scala +++ b/src/main/scala/io/teammion/morefood/recipes/ShapedRecipes.scala @@ -38,39 +38,39 @@ object ShapedRecipes ) Registry.addShapedRecipe( - Items.SANDWICH_SCHNITZEL.stack, + Items.SANDWICH_FISH.stack, "A", "B", "A", char2Character('A'), Items.BREAD_SLICE, - char2Character('B'), Items.SCHNITZEL + char2Character('B'), Items.COOKED_FISH ) Registry.addShapedRecipe( - Items.SANDWICH_PORKCHOP.stack, + Items.SANDWICH_CHICKEN.stack, "A", "B", "A", char2Character('A'), Items.BREAD_SLICE, - char2Character('B'), Items.COOKED_PORKCHOP + char2Character('B'), Items.COOKED_CHICKEN ) Registry.addShapedRecipe( - Items.SANDWICH_CHICKEN.stack, + Items.SANDWICH_PORKCHOP.stack, "A", "B", "A", char2Character('A'), Items.BREAD_SLICE, - char2Character('B'), Items.COOKED_CHICKEN + char2Character('B'), Items.COOKED_PORKCHOP ) Registry.addShapedRecipe( - Items.SANDWICH_FISH.stack, + Items.SANDWICH_SCHNITZEL.stack, "A", "B", "A", char2Character('A'), Items.BREAD_SLICE, - char2Character('B'), Items.COOKED_FISH + char2Character('B'), Items.SCHNITZEL ) } } diff --git a/src/main/scala/io/teammion/morefood/recipes/ShapelessRecipes.scala b/src/main/scala/io/teammion/morefood/recipes/ShapelessRecipes.scala index ccb6241..2746c82 100644 --- a/src/main/scala/io/teammion/morefood/recipes/ShapelessRecipes.scala +++ b/src/main/scala/io/teammion/morefood/recipes/ShapelessRecipes.scala @@ -11,17 +11,24 @@ object ShapelessRecipes def register() : Unit = { Registry.addShapelessRecipe( - Items.MILK_BOTTLE.stack(4), - Items.MILK_BUCKET, - Items.GLASS_BOTTLE, - Items.GLASS_BOTTLE, - Items.GLASS_BOTTLE, - Items.GLASS_BOTTLE + Items.APPLE_CHOCOLATE.stack, + Items.APPLE, + Items.CHOCOLATE_PIECE, + Items.CHOCOLATE_PIECE ) Registry.addShapelessRecipe( - Items.CHOCOLATE_PIECE.stack(8), - Items.CHOCOLATE + Items.BREAD_DOUGH.stack(2), + Items.FLOUR, + Items.FLOUR, + Items.FLOUR, + Items.FLOUR, + Items.WATER_BUCKET + ) + + Registry.addShapelessRecipe( + Items.BREAD_SLICE.stack(2), + Items.BREAD ) Registry.addShapelessRecipe( @@ -34,36 +41,44 @@ object ShapelessRecipes ) Registry.addShapelessRecipe( - Items.FLOUR.stack(2), - Items.WHEAT + Items.CHOCOLATE_PIECE.stack(8), + Items.CHOCOLATE ) Registry.addShapelessRecipe( - Items.SCHNITZEL.stack, - Items.PORKCHOP, + Items.FISH_STICK_RAW.stack, + Items.FISH, Items.EGG, Items.FLOUR, Items.FLOUR ) Registry.addShapelessRecipe( - Items.APPLE_CHOCOLATE.stack, - Items.APPLE, - Items.CHOCOLATE_PIECE, - Items.CHOCOLATE_PIECE + Items.FLOUR.stack(2), + Items.WHEAT ) Registry.addShapelessRecipe( - Items.FISH_STICK_RAW.stack, - Items.FISH, - Items.EGG, - Items.FLOUR, - Items.FLOUR + Items.FRENCH_FRIES_RAW.stack(8), + Items.POTATO, + Items.POTATO ) Registry.addShapelessRecipe( - Items.BREAD_SLICE.stack(2), - Items.BREAD + Items.MILK_BOTTLE.stack(4), + Items.MILK_BUCKET, + Items.GLASS_BOTTLE, + Items.GLASS_BOTTLE, + Items.GLASS_BOTTLE, + Items.GLASS_BOTTLE + ) + + Registry.addShapelessRecipe( + Items.SCHNITZEL_RAW.stack, + Items.PORKCHOP, + Items.EGG, + Items.FLOUR, + Items.FLOUR ) Registry.addShapelessRecipe( @@ -72,20 +87,5 @@ object ShapelessRecipes Items.CHOCOLATE_PIECE, Items.CHOCOLATE_PIECE ) - - Registry.addShapelessRecipe( - Items.FRENCH_FRIES_RAW.stack(8), - Items.POTATO, - Items.POTATO - ) - - Registry.addShapelessRecipe( - Items.BREAD_DOUGH.stack(2), - Items.FLOUR, - Items.FLOUR, - Items.FLOUR, - Items.FLOUR, - Items.WATER_BUCKET - ) } } diff --git a/src/main/scala/io/teammion/morefood/recipes/SmeltingRecipes.scala b/src/main/scala/io/teammion/morefood/recipes/SmeltingRecipes.scala index 7e22245..928f3bd 100644 --- a/src/main/scala/io/teammion/morefood/recipes/SmeltingRecipes.scala +++ b/src/main/scala/io/teammion/morefood/recipes/SmeltingRecipes.scala @@ -11,13 +11,13 @@ object SmeltingRecipes def register() : Unit = { Registry.addSmelting( - new ItemStack(Items.DYE, 1, 3), - Items.COCOA_BEAN_ROASTED.stack + Items.APPLE_CHOCOLATE, + Items.APPLE_CHOCOLATE_COATED.stack ) Registry.addSmelting( - Items.SCHNITZEL_RAW, - Items.SCHNITZEL.stack + Items.BREAD_DOUGH, + new ItemStack(Items.BREAD) ) Registry.addSmelting( @@ -26,28 +26,28 @@ object SmeltingRecipes ) Registry.addSmelting( - Items.APPLE_CHOCOLATE, - Items.APPLE_CHOCOLATE_COATED.stack + Items.FISH_STICK_RAW, + Items.FISH_STICK.stack ) Registry.addSmelting( - Items.FISH_STICK_RAW, - Items.FISH_STICK.stack + Items.FRENCH_FRIES_RAW, + Items.FRENCH_FRIES.stack ) Registry.addSmelting( - Items.STRAWBERRY_CHOCOLATE, - Items.STRAWBERRY_CHOCOLATE_COATED.stack + new ItemStack(Items.DYE, 1, 3), + Items.COCOA_BEAN_ROASTED.stack ) Registry.addSmelting( - Items.FRENCH_FRIES_RAW, - Items.FRENCH_FRIES.stack + Items.SCHNITZEL_RAW, + Items.SCHNITZEL.stack ) Registry.addSmelting( - Items.BREAD_DOUGH, - new ItemStack(Items.BREAD) + Items.STRAWBERRY_CHOCOLATE, + Items.STRAWBERRY_CHOCOLATE_COATED.stack ) } }