-Added Hairy Balls

-Updated Bugs
This commit is contained in:
Ellpeck 2015-05-07 16:36:29 +02:00
parent 3649bdd29c
commit 263c0eea1e
26 changed files with 328 additions and 130 deletions

View file

@ -18,7 +18,7 @@ buildscript {
apply plugin: 'forge' apply plugin: 'forge'
apply plugin: 'maven' apply plugin: 'maven'
version = "1.7.10-0.0.4.3" version = "1.7.10-0.0.4.4"
group = "ellpeck.actuallyadditions" group = "ellpeck.actuallyadditions"
archivesBaseName = "ActuallyAdditions" archivesBaseName = "ActuallyAdditions"

View file

@ -1 +1 @@
1.7.10-0.0.4.3 1.7.10-0.0.4.4

View file

@ -29,7 +29,7 @@ public class BlockGrinder extends BlockContainerBase implements INameableItem{
private IIcon onIcon; private IIcon onIcon;
private IIcon bottomIcon; private IIcon bottomIcon;
private boolean isDouble; private final boolean isDouble;
public BlockGrinder(boolean isDouble){ public BlockGrinder(boolean isDouble){
super(Material.rock); super(Material.rock);

View file

@ -22,7 +22,9 @@ public enum ConfigBoolValues{
DO_UPDATE_CHECK("Do Update Check", ConfigCategories.OTHER, true, "If Actually Additions should check for an Update on joining a World"), DO_UPDATE_CHECK("Do Update Check", ConfigCategories.OTHER, true, "If Actually Additions should check for an Update on joining a World"),
DO_CRUSHER_SPAM("Crusher Debug", ConfigCategories.OTHER, false, "Print out Crusher Recipe Initializing Debug"); DO_CRUSHER_SPAM("Crusher Debug", ConfigCategories.OTHER, false, "Print out Crusher Recipe Initializing Debug"),
DO_CAT_DROPS("Do Cat Drops", ConfigCategories.OTHER, true, "If Cats drop Hairy Balls on Occasion");
public final String name; public final String name;
public final String category; public final String category;

View file

@ -19,7 +19,7 @@ public enum ConfigIntValues{
COMPOST_AMOUNT("Compost: Amount Needed To Convert", ConfigCategories.MACHINE_VALUES, 10, 1, 64, "How many items are needed in the Compost to convert to Fertilizer"), COMPOST_AMOUNT("Compost: Amount Needed To Convert", ConfigCategories.MACHINE_VALUES, 10, 1, 64, "How many items are needed in the Compost to convert to Fertilizer"),
COMPOST_TIME("Compost: Conversion Time Needed", ConfigCategories.MACHINE_VALUES, 1000, 30, 10000, "How long the Compost needs to convert to Fertilizer"), COMPOST_TIME("Compost: Conversion Time Needed", ConfigCategories.MACHINE_VALUES, 1000, 30, 10000, "How long the Compost needs to convert to Fertilizer"),
FISHER_TIME("Fishing Net: Time Needed", ConfigCategories.MACHINE_VALUES, 2000, 50, 50000, "How long it takes on Average until the Fishing Net catches a Fish"), FISHER_TIME("Fishing Net: Time Needed", ConfigCategories.MACHINE_VALUES, 10000, 50, 500000, "How long it takes on Average until the Fishing Net catches a Fish"),
FEEDER_REACH("Feeder: Reach", ConfigCategories.MACHINE_VALUES, 5, 1, 20, "The Radius of Action of the Feeder"), FEEDER_REACH("Feeder: Reach", ConfigCategories.MACHINE_VALUES, 5, 1, 20, "The Radius of Action of the Feeder"),
FEEDER_TIME("Feeder: Time Needed", ConfigCategories.MACHINE_VALUES, 100, 50, 5000, "The time spent between feeding animals with the Feeder"), FEEDER_TIME("Feeder: Time Needed", ConfigCategories.MACHINE_VALUES, 100, 50, 5000, "The time spent between feeding animals with the Feeder"),
@ -39,14 +39,16 @@ public enum ConfigIntValues{
GRINDER_DOUBLE_CRUSH_TIME("Double Crusher: Crush Time", ConfigCategories.MACHINE_VALUES, 300, 10, 1000, "How long the Double Crusher takes to crush an item"), GRINDER_DOUBLE_CRUSH_TIME("Double Crusher: Crush Time", ConfigCategories.MACHINE_VALUES, 300, 10, 1000, "How long the Double Crusher takes to crush an item"),
FURNACE_DOUBLE_SMELT_TIME("Double Furnace: Smelt Time", ConfigCategories.MACHINE_VALUES, 300, 10, 1000, "How long the Double Furnace takes to crush an item"), FURNACE_DOUBLE_SMELT_TIME("Double Furnace: Smelt Time", ConfigCategories.MACHINE_VALUES, 300, 10, 1000, "How long the Double Furnace takes to crush an item"),
REPAIRER_SPEED_SLOWDOWN("Item Repairer: Speed Slowdown", ConfigCategories.MACHINE_VALUES, 2, 1, 100, "How much slower the Item Repairer repairs"), REPAIRER_SPEED_SLOWDOWN("Item Repairer: Speed Slowdown", ConfigCategories.MACHINE_VALUES, 3, 1, 100, "How much slower the Item Repairer repairs"),
HEAT_COLLECTOR_BLOCKS("Heat Collector: Blocks Needed", ConfigCategories.MACHINE_VALUES, 4, 1, 5, "How many Blocks are needed for the Heat Collector to power Machines above it"), HEAT_COLLECTOR_BLOCKS("Heat Collector: Blocks Needed", ConfigCategories.MACHINE_VALUES, 4, 1, 5, "How many Blocks are needed for the Heat Collector to power Machines above it"),
HEAT_COLLECTOR_LAVA_CHANCE("Heat Collector: Random Chance", ConfigCategories.MACHINE_VALUES, 10000, 10, 100000, "The Chance of the Heat Collector destroying a Lava Block around (Default Value 2000 meaning a 1/2000 Chance!)"), HEAT_COLLECTOR_LAVA_CHANCE("Heat Collector: Random Chance", ConfigCategories.MACHINE_VALUES, 10000, 10, 100000, "The Chance of the Heat Collector destroying a Lava Block around (Default Value 2000 meaning a 1/2000 Chance!)"),
GLASS_TIME_NEEDED("Greenhouse Glass: Time Needed", ConfigCategories.MACHINE_VALUES, 1000, 10, 1000000, "The Time Needed for the Greenhouse Glass to grow a Plant below it"), GLASS_TIME_NEEDED("Greenhouse Glass: Time Needed", ConfigCategories.MACHINE_VALUES, 1000, 10, 1000000, "The Time Needed for the Greenhouse Glass to grow a Plant below it"),
BREAKER_TIME_NEEDED("Breaker and Placer: Time Needed", ConfigCategories.MACHINE_VALUES, 15, 1, 10000, "The Time Needed for the Breaker and the Placer to place or break a Block"), BREAKER_TIME_NEEDED("Breaker and Placer: Time Needed", ConfigCategories.MACHINE_VALUES, 15, 1, 10000, "The Time Needed for the Breaker and the Placer to place or break a Block"),
DROPPER_TIME_NEEDED("Dropper: Time Needed", ConfigCategories.MACHINE_VALUES, 10, 1, 10000, "The Time Needed for the Dropper to drop an Item"); DROPPER_TIME_NEEDED("Dropper: Time Needed", ConfigCategories.MACHINE_VALUES, 10, 1, 10000, "The Time Needed for the Dropper to drop an Item"),
CAT_DROP_CHANCE("Cat Drops: Chance", ConfigCategories.OTHER, 5000, 5, 10000000, "The 1 in X chance for a Hairy Ball to Drop from a Cat with X being this value");
public final String name; public final String name;
public final String category; public final String category;

View file

@ -58,7 +58,7 @@ public class BlockCrafting{
'D', "gemDiamond", 'D', "gemDiamond",
'I', "ingotIron", 'I', "ingotIron",
'O', TheMiscItems.COIL.getOredictName(), 'O', TheMiscItems.COIL.getOredictName(),
'C', TheMiscBlocks.STONE_CASING.getOredictName())); 'C', Items.nether_star));
//Solar Panel //Solar Panel
/*if(ConfigCrafting.SOLAR_PANEL.isEnabled()) /*if(ConfigCrafting.SOLAR_PANEL.isEnabled())

View file

@ -4,7 +4,6 @@ import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheDusts; import ellpeck.actuallyadditions.items.metalists.TheDusts;
import ellpeck.actuallyadditions.recipe.GrinderRecipeHandler; import ellpeck.actuallyadditions.recipe.GrinderRecipeHandler;
import ellpeck.actuallyadditions.recipe.GrinderRecipeHandler.SearchCase; import ellpeck.actuallyadditions.recipe.GrinderRecipeHandler.SearchCase;
import ellpeck.actuallyadditions.recipe.GrinderRecipeHandler.SpecialOreCase;
import ellpeck.actuallyadditions.recipe.GrinderRecipes; import ellpeck.actuallyadditions.recipe.GrinderRecipes;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@ -19,10 +18,15 @@ public class GrinderCrafting{
public static void init(){ public static void init(){
Util.logInfo("Initializing Crusher Recipes..."); Util.logInfo("Initializing Crusher Recipes...");
grindRec.registerRecipe(new ItemStack(Blocks.iron_ore), new ItemStack(InitItems.itemDust, 2, TheDusts.IRON.ordinal()), new ItemStack(InitItems.itemDust, 1, TheDusts.GOLD.ordinal()), 10);
grindRec.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10), null, 0); grindRec.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10), null, 0);
grindRec.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(InitItems.itemDust, 12, TheDusts.LAPIS.ordinal()), null, 0); grindRec.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(InitItems.itemDust, 12, TheDusts.LAPIS.ordinal()), null, 0);
grindRecHan.specialOreCases.add(new SpecialOreCase("oreNickel", "dustPlatinum", 30));
grindRec.registerRecipe("cobblestone", "sand");
grindRec.registerRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint));
grindRec.registerRecipe("stone", "cobblestone");
grindRec.registerRecipe("oreNickel", "dustNickel", "dustPlatinum", 30, 2);
grindRec.registerRecipe("oreIron", "dustIron", "dustGold", 20, 2);
grindRecHan.searchCases.add(new SearchCase("ore", 2)); grindRecHan.searchCases.add(new SearchCase("ore", 2));
grindRecHan.searchCases.add(new SearchCase("oreNether", 6)); grindRecHan.searchCases.add(new SearchCase("oreNether", 6));

View file

@ -47,6 +47,7 @@ public class CreativeTab extends CreativeTabs{
this.addBlock(InitBlocks.blockCompost); this.addBlock(InitBlocks.blockCompost);
this.addBlock(InitBlocks.blockGiantChest); this.addBlock(InitBlocks.blockGiantChest);
this.addItem(InitItems.itemHairyBall);
this.addItem(InitItems.itemSpeedUpgrade); this.addItem(InitItems.itemSpeedUpgrade);
this.addItem(InitItems.itemMisc); this.addItem(InitItems.itemMisc);
this.addItem(InitItems.itemFertilizer); this.addItem(InitItems.itemFertilizer);

View file

@ -0,0 +1,31 @@
package ellpeck.actuallyadditions.event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
import ellpeck.actuallyadditions.items.InitItems;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import java.util.Random;
public class EntityLivingEvent{
@SubscribeEvent
public void livingUpdateEvent(LivingUpdateEvent event){
if(!event.entityLiving.worldObj.isRemote){
if(event.entityLiving instanceof EntityOcelot){
EntityOcelot theOcelot = (EntityOcelot)event.entityLiving;
if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && theOcelot.isTamed()){
if(new Random().nextInt(ConfigIntValues.CAT_DROP_CHANCE.getValue())+1 == 1){
EntityItem item = new EntityItem(theOcelot.worldObj, theOcelot.posX + 0.5, theOcelot.posY + 0.5, theOcelot.posZ + 0.5, new ItemStack(InitItems.itemHairyBall));
theOcelot.worldObj.spawnEntityInWorld(item);
}
}
}
}
}
}

View file

@ -12,6 +12,7 @@ public class InitEvents{
Util.registerEvent(new KilledEvent()); Util.registerEvent(new KilledEvent());
Util.registerEvent(new PickupEvent()); Util.registerEvent(new PickupEvent());
Util.registerEvent(new TooltipEvent()); Util.registerEvent(new TooltipEvent());
Util.registerEvent(new EntityLivingEvent());
} }
} }

View file

@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.items;
import ellpeck.actuallyadditions.items.tools.*; import ellpeck.actuallyadditions.items.tools.*;
import ellpeck.actuallyadditions.material.InitItemMaterials; import ellpeck.actuallyadditions.material.InitItemMaterials;
import ellpeck.actuallyadditions.recipe.HairyBallHandler;
import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@ -40,6 +41,8 @@ public class InitItems{
public static Item itemSpeedUpgrade; public static Item itemSpeedUpgrade;
public static Item itemHairyBall;
public static void init(){ public static void init(){
Util.logInfo("Initializing Items..."); Util.logInfo("Initializing Items...");
@ -82,6 +85,10 @@ public class InitItems{
itemSpeedUpgrade = new ItemUpgrade(ItemUpgrade.UpgradeType.SPEED, "itemUpgradeSpeed", 2+3); itemSpeedUpgrade = new ItemUpgrade(ItemUpgrade.UpgradeType.SPEED, "itemUpgradeSpeed", 2+3);
ItemUtil.register(itemSpeedUpgrade); ItemUtil.register(itemSpeedUpgrade);
itemHairyBall = new ItemHairyBall();
ItemUtil.register(itemHairyBall);
HairyBallHandler.init();
itemPickaxeEmerald = new ItemPickaxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemPickaxeEmerald", EnumRarity.rare); itemPickaxeEmerald = new ItemPickaxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemPickaxeEmerald", EnumRarity.rare);
itemAxeEmerald = new ItemAxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", EnumRarity.rare); itemAxeEmerald = new ItemAxeAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", EnumRarity.rare);
itemShovelEmerald = new ItemShovelAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemShovelEmerald", EnumRarity.rare); itemShovelEmerald = new ItemShovelAA(InitItemMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemShovelEmerald", EnumRarity.rare);

View file

@ -0,0 +1,74 @@
package ellpeck.actuallyadditions.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.recipe.HairyBallHandler;
import ellpeck.actuallyadditions.util.INameableItem;
import ellpeck.actuallyadditions.util.ItemUtil;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.WeightedRandom;
import net.minecraft.world.World;
import java.util.List;
import java.util.Random;
public class ItemHairyBall extends Item implements INameableItem{
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
if(!world.isRemote){
ItemStack returnItem = this.getRandomReturnItem();
if(!player.inventory.addItemStackToInventory(returnItem)){
EntityItem entityItem = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, returnItem);
entityItem.delayBeforeCanPickup = 0;
player.worldObj.spawnEntityInWorld(entityItem);
}
stack.stackSize--;
}
return stack;
}
public ItemStack getRandomReturnItem(){
return ((HairyBallHandler.Return)WeightedRandom.getRandomItem(new Random(), HairyBallHandler.returns)).returnItem.copy();
}
@Override
public EnumRarity getRarity(ItemStack stack){
return EnumRarity.epic;
}
@Override
@SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) {
ItemUtil.addInformation(this, list, 2, "");
}
@Override
public IIcon getIcon(ItemStack stack, int pass){
return this.itemIcon;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconReg){
this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
}
@Override
public String getName(){
return "itemHairyBall";
}
@Override
public String getOredictName(){
return this.getName();
}
}

View file

@ -8,17 +8,17 @@ import net.minecraft.item.ItemStack;
public enum ThePotionRings implements INameableItem{ public enum ThePotionRings implements INameableItem{
SPEED("Speed", 8171462, 1, 0, 3, 10, false, EnumRarity.uncommon, new ItemStack(Items.sugar)), SPEED("Speed", 8171462, 1, 0, 1, 10, false, EnumRarity.uncommon, new ItemStack(Items.sugar)),
//TODO Slowness //TODO Slowness
HASTE("Haste", 14270531, 3, 0, 3, 10, false, EnumRarity.epic, new ItemStack(Items.repeater)), HASTE("Haste", 14270531, 3, 0, 1, 10, false, EnumRarity.epic, new ItemStack(Items.repeater)),
//TODO Mining Fatigue //TODO Mining Fatigue
STRENGTH("Strength", 9643043, 5, 0, 3, 10, false, EnumRarity.rare, new ItemStack(Items.blaze_powder)), STRENGTH("Strength", 9643043, 5, 0, 1, 10, false, EnumRarity.rare, new ItemStack(Items.blaze_powder)),
//Health (Not Happening) //Health (Not Happening)
//TODO Damage //TODO Damage
JUMP_BOOST("JumpBoost", 7889559, 8, 0, 3, 10, false, EnumRarity.rare, new ItemStack(Blocks.piston)), JUMP_BOOST("JumpBoost", 7889559, 8, 0, 1, 10, false, EnumRarity.rare, new ItemStack(Blocks.piston)),
//TODO Nausea //TODO Nausea
REGEN("Regen", 13458603, 10, 0, 3, 50, true, EnumRarity.rare, new ItemStack(Items.ghast_tear)), REGEN("Regen", 13458603, 10, 0, 1, 50, true, EnumRarity.rare, new ItemStack(Items.ghast_tear)),
RESISTANCE("Resistance", 10044730, 11, 0, 3, 10, false, EnumRarity.epic, new ItemStack(Items.slime_ball)), RESISTANCE("Resistance", 10044730, 11, 0, 1, 10, false, EnumRarity.epic, new ItemStack(Items.slime_ball)),
FIRE_RESISTANCE("FireResistance", 14981690, 12, 0, 0, 10, false, EnumRarity.uncommon, new ItemStack(Items.magma_cream)), FIRE_RESISTANCE("FireResistance", 14981690, 12, 0, 0, 10, false, EnumRarity.uncommon, new ItemStack(Items.magma_cream)),
WATER_BREATHING("WaterBreathing", 3035801, 13, 0, 0, 10, false, EnumRarity.rare, new ItemStack(Items.fish, 1, 3)), WATER_BREATHING("WaterBreathing", 3035801, 13, 0, 0, 10, false, EnumRarity.rare, new ItemStack(Items.fish, 1, 3)),
INVISIBILITY("Invisibility", 8356754, 14, 0, 0, 10, false, EnumRarity.epic, new ItemStack(Items.fermented_spider_eye)), INVISIBILITY("Invisibility", 8356754, 14, 0, 0, 10, false, EnumRarity.epic, new ItemStack(Items.fermented_spider_eye)),
@ -30,7 +30,7 @@ public enum ThePotionRings implements INameableItem{
//TODO Withering //TODO Withering
//Health Boost (Not Happening) //Health Boost (Not Happening)
//Absorption (Not Happening) //Absorption (Not Happening)
SATURATION("Saturation", 16262179, 23, 0, 3, 10, false, EnumRarity.epic, new ItemStack(Items.cooked_beef)); SATURATION("Saturation", 16262179, 23, 0, 1, 10, false, EnumRarity.epic, new ItemStack(Items.cooked_beef));
public final String name; public final String name;
public final int color; public final int color;

View file

@ -18,7 +18,6 @@ public class GrinderRecipeHandler{
public ArrayList<SearchCase> searchCases = new ArrayList<SearchCase>(); public ArrayList<SearchCase> searchCases = new ArrayList<SearchCase>();
public ArrayList<String> exceptions = new ArrayList<String>(); public ArrayList<String> exceptions = new ArrayList<String>();
public ArrayList<SpecialOreCase> specialOreCases = new ArrayList<SpecialOreCase>();
public static class SearchCase{ public static class SearchCase{
@ -31,20 +30,6 @@ public class GrinderRecipeHandler{
} }
} }
public static class SpecialOreCase{
public final String inputName;
public final String secondResultName;
public final int secondResultChance;
public SpecialOreCase(String inputName, String secondResultName, int secondResultChance){
this.inputName = inputName;
this.secondResultChance = secondResultChance;
this.secondResultName = secondResultName;
}
}
public void registerFinally(){ public void registerFinally(){
String[] names = OreDictionary.getOreNames(); String[] names = OreDictionary.getOreNames();
for(String inputName : names){ for(String inputName : names){
@ -73,23 +58,8 @@ public class GrinderRecipeHandler{
ItemStack input = theInput.copy(); ItemStack input = theInput.copy();
ItemStack output = theDust.copy(); ItemStack output = theDust.copy();
output.stackSize = resultAmount; output.stackSize = resultAmount;
if(!GrinderRecipes.instance().hasExactRecipe(input, output)){ if(!GrinderRecipes.instance().hasRecipe(inputName, inputWithDustPrefix)){
ArrayList<ItemStack> specialStacks = null; GrinderRecipes.instance().registerRecipe(input, output, null, 0);
int specialAmount = 0;
for(SpecialOreCase theCase : specialOreCases){
if(inputName.equals(theCase.inputName)){
specialStacks = OreDictionary.getOres(theCase.secondResultName);
specialAmount = theCase.secondResultChance;
}
}
if(specialStacks != null && specialStacks.size() > 0){
for(ItemStack theSpecial : specialStacks){
ItemStack special = theSpecial.copy();
GrinderRecipes.instance().registerRecipe(input, output, special, specialAmount);
}
}
else GrinderRecipes.instance().registerRecipe(input, output, null, 0);
} }
} }
} }

View file

@ -1,6 +1,7 @@
package ellpeck.actuallyadditions.recipe; package ellpeck.actuallyadditions.recipe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList; import java.util.ArrayList;
@ -18,6 +19,36 @@ public class GrinderRecipes{
this.recipes.add(new GrinderRecipe(input, outputOne, outputTwo, secondChance)); this.recipes.add(new GrinderRecipe(input, outputOne, outputTwo, secondChance));
} }
public void registerRecipe(String input, String outputOne, String outputTwo, int secondChance, int outputTwoAmount){
ArrayList<ItemStack> inputStacks = OreDictionary.getOres(input);
ArrayList<ItemStack> outputOneStacks = OreDictionary.getOres(outputOne);
ArrayList<ItemStack> outputTwoStacks = OreDictionary.getOres(outputTwo);
if(inputStacks != null && !inputStacks.isEmpty()){
for(ItemStack theInput : inputStacks){
if(outputOneStacks != null && !outputOneStacks.isEmpty()){
for(ItemStack theOutputOne : outputOneStacks){
theOutputOne.stackSize = outputTwoAmount;
if(outputTwoStacks != null && !outputTwoStacks.isEmpty()){
for(ItemStack theOutputTwo : outputTwoStacks){
this.registerRecipe(theInput, theOutputOne, theOutputTwo, secondChance);
}
}
else this.registerRecipe(theInput, theOutputOne, null, 0);
}
}
}
}
}
public void registerRecipe(String input, String outputOne){
this.registerRecipe(input, outputOne, "", 0, 1);
}
public void registerRecipe(ItemStack input, ItemStack outputOne){
this.registerRecipe(input, outputOne, null, 0);
}
public ItemStack getOutput(ItemStack input, boolean wantSecond){ public ItemStack getOutput(ItemStack input, boolean wantSecond){
for(GrinderRecipe recipe : recipes){ for(GrinderRecipe recipe : recipes){
if(recipe.input.isItemEqual(input)){ if(recipe.input.isItemEqual(input)){
@ -27,13 +58,28 @@ public class GrinderRecipes{
return null; return null;
} }
public boolean hasExactRecipe(ItemStack input, ItemStack outputOne){ public boolean hasRecipe(String input, String outputOne){
boolean containsInput = false;
boolean containsOutput = false;
for(GrinderRecipe recipe : recipes){ for(GrinderRecipe recipe : recipes){
if(recipe.input.isItemEqual(input) && recipe.firstOutput.isItemEqual(outputOne)){ int[] recipeInputIDs = OreDictionary.getOreIDs(recipe.input);
return true; for(int recipeInputID : recipeInputIDs){
if(input.equals(OreDictionary.getOreName(recipeInputID))){
containsInput = true;
break;
} }
} }
return false;
int[] recipeOutputIDs = OreDictionary.getOreIDs(recipe.firstOutput);
for(int recipeOutputID : recipeOutputIDs){
if(outputOne.equals(OreDictionary.getOreName(recipeOutputID))){
containsOutput = true;
break;
}
}
}
return containsInput && containsOutput;
} }
public int getSecondChance(ItemStack input){ public int getSecondChance(ItemStack input){

View file

@ -0,0 +1,57 @@
package ellpeck.actuallyadditions.recipe;
import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandom;
import java.util.ArrayList;
public class HairyBallHandler{
public static ArrayList<Return> returns = new ArrayList<Return>();
public static void init(){
addReturn(new ItemStack(Items.string), 100);
addReturn(new ItemStack(Items.diamond), 2);
addReturn(new ItemStack(Items.name_tag), 1);
addReturn(new ItemStack(Items.fish), 80);
addReturn(new ItemStack(Items.feather), 60);
addReturn(new ItemStack(Items.leather), 30);
addReturn(new ItemStack(Items.dye), 70);
addReturn(new ItemStack(Items.clay_ball), 40);
addReturn(new ItemStack(Items.stick), 40);
addReturn(new ItemStack(Items.iron_ingot), 10);
addReturn(new ItemStack(Items.gold_ingot), 6);
addReturn(new ItemStack(Items.beef), 30);
addReturn(new ItemStack(Items.ender_pearl), 2);
addReturn(new ItemStack(Blocks.planks), 20);
addReturn(new ItemStack(Blocks.waterlily), 10);
addReturn(new ItemStack(Items.experience_bottle), 3);
addReturn(new ItemStack(Blocks.gravel), 40);
addReturn(new ItemStack(Blocks.sand), 50);
addReturn(new ItemStack(Blocks.vine), 30);
addReturn(new ItemStack(Blocks.web), 4);
addReturn(new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.SOLIDIFIED_EXPERIENCE.ordinal()), 20);
addReturn(new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.EMERALD_SHARD.ordinal()), 10);
addReturn(new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.PEARL_SHARD.ordinal()), 10);
}
public static void addReturn(ItemStack stack, int chance){
returns.add(new Return(stack, chance));
}
public static class Return extends WeightedRandom.Item{
public ItemStack returnItem;
public Return(ItemStack returnItem, int chance){
super(chance);
this.returnItem = returnItem;
}
}
}

View file

@ -4,29 +4,11 @@ import cpw.mods.fml.common.registry.GameRegistry;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
import ellpeck.actuallyadditions.util.Util; import ellpeck.actuallyadditions.util.Util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TileEntityBase extends TileEntity{ public class TileEntityBase extends TileEntity{
@Override
public Packet getDescriptionPacket(){
NBTTagCompound compound = new NBTTagCompound();
this.writeToNBT(compound);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), compound);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet){
super.onDataPacket(net, packet);
this.readFromNBT(packet.func_148857_g());
}
public static void init(){ public static void init(){
Util.logInfo("Registering TileEntities..."); Util.logInfo("Registering TileEntities...");
GameRegistry.registerTileEntity(TileEntityCompost.class, ModUtil.MOD_ID_LOWER + ":tileEntityCompost"); GameRegistry.registerTileEntity(TileEntityCompost.class, ModUtil.MOD_ID_LOWER + ":tileEntityCompost");
@ -49,6 +31,6 @@ public class TileEntityBase extends TileEntity{
@Override @Override
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z){ public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z){
return newBlock == null || newBlock instanceof BlockAir; return !(oldBlock.isAssociatedBlock(newBlock));
} }
} }

View file

@ -40,6 +40,15 @@ public class TileEntityBreaker extends TileEntityInventoryBase{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void updateEntity(){ public void updateEntity(){
if(!worldObj.isRemote){ if(!worldObj.isRemote){
//TODO Remove after some Updating
if(this.isPlacer && this.getClass() != TileEntityPlacer.class){
ItemStack[] theSlots = this.slots.clone();
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
worldObj.setTileEntity(xCoord, yCoord, zCoord, new TileEntityPlacer());
((TileEntityPlacer)worldObj.getTileEntity(xCoord, yCoord, zCoord)).slots = theSlots.clone();
}
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
if(this.currentTime > 0){ if(this.currentTime > 0){
this.currentTime--; this.currentTime--;

View file

@ -3,8 +3,13 @@ package ellpeck.actuallyadditions.tile;
import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.config.values.ConfigIntValues;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.FishingHooks; import net.minecraftforge.common.FishingHooks;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.Random; import java.util.Random;
@ -17,18 +22,47 @@ public class TileEntityFishingNet extends TileEntityBase{
@Override @Override
public void updateEntity(){ public void updateEntity(){
if(!worldObj.isRemote){ if(!worldObj.isRemote){
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord).getMaterial() == Material.water){ if(worldObj.getBlock(xCoord, yCoord - 1, zCoord).getMaterial() == Material.water){
Random rand = new Random(); Random rand = new Random();
if(this.timeUntilNextDrop > 0){ if(this.timeUntilNextDrop > 0){
this.timeUntilNextDrop--; this.timeUntilNextDrop--;
if(timeUntilNextDrop <= 0){ if(timeUntilNextDrop <= 0){
worldObj.spawnEntityInWorld(new EntityItem(worldObj, xCoord+0.5, yCoord+1.8, zCoord+0.5, FishingHooks.getRandomFishable(rand, this.worldObj.rand.nextFloat()))); ItemStack fishable = FishingHooks.getRandomFishable(rand, this.worldObj.rand.nextFloat());
TileEntity tile = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
if(tile != null && tile instanceof IInventory){
this.insertIntoInventory((IInventory)tile, fishable);
}
else{
EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, fishable);
item.lifespan = 2000;
worldObj.spawnEntityInWorld(item);
}
} }
} }
else this.timeUntilNextDrop = this.timeUntilNextDropToSet + rand.nextInt(this.timeUntilNextDropToSet / 2); else this.timeUntilNextDrop = this.timeUntilNextDropToSet + rand.nextInt(this.timeUntilNextDropToSet / 2);
} }
} }
} }
}
public void insertIntoInventory(IInventory inventory, ItemStack stack){
for(int i = 0; i < inventory.getSizeInventory(); i++){
if(inventory.isItemValidForSlot(i, stack)){
if(!(inventory instanceof ISidedInventory) || ((ISidedInventory)inventory).canInsertItem(i, stack, ForgeDirection.DOWN.flag)){
ItemStack slot = inventory.getStackInSlot(i);
if(slot == null){
inventory.setInventorySlotContents(i, stack);
return;
}
if(slot.isItemEqual(stack) && slot.stackSize <= slot.getMaxStackSize() - stack.stackSize && slot.stackSize <= inventory.getInventoryStackLimit() - stack.stackSize){
slot.stackSize += stack.stackSize;
return;
}
}
}
}
}
@Override @Override
public void writeToNBT(NBTTagCompound compound){ public void writeToNBT(NBTTagCompound compound){

View file

@ -57,6 +57,15 @@ public class TileEntityGrinder extends TileEntityUpgradable implements IPowerAcc
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void updateEntity(){ public void updateEntity(){
if(!worldObj.isRemote){ if(!worldObj.isRemote){
//TODO Remove after some Updating
if(this.isDouble && this.getClass() != TileEntityGrinderDouble.class){
ItemStack[] theSlots = this.slots.clone();
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
worldObj.setTileEntity(xCoord, yCoord, zCoord, new TileEntityGrinderDouble());
((TileEntityGrinderDouble)worldObj.getTileEntity(xCoord, yCoord, zCoord)).slots = theSlots.clone();
}
this.speedUp(); this.speedUp();
boolean theFlag = this.coalTimeLeft > 0; boolean theFlag = this.coalTimeLeft > 0;

View file

@ -45,6 +45,15 @@ public class TileEntityInputter extends TileEntityInventoryBase{
@Override @Override
public void updateEntity(){ public void updateEntity(){
if(!worldObj.isRemote){ if(!worldObj.isRemote){
//TODO Remove after some Updating
if(this.isAdvanced && this.getClass() != TileEntityInputterAdvanced.class){
ItemStack[] theSlots = this.slots.clone();
worldObj.removeTileEntity(xCoord, yCoord, zCoord);
worldObj.setTileEntity(xCoord, yCoord, zCoord, new TileEntityInputterAdvanced());
((TileEntityInputterAdvanced)worldObj.getTileEntity(xCoord, yCoord, zCoord)).slots = theSlots.clone();
}
this.initVars(); this.initVars();
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){

View file

@ -78,8 +78,11 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
@Override @Override
public ItemStack getStackInSlot(int i){ public ItemStack getStackInSlot(int i){
if(i < this.getSizeInventory()){
return slots[i]; return slots[i];
} }
return null;
}
@Override @Override
public ItemStack decrStackSize(int i, int j){ public ItemStack decrStackSize(int i, int j){

View file

@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger;
public class ModUtil{ public class ModUtil{
public static final String VERSION = "1.7.10-0.0.4.3"; public static final String VERSION = "1.7.10-0.0.4.4";
public static final String MOD_ID = "ActuallyAdditions"; public static final String MOD_ID = "ActuallyAdditions";
public static final String NAME = "Actually Additions"; public static final String NAME = "Actually Additions";

View file

@ -58,6 +58,7 @@ item.actuallyadditions.itemJamChApCi.name=ChApCi-Jam
item.actuallyadditions.itemJamHoMeKi.name=HoMeKi-Jam item.actuallyadditions.itemJamHoMeKi.name=HoMeKi-Jam
item.actuallyadditions.itemJamPiCo.name=PiCo-Jam item.actuallyadditions.itemJamPiCo.name=PiCo-Jam
item.actuallyadditions.itemHairyBall.name=Ball of Hair
item.actuallyadditions.itemLeafBlower.name=Leaf Blower item.actuallyadditions.itemLeafBlower.name=Leaf Blower
item.actuallyadditions.itemLeafBlowerAdvanced.name=Advanced Leaf Blower item.actuallyadditions.itemLeafBlowerAdvanced.name=Advanced Leaf Blower
item.actuallyadditions.itemKnife.name=Knife item.actuallyadditions.itemKnife.name=Knife
@ -131,53 +132,8 @@ tooltip.actuallyadditions.itemJamChApCi.desc=Cherry, Apple and Cinnamon
tooltip.actuallyadditions.itemJamHoMeKi.desc=Honeydew Melon and Kiwi tooltip.actuallyadditions.itemJamHoMeKi.desc=Honeydew Melon and Kiwi
tooltip.actuallyadditions.itemJamPiCo.desc=Pineapple and Coconut tooltip.actuallyadditions.itemJamPiCo.desc=Pineapple and Coconut
tile.actuallyadditions.blockCompactIronSingle.name=Single Compact Iron tooltip.actuallyadditions.itemHairyBall.desc.1=A Ball of Hair dropped from a Cat...
tile.actuallyadditions.blockCompactIronDouble.name=Double Compact Iron tooltip.actuallyadditions.itemHairyBall.desc.2=Maybe you can get something from it by using it...
tile.actuallyadditions.blockCompactIronTriple.name=Triple Compact Iron
tile.actuallyadditions.blockCompactIronQuadruple.name=Quadruple Compact Iron
tile.actuallyadditions.blockCompactIronQuintuple.name=Quintuple Compact Iron
tile.actuallyadditions.blockCompactIronSextuple.name=Sextuple Compact Iron
tooltip.actuallyadditions.blockCompactIron.desc=Iron, but bunched together!
tile.actuallyadditions.blockCompactGoldSingle.name=Single Compact Gold
tile.actuallyadditions.blockCompactGoldDouble.name=Double Compact Gold
tile.actuallyadditions.blockCompactGoldTriple.name=Triple Compact Gold
tile.actuallyadditions.blockCompactGoldQuadruple.name=Quadruple Compact Gold
tile.actuallyadditions.blockCompactGoldQuintuple.name=Quintuple Compact Gold
tile.actuallyadditions.blockCompactGoldSextuple.name=Sextuple Compact Gold
tooltip.actuallyadditions.blockCompactGold.desc=Gold, but bunched together!
tile.actuallyadditions.blockCompactDiamondSingle.name=Single Compact Diamond
tile.actuallyadditions.blockCompactDiamondDouble.name=Double Compact Diamond
tile.actuallyadditions.blockCompactDiamondTriple.name=Triple Compact Diamond
tile.actuallyadditions.blockCompactDiamondQuadruple.name=Quadruple Compact Diamond
tile.actuallyadditions.blockCompactDiamondQuintuple.name=Quintuple Compact Diamond
tile.actuallyadditions.blockCompactDiamondSextuple.name=Sextuple Compact Diamond
tooltip.actuallyadditions.blockCompactDiamond.desc=Diamond, but bunched together!
tile.actuallyadditions.blockCompactRedstoneSingle.name=Single Compact Redstone
tile.actuallyadditions.blockCompactRedstoneDouble.name=Double Compact Redstone
tile.actuallyadditions.blockCompactRedstoneTriple.name=Triple Compact Redstone
tile.actuallyadditions.blockCompactRedstoneQuadruple.name=Quadruple Compact Redstone
tile.actuallyadditions.blockCompactRedstoneQuintuple.name=Quintuple Compact Redstone
tile.actuallyadditions.blockCompactRedstoneSextuple.name=Sextuple Compact Redstone
tooltip.actuallyadditions.blockCompactRedstone.desc=Redstone, but bunched together!
tile.actuallyadditions.blockCompactCoalSingle.name=Single Compact Coal
tile.actuallyadditions.blockCompactCoalDouble.name=Double Compact Coal
tile.actuallyadditions.blockCompactCoalTriple.name=Triple Compact Coal
tile.actuallyadditions.blockCompactCoalQuadruple.name=Quadruple Compact Coal
tile.actuallyadditions.blockCompactCoalQuintuple.name=Quintuple Compact Coal
tile.actuallyadditions.blockCompactCoalSextuple.name=Sextuple Compact Coal
tooltip.actuallyadditions.blockCompactCoal.desc=Coal, but bunched together!
tile.actuallyadditions.blockCompactLapisSingle.name=Single Compact Lapis
tile.actuallyadditions.blockCompactLapisDouble.name=Double Compact Lapis
tile.actuallyadditions.blockCompactLapisTriple.name=Triple Compact Lapis
tile.actuallyadditions.blockCompactLapisQuadruple.name=Quadruple Compact Lapis
tile.actuallyadditions.blockCompactLapisQuintuple.name=Quintuple Compact Lapis
tile.actuallyadditions.blockCompactLapisSextuple.name=Sextuple Compact Lapis
tooltip.actuallyadditions.blockCompactLapis.desc=Lapis, but bunched together!
tooltip.actuallyadditions.itemUpgradeSpeed.desc.1=Speeds up Machines when placed in their Upgrade Slot tooltip.actuallyadditions.itemUpgradeSpeed.desc.1=Speeds up Machines when placed in their Upgrade Slot
tooltip.actuallyadditions.itemUpgradeSpeed.desc.2=Works in: tooltip.actuallyadditions.itemUpgradeSpeed.desc.2=Works in:
@ -344,6 +300,7 @@ info.actuallyadditions.update.generic.desc=[{"text":"There is an "},{"text":"Upd
info.actuallyadditions.update.versionComp.desc=[{"text":"You have Version "},{"text":"%s","color":"dark_red","italic":"false"},{"text":", the newest one is ","color":"none","italic":"false"},{"text":"%s","color":"dark_green","underlined":"false"},{"text":"!","color":"none","underlined":"false"}] info.actuallyadditions.update.versionComp.desc=[{"text":"You have Version "},{"text":"%s","color":"dark_red","italic":"false"},{"text":", the newest one is ","color":"none","italic":"false"},{"text":"%s","color":"dark_green","underlined":"false"},{"text":"!","color":"none","underlined":"false"}]
info.actuallyadditions.update.download.desc=[{"text":"Download the newest Version "},{"text":"here! (Click me!)","color":"dark_green","underlined":"true","clickEvent":{"action":"open_url","value":"%s"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Click here to open your Browser and download the newest Version!"}]}}}] info.actuallyadditions.update.download.desc=[{"text":"Download the newest Version "},{"text":"here! (Click me!)","color":"dark_green","underlined":"true","clickEvent":{"action":"open_url","value":"%s"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Click here to open your Browser and download the newest Version!"}]}}}]
info.actuallyadditions.update.failed.desc=[{"text":"The Update Check for "},{"text":"Actually Additions ","color":"dark_green","bold":"true"},{"text":"failed! Check your Internet Connection and the Logs for more Info!","color":"none"}] info.actuallyadditions.update.failed.desc=[{"text":"The Update Check for "},{"text":"Actually Additions ","color":"dark_green","bold":"true"},{"text":"failed! Check your Internet Connection and the Logs for more Info!","color":"none"}]
info.actuallyadditions.update.new.desc=Important Changes:
achievement.actuallyadditions.pickUpSolidXP=Hard and Rich and Stuff achievement.actuallyadditions.pickUpSolidXP=Hard and Rich and Stuff
achievement.actuallyadditions.pickUpSolidXP.desc=Pick up some Solidified Experience achievement.actuallyadditions.pickUpSolidXP.desc=Pick up some Solidified Experience

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

View file

@ -3,7 +3,7 @@
"modid": "ActuallyAdditions", "modid": "ActuallyAdditions",
"name": "Actually Additions", "name": "Actually Additions",
"description": "Actually Additions is a Mod that offers a bunch of things from Machines for Automation and tons of food to advanced Hopper Mechanisms and Effect Rings!", "description": "Actually Additions is a Mod that offers a bunch of things from Machines for Automation and tons of food to advanced Hopper Mechanisms and Effect Rings!",
"version": "0.0.4.3", "version": "0.0.4.4",
"mcversion": "1.7.10", "mcversion": "1.7.10",
"url": "https://github.com/Ellpeck/ActuallyAdditions", "url": "https://github.com/Ellpeck/ActuallyAdditions",
"updateUrl": "", "updateUrl": "",