-Fixed some tiny Bugs

This commit is contained in:
Ellpeck 2015-06-12 21:29:21 +02:00
parent 2c6bcd72cf
commit 0ce4d001b9
8 changed files with 24 additions and 19 deletions

View file

@ -18,6 +18,7 @@ import ellpeck.actuallyadditions.gen.InitVillager;
import ellpeck.actuallyadditions.gen.OreGen;
import ellpeck.actuallyadditions.inventory.GuiHandler;
import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.ItemCoffee;
import ellpeck.actuallyadditions.material.InitItemMaterials;
import ellpeck.actuallyadditions.network.PacketHandler;
import ellpeck.actuallyadditions.proxy.IProxy;
@ -74,6 +75,7 @@ public class ActuallyAdditions{
Util.logInfo("Starting PostInitialization Phase...");
GrinderCrafting.init();
ItemCoffee.initIngredients();
proxy.postInit();
Util.logInfo("PostInitialization Finished.");

View file

@ -129,6 +129,7 @@ public class BlockCoffeeMachine extends BlockContainerBase implements INameableI
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
BlockUtil.addInformation(theBlock, list, 5, "");
BlockUtil.addPowerUsageInfo(list, TileEntityCoffeeMachine.energyUsePerTick);
}
@Override

View file

@ -7,6 +7,7 @@ import ellpeck.actuallyadditions.config.values.ConfigCrafting;
import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheMiscItems;
import ellpeck.actuallyadditions.util.INameableItem;
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
@ -159,7 +160,7 @@ public class BlockCrafting{
"CRC", "CBC", "CRC",
'C', "cobblestone",
'R', TheMiscBlocks.STONE_CASING.getOredictName(),
'B', "coal"));
'B', new ItemStack(Items.coal, 1, Util.WILDCARD)));
//Enderpearl Block
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()),

View file

@ -120,7 +120,7 @@ public class GuiInputter extends GuiContainer{
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.put"), guiLeft + 107 + 3, guiTop + 32 + (isAdvanced ? 12+OFFSET_ADVANCED : 0), 4210752);
this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft + 24 + 1, guiTop + 45 + 3 + (isAdvanced ? 12+36 : 0), 4210752);
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPut == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPull).toString(), guiLeft + 24 + 3, guiTop + 66 + 3 + (isAdvanced ? 12+OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPull == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPull).toString(), guiLeft + 24 + 3, guiTop + 66 + 3 + (isAdvanced ? 12+OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);
this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft + 109 + 1, guiTop + 45 + 3 + (isAdvanced ? 12+36 : 0), 4210752);
this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPut == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPut).toString(), guiLeft + 109 + 3, guiTop + 66 + 3 + (isAdvanced ? 12+OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT);

View file

@ -29,8 +29,8 @@ public class ItemCoffee extends ItemFood implements INameableItem{
public static ArrayList<Ingredient> ingredients = new ArrayList<Ingredient>();
public void initIngredients(){
this.registerIngredient(new Ingredient(new ItemStack(Items.milk_bucket), null){
public static void initIngredients(){
registerIngredient(new Ingredient(new ItemStack(Items.milk_bucket), null){
@Override
public void effect(ItemStack stack){
PotionEffect[] effects = getEffectsFromStack(stack);
@ -45,19 +45,20 @@ public class ItemCoffee extends ItemFood implements INameableItem{
ItemCoffee.addEffectToStack(stack, this);
}
}
this.effects = null;
}
@Override
public String getExtraText(){
return StatCollector.translateToLocal("container.nei." + ModUtil.MOD_ID_LOWER + ".coffee.extra.milk");
}
});
this.registerIngredient(new Ingredient(new ItemStack(Items.sugar), new PotionEffect[]{new PotionEffect(Potion.moveSpeed.getId(), 30, 0)}));
this.registerIngredient(new Ingredient(new ItemStack(Items.magma_cream), new PotionEffect[]{new PotionEffect(Potion.fireResistance.getId(), 10, 0)}));
this.registerIngredient(new Ingredient(new ItemStack(Items.fish, 1, 3), new PotionEffect[]{new PotionEffect(Potion.waterBreathing.getId(), 15, 0)}));
this.registerIngredient(new Ingredient(new ItemStack(Items.golden_carrot), new PotionEffect[]{new PotionEffect(Potion.nightVision.getId(), 60, 0)}));
this.registerIngredient(new Ingredient(new ItemStack(Items.ghast_tear), new PotionEffect[]{new PotionEffect(Potion.regeneration.getId(), 10, 0)}));
this.registerIngredient(new Ingredient(new ItemStack(Items.blaze_powder), new PotionEffect[]{new PotionEffect(Potion.damageBoost.getId(), 15, 0)}));
this.registerIngredient(new Ingredient(new ItemStack(Items.fermented_spider_eye), new PotionEffect[]{new PotionEffect(Potion.invisibility.getId(), 25, 0)}));
registerIngredient(new Ingredient(new ItemStack(Items.sugar), new PotionEffect[]{new PotionEffect(Potion.moveSpeed.getId(), 30, 0)}));
registerIngredient(new Ingredient(new ItemStack(Items.magma_cream), new PotionEffect[]{new PotionEffect(Potion.fireResistance.getId(), 10, 0)}));
registerIngredient(new Ingredient(new ItemStack(Items.fish, 1, 3), new PotionEffect[]{new PotionEffect(Potion.waterBreathing.getId(), 15, 0)}));
registerIngredient(new Ingredient(new ItemStack(Items.golden_carrot), new PotionEffect[]{new PotionEffect(Potion.nightVision.getId(), 60, 0)}));
registerIngredient(new Ingredient(new ItemStack(Items.ghast_tear), new PotionEffect[]{new PotionEffect(Potion.regeneration.getId(), 10, 0)}));
registerIngredient(new Ingredient(new ItemStack(Items.blaze_powder), new PotionEffect[]{new PotionEffect(Potion.damageBoost.getId(), 15, 0)}));
registerIngredient(new Ingredient(new ItemStack(Items.fermented_spider_eye), new PotionEffect[]{new PotionEffect(Potion.invisibility.getId(), 25, 0)}));
}
public ItemCoffee(){
@ -65,12 +66,11 @@ public class ItemCoffee extends ItemFood implements INameableItem{
this.setMaxDamage(ConfigIntValues.COFFEE_DRINK_AMOUNT.getValue()-1);
this.setAlwaysEdible();
this.setMaxStackSize(1);
this.initIngredients();
}
public static Ingredient getIngredientFromStack(ItemStack stack){
for(Ingredient ingredient : ingredients){
if(ingredient.ingredient.isItemEqual(stack)) return ingredient;
if(ingredient.ingredient.copy().isItemEqual(stack)) return ingredient;
}
return null;
}
@ -224,13 +224,13 @@ public class ItemCoffee extends ItemFood implements INameableItem{
return "itemCoffee";
}
public void registerIngredient(Ingredient ingredient){
public static void registerIngredient(Ingredient ingredient){
ingredients.add(ingredient);
}
public static class Ingredient{
public ItemStack ingredient;
public final ItemStack ingredient;
protected PotionEffect[] effects;
public Ingredient(ItemStack ingredient, PotionEffect[] effects){

View file

@ -41,7 +41,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{
public CachedCoffee(ItemCoffee.Ingredient ingredient){
this.cup = new PositionedStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), 45, 39);
this.coffeeBeans = new PositionedStack(new ItemStack(InitItems.itemCoffeeBean), 2, 39);
this.ingredientStack = new PositionedStack(ingredient.ingredient, 90, 21);
this.ingredientStack = new PositionedStack(ingredient.ingredient.copy(), 90, 21);
this.setupResult(ingredient);
this.extraText = ingredient.getExtraText();
}
@ -112,7 +112,7 @@ public class CoffeeMachineRecipeHandler extends TemplateRecipeHandler{
ArrayList<ItemCoffee.Ingredient> ingredients = ItemCoffee.ingredients;
for(ItemCoffee.Ingredient ingr : ingredients){
if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemCoffeeBean), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(ingr.ingredient, ingredient)){
if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemCoffeeBean), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(ingr.ingredient.copy(), ingredient)){
CachedCoffee theRecipe = new CachedCoffee(ingr);
theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredientStack), ingredient);
arecipes.add(theRecipe);

View file

@ -40,6 +40,7 @@ public class TileEntityBase extends TileEntity{
GameRegistry.registerTileEntity(TileEntityFluidCollector.TileEntityFluidPlacer.class, ModUtil.MOD_ID_LOWER + ":tileEntityFluidPlacer");
GameRegistry.registerTileEntity(TileEntityLavaFactoryController.class, ModUtil.MOD_ID_LOWER + ":tileEntityLavaFactoryController");
GameRegistry.registerTileEntity(TileEntityCoffeeMachine.class, ModUtil.MOD_ID_LOWER + ":tileEntityCoffeeMachine");
GameRegistry.registerTileEntity(TileEntityPhantomBooster.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomBooster");
}
@Override

View file

@ -41,7 +41,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
if(!worldObj.isRemote){
this.storeCoffee();
if(this.brewTime > 0 || worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
if(this.brewTime > 0){
this.brew();
}
}
@ -127,7 +127,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
@Override
public boolean isItemValidForSlot(int i, ItemStack stack){
return (i >= 3 && ItemCoffee.getIngredientFromStack(stack) != null && (this.slots[i] == null || this.slots[i].stackSize < 1)) || (i == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (i == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal());
return (i == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (i == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal());
}
@Override