-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefan Wimmer
committed
Jul 23, 2016
1 parent
42d9c87
commit 7d23aed
Showing
15 changed files
with
89 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> 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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,53 +3,22 @@ | |
import net.minecraft.item.Item; | ||
|
||
/** | ||
* Created by Stefan Wimmer <[email protected]> on 05.06.16. | ||
* Created by Stefan Wimmer <[email protected]> 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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,18 @@ | |
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; | ||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; | ||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
|
||
import java.util.Iterator; | ||
|
||
/** | ||
* Created by Stefan Wimmer <[email protected]> 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<IRecipe> itr = CraftingManager.getInstance().getRecipeList().iterator(); | ||
|
||
while (itr.hasNext()) | ||
{ | ||
ItemStack itemStack = itr.next().getRecipeOutput(); | ||
|
||
if (itemStack != null && itemStack.getItem() == Items.BREAD) | ||
itr.remove(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/tm-morefood/models/item/bread_dough.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "tm-morefood:item/_default", | ||
"textures": { | ||
"layer0": "tm-morefood:items/bread_dough" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.